archives.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option" :search.sync="search" v-model="form" :table-loading="loading" :data="dataList"
  4. ref="crud" :key="key" :before-open="beforeOpen" @on-load="onLoad" @row-save="rowSave"
  5. @row-update="(row, index, done, loading) => { rowSave(row, done, loading, index) }" @search-change="searchChange"
  6. :upload-delete="uploadDelete" :before-close="beforeClose" @row-del="rowDel" @refresh-change="refreshChange"
  7. @resetColumn="resetColumnTwo('crud', 'option', 'optionList', 234)"
  8. @saveColumn="saveColumnTwo('crud', 'option', 'optionList', 234)" :page.sync="page">
  9. <template slot-scope="{type,size,row,$index}" slot="menu">
  10. <el-button icon="el-icon-edit" :size="size" type="text" @click="$refs.crud.rowEdit(row, index)">查 看
  11. </el-button>
  12. </template>
  13. <tempalte slot="boxMakingCompanyForm">
  14. <dic-select v-model="form.boxMakingCompany" placeholder="造箱公司" key="id" label="cnName" res="records"
  15. url="/blade-los/bcorps/selectList?corpTypeName=箱东" :filterable="true" :remote="true" dataName="cnName"
  16. @selectChange="dicChange('boxMakingCompany', $event)"></dic-select>
  17. </tempalte>
  18. <template slot-scope="{type,size,row,index,disabled}" slot="code">
  19. <span class="el-button--text" style="cursor: pointer" @click="track(row)">{{ row.code }}</span>
  20. </template>
  21. </avue-crud>
  22. <el-dialog title="箱轨迹" :visible.sync="boxTrack" :append-to-body="true" :destroy-on-close="true"
  23. :close-on-click-modal="false" v-if="boxTrack" top="1vh" width="80%">
  24. <span>
  25. <avue-crud ref="crudTrack" :option="optionTrack" :data="dataTrackList" :search.sync="searchTwo"
  26. :page.sync="pageTwo" :table-loading="loadingTwo" @on-load="onLoadTrack" @search-change="searchChangeTwo"
  27. @row-update="rowUpdateTrack"
  28. @resetColumn="resetColumnTwo('crudTrack', 'optionTrack', 'optionTrackBack', 234.1)"
  29. @saveColumn="saveColumnTwo('crudTrack', 'optionTrack', 'optionTrackBack', 234.1)" v-model="formTrack">
  30. <template slot-scope="{type,size,row,index,disabled}" slot="code">
  31. <span class="el-button--text" style="cursor: pointer" @click="contractNoJump(row)">{{ row.code
  32. }}</span>
  33. </template>
  34. <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  35. <el-button icon="el-icon-edit" :size="size" :disabled="disabled" :type="type"
  36. @click="$refs.crudTrack.rowEdit(row, index)">编辑
  37. </el-button>
  38. <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
  39. @click="rowDel(row, index, 'GJ')">删除
  40. </el-button>
  41. </template>
  42. </avue-crud>
  43. </span>
  44. </el-dialog>
  45. </basic-container>
  46. </template>
  47. <script>
  48. import { addUpdate, boxRemove, getList, remove, archivestrajectory, update } from "@/api/box/archives";
  49. import { getToken } from "@/util/auth";
  50. import { getAllBoxs } from "@/api/basicData/portinformation";
  51. import dicSelect from "@/components/dicSelect/main";
  52. import fa from "element-ui/src/locale/lang/fa";
  53. export default {
  54. name: "archives",
  55. components: {
  56. dicSelect
  57. },
  58. data() {
  59. return {
  60. boxTrack: false,
  61. dataTrackList: [],
  62. searchTwo: {},
  63. formTrack: {},
  64. optionTrack: {},
  65. optionTrackBack: {
  66. align: 'center',
  67. index: true,
  68. menu: false,
  69. addBtnText: "录入明细",
  70. refreshBtn: false,
  71. addBtn: false,
  72. span: 8,
  73. searchMenuPosition: "right",
  74. searchSpan: 6,
  75. searchMenuSpan: 24,
  76. searchIcon: true,
  77. searchIndex: 3,
  78. addRowBtn: false,
  79. cellBtn: false,
  80. editBtn: false,
  81. delBtn: false,
  82. menuWidth: 200,
  83. dialogTop: 25,
  84. dialogWidth: "80%",
  85. column: [
  86. {
  87. label: '箱号',
  88. prop: 'code',
  89. overHidden: true,
  90. // search: true
  91. },
  92. {
  93. label: '放箱号',
  94. prop: 'containerNumber',
  95. overHidden: true,
  96. },
  97. {
  98. label: '箱型',
  99. prop: 'boxType',
  100. overHidden: true,
  101. },
  102. {
  103. label: '箱东',
  104. prop: 'boxEastName',
  105. overHidden: true,
  106. },
  107. {
  108. label: '放箱号类型',
  109. prop: 'boxCategory',
  110. overHidden: true,
  111. },
  112. {
  113. label: '箱动态',
  114. prop: 'boxDynamics',
  115. overHidden: true,
  116. search: true,
  117. type: 'select',
  118. dicUrl: "/api/blade-system/dict-biz/dictionary?code=boxDynamics",
  119. props: {
  120. label: "dictValue",
  121. value: "dictValue"
  122. },
  123. },
  124. {
  125. label: '动态日期',
  126. prop: 'newDate',
  127. overHidden: true,
  128. },
  129. {
  130. label: '港口',
  131. prop: 'portCname',
  132. overHidden: true,
  133. search: true,
  134. type: "select",
  135. filterable: true,
  136. remote: true,
  137. dicUrl: "/api/blade-los/bports/list?size=20&current=1&cnName={{key}}",
  138. props: {
  139. label: "cnName",
  140. value: "cnName",
  141. res: "data.records"
  142. }
  143. },
  144. {
  145. label: '场站',
  146. prop: 'stationCname',
  147. overHidden: true,
  148. search: true,
  149. type: "select",
  150. filterable: true,
  151. remote: true,
  152. dicUrl: "/api/blade-los/bcorps/selectList?corpTypeName=场站&cnName={{key}}",
  153. props: {
  154. label: "cnName",
  155. value: "cnName",
  156. res: "data.records"
  157. }
  158. },
  159. {
  160. label: '客户名称',
  161. prop: 'corpName',
  162. overHidden: true,
  163. search: true,
  164. type: "select",
  165. filterable: true,
  166. remote: true,
  167. dicUrl: "/api/blade-los/bcorps/selectList?size=20&current=1&cnName={{key}}",
  168. props: {
  169. label: "cnName",
  170. value: "cnName",
  171. res: "data.records"
  172. }
  173. },
  174. {
  175. label: '提单号',
  176. prop: 'mblno',
  177. overHidden: true,
  178. },
  179. {
  180. label: '船名',
  181. prop: 'shipCname',
  182. overHidden: true,
  183. },
  184. {
  185. label: '航次',
  186. prop: 'voyage',
  187. overHidden: true,
  188. },
  189. {
  190. label: 'ETD',
  191. prop: 'etd',
  192. overHidden: true,
  193. },
  194. {
  195. label: 'POL堆场',
  196. prop: 'polCyCname',
  197. overHidden: true,
  198. },
  199. {
  200. label: 'POL免箱使天数',
  201. prop: 'polFreeBoxUseDays',
  202. width: 110,
  203. overHidden: true,
  204. },
  205. {
  206. label: 'POL提前出场日期',
  207. prop: 'polPreAppearanceDate',
  208. width: 120,
  209. overHidden: true,
  210. },
  211. {
  212. label: 'POL场站空箱出场日期',
  213. prop: 'polStationEmptyContainerExitDate',
  214. width: 140,
  215. overHidden: true,
  216. },
  217. {
  218. label: 'POL还箱日期',
  219. prop: 'polReturnDate',
  220. width: 100,
  221. overHidden: true,
  222. },
  223. {
  224. label: 'POL超期箱使天数',
  225. prop: 'polOverdueBoxUseDays',
  226. width: 120,
  227. overHidden: true,
  228. },
  229. {
  230. label: 'ETA',
  231. prop: 'eta',
  232. overHidden: true,
  233. },
  234. {
  235. label: 'POD空箱还箱日期',
  236. prop: 'podEmptyContainerReturnDate',
  237. width: 120,
  238. overHidden: true,
  239. },
  240. {
  241. label: 'POD场站',
  242. prop: 'podStationCname',
  243. overHidden: true,
  244. },
  245. {
  246. label: 'POD免箱使天数',
  247. prop: 'podFreeBoxUseDays',
  248. width: 110,
  249. overHidden: true,
  250. },
  251. {
  252. label: 'POD箱使天数',
  253. prop: 'podBoxUseDays',
  254. width: 100,
  255. overHidden: true,
  256. }
  257. ]
  258. },
  259. excelBox: false,
  260. loading: false,
  261. search: {},
  262. form: {},
  263. excelForm: {},
  264. dataList: [],
  265. page: {
  266. pageSize: 20,
  267. currentPage: 1,
  268. total: 0,
  269. pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
  270. },
  271. key: 0,
  272. option: {},
  273. optionList: {
  274. index: true,
  275. dialogDrag: true,
  276. addBtn: false,
  277. delBtn: false,
  278. editBtn: false,
  279. saveBtn: false,
  280. cancelBtnText: '关闭',
  281. span: 8,
  282. border: true,
  283. height: "auto",
  284. searchMenuPosition: "right",
  285. align: "center",
  286. searchSpan: 6,
  287. searchMenuSpan: 24,
  288. searchIcon: true,
  289. searchIndex: 3,
  290. menuWidth: 80,
  291. highlightCurrentRow: true,
  292. dialogWidth: "70%",
  293. column: [{
  294. label: '合同号',
  295. prop: 'contractNo',
  296. width: 100,
  297. disabled: true,
  298. overHidden: true,
  299. search: true,
  300. }, {
  301. label: '箱号',
  302. prop: 'code',
  303. width: 100,
  304. overHidden: true,
  305. search: true,
  306. disabled: true,
  307. },
  308. {
  309. label: '箱型',
  310. prop: 'typeName',
  311. width: 100,
  312. overHidden: true,
  313. search: true,
  314. disabled: true,
  315. type: "select",
  316. filterable: true,
  317. remote: true,
  318. dicUrl: "/api/blade-los/bcntrtypes/list?status=0&current=1&size=20&cnName={{key}}",
  319. props: {
  320. label: "cnName",
  321. value: "cnName",
  322. res: "data.records"
  323. }
  324. }, {
  325. label: '港口',
  326. prop: 'addressCname',
  327. width: 100,
  328. overHidden: true,
  329. search: true,
  330. disabled: true,
  331. type: "select",
  332. filterable: true,
  333. remote: true,
  334. dicUrl: "/api/blade-los/bports/list?current=1&size=20&cnName={{key}}",
  335. props: {
  336. label: "cnName",
  337. value: "cnName",
  338. res: "data.records"
  339. }
  340. },
  341. {
  342. label: '放箱号',
  343. prop: 'containerNumber',
  344. width: 100,
  345. overHidden: true,
  346. disabled: true,
  347. },
  348. {
  349. label: '箱属',
  350. prop: 'boxBelongsTo',
  351. width: 100,
  352. overHidden: true,
  353. disabled: true,
  354. },
  355. {
  356. label: '放箱号类别',
  357. prop: 'boxType',
  358. width: 100,
  359. overHidden: true,
  360. disabled: true,
  361. },
  362. {
  363. label: '箱东',
  364. prop: 'originalBoxEast',
  365. width: 100,
  366. overHidden: true,
  367. disabled: true,
  368. },
  369. {
  370. label: '场站',
  371. prop: 'stationCname',
  372. width: 100,
  373. overHidden: true,
  374. disabled: true,
  375. },
  376. {
  377. label: '限制港口',
  378. prop: 'restrictedPortsName',
  379. width: 100,
  380. overHidden: true,
  381. disabled: true,
  382. },
  383. {
  384. label: '限制船公司',
  385. prop: 'restrictingShippingCompaniesName',
  386. width: 100,
  387. overHidden: true,
  388. disabled: true,
  389. },
  390. {
  391. label: '启用日期',
  392. prop: 'activationDate',
  393. width: 100,
  394. overHidden: true,
  395. disabled: true,
  396. type: "date",
  397. format: "yyyy-MM-dd",
  398. valueFormat: "yyyy-MM-dd HH:mm:ss"
  399. },
  400. {
  401. label: '动态日期',
  402. prop: 'newDate',
  403. width: 100,
  404. searchProp: 'newDateList',
  405. overHidden: true,
  406. search: true,
  407. disabled: true,
  408. type: "date",
  409. searchRange: true,
  410. searchDefaultTime: ["00:00:00", "23:59:59"],
  411. format: "yyyy-MM-dd",
  412. valueFormat: "yyyy-MM-dd HH:mm:ss"
  413. },
  414. {
  415. label: '租赁公司',
  416. prop: 'leasingCompany',
  417. width: 100,
  418. overHidden: true,
  419. search: true,
  420. disabled: true,
  421. },
  422. {
  423. label: '箱来源',
  424. prop: 'boxSource',
  425. width: 100,
  426. overHidden: true,
  427. disabled: true,
  428. search: true,
  429. filterable: true,
  430. type: 'select',
  431. dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_source",
  432. props: {
  433. label: "dictValue",
  434. value: "dictKey"
  435. }
  436. },
  437. {
  438. label: '箱状态',
  439. prop: 'boxStatus',
  440. width: 100,
  441. overHidden: true,
  442. disabled: true,
  443. search: true,
  444. filterable: true,
  445. type: 'select',
  446. dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_status",
  447. props: {
  448. label: "dictValue",
  449. value: "dictKey"
  450. }
  451. },
  452. {
  453. label: '租赁方式',
  454. prop: 'leaseMethod',
  455. width: 100,
  456. overHidden: true,
  457. filterable: true,
  458. type: 'select',
  459. disabled: true,
  460. dicUrl: "/api/blade-system/dict-biz/dictionary?code=lease_method",
  461. props: {
  462. label: "dictValue",
  463. value: "dictKey"
  464. }
  465. },
  466. {
  467. label: '空重(kg)',
  468. prop: 'emptyWeight',
  469. width: 100,
  470. overHidden: true,
  471. disabled: false,
  472. }, {
  473. label: '毛重(kg)',
  474. prop: 'gorssWeight',
  475. width: 100,
  476. overHidden: true,
  477. disabled: false,
  478. }, {
  479. label: '皮重(kg)',
  480. prop: 'tare',
  481. width: 100,
  482. overHidden: true,
  483. disabled: false,
  484. }, {
  485. label: '装载重量(kg)',
  486. prop: 'loadingWeight',
  487. width: 100,
  488. overHidden: true,
  489. disabled: false,
  490. }, {
  491. label: '容积(m³)',
  492. prop: 'volume',
  493. overHidden: true,
  494. disabled: false,
  495. width: 100
  496. }, {
  497. label: '空闲状态',
  498. width: 100,
  499. overHidden: true,
  500. disabled: true,
  501. search: true,
  502. filterable: true,
  503. prop: 'status',
  504. type: 'select',
  505. dicUrl: "/api/blade-system/dict-biz/dictionary?code=box_archives_status",
  506. props: {
  507. label: "dictValue",
  508. value: "dictKey"
  509. }
  510. }, {
  511. label: '造箱公司',
  512. prop: 'boxMakingCompany',
  513. disabled: false,
  514. width: 100,
  515. overHidden: true,
  516. search: true,
  517. }, {
  518. label: '造箱日期',
  519. prop: 'boxMakingDate',
  520. searchProp: 'boxMakingDateList',
  521. width: 100,
  522. overHidden: true,
  523. disabled: false,
  524. search: true,
  525. type: "date",
  526. searchRange: true,
  527. searchDefaultTime: ["00:00:00", "23:59:59"],
  528. format: "yyyy-MM-dd",
  529. valueFormat: "yyyy-MM-dd HH:mm:ss"
  530. }, {
  531. label: '起租日期',
  532. prop: 'leaseCommencementDate',
  533. searchProp: 'leaseCommencementDateList',
  534. width: 100,
  535. overHidden: true,
  536. search: true,
  537. type: "date",
  538. disabled: true,
  539. searchRange: true,
  540. searchDefaultTime: ["00:00:00", "23:59:59"],
  541. format: "yyyy-MM-dd",
  542. valueFormat: "yyyy-MM-dd HH:mm:ss"
  543. }, {
  544. label: '购入日期',
  545. prop: 'purchaseDate',
  546. width: 100,
  547. overHidden: true,
  548. type: "date",
  549. disabled: true,
  550. searchRange: true,
  551. searchDefaultTime: ["00:00:00", "23:59:59"],
  552. format: "yyyy-MM-dd",
  553. valueFormat: "yyyy-MM-dd HH:mm:ss"
  554. }, {
  555. label: '箱龄(月)',
  556. prop: 'boxAge',
  557. overHidden: true,
  558. disabled: false,
  559. width: 100,
  560. }, {
  561. label: '箱动态',
  562. prop: 'boxAccessStatus',
  563. overHidden: true,
  564. disabled: true,
  565. width: 100,
  566. }
  567. ]
  568. }
  569. }
  570. },
  571. async created() {
  572. this.option = await this.getColumnData(this.getColumnName(234), this.optionList);
  573. this.optionTrack = await this.getColumnData(this.getColumnName(234.1), this.optionTrackBack);
  574. this.key++
  575. let i = 0;
  576. this.option.column.forEach(item => {
  577. if (item.search) i++
  578. })
  579. if (i % 3 !== 0) {
  580. const num = 3 - Number(i % 3)
  581. this.option.searchMenuSpan = num * 8;
  582. this.option.searchMenuPosition = "right";
  583. }
  584. },
  585. methods: {
  586. dicChange(name, row) {
  587. if (name == 'typeName') {
  588. if (row) {
  589. this.form.typeId = row.id
  590. } else {
  591. this.form.typeId = null
  592. this.form.typeName = null
  593. }
  594. }
  595. if (name == 'purchaseCompanyName') {
  596. if (row) {
  597. this.form.boxMakingCompanyId = row.id
  598. } else {
  599. this.form.boxMakingCompanyId = null
  600. this.form.boxMakingCompany = null
  601. }
  602. }
  603. },
  604. // 箱轨迹里合同号跳转
  605. contractNoJump(row) {
  606. this.boxTrack = false
  607. if (row.status == '买箱') {
  608. this.$router.push({
  609. path: '/boxManagement/buyContainer/index?srcId=' + row.srcId
  610. });
  611. } else if (row.status == '卖箱') {
  612. this.$router.push({
  613. path: '/boxManagement/sellingContainers/index?srcId=' + row.srcId
  614. });
  615. } else if (row.status == '出口装运') {
  616. this.$router.push({
  617. path: '/boxManagement/exportShipment/index?srcId=' + row.srcId
  618. });
  619. } else if (row.status == '进口返程') {
  620. this.$router.push({
  621. path: '/boxManagement/importReturnTrip/index?srcId=' + row.srcId
  622. });
  623. } else if (row.status == '租入') {
  624. this.$router.push({
  625. path: '/boxManagement/leaseIn/index?srcId=' + row.srcId
  626. });
  627. } else if (row.status == '租出') {
  628. this.$router.push({
  629. path: '/boxManagement/leaseOut/index?srcId=' + row.srcId
  630. });
  631. } else { }
  632. },
  633. track(row) {
  634. // this.dataTrackList = row
  635. this.formSearch = row
  636. this.boxTrack = true
  637. },
  638. rowUpdateTrack(form, index, done, loading) {
  639. update(form).then(res => {
  640. done()
  641. this.$message.success("操作成功")
  642. this.onLoadTrack(this.pageTwo, this.searchTwo)
  643. })
  644. },
  645. //打开表单前
  646. beforeOpen(done, type) {
  647. if (type === "add") {
  648. this.findObject(this.option.column, "boxSource").value = this.$refs.crud.DIC.boxSource.length > 0 ? this.$refs.crud.DIC.boxSource[0].dictKey : ''
  649. this.findObject(this.option.column, "boxStatus").value = this.$refs.crud.DIC.boxStatus.length > 0 ? this.$refs.crud.DIC.boxStatus[0].dictKey : ''
  650. }
  651. done();
  652. },
  653. searchChangeTwo(params, done) {
  654. done();
  655. this.onLoadTrack(this.pageTwo, params)
  656. },
  657. onLoadTrack(page, params = {}) {
  658. params = {
  659. ...params,
  660. current: page.currentPage,
  661. size: page.pageSize,
  662. code: this.formSearch.code
  663. }
  664. this.loadingTwo = true
  665. archivestrajectory(params).then(res => {
  666. this.dataTrackList = res.data.data.records
  667. this.pageTwo.total = res.data.data.total
  668. this.loadingTwo = false
  669. }).finally(() => {
  670. this.loadingTwo = false
  671. })
  672. },
  673. //导出
  674. outExport() {
  675. this.$confirm('是否导出当前所有箱档案?', '提示', {
  676. confirmButtonText: '确定',
  677. cancelButtonText: '取消',
  678. type: 'warning'
  679. }).then(() => {
  680. let queryParams = this.search
  681. const routeData = this.$router.resolve({
  682. path: '/api/blade-box-tube/archives/export-archives-out', //跳转目标窗口的地址
  683. query: {
  684. 'Blade-Auth': getToken(),
  685. ...queryParams //括号内是要传递给新窗口的参数
  686. }
  687. })
  688. window.open(routeData.href.slice(1, routeData.href.length));
  689. }).catch(() => {
  690. this.$message({
  691. type: 'info',
  692. message: '已取消' //
  693. });
  694. })
  695. },
  696. derivation() {
  697. window.open(`/api/blade-box-tube/archives/export-archives-info?${this.website.tokenHeader}=${getToken()}`);
  698. },
  699. uploadBefore(file, done, loading) {
  700. loading = true;
  701. done();
  702. },
  703. uploadAfter(res, done, loading, column) {
  704. this.excelBox = false;
  705. this.$message.success("导入成功!");
  706. this.onLoad(this.page, this.search);
  707. loading = false;
  708. done();
  709. },
  710. balabala(val) {
  711. if (val === null) {
  712. this.form.address = ''
  713. } else {
  714. this.form.address = val.name
  715. }
  716. },
  717. getGSData(row) {
  718. this.form.leasingCompany = row.cname
  719. },
  720. //关闭弹窗前
  721. beforeClose(done, type) {
  722. this.onLoad(this.page, this.search)
  723. done()
  724. },
  725. //刷新
  726. refreshChange() {
  727. this.onLoad(this.page, this.search)
  728. },
  729. rowDel(form, index) {
  730. this.$confirm('此操作将永久删除该行, 是否继续?', '提示', {
  731. confirmButtonText: '确定',
  732. cancelButtonText: '取消',
  733. type: 'warning'
  734. }).then(() => {
  735. remove(form.id).then(res => {
  736. this.$message({
  737. type: 'success',
  738. message: '删除成功!'
  739. });
  740. this.onLoad(this.page, this.search)
  741. })
  742. }).catch(() => {
  743. });
  744. },
  745. uploadDelete(file, column) {
  746. return new Promise((resolve, reject) => {
  747. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  748. confirmButtonText: '确定',
  749. cancelButtonText: '取消',
  750. type: 'warning'
  751. }).then(() => {
  752. if (this.form.filesList[file.uid].id) {
  753. boxRemove(this.form.filesList[file.uid].id).then(res => {
  754. this.$message({
  755. type: 'success',
  756. message: '删除成功!'
  757. });
  758. resolve();
  759. })
  760. } else {
  761. resolve();
  762. }
  763. }).catch(() => {
  764. reject();
  765. this.$message({
  766. type: "info",
  767. message: "已取消删除"
  768. });
  769. })
  770. })
  771. },
  772. rowSave(form, done, loading, index) {
  773. done()
  774. addUpdate(form).then(res => {
  775. this.onLoad(this.page, this.search)
  776. })
  777. },
  778. searchChange(params, done) {
  779. done();
  780. this.onLoad(this.page, params)
  781. },
  782. onLoad(page, params = {}) {
  783. params = {
  784. ...params,
  785. current: page.currentPage,
  786. size: page.pageSize,
  787. ...Object.assign(params, this.search)
  788. }
  789. this.loading = true
  790. getList(params).then(res => {
  791. this.dataList = res.data.data.records
  792. this.page.total = res.data.data.total
  793. this.loading = false
  794. }).finally(() => {
  795. this.loading = false
  796. })
  797. },
  798. //自定义列保存
  799. async saveColumnTwo(ref, option, optionBack, code) {
  800. /**
  801. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  802. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  803. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  804. */
  805. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  806. if (inSave) {
  807. this.$message.success("保存成功");
  808. //关闭窗口
  809. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  810. }
  811. },
  812. //自定义列重置
  813. async resetColumnTwo(ref, option, optionBack, code) {
  814. this[option] = this[optionBack];
  815. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  816. if (inSave) {
  817. this.$message.success("重置成功");
  818. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  819. }
  820. },
  821. }
  822. }
  823. </script>
  824. <style lang="scss" scoped>
  825. ::v-deep .el-col-md-8 {
  826. width: 24.33333%;
  827. }
  828. </style>