index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849
  1. <template>
  2. <div>
  3. <basic-container v-if="isShow">
  4. <el-button type="success" plain size="small" @click="allClick('POL空箱出场(EXCEL)')">POL空箱出场(EXCEL)</el-button>
  5. <!-- <el-button type="primary" plain size="small"
  6. @click="allClick('POL返场(EXCEL)')">POL返场(EXCEL)</el-button> -->
  7. <el-button type="info" plain size="small" @click="allClick('POD空箱进场(EXCEL)')">POD空箱进场(EXCEL)</el-button>
  8. <!-- <el-button type="warning" plain size="small"
  9. @click="allClick('空箱进场(excel)')">空箱进场(excel)</el-button> -->
  10. <el-button type="danger" plain size="small" @click="allClick('POL无货返空(EXCEL)')">POL无货返空(EXCEL)</el-button>
  11. <el-tabs v-model="activeName" type="card" style="margin-top: 8px;">
  12. <el-tab-pane label="按港口" name="1">
  13. <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page"
  14. :search.sync="query" v-model="form" id="out-table" :header-cell-class-name="headerClassName"
  15. ref="crud" @search-change="searchChange" @search-reset="searchReset"
  16. @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange"
  17. @on-load="onLoad">
  18. </avue-crud>
  19. </el-tab-pane>
  20. <el-tab-pane label="按放箱号" name="2">
  21. <avue-crud :option="option2" :table-loading="loading2" :data="data2" :page.sync="page2"
  22. :search.sync="query2" v-model="form2" id="out-table" :header-cell-class-name="headerClassName"
  23. ref="crud2" @search-change="searchChange2" @search-reset="searchReset2"
  24. @current-change="currentChange2" @size-change="sizeChange2" @refresh-change="refreshChange2"
  25. @on-load="onLoad2" @resetColumn="resetColumn('crud2', 'option2', 'optionBack2', 466)"
  26. @saveColumn="saveColumn('crud2', 'option2', 'optionBack2', 466)">
  27. <template slot="menuLeft">
  28. <!-- <el-button type="primary" plain size="small"
  29. @click="allClick('空箱出场(EDI)')">空箱出场(EDI)</el-button> -->
  30. <!-- <el-button type="success" plain size="small"
  31. @click="allClick('POL空箱出场(EXCEL)')">POL空箱出场(EXCEL)</el-button> -->
  32. <!-- <el-button type="primary" plain size="small"
  33. @click="allClick('POL返场(EXCEL)')">POL返场(EXCEL)</el-button> -->
  34. <!-- <el-button type="info" plain size="small"
  35. @click="allClick('POD空箱进场(EXCEL)')">POD空箱进场(EXCEL)</el-button> -->
  36. <!-- <el-button type="warning" plain size="small"
  37. @click="allClick('空箱进场(excel)')">空箱进场(excel)</el-button> -->
  38. <!-- <el-button type="danger" plain size="small"
  39. @click="allClick('POL无货返空(EXCEL)')">POL无货返空(EXCEL)</el-button> -->
  40. </template>
  41. <template slot="menu" slot-scope="{ row, index }">
  42. <el-button size="small" icon="el-icon-edit" type="text" @click="rowEdit(row)">查看</el-button>
  43. </template>
  44. <template slot="containerNumber" slot-scope="{ row }">
  45. <span style="color: #1e9fff;cursor: pointer;" @click="rowEdit(row)">{{
  46. row.containerNumber }}</span>
  47. </template>
  48. </avue-crud>
  49. </el-tab-pane>
  50. <el-tab-pane label="导入文件记录" name="3">
  51. <avue-crud :option="option3" :table-loading="loading3" :data="data3" :page.sync="page3"
  52. :search.sync="query3" v-model="form3" id="out-table" :header-cell-class-name="headerClassName"
  53. ref="crud3" @search-change="searchChange3" @search-reset="searchReset3"
  54. @current-change="currentChange3" @size-change="sizeChange3" @refresh-change="refreshChange3"
  55. @on-load="onLoad3">
  56. <template slot="menu" slot-scope="{ row, index }">
  57. <el-button size="small" type="text" @click="rowDownload(row)">下载</el-button>
  58. </template>
  59. </avue-crud>
  60. </el-tab-pane>
  61. </el-tabs>
  62. <el-dialog title="导入数据" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false"
  63. v-dialog-drag>
  64. <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading"
  65. :upload-before="uploadBefore" :upload-after="onSuccess">
  66. <template slot="excelTemplate">
  67. <el-button type="primary" @click="handleGet">
  68. 点击下载<i class="el-icon-download el-icon--right"></i>
  69. </el-button>
  70. </template>
  71. </avue-form>
  72. <p style="text-align: center;color: #DC0505">
  73. 温馨提示 第一次导入时请先下载模板
  74. </p>
  75. </el-dialog>
  76. </basic-container>
  77. <detailsPage v-if="!isShow" :detailData="detailData" @goBack="goBack"></detailsPage>
  78. </div>
  79. </template>
  80. <script>
  81. import { getList, getList2, getList3 } from "@/api/boxManagement/boxPoolDynamics/index.js";
  82. import { getWorkDicts } from "@/api/system/dictbiz";
  83. import detailsPage from "./detailsPage";
  84. import { getToken } from "@/util/auth";
  85. import _ from "lodash";
  86. export default {
  87. data() {
  88. return {
  89. excelBox: false,
  90. excelForm: {},
  91. excelLoading: false,
  92. excelOption: {
  93. submitBtn: false,
  94. emptyBtn: false,
  95. column: [
  96. {
  97. label: "模板下载",
  98. prop: "excelTemplate",
  99. formslot: true,
  100. span: 24
  101. },
  102. {
  103. label: "模板上传",
  104. prop: "excelFile",
  105. type: "upload",
  106. drag: true,
  107. loadText: "模板上传中,请稍等",
  108. span: 24,
  109. propsHttp: {
  110. res: "data"
  111. },
  112. tip: "请上传 .xls,.xlsx 标准格式文件",
  113. action: "/api/blade-los/boxPool/emptyContainerAppearance"
  114. }
  115. ]
  116. },
  117. activeName: '1',
  118. isShow: true,
  119. form: {},
  120. query: {},
  121. loading: false,
  122. page: {
  123. pageSize: 10,
  124. currentPage: 1,
  125. total: 0
  126. },
  127. form2: {},
  128. query2: {},
  129. loading2: false,
  130. page2: {
  131. pageSize: 10,
  132. currentPage: 1,
  133. total: 0
  134. },
  135. form3: {},
  136. query3: {},
  137. loading3: false,
  138. page3: {
  139. pageSize: 10,
  140. currentPage: 1,
  141. total: 0
  142. },
  143. selectionList: [],
  144. option: {
  145. height: 'auto',
  146. calcHeight: 30,
  147. menuWidth: 70,
  148. tip: false,
  149. searchShow: true,
  150. searchMenuSpan: 18,
  151. header: false,
  152. menu: false,
  153. border: true,
  154. index: true,
  155. addBtn: false,
  156. viewBtn: false,
  157. editBtn: false,
  158. delBtn: false,
  159. searchIcon: true,
  160. align: 'center',
  161. searchIndex: 3,
  162. summaryText: "合计",
  163. showSummary: true,
  164. sumColumnList: [
  165. {
  166. name: 'total',
  167. type: 'sum',
  168. decimals: 0
  169. },
  170. {
  171. name: 'remainingTotal',
  172. type: 'sum',
  173. decimals: 0
  174. },
  175. {
  176. name: 'gp20Good',
  177. type: 'sum',
  178. decimals: 0
  179. },
  180. {
  181. name: 'gp40Good',
  182. type: 'sum',
  183. decimals: 0
  184. },
  185. {
  186. name: 'hg40Good',
  187. type: 'sum',
  188. decimals: 0
  189. },
  190. {
  191. name: 'otherGood',
  192. type: 'sum',
  193. decimals: 0
  194. },
  195. {
  196. name: 'gp20Bad',
  197. type: 'sum',
  198. decimals: 0
  199. },
  200. {
  201. name: 'gp40Bad',
  202. type: 'sum',
  203. decimals: 0
  204. },
  205. {
  206. name: 'hg40Bad',
  207. type: 'sum',
  208. decimals: 0
  209. },
  210. {
  211. name: 'otherBad',
  212. type: 'sum',
  213. decimals: 0
  214. }
  215. ],
  216. column: [
  217. {
  218. label: '港口',
  219. prop: 'polName',
  220. overHidden: true,
  221. hide: true,
  222. showColumn: false,
  223. search: true,
  224. searchOrder: 1,
  225. type: "select",
  226. filterable: true,
  227. remote: true,
  228. dicUrl: "/api/blade-los/bports/list?status=0&size=5&current=1&cnName={{key}}",
  229. props: {
  230. label: "cnName",
  231. value: "cnName",
  232. desc: 'code',
  233. res: "data.records"
  234. }
  235. },
  236. {
  237. label: '港口',
  238. prop: 'portName',
  239. overHidden: true,
  240. },
  241. {
  242. label: '场站',
  243. prop: 'stationName',
  244. overHidden: true,
  245. },
  246. {
  247. label: '放箱号类型',
  248. prop: 'busType',
  249. overHidden: true,
  250. },
  251. {
  252. label: '场地盘存',
  253. prop: 'total',
  254. width: 100,
  255. overHidden: true,
  256. },
  257. {
  258. label: '操作占用',
  259. prop: 'occupyNum',
  260. width: 100,
  261. overHidden: true,
  262. },
  263. {
  264. label: '可用箱量',
  265. prop: 'remainingTotal',
  266. width: 100,
  267. overHidden: true,
  268. },
  269. {
  270. label: '好',
  271. prop: 'good',
  272. overHidden: true,
  273. children: [
  274. {
  275. label: '20GP',
  276. prop: 'gp20Good',
  277. width: 60,
  278. overHidden: true,
  279. },
  280. {
  281. label: '40GP',
  282. prop: 'gp40Good',
  283. width: 60,
  284. overHidden: true,
  285. },
  286. {
  287. label: '40HG',
  288. prop: 'hg40Good',
  289. width: 60,
  290. overHidden: true,
  291. },
  292. {
  293. label: 'OTHER',
  294. prop: 'otherGood',
  295. width: 70,
  296. overHidden: true,
  297. }
  298. ]
  299. },
  300. {
  301. label: '坏',
  302. prop: 'bad',
  303. overHidden: true,
  304. children: [
  305. {
  306. label: '20GP',
  307. prop: 'gp20Bad',
  308. width: 60,
  309. overHidden: true,
  310. },
  311. {
  312. label: '40GP',
  313. prop: 'gp40Bad',
  314. width: 60,
  315. overHidden: true,
  316. },
  317. {
  318. label: '40HG',
  319. prop: 'hg40Bad',
  320. width: 60,
  321. overHidden: true,
  322. },
  323. {
  324. label: 'OTHER',
  325. prop: 'otherBad',
  326. width: 70,
  327. overHidden: true,
  328. }
  329. ]
  330. },
  331. ]
  332. },
  333. option2: {},
  334. optionBack2: {
  335. height: 'auto',
  336. calcHeight: 30,
  337. menuWidth: 70,
  338. tip: false,
  339. searchShow: true,
  340. searchMenuSpan: 12,
  341. border: true,
  342. index: true,
  343. addBtn: false,
  344. viewBtn: false,
  345. editBtn: false,
  346. delBtn: false,
  347. searchIcon: true,
  348. align: 'center',
  349. searchIndex: 3,
  350. summaryText: "合计",
  351. showSummary: true,
  352. sumColumnList: [
  353. {
  354. name: 'total',
  355. type: 'sum',
  356. decimals: 0
  357. },
  358. {
  359. name: 'remainingTotal',
  360. type: 'sum',
  361. decimals: 0
  362. },
  363. {
  364. name: 'good',
  365. type: 'sum',
  366. decimals: 0
  367. },
  368. {
  369. name: 'bad',
  370. type: 'sum',
  371. decimals: 0
  372. }
  373. ],
  374. column: [
  375. {
  376. label: '放箱号',
  377. prop: 'containerNumber',
  378. width: 150,
  379. overHidden: true,
  380. search: true,
  381. searchOrder: 1,
  382. },
  383. {
  384. label: '放箱号类型',
  385. prop: 'busType',
  386. width: 150,
  387. overHidden: true,
  388. search: true,
  389. searchOrder: 2,
  390. type: 'select',
  391. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxCategory",
  392. props: {
  393. label: "dictValue",
  394. value: "dictValue"
  395. },
  396. },
  397. {
  398. label: '箱东',
  399. prop: 'boxEastName',
  400. width: 150,
  401. overHidden: true,
  402. hide: true,
  403. showColumn: false,
  404. search: true,
  405. searchOrder: 3,
  406. type: "select",
  407. filterable: true,
  408. remote: true,
  409. dicUrl: "/api/blade-los/bcorps/selectList?status=0&corpTypeName=箱东&size=5&current=1&shortName={{key}}",
  410. props: {
  411. label: "shortName",
  412. value: "shortName",
  413. desc: 'code',
  414. res: "data.records"
  415. }
  416. },
  417. {
  418. label: '起运港',
  419. prop: 'polName',
  420. width: 150,
  421. overHidden: true,
  422. search: true,
  423. searchOrder: 5,
  424. type: "select",
  425. filterable: true,
  426. remote: true,
  427. dicUrl: "/api/blade-los/bports/list?status=0&size=5&current=1&cnName={{key}}",
  428. props: {
  429. label: "cnName",
  430. value: "cnName",
  431. desc: 'code',
  432. res: "data.records"
  433. }
  434. },
  435. {
  436. label: '起运港场站/堆场',
  437. prop: 'polStationName',
  438. width: 150,
  439. overHidden: true,
  440. },
  441. {
  442. label: '目的港',
  443. prop: 'podName',
  444. width: 150,
  445. overHidden: true,
  446. search: true,
  447. searchOrder: 6,
  448. type: "select",
  449. filterable: true,
  450. remote: true,
  451. dicUrl: "/api/blade-los/bports/list?status=0&size=5&current=1&cnName={{key}}",
  452. props: {
  453. label: "cnName",
  454. value: "cnName",
  455. desc: 'code',
  456. res: "data.records"
  457. }
  458. },
  459. {
  460. label: '目的运港场站/堆场',
  461. prop: 'podStationName',
  462. width: 150,
  463. overHidden: true,
  464. },
  465. {
  466. label: '箱型',
  467. prop: 'boxType',
  468. width: 150,
  469. overHidden: true,
  470. search: true,
  471. searchOrder: 7,
  472. type: "select",
  473. filterable: true,
  474. remote: true,
  475. dicUrl: "/api/blade-los/bcntrtypes/list?status=0&size=20&current=1&cnName={{key}}",
  476. props: {
  477. label: "cnName",
  478. value: "cnName",
  479. res: "data.records"
  480. }
  481. },
  482. {
  483. label: '场地盘存',
  484. prop: 'total',
  485. width: 100,
  486. overHidden: true,
  487. },
  488. {
  489. label: '操作占用',
  490. prop: 'occupyNum',
  491. width: 100,
  492. overHidden: true,
  493. },
  494. {
  495. label: '可用箱量',
  496. prop: 'remainingTotal',
  497. width: 100,
  498. overHidden: true,
  499. },
  500. {
  501. label: '好',
  502. prop: 'good',
  503. width: 100,
  504. overHidden: true,
  505. },
  506. {
  507. label: '坏',
  508. prop: 'bad',
  509. width: 100,
  510. overHidden: true,
  511. },
  512. ]
  513. },
  514. option3: {
  515. height: 'auto',
  516. calcHeight: 30,
  517. menuWidth: 70,
  518. tip: false,
  519. searchShow: true,
  520. searchMenuSpan: 12,
  521. header: false,
  522. menu: true,
  523. border: true,
  524. index: true,
  525. addBtn: false,
  526. viewBtn: false,
  527. editBtn: false,
  528. delBtn: false,
  529. searchIcon: true,
  530. align: 'center',
  531. searchIndex: 3,
  532. column: [
  533. {
  534. label: '文件名',
  535. prop: 'fileName',
  536. overHidden: true,
  537. search: true,
  538. },
  539. {
  540. label: '文件地址',
  541. prop: 'url',
  542. overHidden: true,
  543. },
  544. {
  545. label: '文件类型',
  546. prop: 'type',
  547. overHidden: true,
  548. search: true,
  549. type: 'select',
  550. dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_file_type",
  551. props: {
  552. label: "dictValue",
  553. value: "dictKey"
  554. },
  555. },
  556. {
  557. label: '创建时间',
  558. prop: 'createTime',
  559. overHidden: true,
  560. },
  561. ]
  562. },
  563. data: [],
  564. };
  565. },
  566. components: {
  567. detailsPage
  568. },
  569. async created() {
  570. this.option2 = await this.getColumnData(this.getColumnName(466), this.optionBack2);
  571. },
  572. methods: {
  573. uploadBefore(file, done, loading) {
  574. done();
  575. loading = true;
  576. },
  577. // 上传成功
  578. onSuccess(res, done, loading, column) {
  579. loading = false;
  580. done();
  581. this.excelBox = false;
  582. // this.$message.success("导入成功!");
  583. this.getDetail(this.detailData.id)
  584. },
  585. // 下载模板
  586. handleGet() {
  587. window.open(
  588. `/api/blade-los/boxPool/emptyContainerAppearance/template?${this.website.tokenHeader
  589. }=${getToken()}`
  590. );
  591. },
  592. rowDownload(row) {
  593. window.open(row.url);
  594. },
  595. allClick(name) {
  596. if (name == 'POL空箱出场(EXCEL)') {
  597. this.excelOption.column.forEach(item => {
  598. if (item.prop == 'excelFile') {
  599. item.action = "/api/blade-los/boxPool/emptyContainerAppearance"
  600. }
  601. })
  602. this.excelBox = true
  603. }
  604. if (name == 'POD空箱进场(EXCEL)') {
  605. this.excelOption.column.forEach(item => {
  606. if (item.prop == 'excelFile') {
  607. item.action = "/api/blade-los/boxPool/giveAnEncore"
  608. }
  609. })
  610. this.excelBox = true
  611. }
  612. if (name == 'POL无货返空(EXCEL)') {
  613. this.excelOption.column.forEach(item => {
  614. if (item.prop == 'excelFile') {
  615. item.action = "/api/blade-los/boxPool/returnEmpty"
  616. }
  617. })
  618. this.excelBox = true
  619. }
  620. },
  621. addButton() {
  622. this.isShow = false
  623. },
  624. copyButton() {
  625. this.isShow = false
  626. this.detailData = {
  627. copyId: this.selectionList[0].id
  628. };
  629. },
  630. rowEdit(row) {
  631. this.detailData = {
  632. id: row.id
  633. };
  634. this.isShow = false
  635. },
  636. searchReset() {
  637. this.query = this.$options.data().query;
  638. this.onLoad(this.page);
  639. },
  640. // 搜索按钮点击
  641. searchChange(params, done) {
  642. this.page.currentPage = 1;
  643. this.onLoad(this.page, this.query);
  644. done();
  645. },
  646. selectionChange(list) {
  647. this.selectionList = list;
  648. },
  649. currentChange(currentPage) {
  650. this.page.currentPage = currentPage;
  651. },
  652. sizeChange(pageSize) {
  653. this.page.pageSize = pageSize;
  654. },
  655. refreshChange() {
  656. this.onLoad(this.page, this.query);
  657. },
  658. onLoad(page, params = {}) {
  659. let obj = {}
  660. obj = {
  661. ...Object.assign(params, this.query),
  662. }
  663. this.loading = true;
  664. getList(page.currentPage, page.pageSize, obj).then(res => {
  665. this.data = res.data.data.records;
  666. this.page.total = res.data.data.total;
  667. this.$nextTick(() => {
  668. this.$refs.crud.doLayout();
  669. this.$refs.crud.dicInit();
  670. });
  671. }).finally(() => {
  672. this.loading = false;
  673. })
  674. },
  675. searchReset2() {
  676. this.query2 = this.$options.data().query2;
  677. this.onLoad2(this.page2);
  678. },
  679. // 搜索按钮点击
  680. searchChange2(params, done) {
  681. this.page2.currentPage = 1;
  682. this.onLoad2(this.page2, this.query2);
  683. done();
  684. },
  685. currentChange2(currentPage) {
  686. this.page2.currentPage = currentPage;
  687. },
  688. sizeChange2(pageSize) {
  689. this.page2.pageSize = pageSize;
  690. },
  691. refreshChange2() {
  692. this.onLoad2(this.page2, this.query2);
  693. },
  694. onLoad2(page, params = {}) {
  695. let obj = {}
  696. obj = {
  697. ...Object.assign(params, this.query2),
  698. }
  699. this.loading2 = true;
  700. getList2(page.currentPage, page.pageSize, obj).then(res => {
  701. this.data2 = res.data.data.records;
  702. this.page2.total = res.data.data.total;
  703. this.$nextTick(() => {
  704. this.$refs.crud2.doLayout();
  705. this.$refs.crud2.dicInit();
  706. });
  707. }).finally(() => {
  708. this.loading2 = false;
  709. })
  710. },
  711. searchReset3() {
  712. this.query3 = this.$options.data().query3;
  713. this.onLoad3(this.page3);
  714. },
  715. // 搜索按钮点击
  716. searchChange3(params, done) {
  717. this.page3.currentPage = 1;
  718. this.onLoad3(this.page3, this.query3);
  719. done();
  720. },
  721. currentChange3(currentPage) {
  722. this.page3.currentPage = currentPage;
  723. },
  724. sizeChange3(pageSize) {
  725. this.page3.pageSize = pageSize;
  726. },
  727. refreshChange3() {
  728. this.onLoad3(this.page3, this.query3);
  729. },
  730. onLoad3(page, params = {}) {
  731. let obj = {}
  732. obj = {
  733. ...Object.assign(params, this.query3),
  734. }
  735. this.loading3 = true;
  736. getList3(page.currentPage, page.pageSize, obj).then(res => {
  737. this.data3 = res.data.data.records;
  738. this.page3.total = res.data.data.total;
  739. this.$nextTick(() => {
  740. this.$refs.crud3.doLayout();
  741. });
  742. }).finally(() => {
  743. this.loading3 = false;
  744. })
  745. },
  746. // 详情的返回列表
  747. goBack() {
  748. // 初始化数据
  749. if (JSON.stringify(this.$route.query) != "{}") {
  750. this.$router.$avueRouter.closeTag();
  751. this.$router.push({
  752. path: "/boxManagement/buyContainer/index"
  753. });
  754. }
  755. this.detailData = {}
  756. this.isShow = true;
  757. this.onLoad(this.page, this.query);
  758. },
  759. outExport() {
  760. let config = { params: { ...this.query } }
  761. if (config.params) {
  762. for (const propName of Object.keys(config.params)) {
  763. const value = config.params[propName];
  764. if (value !== null && typeof (value) !== "undefined") {
  765. if (value instanceof Array) {
  766. for (const key of Object.keys(value)) {
  767. let params = propName + '[' + key + ']';
  768. config.params[params] = value[key]
  769. }
  770. delete config.params[propName]
  771. }
  772. }
  773. }
  774. }
  775. const routeData = this.$router.resolve({
  776. path: '/api/blade-los/routecost/exportRouteCost', //跳转目标窗口的地址
  777. query: {
  778. ...config.params, //括号内是要传递给新窗口的参数
  779. identification: this.url
  780. }
  781. })
  782. window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
  783. },
  784. //自定义列保存
  785. async saveColumn(ref, option, optionBack, code) {
  786. /**
  787. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  788. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  789. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  790. */
  791. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  792. if (inSave) {
  793. this.$message.success("保存成功");
  794. //关闭窗口
  795. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  796. this.searchReset()
  797. }
  798. },
  799. //自定义列重置
  800. async resetColumn(ref, option, optionBack, code) {
  801. this[option] = this[optionBack];
  802. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  803. if (inSave) {
  804. this.$message.success("重置成功");
  805. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  806. this.searchReset()
  807. }
  808. },
  809. // 更改表格颜色
  810. headerClassName(tab) {
  811. //颜色间隔
  812. let back = "back-two"
  813. // if (tab.columnIndex >= 0 && tab.column.level === 1) {
  814. // if (tab.columnIndex % 2 === 0) {
  815. // back = "back-one"
  816. // } else if (tab.columnIndex % 2 === 1) {
  817. // back = "back-two"
  818. // }
  819. // }
  820. return back;
  821. },
  822. }
  823. }
  824. </script>
  825. <style lang="scss" scoped>
  826. ::v-deep #out-table .back-one {
  827. background: #ecf5ff !important;
  828. text-align: center;
  829. }
  830. ::v-deep #out-table .back-two {
  831. background: #ecf5ff !important;
  832. text-align: center;
  833. }
  834. .pointerClick {
  835. cursor: pointer;
  836. color: #1e9fff;
  837. }
  838. ::v-deep .el-col-md-8 {
  839. width: 24.33333%;
  840. }
  841. </style>