archives.vue 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082
  1. <template>
  2. <basic-container>
  3. <avue-crud
  4. :option="option"
  5. :search.sync="search"
  6. v-model="form"
  7. :table-loading="loading"
  8. :data="dataList"
  9. ref="crud"
  10. :key="key"
  11. :before-open="beforeOpen"
  12. @on-load="onLoad"
  13. @row-save="rowSave"
  14. @row-update="rowUpdate"
  15. @search-change="searchChange"
  16. :upload-delete="uploadDelete"
  17. @row-del="rowDel"
  18. @refresh-change="refreshChange"
  19. @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 234)"
  20. @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 234)"
  21. :page.sync="page"
  22. >
  23. <template slot="menuLeft">
  24. <el-button type="success" size="small" @click="importData">导入</el-button>
  25. <el-button type="warning" size="small" @click="outExport">导 出 </el-button>
  26. </template>
  27. <!-- <template slot-scope="{ type, size, row, index }" slot="menu">
  28. <el-button icon="el-icon-edit" :size="size" type="text" @click="$refs.crud.rowEdit(row, index)">查 看 </el-button>
  29. </template> -->
  30. <tempalte slot="boxMakingCompanyForm">
  31. <dic-select
  32. v-model="form.boxMakingCompany"
  33. placeholder="造箱公司"
  34. key="id"
  35. label="cnName"
  36. res="records"
  37. url="/blade-los/bcorps/selectList?corpTypeName=箱东"
  38. :filterable="true"
  39. :remote="true"
  40. dataName="cnName"
  41. @selectChange="dicChange('boxMakingCompany', $event)"
  42. ></dic-select>
  43. </tempalte>
  44. <template slot-scope="{ type, size, row, index, disabled }" slot="code">
  45. <span class="el-button--text" style="cursor: pointer" @click="track(row)">{{ row.code }}</span>
  46. </template>
  47. <template slot-scope="{ type, size, row, index, disabled }" slot="menu">
  48. <el-button size="small" :disabled="disabled" type="text" @click="rowEdit(row, $index)">编辑 </el-button>
  49. </template>
  50. </avue-crud>
  51. <el-dialog
  52. title="箱轨迹"
  53. :visible.sync="boxTrack"
  54. :append-to-body="true"
  55. :destroy-on-close="true"
  56. :close-on-click-modal="false"
  57. v-if="boxTrack"
  58. top="1vh"
  59. width="80%"
  60. v-dialog-drag
  61. >
  62. <span>
  63. <avue-crud
  64. ref="crudTrack"
  65. :option="optionTrack"
  66. :data="dataTrackList"
  67. :search.sync="searchTwo"
  68. :page.sync="pageTwo"
  69. :table-loading="loadingTwo"
  70. @on-load="onLoadTrack"
  71. @search-change="searchChangeTwo"
  72. @row-update="rowUpdateTrack"
  73. @resetColumn="resetColumnTwo('crudTrack', 'optionTrack', 'optionTrackBack', 234.1)"
  74. @saveColumn="saveColumnTwo('crudTrack', 'optionTrack', 'optionTrackBack', 234.1)"
  75. v-model="formTrack"
  76. >
  77. <template slot-scope="{ type, size, row, index, disabled }" slot="code">
  78. <span class="el-button--text" style="cursor: pointer" @click="contractNoJump(row)">{{ row.code }}</span>
  79. </template>
  80. <template slot-scope="{ type, size, row, index, disabled }" slot="menu">
  81. <el-button icon="el-icon-edit" :size="size" :disabled="disabled" :type="type" @click="$refs.crudTrack.rowEdit(row, index)"
  82. >编辑
  83. </el-button>
  84. <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type" @click="rowDel(row, index, 'GJ')">删除 </el-button>
  85. </template>
  86. </avue-crud>
  87. </span>
  88. </el-dialog>
  89. <el-dialog title="导入数据" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false" v-dialog-drag>
  90. <avue-form
  91. v-if="excelBox"
  92. :option="excelOption"
  93. v-model="excelForm"
  94. :table-loading="excelLoading"
  95. :upload-before="uploadBefore"
  96. :upload-after="onSuccess"
  97. >
  98. <template slot="excelTemplate">
  99. <el-button type="primary" @click="handleGet"> 点击下载<i class="el-icon-download el-icon--right"></i> </el-button>
  100. </template>
  101. </avue-form>
  102. <p style="text-align: center;color: #DC0505">
  103. 温馨提示 第一次导入时请先下载模板
  104. </p>
  105. </el-dialog>
  106. </basic-container>
  107. </template>
  108. <script>
  109. import { addUpdate, boxRemove, getList, remove, archivestrajectory, update } from "@/api/box/archives";
  110. import { getToken } from "@/util/auth";
  111. import { getAllBoxs } from "@/api/basicData/portinformation";
  112. import dicSelect from "@/components/dicSelect/main";
  113. import fa from "element-ui/src/locale/lang/fa";
  114. export default {
  115. name: "箱档案",
  116. components: {
  117. dicSelect
  118. },
  119. data() {
  120. return {
  121. excelBox: false,
  122. excelForm: {},
  123. excelLoading: false,
  124. excelOption: {
  125. submitBtn: false,
  126. emptyBtn: false,
  127. column: [
  128. {
  129. label: "模板下载",
  130. prop: "excelTemplate",
  131. formslot: true,
  132. span: 24
  133. },
  134. {
  135. label: "模板上传",
  136. prop: "excelFile",
  137. type: "upload",
  138. drag: true,
  139. loadText: "模板上传中,请稍等",
  140. span: 24,
  141. propsHttp: {
  142. res: "data"
  143. },
  144. tip: "请上传 .xls,.xlsx 标准格式文件",
  145. action: "/api/blade-los/archives/import-descParts-info"
  146. }
  147. ]
  148. },
  149. boxTrack: false,
  150. dataTrackList: [],
  151. loadingTwo: false,
  152. searchTwo: {},
  153. formTrack: {},
  154. optionTrack: {},
  155. optionTrackBack: {
  156. align: "center",
  157. index: true,
  158. menu: false,
  159. addBtnText: "录入明细",
  160. refreshBtn: false,
  161. addBtn: false,
  162. span: 8,
  163. searchMenuPosition: "right",
  164. searchSpan: 6,
  165. searchMenuSpan: 6,
  166. searchIcon: true,
  167. searchIndex: 3,
  168. addRowBtn: false,
  169. cellBtn: false,
  170. editBtn: false,
  171. delBtn: false,
  172. menuWidth: 200,
  173. dialogTop: 25,
  174. dialogWidth: "80%",
  175. column: [
  176. {
  177. label: "箱号",
  178. prop: "code",
  179. overHidden: true
  180. // search: true
  181. },
  182. {
  183. label: "放箱号",
  184. prop: "containerNumber",
  185. overHidden: true
  186. },
  187. {
  188. label: "箱型",
  189. prop: "boxType",
  190. overHidden: true
  191. },
  192. {
  193. label: "箱东",
  194. prop: "boxEastName",
  195. overHidden: true
  196. },
  197. {
  198. label: "放箱号类型",
  199. prop: "boxCategory",
  200. overHidden: true
  201. // search: true
  202. },
  203. {
  204. label: "箱动态",
  205. prop: "boxDynamics",
  206. overHidden: true,
  207. search: true,
  208. type: "select",
  209. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxDynamics",
  210. props: {
  211. label: "dictValue",
  212. value: "dictValue"
  213. }
  214. },
  215. {
  216. label: "动态日期",
  217. prop: "newDate",
  218. overHidden: true
  219. },
  220. {
  221. label: "港口",
  222. prop: "portCname",
  223. overHidden: true
  224. // search: true,
  225. // type: "select",
  226. // filterable: true,
  227. // remote: true,
  228. // dicUrl: "/api/blade-los/bports/list?size=20&current=1&cnName={{key}}",
  229. // props: {
  230. // label: "cnName",
  231. // value: "cnName",
  232. // res: "data.records"
  233. // }
  234. },
  235. {
  236. label: "港口",
  237. prop: "portId",
  238. overHidden: true,
  239. search: true,
  240. type: "select",
  241. filterable: true,
  242. remote: true,
  243. hide: true,
  244. dicUrl: "/api/blade-los/bports/list?size=20&current=1&cnName={{key}}",
  245. props: {
  246. label: "cnName",
  247. value: "id",
  248. res: "data.records"
  249. }
  250. },
  251. {
  252. label: "场站",
  253. prop: "stationCname",
  254. overHidden: true,
  255. search: true,
  256. type: "select",
  257. filterable: true,
  258. remote: true,
  259. dicUrl: "/api/blade-los/bcorps/selectList?corpTypeName=场站&cnName={{key}}",
  260. props: {
  261. label: "cnName",
  262. value: "cnName",
  263. res: "data.records"
  264. }
  265. },
  266. // {
  267. // label: '客户名称',
  268. // prop: 'corpName',
  269. // overHidden: true,
  270. // search: true,
  271. // type: "select",
  272. // filterable: true,
  273. // remote: true,
  274. // dicUrl: "/api/blade-los/bcorps/selectList?size=20&current=1&cnName={{key}}",
  275. // props: {
  276. // label: "cnName",
  277. // value: "cnName",
  278. // res: "data.records"
  279. // }
  280. // },
  281. {
  282. label: "提单号",
  283. prop: "mblno",
  284. overHidden: true
  285. },
  286. {
  287. label: "船名",
  288. prop: "shipCname",
  289. overHidden: true
  290. },
  291. {
  292. label: "航次",
  293. prop: "voyage",
  294. overHidden: true
  295. },
  296. {
  297. label: "ETD",
  298. prop: "etd",
  299. overHidden: true
  300. },
  301. {
  302. label: "POL堆场",
  303. prop: "polCyCname",
  304. overHidden: true
  305. },
  306. {
  307. label: "POL免箱使天数",
  308. prop: "polFreeBoxUseDays",
  309. width: 110,
  310. overHidden: true
  311. },
  312. {
  313. label: "POL提前出场日期",
  314. prop: "polPreAppearanceDate",
  315. width: 120,
  316. overHidden: true
  317. },
  318. {
  319. label: "POL场站空箱出场日期",
  320. prop: "polStationEmptyContainerExitDate",
  321. width: 140,
  322. overHidden: true
  323. },
  324. {
  325. label: "POL还箱日期",
  326. prop: "polReturnDate",
  327. width: 100,
  328. overHidden: true
  329. },
  330. {
  331. label: "POL超期箱使天数",
  332. prop: "polOverdueBoxUseDays",
  333. width: 120,
  334. overHidden: true
  335. },
  336. {
  337. label: "ETA",
  338. prop: "eta",
  339. overHidden: true
  340. },
  341. {
  342. label: "POD空箱还箱日期",
  343. prop: "podEmptyContainerReturnDate",
  344. width: 120,
  345. overHidden: true
  346. },
  347. {
  348. label: "POD场站",
  349. prop: "podStationCname",
  350. overHidden: true
  351. },
  352. {
  353. label: "POD免箱使天数",
  354. prop: "podFreeBoxUseDays",
  355. width: 110,
  356. overHidden: true
  357. },
  358. {
  359. label: "POD箱使天数",
  360. prop: "podBoxUseDays",
  361. width: 100,
  362. overHidden: true
  363. }
  364. ]
  365. },
  366. loading: false,
  367. search: {},
  368. form: {},
  369. dataList: [],
  370. page: {
  371. pageSize: 20,
  372. currentPage: 1,
  373. total: 0,
  374. pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
  375. },
  376. key: 0,
  377. option: {},
  378. optionList: {
  379. index: true,
  380. dialogDrag: true,
  381. addBtn: false,
  382. delBtn: false,
  383. viewBtn: false,
  384. editBtn: false,
  385. saveBtn: false,
  386. cancelBtnText: "关闭",
  387. span: 8,
  388. border: true,
  389. height: "auto",
  390. searchMenuPosition: "right",
  391. align: "center",
  392. searchSpan: 6,
  393. searchMenuSpan: 18,
  394. searchIcon: true,
  395. searchIndex: 3,
  396. menuWidth: 60,
  397. highlightCurrentRow: true,
  398. dialogWidth: "70%",
  399. column: [
  400. {
  401. label: "箱号",
  402. prop: "code",
  403. width: 100,
  404. overHidden: true,
  405. search: true,
  406. disabled: true
  407. },
  408. {
  409. label: "合同号",
  410. prop: "contractNo",
  411. width: 100,
  412. disabled: true,
  413. overHidden: true,
  414. search: true
  415. },
  416. {
  417. label: "港口",
  418. prop: "addressCname",
  419. width: 100,
  420. overHidden: true,
  421. search: true,
  422. disabled: true,
  423. type: "select",
  424. filterable: true,
  425. remote: true,
  426. dicUrl: "/api/blade-los/bports/list?current=1&size=20&cnName={{key}}",
  427. props: {
  428. label: "cnName",
  429. value: "cnName",
  430. res: "data.records"
  431. }
  432. },
  433. {
  434. label: "场站",
  435. prop: "stationCname",
  436. width: 100,
  437. overHidden: true,
  438. disabled: true
  439. },
  440. {
  441. label: "放箱号",
  442. prop: "containerNumber",
  443. width: 100,
  444. overHidden: true,
  445. disabled: true
  446. },
  447. {
  448. label: "箱型",
  449. prop: "typeName",
  450. width: 100,
  451. overHidden: true,
  452. search: true,
  453. disabled: true,
  454. type: "select",
  455. filterable: true,
  456. remote: true,
  457. dicUrl: "/api/blade-los/bcntrtypes/list?status=0&current=1&size=20&cnName={{key}}",
  458. props: {
  459. label: "cnName",
  460. value: "cnName",
  461. res: "data.records"
  462. }
  463. },
  464. {
  465. label: "动态日期",
  466. prop: "newDate",
  467. width: 100,
  468. searchProp: "newDateList",
  469. overHidden: true,
  470. search: true,
  471. disabled: true,
  472. type: "date",
  473. searchRange: true,
  474. searchDefaultTime: ["00:00:00", "23:59:59"],
  475. format: "yyyy-MM-dd",
  476. valueFormat: "yyyy-MM-dd HH:mm:ss"
  477. },
  478. {
  479. label: "箱状态",
  480. width: 100,
  481. overHidden: true,
  482. disabled: true,
  483. search: true,
  484. filterable: true,
  485. prop: "status",
  486. type: "select",
  487. dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_archives_status",
  488. props: {
  489. label: "dictValue",
  490. value: "dictKey"
  491. }
  492. },
  493. {
  494. label: "箱属",
  495. prop: "boxBelongsTo",
  496. width: 100,
  497. overHidden: true,
  498. disabled: true
  499. },
  500. {
  501. label: "放箱号类型",
  502. prop: "containerNumberType",
  503. width: 100,
  504. overHidden: true,
  505. disabled: true,
  506. search: true,
  507. type: "select",
  508. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxCategory",
  509. props: {
  510. label: "dictValue",
  511. value: "dictValue"
  512. }
  513. },
  514. {
  515. label: "放箱号OW",
  516. prop: "containerNumberOw",
  517. width: 100,
  518. overHidden: true,
  519. disabled: true
  520. },
  521. {
  522. label: "放箱号类型OW",
  523. prop: "containerNumberTypeOw",
  524. width: 110,
  525. labelWidth: 100,
  526. type: "select",
  527. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxCategory",
  528. props: {
  529. label: "dictValue",
  530. value: "dictValue"
  531. },
  532. overHidden: true,
  533. disabled: false
  534. },
  535. // {
  536. // label: "箱东",
  537. // prop: "boxEastName",
  538. // width: 100,
  539. // overHidden: true,
  540. // disabled: true
  541. // },
  542. {
  543. label: "限制港口",
  544. prop: "restrictedPortsName",
  545. width: 100,
  546. overHidden: true,
  547. disabled: true
  548. },
  549. {
  550. label: "限制船公司",
  551. prop: "restrictingShippingCompaniesName",
  552. width: 100,
  553. overHidden: true,
  554. disabled: true
  555. },
  556. {
  557. label: "启用日期",
  558. prop: "activationDate",
  559. width: 100,
  560. overHidden: true,
  561. disabled: true,
  562. type: "date",
  563. format: "yyyy-MM-dd",
  564. valueFormat: "yyyy-MM-dd HH:mm:ss"
  565. },
  566. {
  567. label: "租赁公司",
  568. prop: "leasingCompany",
  569. width: 100,
  570. overHidden: true,
  571. search: true,
  572. disabled: true,
  573. type: "select",
  574. filterable: true,
  575. remote: true,
  576. dicUrl: "/api/blade-los/bcorps/selectList?current=1&size=5&corpTypeName=箱东&shortName={{key}}",
  577. props: {
  578. label: "shortName",
  579. value: "shortName",
  580. desc: "code",
  581. res: "data.records"
  582. }
  583. },
  584. {
  585. label: "箱来源",
  586. prop: "boxSource",
  587. width: 100,
  588. overHidden: true,
  589. disabled: true,
  590. search: true,
  591. filterable: true,
  592. type: "select",
  593. dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_source",
  594. props: {
  595. label: "dictValue",
  596. value: "dictKey"
  597. }
  598. },
  599. {
  600. label: "箱好坏",
  601. prop: "boxStatus",
  602. width: 100,
  603. overHidden: true,
  604. disabled: true,
  605. search: true,
  606. filterable: true,
  607. type: "select",
  608. dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_status",
  609. props: {
  610. label: "dictValue",
  611. value: "dictKey"
  612. }
  613. },
  614. {
  615. label: "租赁方式",
  616. prop: "leaseMethod",
  617. width: 100,
  618. overHidden: true,
  619. filterable: true,
  620. type: "select",
  621. disabled: true,
  622. dicUrl: "/api/blade-system/dict-biz/dictionary?code=lease_method",
  623. props: {
  624. label: "dictValue",
  625. value: "dictKey"
  626. }
  627. },
  628. {
  629. label: "空重(kg)",
  630. prop: "emptyWeight",
  631. width: 100,
  632. overHidden: true,
  633. disabled: false
  634. },
  635. {
  636. label: "毛重(kg)",
  637. prop: "gorssWeight",
  638. width: 100,
  639. overHidden: true,
  640. disabled: false
  641. },
  642. {
  643. label: "皮重(kg)",
  644. prop: "tare",
  645. width: 100,
  646. overHidden: true,
  647. disabled: false
  648. },
  649. {
  650. label: "装载重量(kg)",
  651. prop: "loadingWeight",
  652. width: 100,
  653. overHidden: true,
  654. disabled: false
  655. },
  656. {
  657. label: "容积(m³)",
  658. prop: "volume",
  659. overHidden: true,
  660. disabled: false,
  661. width: 100
  662. },
  663. {
  664. label: "造箱公司",
  665. prop: "boxMakingCompany",
  666. disabled: false,
  667. width: 100,
  668. overHidden: true,
  669. search: true,
  670. type: "select",
  671. filterable: true,
  672. remote: true,
  673. dicUrl: "/api/blade-los/bcorps/selectList?current=1&size=5&corpTypeName=箱东&shortName={{key}}",
  674. props: {
  675. label: "shortName",
  676. value: "shortName",
  677. desc: "code",
  678. res: "data.records"
  679. }
  680. },
  681. {
  682. label: "造箱日期",
  683. prop: "boxMakingDate",
  684. searchProp: "boxMakingDateList",
  685. width: 100,
  686. overHidden: true,
  687. disabled: false,
  688. search: true,
  689. type: "date",
  690. searchRange: true,
  691. searchDefaultTime: ["00:00:00", "23:59:59"],
  692. format: "yyyy-MM-dd",
  693. valueFormat: "yyyy-MM-dd HH:mm:ss"
  694. },
  695. {
  696. label: "起租日期",
  697. prop: "leaseCommencementDate",
  698. searchProp: "leaseCommencementDateList",
  699. width: 100,
  700. overHidden: true,
  701. search: true,
  702. type: "date",
  703. disabled: true,
  704. searchRange: true,
  705. searchDefaultTime: ["00:00:00", "23:59:59"],
  706. format: "yyyy-MM-dd",
  707. valueFormat: "yyyy-MM-dd HH:mm:ss"
  708. },
  709. {
  710. label: "购入日期",
  711. prop: "purchaseDate",
  712. width: 100,
  713. overHidden: true,
  714. type: "date",
  715. disabled: true,
  716. searchRange: true,
  717. searchDefaultTime: ["00:00:00", "23:59:59"],
  718. format: "yyyy-MM-dd",
  719. valueFormat: "yyyy-MM-dd HH:mm:ss"
  720. },
  721. {
  722. label: "箱龄(月)",
  723. prop: "boxAge",
  724. overHidden: true,
  725. disabled: false,
  726. width: 100
  727. },
  728. {
  729. label: "备注",
  730. prop: "remarks",
  731. type: "textarea",
  732. minRows: 2,
  733. span: 24
  734. }
  735. ]
  736. }
  737. };
  738. },
  739. async created() {
  740. this.option = await this.getColumnData(this.getColumnName(234), this.optionList);
  741. this.optionTrack = await this.getColumnData(this.getColumnName(234.1), this.optionTrackBack);
  742. this.key++;
  743. let i = 0;
  744. this.option.column.forEach(item => {
  745. if (item.search) i++;
  746. });
  747. },
  748. methods: {
  749. importData() {
  750. this.excelForm = {};
  751. this.excelBox = true;
  752. },
  753. // 上传成功
  754. onSuccess(res, done, loading, column) {
  755. if (res.length > 0) {
  756. this.$message.success("上传成功!");
  757. }
  758. this.excelBox = false;
  759. // this.$message.success("导入成功!");
  760. this.onLoad(this.page, this.search);
  761. loading = false;
  762. done();
  763. },
  764. // 下载模板
  765. handleGet() {
  766. window.open(`/api/blade-los/archives/export-archives-info?${this.website.tokenHeader}=${getToken()}`);
  767. },
  768. dicChange(name, row) {
  769. if (name == "typeName") {
  770. if (row) {
  771. this.form.typeId = row.id;
  772. } else {
  773. this.form.typeId = null;
  774. this.form.typeName = null;
  775. }
  776. }
  777. if (name == "purchaseCompanyName") {
  778. if (row) {
  779. this.form.boxMakingCompanyId = row.id;
  780. } else {
  781. this.form.boxMakingCompanyId = null;
  782. this.form.boxMakingCompany = null;
  783. }
  784. }
  785. },
  786. rowEdit(row, index) {
  787. // this.option.column.forEach(item => {
  788. // if (
  789. // item.prop == "code" ||
  790. // item.prop == "contractNo" ||
  791. // item.prop == "addressCname" ||
  792. // item.prop == "stationCname" ||
  793. // item.prop == "containerNumber" ||
  794. // item.prop == "containerNumber" ||
  795. // item.prop == "typeName" ||
  796. // item.prop == "newDate" ||
  797. // item.prop == "status" ||
  798. // item.prop == "boxBelongsTo" ||
  799. // item.prop == "containerNumberOw" ||
  800. // item.prop == "containerNumberTypeOw"||
  801. // item.prop == "restrictedPortsName"||
  802. // item.prop == "restrictingShippingCompaniesName"||
  803. // item.prop == "activationDate"||
  804. // item.prop == "leasingCompany"||
  805. // item.prop == "boxSource"||
  806. // item.prop == "boxStatus"||
  807. // item.prop == "leaseMethod"||
  808. // item.prop == "leaseCommencementDate"||
  809. // item.prop == "purchaseDate"
  810. // ) {
  811. // item.disabled = false;
  812. // }
  813. // });
  814. this.$refs.crud.rowEdit(row, index);
  815. },
  816. // 箱轨迹里合同号跳转
  817. contractNoJump(row) {
  818. this.boxTrack = false;
  819. if (row.billType == "BUY") {
  820. this.$router.push({
  821. path: "/boxManagement/buyContainer/index",
  822. query: {
  823. id: row.srcId
  824. }
  825. });
  826. }
  827. if (row.billType == "OW-N") {
  828. this.$router.push({
  829. path: "/ow/owTask/index",
  830. query: {
  831. id: row.srcId
  832. }
  833. });
  834. }
  835. if (row.billType == "OW-F") {
  836. this.$router.push({
  837. path: "/ow/owPut/index",
  838. query: {
  839. id: row.srcId
  840. }
  841. });
  842. }
  843. if (row.billType == "ZR") {
  844. this.$router.push({
  845. path: "/boxManagement/rentalBox/index",
  846. query: {
  847. id: row.srcId
  848. }
  849. });
  850. }
  851. if (row.billType == "DL") {
  852. this.$router.push({
  853. path: "/boxManagement/agentBox/index",
  854. query: {
  855. id: row.srcId
  856. }
  857. });
  858. }
  859. },
  860. track(row) {
  861. // this.dataTrackList = row
  862. this.formSearch = row;
  863. this.boxTrack = true;
  864. },
  865. rowUpdateTrack(form, index, done, loading) {
  866. update(form).then(res => {
  867. done();
  868. this.$message.success("操作成功");
  869. this.onLoadTrack(this.pageTwo, this.searchTwo);
  870. });
  871. },
  872. //打开表单前
  873. beforeOpen(done, type) {
  874. if (type === "add") {
  875. this.findObject(this.option.column, "boxSource").value =
  876. this.$refs.crud.DIC.boxSource.length > 0 ? this.$refs.crud.DIC.boxSource[0].dictKey : "";
  877. this.findObject(this.option.column, "boxStatus").value =
  878. this.$refs.crud.DIC.boxStatus.length > 0 ? this.$refs.crud.DIC.boxStatus[0].dictKey : "";
  879. }
  880. done();
  881. },
  882. searchChangeTwo(params, done) {
  883. done();
  884. this.onLoadTrack(this.pageTwo, params);
  885. },
  886. onLoadTrack(page, params = {}) {
  887. params = {
  888. ...params,
  889. current: page.currentPage,
  890. size: page.pageSize,
  891. code: this.formSearch.code
  892. };
  893. this.loadingTwo = true;
  894. archivestrajectory(params)
  895. .then(res => {
  896. this.dataTrackList = res.data.data.records;
  897. this.pageTwo.total = res.data.data.total;
  898. this.$nextTick(() => {
  899. this.$refs.crudTrack.doLayout();
  900. this.$refs.crudTrack.dicInit();
  901. });
  902. })
  903. .finally(() => {
  904. this.loadingTwo = false;
  905. });
  906. },
  907. //导出
  908. outExport() {
  909. this.$confirm("是否导出当前所有箱档案?", "提示", {
  910. confirmButtonText: "确定",
  911. cancelButtonText: "取消",
  912. type: "warning"
  913. })
  914. .then(() => {
  915. let queryParams = this.search;
  916. const routeData = this.$router.resolve({
  917. path: "/api/blade-los/archives/export-archives-out", //跳转目标窗口的地址
  918. query: {
  919. "Blade-Auth": getToken(),
  920. ...queryParams //括号内是要传递给新窗口的参数
  921. }
  922. });
  923. window.open(routeData.href.slice(1, routeData.href.length));
  924. })
  925. .catch(() => {
  926. this.$message({
  927. type: "info",
  928. message: "已取消" //
  929. });
  930. });
  931. },
  932. derivation() {
  933. window.open(`/api/blade-box-tube/archives/export-archives-info?${this.website.tokenHeader}=${getToken()}`);
  934. },
  935. uploadBefore(file, done, loading) {
  936. loading = true;
  937. done();
  938. },
  939. uploadAfter(res, done, loading, column) {
  940. this.excelBox = false;
  941. this.$message.success("导入成功!");
  942. this.onLoad(this.page, this.search);
  943. loading = false;
  944. done();
  945. },
  946. balabala(val) {
  947. if (val === null) {
  948. this.form.address = "";
  949. } else {
  950. this.form.address = val.name;
  951. }
  952. },
  953. getGSData(row) {
  954. this.form.leasingCompany = row.cname;
  955. },
  956. //关闭弹窗前
  957. beforeClose(done, type) {
  958. this.onLoad(this.page, this.search);
  959. done();
  960. },
  961. //刷新
  962. refreshChange() {
  963. this.onLoad(this.page, this.search);
  964. },
  965. rowDel(form, index) {
  966. this.$confirm("此操作将永久删除该行, 是否继续?", "提示", {
  967. confirmButtonText: "确定",
  968. cancelButtonText: "取消",
  969. type: "warning"
  970. })
  971. .then(() => {
  972. remove(form.id).then(res => {
  973. this.$message({
  974. type: "success",
  975. message: "删除成功!"
  976. });
  977. this.onLoad(this.page, this.search);
  978. });
  979. })
  980. .catch(() => {});
  981. },
  982. uploadDelete(file, column) {
  983. return new Promise((resolve, reject) => {
  984. this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
  985. confirmButtonText: "确定",
  986. cancelButtonText: "取消",
  987. type: "warning"
  988. })
  989. .then(() => {
  990. if (this.form.filesList[file.uid].id) {
  991. boxRemove(this.form.filesList[file.uid].id).then(res => {
  992. this.$message({
  993. type: "success",
  994. message: "删除成功!"
  995. });
  996. resolve();
  997. });
  998. } else {
  999. resolve();
  1000. }
  1001. })
  1002. .catch(() => {
  1003. reject();
  1004. this.$message({
  1005. type: "info",
  1006. message: "已取消删除"
  1007. });
  1008. });
  1009. });
  1010. },
  1011. rowSave(form, done, loading, index) {
  1012. done();
  1013. addUpdate(form).then(res => {
  1014. this.onLoad(this.page, this.search);
  1015. });
  1016. },
  1017. rowUpdate(row, index, done, loading) {
  1018. done();
  1019. addUpdate(row).then(res => {
  1020. this.onLoad(this.page, this.search);
  1021. });
  1022. },
  1023. searchChange(params, done) {
  1024. done();
  1025. this.onLoad(this.page, params);
  1026. },
  1027. onLoad(page, params = {}) {
  1028. params = {
  1029. ...params,
  1030. current: page.currentPage,
  1031. size: page.pageSize,
  1032. ...Object.assign(params, this.search)
  1033. };
  1034. this.loading = true;
  1035. getList(params)
  1036. .then(res => {
  1037. this.dataList = res.data.data.records;
  1038. this.page.total = res.data.data.total;
  1039. this.loading = false;
  1040. this.$nextTick(() => {
  1041. this.$refs.crud.doLayout();
  1042. this.$refs.crud.dicInit();
  1043. });
  1044. })
  1045. .finally(() => {
  1046. this.loading = false;
  1047. });
  1048. },
  1049. //自定义列保存
  1050. async saveColumnTwo(ref, option, optionBack, code) {
  1051. /**
  1052. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1053. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1054. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1055. */
  1056. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1057. if (inSave) {
  1058. this.$message.success("保存成功");
  1059. //关闭窗口
  1060. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1061. }
  1062. },
  1063. //自定义列重置
  1064. async resetColumnTwo(ref, option, optionBack, code) {
  1065. this[option] = this[optionBack];
  1066. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1067. if (inSave) {
  1068. this.$message.success("重置成功");
  1069. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1070. }
  1071. }
  1072. }
  1073. };
  1074. </script>
  1075. <style lang="scss" scoped>
  1076. ::v-deep .el-col-md-8 {
  1077. width: 24.33333%;
  1078. }
  1079. </style>