detailsPage.vue 42 KB

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