index.vue 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190
  1. <template>
  2. <div>
  3. <basic-container v-if="isShow">
  4. <!-- <el-button
  5. v-if="roleName.includes('admin') || roleName.includes('箱管')"
  6. type="warning"
  7. plain
  8. size="small"
  9. @click="allClick('POL空箱提箱进场(EXCEL)')"
  10. >POL空箱提箱进场(EXCEL)</el-button
  11. > -->
  12. <!-- <el-button
  13. v-if="roleName.includes('admin') || roleName.includes('箱管')"
  14. type="success"
  15. plain
  16. size="small"
  17. @click="allClick('POL空箱出场(EXCEL)')"
  18. >POL空箱出场(EXCEL)</el-button
  19. > -->
  20. <!-- <el-button v-if="roleName.includes('admin') || roleName.includes('箱管')" type="info" plain size="small"
  21. @click="allClick('POD空箱进场(EXCEL)')">POD空箱进场(EXCEL)</el-button>-->
  22. <!-- <el-button type="primary" plain size="small"
  23. @click="allClick('POL返场(EXCEL)')">POL返场(EXCEL)</el-button> -->
  24. <!-- <el-button
  25. v-if="roleName.includes('admin') || roleName.includes('箱管')"
  26. type="danger"
  27. plain
  28. size="small"
  29. @click="allClick('POL无货返空(EXCEL)')"
  30. >POL无货返空(EXCEL)</el-button
  31. > -->
  32. <!-- <el-button v-if="roleName.includes('admin') || roleName.includes('箱管')" type="primary" plain size="small"
  33. @click="allClick('进场导入')">进场导入</el-button>
  34. <el-button v-if="roleName.includes('admin') || roleName.includes('箱管')" type="info" plain size="small"
  35. @click="allClick('出场导入')">出场导入</el-button> -->
  36. <el-tabs v-model="activeName" type="card" style="margin-top: 8px;">
  37. <el-tab-pane label="按港口" name="1">
  38. <avue-crud
  39. :option="option"
  40. :table-loading="loading"
  41. :data="data"
  42. :page.sync="page"
  43. :search.sync="query"
  44. v-model="form"
  45. id="out-table"
  46. :header-cell-class-name="headerClassName"
  47. ref="crud"
  48. @search-change="searchChange"
  49. @search-reset="searchReset"
  50. @current-change="currentChange"
  51. @size-change="sizeChange"
  52. @refresh-change="refreshChange"
  53. @on-load="onLoad"
  54. :cell-style="cellStyle"
  55. >
  56. <template slot="menuLeft">
  57. <el-button type="warning" size="small" @click="outExport">导 出</el-button>
  58. <el-button type="warning" size="small" @click="outExport3">导出明细</el-button>
  59. </template>
  60. </avue-crud>
  61. </el-tab-pane>
  62. <el-tab-pane label="按放箱号" name="2">
  63. <avue-crud
  64. :option="option2"
  65. :table-loading="loading2"
  66. :data="data2"
  67. :page.sync="page2"
  68. :search.sync="query2"
  69. v-model="form2"
  70. id="out-table"
  71. :header-cell-class-name="headerClassName"
  72. ref="crud2"
  73. @search-change="searchChange2"
  74. @search-reset="searchReset2"
  75. @current-change="currentChange2"
  76. @size-change="sizeChange2"
  77. @refresh-change="refreshChange2"
  78. @on-load="onLoad2"
  79. :cell-style="cellStyle"
  80. @resetColumn="resetColumn('crud2', 'option2', 'optionBack2', 466)"
  81. @saveColumn="saveColumn('crud2', 'option2', 'optionBack2', 466)"
  82. >
  83. <template slot="menuLeft">
  84. <el-button type="warning" size="small" @click="outExport2">导 出</el-button>
  85. <el-button type="warning" size="small" @click="outExport4">导出明细</el-button>
  86. <!-- <el-button type="primary" plain size="small"
  87. @click="allClick('空箱出场(EDI)')">空箱出场(EDI)</el-button> -->
  88. <!-- <el-button type="success" plain size="small"
  89. @click="allClick('POL空箱出场(EXCEL)')">POL空箱出场(EXCEL)</el-button> -->
  90. <!-- <el-button type="primary" plain size="small"
  91. @click="allClick('POL返场(EXCEL)')">POL返场(EXCEL)</el-button> -->
  92. <!-- <el-button type="info" plain size="small"
  93. @click="allClick('POD空箱进场(EXCEL)')">POD空箱进场(EXCEL)</el-button> -->
  94. <!-- <el-button type="warning" plain size="small"
  95. @click="allClick('空箱进场(excel)')">空箱进场(excel)</el-button> -->
  96. <!-- <el-button type="danger" plain size="small"
  97. @click="allClick('POL无货返空(EXCEL)')">POL无货返空(EXCEL)</el-button> -->
  98. </template>
  99. <template slot="menu" slot-scope="{ row, index }">
  100. <el-button size="small" icon="el-icon-edit" type="text" @click="rowEdit(row)">查看</el-button>
  101. </template>
  102. <template slot="containerNumber" slot-scope="{ row }">
  103. <span style="color: #1e9fff;cursor: pointer;" @click="rowContainerNumber(row)">{{ row.containerNumber }}</span>
  104. </template>
  105. </avue-crud>
  106. </el-tab-pane>
  107. <!-- <el-tab-pane label="导入文件记录" name="3">
  108. <avue-crud
  109. :option="option3"
  110. :table-loading="loading3"
  111. :data="data3"
  112. :page.sync="page3"
  113. :search.sync="query3"
  114. v-model="form3"
  115. id="out-table"
  116. :header-cell-class-name="headerClassName"
  117. ref="crud3"
  118. @search-change="searchChange3"
  119. @search-reset="searchReset3"
  120. @current-change="currentChange3"
  121. @size-change="sizeChange3"
  122. @refresh-change="refreshChange3"
  123. @on-load="onLoad3"
  124. >
  125. <template slot="menu" slot-scope="{ row, index }">
  126. <el-button size="small" type="text" @click="rowDownload(row)">下载</el-button>
  127. </template>
  128. </avue-crud>
  129. </el-tab-pane> -->
  130. </el-tabs>
  131. <el-dialog title="导入数据" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false" v-dialog-drag>
  132. <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading" :upload-before="uploadBefore" :upload-after="onSuccess">
  133. <template slot="excelTemplate">
  134. <el-button type="primary" @click="handleGet(excelType)"> 点击下载<i class="el-icon-download el-icon--right"></i> </el-button>
  135. </template>
  136. </avue-form>
  137. <p style="text-align: center;color: #DC0505">
  138. 温馨提示 第一次导入时请先下载模板
  139. </p>
  140. </el-dialog>
  141. <import-module ref="importModule" @refreshData="refreshData" />
  142. </basic-container>
  143. <detailsPage v-if="!isShow" :detailData="detailData" @goBack="goBack"></detailsPage>
  144. </div>
  145. </template>
  146. <script>
  147. import { getList, getList2, getList3, emptyContainerEntryFtp } from "@/api/boxManagement/boxPoolDynamics/index.js";
  148. import { getWorkDicts } from "@/api/system/dictbiz";
  149. import detailsPage from "./detailsPage";
  150. import importModule from "./components/importModule.vue";
  151. import { getToken } from "@/util/auth";
  152. import _ from "lodash";
  153. export default {
  154. name: "箱池动态",
  155. data() {
  156. return {
  157. roleName: localStorage.getItem("roleName"),
  158. excelType: 1,
  159. excelBox: false,
  160. excelForm: {},
  161. excelLoading: false,
  162. excelOption: {
  163. submitBtn: false,
  164. emptyBtn: false,
  165. column: [
  166. {
  167. label: "模板下载",
  168. prop: "excelTemplate",
  169. formslot: true,
  170. span: 24
  171. },
  172. {
  173. label: "模板上传",
  174. prop: "excelFile",
  175. type: "upload",
  176. drag: true,
  177. loadText: "模板上传中,请稍等",
  178. span: 24,
  179. propsHttp: {
  180. res: "data"
  181. },
  182. tip: "请上传 .xls,.xlsx 标准格式文件",
  183. action: "/api/blade-los/boxPool/emptyContainerAppearance"
  184. }
  185. ]
  186. },
  187. activeName: "1",
  188. isShow: true,
  189. form: {},
  190. query: {},
  191. loading: false,
  192. page: {
  193. pageSize: 10,
  194. currentPage: 1,
  195. total: 0,
  196. pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
  197. },
  198. form2: {},
  199. query2: {},
  200. loading2: false,
  201. page2: {
  202. pageSize: 10,
  203. currentPage: 1,
  204. total: 0,
  205. pageSizes: [10, 20, 30, 40, 50, 100, 500, 1000]
  206. },
  207. form3: {},
  208. query3: {},
  209. loading3: false,
  210. page3: {
  211. pageSize: 10,
  212. currentPage: 1,
  213. total: 0
  214. },
  215. selectionList: [],
  216. option: {
  217. height: "auto",
  218. calcHeight: 30,
  219. menuWidth: 70,
  220. tip: false,
  221. searchShow: true,
  222. searchMenuSpan: 6,
  223. // header: false,
  224. menu: false,
  225. border: true,
  226. index: true,
  227. addBtn: false,
  228. viewBtn: false,
  229. editBtn: false,
  230. delBtn: false,
  231. columnBtn: false,
  232. searchIcon: true,
  233. align: "center",
  234. searchIndex: 3,
  235. summaryText: "合计",
  236. showSummary: true,
  237. sumColumnList: [
  238. {
  239. name: "total",
  240. type: "sum",
  241. decimals: 0
  242. },
  243. {
  244. name: "remainingTotal",
  245. type: "sum",
  246. decimals: 0
  247. },
  248. {
  249. name: "gp20Good",
  250. type: "sum",
  251. decimals: 0
  252. },
  253. {
  254. name: "gp40Good",
  255. type: "sum",
  256. decimals: 0
  257. },
  258. {
  259. name: "hg40Good",
  260. type: "sum",
  261. decimals: 0
  262. },
  263. {
  264. name: "otherGood",
  265. type: "sum",
  266. decimals: 0
  267. },
  268. {
  269. name: "gp20Bad",
  270. type: "sum",
  271. decimals: 0
  272. },
  273. {
  274. name: "gp40Bad",
  275. type: "sum",
  276. decimals: 0
  277. },
  278. {
  279. name: "hg40Bad",
  280. type: "sum",
  281. decimals: 0
  282. },
  283. {
  284. name: "otherBad",
  285. type: "sum",
  286. decimals: 0
  287. }
  288. ],
  289. column: [
  290. {
  291. label: "港口",
  292. prop: "polId",
  293. overHidden: true,
  294. hide: true,
  295. search: true,
  296. type: "select",
  297. filterable: true,
  298. dicUrl: "/api/blade-los/blade-los/bports/listAll?status=0",
  299. props: {
  300. label: "cnName",
  301. value: "id",
  302. desc: "code"
  303. }
  304. },
  305. {
  306. label: "港口",
  307. prop: "portName",
  308. overHidden: true
  309. },
  310. {
  311. label: "场站",
  312. prop: "stationName",
  313. overHidden: true
  314. },
  315. {
  316. label: "场站",
  317. prop: "stationId",
  318. overHidden: true,
  319. hide: true,
  320. search: true,
  321. type: "select",
  322. filterable: true,
  323. dicUrl: "/api/blade-los/bcorps/listAll?status=0&corpTypeName=场站",
  324. props: {
  325. label: "shortName",
  326. value: "id"
  327. }
  328. },
  329. {
  330. label: "放箱号类型",
  331. prop: "busType",
  332. width: 100,
  333. overHidden: true,
  334. search: true,
  335. type: "select",
  336. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxCategory",
  337. props: {
  338. label: "dictValue",
  339. value: "dictValue"
  340. }
  341. },
  342. {
  343. label: "场地盘存",
  344. prop: "total",
  345. width: 100,
  346. overHidden: true
  347. },
  348. // {
  349. // label: '操作占用',
  350. // prop: 'occupyNum',
  351. // width: 100,
  352. // overHidden: true,
  353. // },
  354. {
  355. label: "可用箱量",
  356. prop: "remainingTotal",
  357. width: 100,
  358. overHidden: true
  359. },
  360. {
  361. label: "好",
  362. prop: "good",
  363. overHidden: true,
  364. children: [
  365. {
  366. label: "20GP",
  367. prop: "gp20Good",
  368. width: 60,
  369. overHidden: true
  370. },
  371. {
  372. label: "40GP",
  373. prop: "gp40Good",
  374. width: 60,
  375. overHidden: true
  376. },
  377. {
  378. label: "40HC",
  379. prop: "hg40Good",
  380. width: 60,
  381. overHidden: true
  382. },
  383. {
  384. label: "OTHER",
  385. prop: "otherGood",
  386. width: 70,
  387. overHidden: true
  388. }
  389. ]
  390. },
  391. {
  392. label: "坏",
  393. prop: "bad",
  394. overHidden: true,
  395. children: [
  396. {
  397. label: "20GP",
  398. prop: "gp20Bad",
  399. width: 60,
  400. overHidden: true
  401. },
  402. {
  403. label: "40GP",
  404. prop: "gp40Bad",
  405. width: 60,
  406. overHidden: true
  407. },
  408. {
  409. label: "40HC",
  410. prop: "hg40Bad",
  411. width: 60,
  412. overHidden: true
  413. },
  414. {
  415. label: "OTHER",
  416. prop: "otherBad",
  417. width: 70,
  418. overHidden: true
  419. }
  420. ]
  421. }
  422. ]
  423. },
  424. option2: {},
  425. optionBack2: {
  426. height: "auto",
  427. calcHeight: 30,
  428. menuWidth: 70,
  429. tip: false,
  430. searchShow: true,
  431. searchMenuSpan: 12,
  432. border: true,
  433. index: true,
  434. addBtn: false,
  435. viewBtn: false,
  436. editBtn: false,
  437. delBtn: false,
  438. searchIcon: true,
  439. align: "center",
  440. searchIndex: 3,
  441. summaryText: "合计",
  442. showSummary: true,
  443. sumColumnList: [
  444. {
  445. name: "total",
  446. type: "sum",
  447. decimals: 0
  448. },
  449. {
  450. name: "remainingTotal",
  451. type: "sum",
  452. decimals: 0
  453. },
  454. {
  455. name: "good",
  456. type: "sum",
  457. decimals: 0
  458. },
  459. {
  460. name: "bad",
  461. type: "sum",
  462. decimals: 0
  463. },
  464. {
  465. name: "occupyNum",
  466. type: "sum",
  467. decimals: 0
  468. }
  469. ],
  470. column: [
  471. {
  472. label: "港口",
  473. prop: "polName",
  474. width: 150,
  475. overHidden: true
  476. },
  477. {
  478. label: "港口",
  479. prop: "polId",
  480. overHidden: true,
  481. hide: true,
  482. search: true,
  483. type: "select",
  484. filterable: true,
  485. dicUrl: "/api/blade-los/blade-los/bports/listAll?status=0",
  486. props: {
  487. label: "cnName",
  488. value: "id",
  489. desc: "code"
  490. }
  491. },
  492. {
  493. label: "场站",
  494. prop: "stationId",
  495. overHidden: true,
  496. hide: true,
  497. search: true,
  498. type: "select",
  499. filterable: true,
  500. dicUrl: "/api/blade-los/bcorps/listAll?status=0&corpTypeName=场站",
  501. props: {
  502. label: "shortName",
  503. value: "id"
  504. }
  505. },
  506. {
  507. label: "放箱号类型",
  508. prop: "busType",
  509. width: 150,
  510. overHidden: true,
  511. search: true,
  512. type: "select",
  513. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxCategory",
  514. props: {
  515. label: "dictValue",
  516. value: "dictValue"
  517. }
  518. },
  519. {
  520. label: "放箱号",
  521. prop: "containerNumber",
  522. width: 150,
  523. overHidden: true,
  524. search: true
  525. },
  526. {
  527. label: "起运港场站/堆场",
  528. prop: "polStationName",
  529. width: 150,
  530. overHidden: true
  531. },
  532. {
  533. label: "目的港",
  534. prop: "podName",
  535. width: 150,
  536. overHidden: true
  537. },
  538. {
  539. label: "目的港",
  540. prop: "podId",
  541. width: 150,
  542. overHidden: true,
  543. hide: true,
  544. search: true,
  545. type: "select",
  546. filterable: true,
  547. remote: true,
  548. dicUrl: "/api/blade-los/bports/listAll?status=0",
  549. props: {
  550. label: "cnName",
  551. value: "id",
  552. desc: "code"
  553. }
  554. },
  555. {
  556. label: "目的港场站/堆场",
  557. prop: "podStationName",
  558. width: 150,
  559. overHidden: true
  560. },
  561. {
  562. label: "箱型",
  563. prop: "boxType",
  564. width: 150,
  565. overHidden: true,
  566. search: true,
  567. type: "select",
  568. filterable: true,
  569. remote: true,
  570. dicUrl: "/api/blade-los/bcntrtypes/list?status=0&size=20&current=1&cnName={{key}}",
  571. props: {
  572. label: "cnName",
  573. value: "cnName",
  574. res: "data.records"
  575. }
  576. },
  577. {
  578. label: "场地盘存",
  579. prop: "total",
  580. width: 100,
  581. overHidden: true
  582. },
  583. {
  584. label: "操作占用",
  585. prop: "occupyNum",
  586. width: 100,
  587. overHidden: true
  588. },
  589. {
  590. label: "可用箱量",
  591. prop: "remainingTotal",
  592. width: 100,
  593. overHidden: true
  594. },
  595. {
  596. label: "好",
  597. prop: "good",
  598. width: 100,
  599. overHidden: true
  600. },
  601. {
  602. label: "坏",
  603. prop: "bad",
  604. width: 100,
  605. overHidden: true
  606. }
  607. ]
  608. },
  609. option3: {
  610. height: "auto",
  611. calcHeight: 30,
  612. menuWidth: 70,
  613. tip: false,
  614. searchShow: true,
  615. searchMenuSpan: 12,
  616. header: false,
  617. menu: true,
  618. border: true,
  619. index: true,
  620. addBtn: false,
  621. viewBtn: false,
  622. editBtn: false,
  623. delBtn: false,
  624. searchIcon: true,
  625. align: "center",
  626. searchIndex: 3,
  627. column: [
  628. {
  629. label: "文件名",
  630. prop: "fileName",
  631. overHidden: true,
  632. search: true
  633. },
  634. {
  635. label: "文件地址",
  636. prop: "url",
  637. overHidden: true
  638. },
  639. {
  640. label: "文件类型",
  641. prop: "type",
  642. overHidden: true,
  643. search: true,
  644. type: "select",
  645. dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_file_type",
  646. props: {
  647. label: "dictValue",
  648. value: "dictKey"
  649. }
  650. },
  651. {
  652. label: "创建时间",
  653. prop: "createTime",
  654. overHidden: true
  655. }
  656. ]
  657. },
  658. data: []
  659. };
  660. },
  661. components: {
  662. detailsPage,
  663. importModule
  664. },
  665. async created() {
  666. this.option2 = await this.getColumnData(this.getColumnName(466), this.optionBack2);
  667. this.$nextTick(() => {
  668. this.$refs.crud2.dicInit();
  669. });
  670. },
  671. methods: {
  672. outExport() {
  673. let config = { params: { ...this.query } };
  674. if (config.params) {
  675. for (const propName of Object.keys(config.params)) {
  676. const value = config.params[propName];
  677. if (value !== null && typeof value !== "undefined") {
  678. if (value instanceof Array) {
  679. for (const key of Object.keys(value)) {
  680. let params = propName + "[" + key + "]";
  681. config.params[params] = value[key];
  682. }
  683. delete config.params[propName];
  684. }
  685. }
  686. }
  687. }
  688. const routeData = this.$router.resolve({
  689. path: "/api/blade-los/boxPool/listPortExport", //跳转目标窗口的地址
  690. query: {
  691. ...config.params, //括号内是要传递给新窗口的参数
  692. identification: this.url
  693. }
  694. });
  695. window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
  696. },
  697. outExport2() {
  698. let config = { params: { ...this.query2 } };
  699. if (config.params) {
  700. for (const propName of Object.keys(config.params)) {
  701. const value = config.params[propName];
  702. if (value !== null && typeof value !== "undefined") {
  703. if (value instanceof Array) {
  704. for (const key of Object.keys(value)) {
  705. let params = propName + "[" + key + "]";
  706. config.params[params] = value[key];
  707. }
  708. delete config.params[propName];
  709. }
  710. }
  711. }
  712. }
  713. const routeData = this.$router.resolve({
  714. path: "/api/blade-los/boxPool/listContainerNumberExport", //跳转目标窗口的地址
  715. query: {
  716. ...config.params, //括号内是要传递给新窗口的参数
  717. identification: this.url
  718. }
  719. });
  720. window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
  721. },
  722. outExport3() {
  723. let config = { params: { ...this.query } };
  724. if (config.params) {
  725. for (const propName of Object.keys(config.params)) {
  726. const value = config.params[propName];
  727. if (value !== null && typeof value !== "undefined") {
  728. if (value instanceof Array) {
  729. for (const key of Object.keys(value)) {
  730. let params = propName + "[" + key + "]";
  731. config.params[params] = value[key];
  732. }
  733. delete config.params[propName];
  734. }
  735. }
  736. }
  737. }
  738. const routeData = this.$router.resolve({
  739. path: "/api/blade-los/boxPool/listPortExportItems", //跳转目标窗口的地址
  740. query: {
  741. ...config.params, //括号内是要传递给新窗口的参数
  742. identification: this.url
  743. }
  744. });
  745. window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
  746. },
  747. outExport4() {
  748. let config = { params: { ...this.query2 } };
  749. if (config.params) {
  750. for (const propName of Object.keys(config.params)) {
  751. const value = config.params[propName];
  752. if (value !== null && typeof value !== "undefined") {
  753. if (value instanceof Array) {
  754. for (const key of Object.keys(value)) {
  755. let params = propName + "[" + key + "]";
  756. config.params[params] = value[key];
  757. }
  758. delete config.params[propName];
  759. }
  760. }
  761. }
  762. }
  763. const routeData = this.$router.resolve({
  764. path: "/api/blade-los/boxPool/listContainerNumberExportItems", //跳转目标窗口的地址
  765. query: {
  766. ...config.params, //括号内是要传递给新窗口的参数
  767. identification: this.url
  768. }
  769. });
  770. window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
  771. },
  772. refreshData() {
  773. this.refreshChange();
  774. this.refreshChange2();
  775. this.refreshChange3();
  776. },
  777. uploadBefore(file, done, loading) {
  778. done();
  779. loading = true;
  780. },
  781. // 上传成功
  782. onSuccess(res, done, loading, column) {
  783. if (res == "操作成功") {
  784. this.$message.success("上传成功!");
  785. }
  786. loading = false;
  787. done();
  788. this.excelBox = false;
  789. },
  790. // 下载模板
  791. handleGet(type) {
  792. if (type == 1) {
  793. window.open(`/api/blade-los/boxPool/emptyContainerAppearance/template?${this.website.tokenHeader}=${getToken()}`);
  794. } else if (type == 2) {
  795. window.open(`/api/blade-los/boxPool/emptyContainerEntry/template?${this.website.tokenHeader}=${getToken()}`);
  796. } else if (type == 3) {
  797. window.open(`/api/blade-los/boxPool/giveAnEncore/template?${this.website.tokenHeader}=${getToken()}`);
  798. }
  799. },
  800. rowDownload(row) {
  801. window.open(row.url);
  802. },
  803. allClick(name) {
  804. if (name == "POL空箱出场(EXCEL)") {
  805. this.$refs.importModule.openDialog(2);
  806. // this.excelOption.column.forEach(item => {
  807. // if (item.prop == 'excelFile') {
  808. // item.action = "/api/blade-los/boxPool/emptyContainerAppearance"
  809. // }
  810. // })
  811. // this.excelType = 1
  812. // this.excelBox = true
  813. }
  814. if (name == "POD空箱进场(EXCEL)") {
  815. this.$refs.importModule.openDialog(3);
  816. // this.excelOption.column.forEach(item => {
  817. // if (item.prop == 'excelFile') {
  818. // item.action = "/api/blade-los/boxPool/giveAnEncore"
  819. // }
  820. // })
  821. // this.excelType = 3
  822. // this.excelBox = true
  823. }
  824. if (name == "POL无货返空(EXCEL)") {
  825. this.$refs.importModule.openDialog(4);
  826. // this.excelOption.column.forEach(item => {
  827. // if (item.prop == 'excelFile') {
  828. // item.action = "/api/blade-los/boxPool/returnEmpty"
  829. // }
  830. // })
  831. // this.excelType = 3
  832. // this.excelBox = true
  833. }
  834. if (name == "POL空箱提箱进场(EXCEL)") {
  835. this.$refs.importModule.openDialog(1);
  836. // this.excelOption.column.forEach(item => {
  837. // if (item.prop == 'excelFile') {
  838. // item.action = "/api/blade-los/boxPool/emptyContainerEntry"
  839. // }
  840. // })
  841. // this.excelType = 2
  842. // this.excelBox = true
  843. }
  844. if (name == "进场导入") {
  845. this.$DialogForm.show({
  846. title: "进场导入",
  847. width: "30%",
  848. // data: this.assemblyForm.hmmEdi,
  849. menuPosition: "right",
  850. option: {
  851. submitText: "确定",
  852. emptyText: "取消",
  853. // labelWidth: 130,
  854. column: [
  855. {
  856. label: "场站",
  857. span: 24,
  858. prop: "corpId",
  859. type: "select",
  860. filterable: true,
  861. remote: true,
  862. dicUrl: "/api/blade-los/bcorps/selectList?status=0&corpTypeName=场站&size=5&current=1&shortName={{key}}",
  863. props: {
  864. label: "shortName",
  865. value: "id",
  866. desc: "code",
  867. res: "data.records"
  868. },
  869. rules: [
  870. {
  871. required: true,
  872. message: "选择场站",
  873. trigger: "blur"
  874. }
  875. ]
  876. }
  877. ]
  878. },
  879. beforeClose: done => {
  880. done();
  881. },
  882. callback: res => {
  883. res.done();
  884. let obj = {
  885. corpId: res.data.corpId,
  886. type: "IN"
  887. };
  888. emptyContainerEntryFtp(obj).then(res => {
  889. this.$message.success("操作成功!");
  890. // this.refreshChange()
  891. this.$refs.importModule.openDialog(5, res.data.data);
  892. });
  893. res.close();
  894. }
  895. });
  896. // this.excelOption.column.forEach(item => {
  897. // if (item.prop == 'excelFile') {
  898. // item.action = "/api/blade-los/boxPool/emptyContainerEntry"
  899. // }
  900. // })
  901. // this.excelType = 2
  902. // this.excelBox = true
  903. }
  904. if (name == "出场导入") {
  905. this.$DialogForm.show({
  906. title: "出场导入",
  907. width: "30%",
  908. // data: this.assemblyForm.hmmEdi,
  909. menuPosition: "right",
  910. option: {
  911. submitText: "确定",
  912. emptyText: "取消",
  913. // labelWidth: 130,
  914. column: [
  915. {
  916. label: "场站",
  917. span: 24,
  918. prop: "corpId",
  919. type: "select",
  920. filterable: true,
  921. remote: true,
  922. dicUrl: "/api/blade-los/bcorps/selectList?status=0&corpTypeName=场站&size=5&current=1&shortName={{key}}",
  923. props: {
  924. label: "shortName",
  925. value: "id",
  926. desc: "code",
  927. res: "data.records"
  928. },
  929. rules: [
  930. {
  931. required: true,
  932. message: "选择场站",
  933. trigger: "blur"
  934. }
  935. ]
  936. }
  937. ]
  938. },
  939. beforeClose: done => {
  940. done();
  941. },
  942. callback: res => {
  943. res.done();
  944. console.log(res);
  945. let obj = {
  946. corpId: res.data.corpId,
  947. type: "OUT"
  948. };
  949. emptyContainerEntryFtp(obj).then(res => {
  950. this.$message.success("操作成功!");
  951. this.$refs.importModule.openDialog(6, res.data.data);
  952. });
  953. res.close();
  954. }
  955. });
  956. // this.excelOption.column.forEach(item => {
  957. // if (item.prop == 'excelFile') {
  958. // item.action = "/api/blade-los/boxPool/emptyContainerEntry"
  959. // }
  960. // })
  961. // this.excelType = 2
  962. // this.excelBox = true
  963. }
  964. },
  965. addButton() {
  966. this.isShow = false;
  967. },
  968. copyButton() {
  969. this.isShow = false;
  970. this.detailData = {
  971. copyId: this.selectionList[0].id
  972. };
  973. },
  974. rowContainerNumber(row) {
  975. if (this.verifyTags("放箱号")) {
  976. this.$router.push({
  977. path: "/boxManagement/containerNumber/index",
  978. query: {
  979. id: row.id
  980. }
  981. });
  982. }
  983. },
  984. rowEdit(row) {
  985. this.detailData = {
  986. id: row.id
  987. };
  988. this.isShow = false;
  989. },
  990. searchReset() {
  991. this.query = this.$options.data().query;
  992. // this.onLoad(this.page);
  993. },
  994. // 搜索按钮点击
  995. searchChange(params, done) {
  996. this.page.currentPage = 1;
  997. this.onLoad(this.page, this.query);
  998. done();
  999. },
  1000. selectionChange(list) {
  1001. this.selectionList = list;
  1002. },
  1003. currentChange(currentPage) {
  1004. this.page.currentPage = currentPage;
  1005. },
  1006. sizeChange(pageSize) {
  1007. this.page.pageSize = pageSize;
  1008. },
  1009. refreshChange() {
  1010. this.onLoad(this.page, this.query);
  1011. },
  1012. onLoad(page, params = {}) {
  1013. let obj = {};
  1014. obj = {
  1015. ...Object.assign(params, this.query)
  1016. };
  1017. this.loading = true;
  1018. getList(page.currentPage, page.pageSize, obj)
  1019. .then(res => {
  1020. this.data = res.data.data.records;
  1021. this.page.total = res.data.data.total;
  1022. this.$nextTick(() => {
  1023. this.$refs.crud.doLayout();
  1024. });
  1025. })
  1026. .finally(() => {
  1027. this.loading = false;
  1028. });
  1029. },
  1030. searchReset2() {
  1031. this.query2 = this.$options.data().query2;
  1032. // this.onLoad2(this.page2);
  1033. },
  1034. // 搜索按钮点击
  1035. searchChange2(params, done) {
  1036. this.page2.currentPage = 1;
  1037. this.onLoad2(this.page2, this.query2);
  1038. done();
  1039. },
  1040. currentChange2(currentPage) {
  1041. this.page2.currentPage = currentPage;
  1042. },
  1043. sizeChange2(pageSize) {
  1044. this.page2.pageSize = pageSize;
  1045. },
  1046. refreshChange2() {
  1047. this.onLoad2(this.page2, this.query2);
  1048. },
  1049. onLoad2(page, params = {}) {
  1050. let obj = {};
  1051. obj = {
  1052. ...Object.assign(params, this.query2)
  1053. };
  1054. this.loading2 = true;
  1055. getList2(page.currentPage, page.pageSize, obj)
  1056. .then(res => {
  1057. this.data2 = res.data.data.records;
  1058. this.page2.total = res.data.data.total;
  1059. this.$nextTick(() => {
  1060. this.$refs.crud2.doLayout();
  1061. });
  1062. })
  1063. .finally(() => {
  1064. this.loading2 = false;
  1065. });
  1066. },
  1067. searchReset3() {
  1068. this.query3 = this.$options.data().query3;
  1069. // this.onLoad3(this.page3);
  1070. },
  1071. // 搜索按钮点击
  1072. searchChange3(params, done) {
  1073. this.page3.currentPage = 1;
  1074. this.onLoad3(this.page3, this.query3);
  1075. done();
  1076. },
  1077. currentChange3(currentPage) {
  1078. this.page3.currentPage = currentPage;
  1079. },
  1080. sizeChange3(pageSize) {
  1081. this.page3.pageSize = pageSize;
  1082. },
  1083. refreshChange3() {
  1084. this.onLoad3(this.page3, this.query3);
  1085. },
  1086. onLoad3(page, params = {}) {
  1087. let obj = {};
  1088. obj = {
  1089. ...Object.assign(params, this.query3)
  1090. };
  1091. this.loading3 = true;
  1092. getList3(page.currentPage, page.pageSize, obj)
  1093. .then(res => {
  1094. this.data3 = res.data.data.records;
  1095. this.page3.total = res.data.data.total;
  1096. this.$nextTick(() => {
  1097. this.$refs.crud3.doLayout();
  1098. });
  1099. })
  1100. .finally(() => {
  1101. this.loading3 = false;
  1102. });
  1103. },
  1104. cellStyle({ row, column, rowIndex, columnIndex }) {
  1105. if (row.busType == "自有箱") {
  1106. if (row.total < row.remainingTotal) {
  1107. return {
  1108. color: "#F56C6C"
  1109. };
  1110. }
  1111. }
  1112. },
  1113. // 详情的返回列表
  1114. goBack() {
  1115. // 初始化数据
  1116. if (JSON.stringify(this.$route.query) != "{}") {
  1117. this.$router.$avueRouter.closeTag();
  1118. this.$router.push({
  1119. path: "/boxManagement/buyContainer/index"
  1120. });
  1121. }
  1122. this.detailData = {};
  1123. this.isShow = true;
  1124. this.onLoad(this.page, this.query);
  1125. },
  1126. //自定义列保存
  1127. async saveColumn(ref, option, optionBack, code) {
  1128. /**
  1129. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1130. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1131. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1132. */
  1133. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  1134. if (inSave) {
  1135. this.$message.success("保存成功");
  1136. //关闭窗口
  1137. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1138. this.searchReset();
  1139. }
  1140. },
  1141. //自定义列重置
  1142. async resetColumn(ref, option, optionBack, code) {
  1143. this[option] = this[optionBack];
  1144. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  1145. if (inSave) {
  1146. this.$message.success("重置成功");
  1147. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  1148. this.searchReset();
  1149. }
  1150. },
  1151. // 更改表格颜色
  1152. headerClassName(tab) {
  1153. //颜色间隔
  1154. let back = "back-two";
  1155. // if (tab.columnIndex >= 0 && tab.column.level === 1) {
  1156. // if (tab.columnIndex % 2 === 0) {
  1157. // back = "back-one"
  1158. // } else if (tab.columnIndex % 2 === 1) {
  1159. // back = "back-two"
  1160. // }
  1161. // }
  1162. return back;
  1163. }
  1164. }
  1165. };
  1166. </script>
  1167. <style lang="scss" scoped>
  1168. ::v-deep #out-table .back-one {
  1169. background: #ecf5ff !important;
  1170. text-align: center;
  1171. }
  1172. ::v-deep #out-table .back-two {
  1173. background: #ecf5ff !important;
  1174. text-align: center;
  1175. }
  1176. .pointerClick {
  1177. cursor: pointer;
  1178. color: #1e9fff;
  1179. }
  1180. ::v-deep .el-col-md-8 {
  1181. width: 24.33333%;
  1182. }
  1183. </style>