detailsPage.vue 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList(0)">返回列表
  7. </el-button>
  8. <el-button v-if="detailData.id" type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  9. @click="backToList(1)">返回审核列表
  10. </el-button>
  11. </div>
  12. <div class="add-customer-btn">
  13. <el-button class="el-button--small-yh" style="margin-right: 10px" type="primary" size="small" :disabled="form.status>0"
  14. @click="confirmEdit" v-if="optionForm.disabled === true">编辑
  15. </el-button>
  16. <el-dropdown style="margin-right: 10px">
  17. <el-button type="primary" size="small">
  18. 审核处理<i class="el-icon-arrow-down el-icon--right"></i>
  19. </el-button>
  20. <el-dropdown-menu slot="dropdown">
  21. <el-dropdown-item @click.native="pleaseCheck" :disabled="form.status>0">请核数据</el-dropdown-item>
  22. <el-dropdown-item @click.native="checkScheduleDialog = true,checkId = form.id" :disabled="!form.id">审核进度</el-dropdown-item>
  23. <el-dropdown-item @click.native="repealCancel" :disabled="form.status === 0 || !form.status"
  24. v-if="!detailData.id">撤销请核
  25. </el-dropdown-item>
  26. <el-dropdown-item @click.native="checkDialog = true,checkData = detailData.check;" v-if="detailData.id">特殊审批
  27. </el-dropdown-item>
  28. </el-dropdown-menu>
  29. </el-dropdown>
  30. <el-button class="el-button--small-yh" type="primary" size="small" :disabled="form.status>0"
  31. @click="editCustomer">保存数据
  32. </el-button>
  33. </div>
  34. </div>
  35. <trade-card title="基础资料" style="margin-top: 50px">
  36. <avue-form :option="optionForm" v-model="form" ref="form">
  37. <template slot="corpId" slot-scope="scope">
  38. <crop-select v-model="form.corpId" @getCorpData="(row)=>{getGSData(row,['form','corpName'])}"
  39. :disabled="scope.disabled"
  40. corpType="KH"/>
  41. </template>
  42. <template slot="shippingCompany" slot-scope="scope">
  43. <crop-select v-model="form.shippingCompanyId"
  44. @getCorpData="(row)=>{getGSData(row,['form','shippingCompany'])}" :disabled="scope.disabled"
  45. corpType="GS"/>
  46. </template>
  47. <template slot="departureHarbor" slot-scope="scope">
  48. <port-info :disabled="scope.disabled" v-model="form.departureHarborId" type="id"
  49. @balabalaTow="(val)=>{balabala(val,['form','departureHarbor'])}"/>
  50. </template>
  51. <template slot="objectiveHarbor" slot-scope="scope">
  52. <port-info :disabled="scope.disabled" v-model="form.objectiveHarborId" type="id"
  53. @balabalaTow="(val)=>{balabala(val,['form','objectiveHarbor'])}"/>
  54. </template>
  55. </avue-form>
  56. </trade-card>
  57. <trade-card title="箱信息">
  58. <avue-crud
  59. :option="option"
  60. :data="dataList"
  61. v-model="formTwo"
  62. ref="crud"
  63. :key="key"
  64. @row-save="rowSave"
  65. @row-update="rowUpdate"
  66. @selection-change="selectionChange"
  67. @resetColumn="resetColumnTwo('crud','option','optionBack',237.1)"
  68. @saveColumn="saveColumnTwo('crud','option','optionBack',237.1)">
  69. <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  70. <el-button icon="el-icon-share" :size="size" :disabled="disabled" :type="type"
  71. @click="track(row)">箱轨迹
  72. </el-button>
  73. <el-button icon="el-icon-edit" :size="size" :disabled="disabled" :type="type"
  74. @click="$refs.crud.rowEdit(row,index)">编辑
  75. </el-button>
  76. <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
  77. @click="rowDel(row,index,'MX')">删除
  78. </el-button>
  79. </template>
  80. <template slot="menuLeft" slot-scope="scope">
  81. <el-button type="success" size="small" :disabled="option.disabled" @click="importBox">提取</el-button>
  82. <el-button :disabled="option.disabled" type="success" size="small" icon="el-icon-bottom" @click="importBoxTwo">导入</el-button>
  83. <el-button class="el-icon-download" type="info" size="small" :disabled="!form.id" @click="openReport">报表打印</el-button>
  84. <el-dropdown>
  85. <el-button type="primary" size="small" :disabled="selectionList.length === 0">
  86. 起运港<i class="el-icon-arrow-down el-icon--right"></i>
  87. </el-button>
  88. <el-dropdown-menu slot="dropdown">
  89. <el-dropdown-item @click.native="statusUpdate('1','空箱离场')">空箱离场</el-dropdown-item>
  90. <el-dropdown-item @click.native="statusUpdate('1','重箱回场')">重箱回场</el-dropdown-item>
  91. <el-dropdown-item @click.native="statusUpdate('1','上船')">上船</el-dropdown-item>
  92. </el-dropdown-menu>
  93. </el-dropdown>
  94. <el-dropdown>
  95. <el-button type="primary" size="small" :disabled="selectionList.length === 0">
  96. 目的港<i class="el-icon-arrow-down el-icon--right"></i>
  97. </el-button>
  98. <el-dropdown-menu slot="dropdown">
  99. <el-dropdown-item @click.native="statusUpdate('2','重箱入场')">重箱入场</el-dropdown-item>
  100. <el-dropdown-item @click.native="statusUpdate('2','重箱出场')">重箱出场</el-dropdown-item>
  101. <el-dropdown-item @click.native="statusUpdate('2','空箱入场')">空箱入场</el-dropdown-item>
  102. </el-dropdown-menu>
  103. </el-dropdown>
  104. <el-button style="margin-left: 0" type="success" size="small"
  105. :disabled=" storeUp || selectionList.length === 0"
  106. @click="stockpiling()">堆存
  107. </el-button>
  108. </template>
  109. <template slot="addressForm" slot-scope="scope">
  110. <port-info v-model="formTwo.addressId" type="id" :disabled="scope.disabled"
  111. @balabalaTow="(val)=>{balabala(val,['formTwo','address'])}"/>
  112. </template>
  113. <!-- <template slot="boxMakingCompanyIdForm" slot-scope="scope">-->
  114. <!-- <crop-select v-model="formTwo.boxMakingCompanyId" :disabled="scope.disabled" :refresh="false"-->
  115. <!-- @getCorpData="(row)=>{getGSData(row,['formTwo','boxMakingCompany'])}" corpType="GS"/>-->
  116. <!-- </template>-->
  117. </avue-crud>
  118. </trade-card>
  119. <!-- 报表-->
  120. <report-dialog
  121. :switchDialog="switchDialog"
  122. :reportId="form.id"
  123. reportName="出口装运"
  124. @onClose="onClose()"
  125. />
  126. <!-- 费用信息组件-->
  127. <box-cost v-model="dataListTwo" :id="form.id" :codeValue="237.2" type="CK" activeName="first" ref="boxCost"
  128. url="/api/blade-box-tube/transportItemFees/remove" @resetTrigger="resetTrigger"></box-cost>
  129. <trade-card title="附件明细">
  130. <c-upload
  131. basic
  132. :data="tradingBoxFilesList"
  133. :disabled="disabled"
  134. deleteUrl="/api/blade-box-tube/transportFiles/remove"
  135. :enumerationValue="237.3"
  136. display
  137. />
  138. </trade-card>
  139. <el-dialog
  140. append-to-body
  141. title="审批进度"
  142. class="el-dialogDeep"
  143. :visible.sync="checkScheduleDialog"
  144. width="40%"
  145. :close-on-click-modal="false"
  146. :destroy-on-close="true"
  147. :close-on-press-escape="false"
  148. v-dialog-drag
  149. >
  150. <check-schedule
  151. :checkId="checkId"
  152. :batchNo="batchNo"
  153. @choceScheduleFun="choceScheduleFun"
  154. ></check-schedule>
  155. </el-dialog>
  156. <el-dialog title="导入箱档案" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
  157. v-dialog-drag>
  158. <avue-form v-if="excelBox" :option="excelOption" v-model="excelForm" table-loading="excelLoading"
  159. :upload-before="uploadBefore" :upload-after="uploadAfter">
  160. <template slot="excelTemplate">
  161. <el-button type="primary" @click="derivation">
  162. 点击下载<i class="el-icon-download el-icon--right"></i>
  163. </el-button>
  164. </template>
  165. </avue-form>
  166. <p style="text-align: center;color: #DC0505">
  167. 温馨提示 第一次导入时请先下载模板
  168. </p>
  169. </el-dialog>
  170. <el-dialog
  171. title="导入箱信息"
  172. :visible.sync="importOpen"
  173. :append-to-body="true"
  174. :destroy-on-close="true"
  175. :close-on-click-modal="false"
  176. top="1vh"
  177. width="70%">
  178. <span>
  179. <box-information v-model="importList"></box-information>
  180. </span>
  181. <span slot="footer" class="dialog-footer">
  182. <el-button @click="importOpen = false">取 消</el-button>
  183. <el-button type="primary" @click="confirmImport" :disabled="importList.length === 0">导 入</el-button>
  184. </span>
  185. </el-dialog>
  186. <el-dialog
  187. :title="title"
  188. :visible.sync="dialogVisible"
  189. :append-to-body="true"
  190. :destroy-on-close="true"
  191. :close-on-click-modal="false"
  192. v-if="dialogVisible"
  193. width="60%">
  194. <span>
  195. <avue-form v-if="title == '堆存'" :option="optionStateTwo" v-model="formState" ref="formState">
  196. <template slot="addressId" slot-scope="scope">
  197. <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
  198. @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
  199. </template>
  200. <template slot="purchaseCompanyId" slot-scope="scope">
  201. <crop-select v-model="formState.purchaseCompanyId"
  202. @getCorpData="(row)=>{getGSData(row,['formState','purchaseCompanyName'])}"
  203. :disabled="scope.disabled"
  204. corpType="KH"/>
  205. </template>
  206. </avue-form>
  207. <avue-form v-else :option="optionState" v-model="formState" ref="formState">
  208. <template slot="addressId" slot-scope="scope">
  209. <port-info v-model="formState.addressId" type="id" :disabled="scope.disabled"
  210. @balabalaTow="(val)=>{balabala(val,['formState','address'])}"/>
  211. </template>
  212. </avue-form>
  213. </span>
  214. <span slot="footer" class="dialog-footer">
  215. <el-button @click="dialogVisible = false">取 消</el-button>
  216. <el-button type="primary" :disabled="disabledVisible" @click="confirmChange">确 定</el-button>
  217. </span>
  218. </el-dialog>
  219. <el-dialog
  220. title="箱轨迹"
  221. :visible.sync="boxTrack"
  222. :append-to-body="true"
  223. :destroy-on-close="true"
  224. :close-on-click-modal="false"
  225. width="80%">
  226. <span>
  227. <avue-crud
  228. ref="crudTrack"
  229. :option="optionTrack"
  230. :data="dataTrackList"
  231. :search.sync="search"
  232. :page.sync="page"
  233. :table-loading="loading"
  234. @on-load="onLoadTrack"
  235. @search-change="searchChange"
  236. @row-update="rowUpdateTrack"
  237. @resetColumn="resetColumnTwo('crudTrack','optionTrack','optionTrackBack',237.4)"
  238. @saveColumn="saveColumnTwo('crudTrack','optionTrack','optionTrackBack',237.4)"
  239. v-model="formTrack">
  240. <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  241. <el-button icon="el-icon-edit" :size="size" :disabled="disabled" :type="type"
  242. @click="$refs.crudTrack.rowEdit(row,index)">编辑
  243. </el-button>
  244. <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
  245. @click="rowDel(row,index,'GJ')">删除
  246. </el-button>
  247. </template>
  248. </avue-crud>
  249. </span>
  250. </el-dialog>
  251. <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
  252. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  253. <check :checkData="checkData" :checkDetail="false" :idList="[]" @choceCheckFun="choceCheckFun">
  254. </check>
  255. </el-dialog>
  256. </div>
  257. </template>
  258. <script>
  259. import {
  260. detail,
  261. submit,
  262. generateStack,
  263. tradingBoxItem,
  264. tradingBoxFees,
  265. pleaseCheck,
  266. repealCancel, statusUpdate, archivestrajectory, update, tradingBoxGJ
  267. } from "@/api/boxManagement/exportShipment/index.js";
  268. import checkSchedule from "@/components/check/checkSchedule";
  269. import {selectByName} from "@/api/boxManagement";
  270. import {selectArchivesList} from "@/api/boxManagement/buyContainer";
  271. import {dateFormat} from "@/util/date";
  272. import {getToken} from "@/util/auth";
  273. import reportDialog from "@/components/report-dialog/main.vue";
  274. import check from "@/components/check/check";
  275. export default {
  276. name: "detailsPage",
  277. props: {
  278. onLoad: Object,
  279. detailData: Object
  280. },
  281. components: {checkSchedule,reportDialog,check},
  282. data() {
  283. return {
  284. checkData: {},
  285. checkDialog: false,
  286. switchDialog: false,
  287. excelBox: false,
  288. excelOption: {
  289. submitBtn: false,
  290. emptyBtn: false,
  291. column: [
  292. {
  293. label: "模板下载",
  294. prop: "excelTemplate",
  295. formslot: true,
  296. span: 24
  297. },
  298. {
  299. label: "模板上传",
  300. prop: "excelFile",
  301. type: "upload",
  302. drag: true,
  303. loadText: "模板上传中,请稍等",
  304. span: 24,
  305. propsHttp: {
  306. res: "data"
  307. },
  308. tip: "请上传 .xls,.xlsx 标准格式文件",
  309. action: "/api/blade-box-tube/transport/import-transport-info"
  310. }
  311. ]
  312. },
  313. excelForm: {},
  314. key: 0,
  315. importList: [],
  316. title: '',
  317. storeUp:true,
  318. loading: false,
  319. disabledVisible: false,
  320. boxTrack: false,
  321. importOpen: false,
  322. dialogVisible: false,
  323. checkScheduleDialog: false,
  324. checkId: '',
  325. batchNo: '',
  326. breakConfiguration: {
  327. multipleChoices: false,
  328. multiple: false,
  329. disabled: false,
  330. searchShow: true,
  331. collapseTags: false,
  332. clearable: true,
  333. placeholder: "请点击右边按钮选择",
  334. dicData: []
  335. },
  336. page: {
  337. pageSize: 20,
  338. currentPage: 1,
  339. total: 0,
  340. pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
  341. },
  342. formState: {},
  343. form: {},
  344. formTwo: {},
  345. formTrack: {},
  346. search: {},
  347. optionTrack: {},
  348. optionTrackBack: {
  349. align: 'center',
  350. index: true,
  351. addBtnText: "录入明细",
  352. refreshBtn: false,
  353. addBtn: false,
  354. span: 8,
  355. searchMenuPosition: "right",
  356. searchSpan: 8,
  357. searchIcon: true,
  358. searchIndex: 2,
  359. addRowBtn: false,
  360. cellBtn: false,
  361. editBtn: false,
  362. delBtn: false,
  363. menuWidth: 200,
  364. dialogTop: 25,
  365. dialogWidth: "80%",
  366. column: [{
  367. label: '客户名称',
  368. prop: 'corpName',
  369. width: 170,
  370. search: true,
  371. },{
  372. label: '箱号',
  373. prop: 'code',
  374. width: 100,
  375. overHidden: true,
  376. remote: true,
  377. filterable: true,
  378. type: "select",
  379. dicUrl: "/api/blade-box-tube/archives/selectArchivesList?size=10&current=1&code={{key}}",
  380. props: {
  381. label: "code",
  382. value: "code"
  383. },
  384. disabled: true
  385. }, {
  386. label: '地点',
  387. prop: 'address',
  388. width: 200,
  389. overHidden: true,
  390. formProp: 'address',
  391. search: true
  392. }, {
  393. label: '日期',
  394. prop: 'newDate',
  395. search: true,
  396. searchProp: 'newDateList',
  397. overHidden: true,
  398. type: "date",
  399. searchRange: true,
  400. searchDefaultTime: ["00:00:00", "23:59:59"],
  401. format: "yyyy-MM-dd",
  402. valueFormat: "yyyy-MM-dd HH:mm:ss"
  403. }, {
  404. label: '业务类型',
  405. prop: 'status',
  406. width: 140
  407. }]
  408. },
  409. dataTrackList: [],
  410. formSearch: {},
  411. optionStateTwo: {
  412. menuBtn: false,
  413. span: 12,
  414. column: [{
  415. label: '堆存地点',
  416. prop: 'addressId',
  417. rules: [{
  418. required: true,
  419. message: " ",
  420. trigger: "blur"
  421. }]
  422. }, {
  423. label: '付费对象',
  424. prop: 'purchaseCompanyId',
  425. rules: [{
  426. required: true,
  427. message: " ",
  428. trigger: "blur"
  429. }]
  430. },{
  431. label: '堆存日期',
  432. prop: 'rentDate',
  433. width: 100,
  434. type: "date",
  435. format: "yyyy-MM-dd",
  436. valueFormat: "yyyy-MM-dd HH:mm:ss",
  437. rules: [{
  438. required: true,
  439. message: " ",
  440. trigger: "blur"
  441. }]
  442. }]
  443. },
  444. optionState: {
  445. menuBtn: false,
  446. span: 12,
  447. column: [{
  448. label: '地点',
  449. prop: 'addressId',
  450. rules: [{
  451. required: true,
  452. message: " ",
  453. trigger: "blur"
  454. }]
  455. }, {
  456. label: '最新日期',
  457. prop: 'date',
  458. width: 100,
  459. search: true,
  460. overHidden: true,
  461. type: "date",
  462. format: "yyyy-MM-dd",
  463. valueFormat: "yyyy-MM-dd HH:mm:ss",
  464. rules: [{
  465. required: true,
  466. message: " ",
  467. trigger: "blur"
  468. }]
  469. }]
  470. },
  471. optionForm: {
  472. menuBtn: false,
  473. span: 6,
  474. column: [{
  475. label: '系统号',
  476. prop: 'sysNo',
  477. disabled: true
  478. },{
  479. label: '箱数',
  480. prop: 'boxNumber',
  481. disabled: true
  482. },{
  483. label: '合同号',
  484. prop: 'contractNo'
  485. }, {
  486. label: '客户',
  487. prop: 'corpId',
  488. width: 100,
  489. search: true,
  490. overHidden: true,
  491. rules: [{
  492. required: true,
  493. message: " ",
  494. trigger: "blur"
  495. }]
  496. }, {
  497. label: '船公司',
  498. prop: 'shippingCompany',
  499. width: 100,
  500. search: true,
  501. overHidden: true,
  502. rules: [{
  503. required: true,
  504. message: " ",
  505. trigger: "blur"
  506. }]
  507. }, {
  508. label: '提单号',
  509. prop: 'billNo',
  510. width: 100,
  511. search: true,
  512. overHidden: true
  513. }, {
  514. label: '船名',
  515. prop: 'shipName',
  516. width: 100,
  517. search: true,
  518. overHidden: true
  519. }, {
  520. label: '航次',
  521. prop: 'voyageNumber',
  522. width: 100,
  523. search: true,
  524. overHidden: true
  525. }, {
  526. label: '开船日期',
  527. prop: 'sailDate',
  528. width: 100,
  529. search: true,
  530. overHidden: true,
  531. type: "date",
  532. format: "yyyy-MM-dd",
  533. valueFormat: "yyyy-MM-dd HH:mm:ss",
  534. }, {
  535. label: '起运港',
  536. prop: 'departureHarbor',
  537. width: 100,
  538. search: true,
  539. overHidden: true,
  540. rules: [{
  541. required: true,
  542. message: " ",
  543. trigger: "blur"
  544. }]
  545. }, {
  546. label: '目的港',
  547. prop: 'objectiveHarbor',
  548. width: 100,
  549. search: true,
  550. overHidden: true,
  551. rules: [{
  552. required: true,
  553. message: " ",
  554. trigger: "blur"
  555. }]
  556. }, {
  557. label: '合同生效日期',
  558. prop: 'effectiveDate',
  559. width: 100,
  560. search: true,
  561. overHidden: true,
  562. type: "date",
  563. format: "yyyy-MM-dd",
  564. valueFormat: "yyyy-MM-dd HH:mm:ss",
  565. labelWidth:100,
  566. rules: [{
  567. required: true,
  568. message: " ",
  569. trigger: "blur"
  570. }]
  571. }, {
  572. label: '合同失效日期',
  573. prop: 'expiryDate',
  574. width: 100,
  575. search: true,
  576. overHidden: true,
  577. type: "date",
  578. format: "yyyy-MM-dd",
  579. valueFormat: "yyyy-MM-dd HH:mm:ss",
  580. labelWidth:100,
  581. rules: [{
  582. required: true,
  583. message: " ",
  584. trigger: "blur"
  585. }]
  586. }, {
  587. label: '起租日期',
  588. prop: 'startingRentDate',
  589. width: 100,
  590. search: true,
  591. overHidden: true,
  592. type: "date",
  593. format: "yyyy-MM-dd",
  594. valueFormat: "yyyy-MM-dd HH:mm:ss",
  595. rules: [{
  596. required: true,
  597. message: " ",
  598. trigger: "blur"
  599. }]
  600. }, {
  601. label: '出场日期',
  602. prop: 'exitDate',
  603. width: 100,
  604. search: true,
  605. overHidden: true,
  606. type: "date",
  607. format: "yyyy-MM-dd",
  608. valueFormat: "yyyy-MM-dd HH:mm:ss",
  609. }, {
  610. label: '入场日期',
  611. prop: 'admissionDate',
  612. width: 100,
  613. search: true,
  614. overHidden: true,
  615. type: "date",
  616. format: "yyyy-MM-dd",
  617. valueFormat: "yyyy-MM-dd HH:mm:ss",
  618. }, {
  619. label: '租金合计',
  620. prop: 'totalAmount',
  621. disabled: true
  622. }, {
  623. label: '超期箱使合计',
  624. prop: 'overdueAmount',
  625. disabled: true
  626. }, {
  627. label: '备注',
  628. prop: 'remarks',
  629. type: 'textarea',
  630. minRows: 1,
  631. span: 12
  632. }]
  633. },
  634. option: {},
  635. optionBack: {
  636. align: 'center',
  637. index: true,
  638. dialogDrag: true,
  639. selection: true,
  640. addBtnText: "录入明细",
  641. refreshBtn: false,
  642. addBtn: true,
  643. span: 8,
  644. addRowBtn: false,
  645. cellBtn: false,
  646. editBtn: false,
  647. delBtn: false,
  648. menuWidth: 200,
  649. dialogTop: 25,
  650. height:500,
  651. dialogWidth: "80%",
  652. showSummary: true,
  653. sumColumnList: [{
  654. name: 'amount',
  655. type: 'sum',
  656. decimals: 2
  657. },{
  658. name: 'emptyWeight',
  659. type: 'sum',
  660. decimals: 2
  661. },{
  662. name: 'grossWeight',
  663. type: 'sum',
  664. decimals: 2
  665. },{
  666. name: 'tare',
  667. type: 'sum',
  668. decimals: 2
  669. },{
  670. name: 'overdueAmount',
  671. type: 'sum',
  672. decimals: 2
  673. },{
  674. name: 'loadingWeight',
  675. type: 'sum',
  676. decimals: 2
  677. },{
  678. name: 'volume',
  679. type: 'sum',
  680. decimals: 2
  681. }],
  682. column: [{
  683. label: '箱号',
  684. prop: 'code',
  685. width: 100,
  686. overHidden: true,
  687. remote: true,
  688. filterable: true,
  689. type: "select",
  690. dicUrl: "/api/blade-box-tube/archives/selectArchivesList?size=10&current=1&code={{key}}",
  691. props: {
  692. label: "code",
  693. value: "code"
  694. },
  695. rules: [{
  696. required: true,
  697. message: " ",
  698. trigger: "blur"
  699. }]
  700. }, {
  701. label: '地点',
  702. prop: 'address',
  703. overHidden: true,
  704. width: 100,
  705. rules: [{
  706. required: true,
  707. message: " ",
  708. trigger: "blur"
  709. }]
  710. }, {
  711. label: '日期',
  712. prop: 'newDate',
  713. overHidden: true,
  714. width: 100,
  715. type: "date",
  716. format: "yyyy-MM-dd",
  717. valueFormat: "yyyy-MM-dd HH:mm:ss",
  718. rules: [{
  719. required: true,
  720. message: " ",
  721. trigger: "blur"
  722. }]
  723. }, {
  724. label: '箱类型',
  725. prop: 'boxTypeId',
  726. width: 100,
  727. overHidden: true,
  728. filterable: true,
  729. type: 'select',
  730. props: {
  731. label: 'name',
  732. value: 'id'
  733. },
  734. dicUrl: '/api/blade-client/container/listMessage',
  735. rules: [{
  736. required: true,
  737. message: " ",
  738. trigger: "blur"
  739. }]
  740. }, {
  741. label: '币别',
  742. prop: 'currency',
  743. width: 100,
  744. overHidden: true,
  745. filterable: true,
  746. type: "select",
  747. dicUrl: "/api/blade-system/dict-biz/dictionary?code=currency",
  748. props: {
  749. label: "dictValue",
  750. value: "dictKey"
  751. },
  752. rules: [{
  753. required: true,
  754. message: " ",
  755. trigger: "blur"
  756. }]
  757. }, {
  758. label: '租金收入',
  759. prop: 'amount',
  760. type: 'number',
  761. value:0,
  762. controls: false,
  763. overHidden: true,
  764. rules: [{
  765. required: true,
  766. message: " ",
  767. trigger: "blur"
  768. }]
  769. }, {
  770. label: '超期单价/天',
  771. prop: 'price',
  772. type: 'number',
  773. value:0,
  774. controls: false,
  775. overHidden: true,
  776. rules: [{
  777. required: true,
  778. message: " ",
  779. trigger: "blur"
  780. }]
  781. }, {
  782. label: '超期箱使收入',
  783. prop: 'overdueAmount',
  784. overHidden: true,
  785. disabled: true
  786. }, {
  787. label: '状态',
  788. prop: 'status',
  789. width: 100,
  790. overHidden: true,
  791. filterable: true,
  792. type: 'select',
  793. dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_access_status",
  794. props: {
  795. label: "dictValue",
  796. value: "dictKey"
  797. },
  798. disabled: true
  799. }]
  800. },
  801. dataList: [],
  802. dataListTwo: [],
  803. tradingBoxFilesList: [],
  804. selectionList: [],
  805. disabled: false,
  806. costData: {}
  807. }
  808. },
  809. async created() {
  810. this.option = await this.getColumnData(this.getColumnName(237.1), this.optionBack);
  811. this.optionTrack = await this.getColumnData(this.getColumnName(237.4), this.optionTrackBack);
  812. this.option.selectable = (row, index) => {
  813. return row.id;
  814. }
  815. selectByName("租金").then(res => {
  816. this.costData = res.data.data
  817. })
  818. //下拉箱号带出对应信息
  819. this.findObject(this.option.column, "newDate").value = dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
  820. this.findObject(this.option.column, "code").change = ({value, column}) => {
  821. selectArchivesList({code: value}).then(res => {
  822. for (let item of res.data.data) {
  823. if (value == item.code) {
  824. this.formTwo = {
  825. boxTypeId: item.typeId,
  826. boxType: item.name,
  827. addressId:item.addressId,
  828. address:item.address
  829. }
  830. }
  831. }
  832. })
  833. }
  834. if (this.onLoad.id && this.detailData.id) {
  835. this.refresh(this.onLoad.id, true)
  836. }else if (this.onLoad.id){
  837. this.refresh(this.onLoad.id, true)
  838. }
  839. this.key++
  840. },
  841. activated() {
  842. this.key++
  843. },
  844. methods: {
  845. //堆存
  846. stockpiling() {
  847. this.title = "堆存"
  848. const date = new Date();
  849. this.formState.rentDate = dateFormat(date, "yyyy-MM-dd") + " 00:00:00"
  850. this.dialogVisible = true
  851. },
  852. //关闭审核
  853. choceCheckFun() {
  854. this.checkDialog = false;
  855. },
  856. // 报表
  857. openReport() {
  858. this.switchDialog = !this.switchDialog;
  859. },
  860. // 报表关闭
  861. onClose(val) {
  862. this.switchDialog = val;
  863. },
  864. confirmEdit() {
  865. if (this.form.status > 0) {
  866. //基础资料
  867. this.$set(this.optionForm, "disabled", true)
  868. //箱信息
  869. this.$set(this.option, "disabled", true)
  870. this.$set(this.option, "addBtn", false)
  871. this.$set(this.option, "menu", false)
  872. //费用信息
  873. this.$set(this.$refs.boxCost.option, "disabled", true)
  874. this.$set(this.$refs.boxCost.option, "addBtn", false)
  875. this.$set(this.$refs.boxCost.option, "menu", false)
  876. //附件和顶部按钮
  877. this.disabled = true
  878. } else {
  879. //基础资料
  880. this.$set(this.optionForm, "disabled", false)
  881. //箱信息
  882. this.$set(this.option, "disabled", false)
  883. this.$set(this.option, "addBtn", true)
  884. this.$set(this.option, "menu", true)
  885. //费用信息
  886. this.$set(this.$refs.boxCost.option, "disabled", false)
  887. this.$set(this.$refs.boxCost.option, "addBtn", true)
  888. this.$set(this.$refs.boxCost.option, "menu", true)
  889. //附件和顶部按钮
  890. this.disabled = false
  891. }
  892. this.key++
  893. },
  894. //打开箱档案导入
  895. importBox() {
  896. this.importOpen = true
  897. },
  898. derivation() {
  899. window.open(`/api/blade-box-tube/transport/export-transport-info?${this.website.tokenHeader}=${getToken()}`);
  900. },
  901. importBoxTwo() {
  902. this.findObject(this.excelOption.column, "excelFile").data = {
  903. corpId: this.form.corpId,
  904. corpName: this.form.corpName,
  905. billType: "CKZY"
  906. }
  907. this.excelBox = true
  908. },
  909. uploadBefore(file, done, loading) {
  910. loading = true;
  911. done();
  912. },
  913. uploadAfter(res, done, loading, column) {
  914. this.excelBox = false;
  915. if (typeof res.message === "string") return
  916. for (let item of this.dataList) {
  917. for (let li of res.transportItemList) {
  918. if (item.code === li.code) {
  919. return this.$message.error(`箱号:${item.code}重复!`);
  920. }
  921. }
  922. }
  923. this.dataList = this.dataList.concat(res.transportItemList)
  924. this.dataListTwo = this.dataListTwo.concat(res.transportItemFeesList)
  925. this.$message.success("导入成功!");
  926. loading = false;
  927. done();
  928. },
  929. //确认导入箱信息
  930. confirmImport() {
  931. const loading = this.$loading({
  932. lock: true,
  933. text: '加载中',
  934. spinner: 'el-icon-loading',
  935. background: 'rgba(255,255,255,0.7)'
  936. });
  937. let list = []
  938. this.getWorkDicts("currency").then(res => {
  939. list = res.data.data
  940. });
  941. for (let item in this.importList) {
  942. for (let li in this.dataList) {
  943. if (this.importList[item].code === this.dataList[li].code) {
  944. loading.close();
  945. return this.$message.error(`第${Number(Number(item) + 1)}行箱号和明细第${Number(Number(li) + 1)}行重复`);
  946. }
  947. }
  948. }
  949. this.importOpen = false
  950. for (let item of this.importList) {
  951. this.dataList.push({
  952. code: item.code,
  953. address: item.address,
  954. addressId: item.addressId,
  955. newDate: item.newDate,
  956. boxType: item.name,
  957. boxTypeId: item.typeId,
  958. currency: "CNY"
  959. })
  960. for (let li of list) {
  961. if (li.dictValue == item.currency) {
  962. item.exchangeRate = li.remark
  963. }
  964. }
  965. this.dataListTwo.push({
  966. corpId: this.form.corpId,
  967. corpName: this.form.corpName,
  968. code: item.code,
  969. itemId: this.costData.id,
  970. itemName: this.costData.cname,
  971. currency: "CNY",
  972. price: item.amount,
  973. quantity: 1,
  974. autoGenerate: 1,
  975. feesType: 1,
  976. exchangeRate: item.exchangeRate || 1,
  977. amount: item.amount
  978. })
  979. loading.close();
  980. }
  981. this.key++
  982. },
  983. confirmChange() {
  984. if (this.title == "堆存") {
  985. this.$refs["formState"].validate((valid, done) => {
  986. done()
  987. if (valid) {
  988. let data = {
  989. ...this.form,
  990. type: "DCF",
  991. source: "CKZY",
  992. ...this.formState,
  993. // tradingBoxItemsList: this.dataList,
  994. tradingBoxItemsList: this.selectionList,
  995. }
  996. console.log(this.formState)
  997. // data.tradingBoxItemsList.forEach(item=> delete item.id)
  998. delete data.id
  999. const loading = this.$loading({
  1000. lock: true,
  1001. text: '加载中',
  1002. spinner: 'el-icon-loading',
  1003. background: 'rgba(255,255,255,0.7)'
  1004. });
  1005. generateStack(data).then(res => {
  1006. this.$message.success("生成堆存成功")
  1007. this.dialogVisible = false
  1008. this.disabledVisible = false
  1009. this.formState = {}
  1010. this.selectionList = []
  1011. loading.close();
  1012. this.refresh(this.form.id)
  1013. }).catch(()=>{
  1014. loading.close();
  1015. })
  1016. }
  1017. })
  1018. } else {
  1019. let data = []
  1020. for (let item of this.selectionList) {
  1021. data.push(item.id)
  1022. }
  1023. this.$refs["formState"].validate((valid, done) => {
  1024. done()
  1025. if (valid) {
  1026. this.disabledVisible = true
  1027. statusUpdate({
  1028. ...this.formState,
  1029. ids: data.join(',')
  1030. }).then(res => {
  1031. this.$message.success("操作成功")
  1032. this.dialogVisible = false
  1033. this.disabledVisible = false
  1034. this.formState = {}
  1035. this.refresh(this.form.id)
  1036. }).catch(() => {
  1037. this.disabledVisible = false
  1038. })
  1039. }
  1040. })
  1041. }
  1042. },
  1043. statusUpdate(status, type) {
  1044. if (this.form.id) {
  1045. this.title = type
  1046. if (status === '1'){
  1047. if(type === "空箱离场"){
  1048. this.formState = {
  1049. type: type,
  1050. status: status,
  1051. transportId: this.form.id,
  1052. addressId:this.form.departureHarborId,
  1053. address:this.form.departureHarbor,
  1054. date:dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
  1055. }
  1056. }else {
  1057. this.formState = {
  1058. type: type,
  1059. status: status,
  1060. transportId: this.form.id,
  1061. date:dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
  1062. }
  1063. }
  1064. }else {
  1065. if(type === "空箱入场"){
  1066. this.formState = {
  1067. type: type,
  1068. status: status,
  1069. transportId: this.form.id,
  1070. addressId:this.form.objectiveHarborId,
  1071. address:this.form.objectiveHarbor,
  1072. date:dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
  1073. }
  1074. }else {
  1075. this.formState = {
  1076. type: type,
  1077. status: status,
  1078. transportId: this.form.id,
  1079. date:dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
  1080. }
  1081. }
  1082. }
  1083. this.dialogVisible = true
  1084. } else {
  1085. this.$message.error('请保存后操作')
  1086. }
  1087. },
  1088. selectionChange(list) {
  1089. this.selectionList = list
  1090. for (let item of list){
  1091. if (item.status == '空箱入场' && item.stockpilingStatus == '1'){
  1092. this.storeUp = false
  1093. }else {
  1094. return this.storeUp = true
  1095. }
  1096. }
  1097. },
  1098. track(row) {
  1099. // this.dataTrackList = row
  1100. this.formSearch = row
  1101. this.boxTrack = true
  1102. },
  1103. searchChange(params, done) {
  1104. done();
  1105. this.onLoadTrack(this.page, params)
  1106. },
  1107. onLoadTrack(page, params = {}) {
  1108. params = {
  1109. ...params,
  1110. current: page.currentPage,
  1111. size: page.pageSize,
  1112. code: this.formSearch.code
  1113. }
  1114. this.loading = true
  1115. archivestrajectory(params).then(res => {
  1116. this.dataTrackList = res.data.data.records
  1117. this.page.total = res.data.data.total
  1118. this.loading = false
  1119. }).finally(() => {
  1120. this.loading = false
  1121. })
  1122. },
  1123. // 明细删除
  1124. rowDel(row, index, type) {
  1125. this.$confirm("确定将选择数据删除?", {
  1126. confirmButtonText: "确定",
  1127. cancelButtonText: "取消",
  1128. type: "warning"
  1129. }).then(() => {
  1130. if (type == "GJ") {
  1131. if (row.id){
  1132. tradingBoxGJ(row.id).then(res => {
  1133. if (res.data.success) {
  1134. this.$message.success("操作成功!");
  1135. this.dataTrackList.splice(index, 1);
  1136. }
  1137. })
  1138. }else {
  1139. this.$message.success("操作成功!");
  1140. this.dataTrackList.splice(index, 1);
  1141. }
  1142. } else {
  1143. if (row.id) {
  1144. tradingBoxItem(row.id).then(res => {
  1145. if (res.data.success) {
  1146. this.$message.success("操作成功!");
  1147. this.dataList.splice(index, 1);
  1148. if (this.dataListTwo.length > 0) {
  1149. for (let item in this.dataListTwo) {
  1150. if (this.dataListTwo[item].code == row.code) {
  1151. if (this.dataListTwo[item].autoGenerate == 1) {
  1152. if (this.dataListTwo[item].id) {
  1153. tradingBoxFees(this.dataListTwo[item].id).then(res => {
  1154. if (res.data.success) {
  1155. this.dataListTwo.splice(index, 1);
  1156. }
  1157. });
  1158. } else {
  1159. this.dataListTwo.splice(Number(item), 1);
  1160. }
  1161. }
  1162. }
  1163. }
  1164. }
  1165. }
  1166. });
  1167. } else {
  1168. this.dataList.splice(index, 1);
  1169. this.$message.success("操作成功!");
  1170. if (this.dataListTwo.length > 0) {
  1171. for (let item in this.dataListTwo) {
  1172. if (this.dataListTwo[item].code === row.code) {
  1173. if (this.dataListTwo[item].autoGenerate == 1) {
  1174. this.dataListTwo.splice(Number(item), 1);
  1175. }
  1176. }
  1177. }
  1178. }
  1179. }
  1180. }
  1181. }
  1182. )
  1183. ;
  1184. },
  1185. balabala(val, type) {
  1186. if (val === null) {
  1187. this[type[0]][type[1]] = ''
  1188. } else {
  1189. this[type[0]][type[1]] = val.name
  1190. }
  1191. },
  1192. //撤销
  1193. repealCancel() {
  1194. this.$confirm("您确定撤回此次申请吗?", {
  1195. confirmButtonText: "确定",
  1196. cancelButtonText: "取消",
  1197. type: "warning"
  1198. }).then(() => {
  1199. const data = {
  1200. id: this.form.id,
  1201. pageLabel: "出库装运",
  1202. checkFlag: 1,
  1203. }
  1204. const loading = this.$loading({
  1205. lock: true,
  1206. text: '加载中',
  1207. spinner: 'el-icon-loading',
  1208. background: 'rgba(255,255,255,0.7)'
  1209. });
  1210. repealCancel(data).then(res => {
  1211. loading.close();
  1212. this.$message.success('撤回成功')
  1213. this.refresh(this.form.id)
  1214. })
  1215. })
  1216. },
  1217. // 请核
  1218. pleaseCheck() {
  1219. // for (let item of this.dataList) {
  1220. // if (item.status !== "空箱入场") return this.$message.error("有未空箱入场的明细,禁止请核!")
  1221. // }
  1222. if (this.dataList.length === 0) {
  1223. return this.$message.error("箱信息不能为空")
  1224. }
  1225. if (this.$refs.boxCost.dataList.length === 0) {
  1226. return this.$message.error("费用信息不能为空")
  1227. }else {
  1228. for (let item of this.$refs.boxCost.dataList){
  1229. if (!item.id){
  1230. return this.$message.error("费用信息未保存")
  1231. }
  1232. }
  1233. }
  1234. this.$confirm("您确定提交请核申请吗?", {
  1235. confirmButtonText: "确定",
  1236. cancelButtonText: "取消",
  1237. type: "warning"
  1238. }).then(() => {
  1239. this.$refs["form"].validate((valid, done) => {
  1240. done()
  1241. if (valid) {
  1242. let data = {
  1243. ...this.form,
  1244. transportItemList: this.dataList,
  1245. transportItemFeesList: this.dataListTwo,
  1246. transportFilesList: this.tradingBoxFilesList,
  1247. billType: "CKZY",
  1248. checkFlag: 1
  1249. }
  1250. const loading = this.$loading({
  1251. lock: true,
  1252. text: '加载中',
  1253. spinner: 'el-icon-loading',
  1254. background: 'rgba(255,255,255,0.7)'
  1255. });
  1256. submit(data).then(res => {
  1257. const data = {
  1258. id: res.data.data.id,
  1259. url: '/boxManagement/exportShipment/index',
  1260. pageStatus: "this.$store.getters.domSaleStatus",
  1261. pageLabel: "出口装运",
  1262. checkFlag: 1,
  1263. }
  1264. pleaseCheck({
  1265. ...data,
  1266. billType: "CKZY"
  1267. }).then(rest => {
  1268. loading.close();
  1269. this.$message.success('请核成功')
  1270. this.refresh(res.data.data.id)
  1271. }).catch(()=>{
  1272. loading.close();
  1273. })
  1274. }).catch(()=>{
  1275. loading.close();
  1276. })
  1277. }
  1278. });
  1279. })
  1280. },
  1281. //审核关闭
  1282. choceScheduleFun() {
  1283. this.checkScheduleDialog = false
  1284. },
  1285. refresh(id, type) {
  1286. const loading = this.$loading({
  1287. lock: true,
  1288. text: '加载中',
  1289. spinner: 'el-icon-loading',
  1290. background: 'rgba(255,255,255,0.7)'
  1291. });
  1292. detail({id: id}).then(res => {
  1293. this.form = res.data.data
  1294. this.dataList = res.data.data.transportItemList
  1295. this.dataListTwo = res.data.data.transportItemFeesList
  1296. this.tradingBoxFilesList = res.data.data.transportFilesList
  1297. delete this.form.transportItemList
  1298. delete this.form.transportItemFeesList
  1299. delete this.form.transportFilesList
  1300. this.$refs.boxCost.code = this.form.code
  1301. loading.close();
  1302. if (type) {
  1303. //基础资料
  1304. this.$set(this.optionForm, "disabled", true)
  1305. //箱信息
  1306. this.$set(this.option, "disabled", true)
  1307. this.$set(this.option, "addBtn", false)
  1308. this.$set(this.option, "menu", false)
  1309. //费用信息
  1310. this.$set(this.$refs.boxCost.option, "disabled", true)
  1311. this.$set(this.$refs.boxCost.option, "addBtn", false)
  1312. this.$set(this.$refs.boxCost.option, "menu", false)
  1313. //附件和顶部按钮
  1314. this.disabled = true
  1315. }else {
  1316. if (this.form.status > 0) {
  1317. //基础资料
  1318. this.$set(this.optionForm, "disabled", true)
  1319. //箱信息
  1320. this.$set(this.option, "disabled", true)
  1321. this.$set(this.option, "addBtn", false)
  1322. this.$set(this.option, "menu", false)
  1323. //费用信息
  1324. this.$set(this.$refs.boxCost.option, "disabled", true)
  1325. this.$set(this.$refs.boxCost.option, "addBtn", false)
  1326. this.$set(this.$refs.boxCost.option,"menu",false)
  1327. //附件和顶部按钮
  1328. this.disabled = true
  1329. } else {
  1330. //基础资料
  1331. this.$set(this.optionForm, "disabled", false)
  1332. //箱信息
  1333. this.$set(this.option, "disabled", false)
  1334. this.$set(this.option, "addBtn", true)
  1335. this.$set(this.option, "menu", true)
  1336. //费用信息
  1337. this.$set(this.$refs.boxCost.option, "disabled", false)
  1338. this.$set(this.$refs.boxCost.option, "addBtn", true)
  1339. this.$set(this.$refs.boxCost.option, "menu", true)
  1340. //附件和顶部按钮
  1341. this.disabled = false
  1342. }
  1343. }
  1344. this.key++
  1345. })
  1346. },
  1347. //新增修改
  1348. editCustomer() {
  1349. this.$refs["form"].validate((valid, done) => {
  1350. done()
  1351. if (valid) {
  1352. let data = {
  1353. ...this.form,
  1354. transportItemList: this.dataList,
  1355. transportItemFeesList: this.dataListTwo,
  1356. transportFilesList: this.tradingBoxFilesList,
  1357. billType: "CKZY"
  1358. }
  1359. const loading = this.$loading({
  1360. lock: true,
  1361. text: '加载中',
  1362. spinner: 'el-icon-loading',
  1363. background: 'rgba(255,255,255,0.7)'
  1364. });
  1365. submit(data).then(res => {
  1366. if (this.form.id) {
  1367. this.$message.success("修改成功")
  1368. } else {
  1369. this.$message.success("新增成功")
  1370. }
  1371. loading.close();
  1372. this.refresh(res.data.data.id)
  1373. }).catch(()=>{
  1374. loading.close();
  1375. })
  1376. }
  1377. });
  1378. },
  1379. rowSave(form, done, loading) {
  1380. let result = this.dataList.some((item) => {
  1381. if (item.code == form.code) {
  1382. return true
  1383. }
  1384. })
  1385. if (result === true) {
  1386. this.$message.error("已存在此箱号");
  1387. return loading();
  1388. }
  1389. done(form)
  1390. this.getWorkDicts("currency").then(res => {
  1391. for (let item of res.data.data){
  1392. if (item.dictValue == form.currency){
  1393. form.exchangeRate = item.remark
  1394. }
  1395. }
  1396. this.dataListTwo.push({
  1397. corpId: this.form.corpId,
  1398. corpName: this.form.corpName,
  1399. code: form.code,
  1400. itemId: this.costData.id,
  1401. itemName: this.costData.cname,
  1402. currency: form.currency,
  1403. price: form.amount,
  1404. quantity: 1,
  1405. autoGenerate: 1,
  1406. feesType: 1,
  1407. exchangeRate:form.exchangeRate || 1,
  1408. amount: form.amount,
  1409. })
  1410. });
  1411. },
  1412. rowUpdateTrack(form, index, done, loading) {
  1413. update(form).then(res => {
  1414. done()
  1415. this.$message.success("操作成功")
  1416. this.onLoadTrack(this.page, this.search)
  1417. })
  1418. },
  1419. rowUpdate(form, index, done, loading) {
  1420. if (!Number(form.price) || Number(form.price) < 0) {
  1421. loading()
  1422. return this.$message.error('超期单价/天,不能不能为0或不能为负')
  1423. }
  1424. form.boxType = form.$boxTypeId
  1425. done(form)
  1426. this.getWorkDicts("currency").then(res => {
  1427. for (let item of res.data.data) {
  1428. if (item.dictValue == form.currency) {
  1429. form.exchangeRate = item.remark
  1430. }
  1431. }
  1432. if (this.dataListTwo.length > 0) {
  1433. for (let item in this.dataListTwo) {
  1434. if (this.dataListTwo[item].code == form.code) {
  1435. if (this.dataListTwo[item].autoGenerate == 1) {
  1436. console.log(form.exchangeRate)
  1437. this.dataListTwo.splice(Number(item), 1, {
  1438. ...this.dataListTwo[item],
  1439. corpId: this.form.corpId,
  1440. corpName: this.form.corpName,
  1441. code: form.code,
  1442. currency: form.currency,
  1443. price: form.amount,
  1444. exchangeRate:form.exchangeRate || 1,
  1445. amount: form.amount
  1446. })
  1447. this.key++
  1448. }
  1449. }
  1450. }
  1451. }
  1452. });
  1453. },
  1454. getGSData(row, type) {
  1455. this[type[0]][type[1]] = row.cname
  1456. },
  1457. backToList(type) {
  1458. if (type == 0){
  1459. if (this.detailData.id){
  1460. this.$router.push({
  1461. path: '/boxManagement/exportShipment/index'
  1462. });
  1463. }
  1464. this.$emit("backToList",type);
  1465. }else if (type == 1){
  1466. this.$router.push({
  1467. path: '/approveData/index'
  1468. });
  1469. this.$emit("backToList",type);
  1470. }
  1471. },
  1472. //自定义列保存
  1473. async saveColumnTwo(ref, option, optionBack, code) {
  1474. /**
  1475. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1476. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1477. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1478. */
  1479. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1480. if (inSave) {
  1481. this.$message.success("保存成功");
  1482. //关闭窗口
  1483. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1484. }
  1485. },
  1486. resetTrigger() {
  1487. if (this.optionForm.disabled == true) {
  1488. if (this.form.status > 0) {
  1489. //基础资料
  1490. this.$set(this.optionForm, "disabled", true)
  1491. //箱信息
  1492. this.$set(this.option, "disabled", true)
  1493. this.$set(this.option, "addBtn", false)
  1494. this.$set(this.option, "menu", false)
  1495. //费用信息
  1496. this.$set(this.$refs.boxCost.option, "disabled", true)
  1497. this.$set(this.$refs.boxCost.option, "addBtn", false)
  1498. this.$set(this.$refs.boxCost.option,"menu",false)
  1499. //附件和顶部按钮
  1500. this.disabled = true
  1501. } else {
  1502. //基础资料
  1503. this.$set(this.optionForm, "disabled", false)
  1504. //箱信息
  1505. this.$set(this.option, "disabled", false)
  1506. this.$set(this.option, "addBtn", true)
  1507. this.$set(this.option, "menu", true)
  1508. //费用信息
  1509. this.$set(this.$refs.boxCost.option, "disabled", false)
  1510. this.$set(this.$refs.boxCost.option, "addBtn", true)
  1511. this.$set(this.$refs.boxCost.option, "menu", true)
  1512. //附件和顶部按钮
  1513. this.disabled = false
  1514. }
  1515. }else {
  1516. //基础资料
  1517. this.$set(this.optionForm, "disabled", false)
  1518. //箱信息
  1519. this.$set(this.option, "disabled", false)
  1520. this.$set(this.option, "addBtn", true)
  1521. this.$set(this.option, "menu", true)
  1522. //费用信息
  1523. this.$set(this.$refs.boxCost.option, "disabled", false)
  1524. this.$set(this.$refs.boxCost.option, "addBtn", true)
  1525. this.$set(this.$refs.boxCost.option, "menu", true)
  1526. //附件和顶部按钮
  1527. this.disabled = false
  1528. }
  1529. this.key++
  1530. },
  1531. //自定义列重置
  1532. async resetColumnTwo(ref, option, optionBack, code) {
  1533. this[option] = this[optionBack];
  1534. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1535. if (inSave) {
  1536. //下拉箱号带出对应信息
  1537. this.findObject(this.option.column, "newDate").value = dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00"
  1538. this.findObject(this.option.column, "code").change = ({value, column}) => {
  1539. selectArchivesList({code: value}).then(res => {
  1540. for (let item of res.data.data) {
  1541. if (value == item.code) {
  1542. this.formTwo = {
  1543. boxTypeId: item.typeId,
  1544. boxType: item.name,
  1545. addressId:item.addressId,
  1546. address:item.address
  1547. }
  1548. }
  1549. }
  1550. })
  1551. }
  1552. this.resetTrigger()
  1553. this.$message.success("重置成功");
  1554. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1555. }
  1556. }
  1557. }
  1558. }
  1559. </script>
  1560. <style scoped>
  1561. ::v-deep .el-form-item {
  1562. margin-bottom: 8px;
  1563. }
  1564. </style>