index.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914
  1. <template>
  2. <div>
  3. <basic-container v-if="isShow">
  4. <avue-crud :option="option"
  5. :table-loading="loading"
  6. :data="data"
  7. :page.sync="page"
  8. id="out-table"
  9. :header-cell-class-name="headerClassName"
  10. v-model="form"
  11. ref="crud"
  12. :search.sync="query"
  13. @selection-change="selectionChange"
  14. @search-change="searchChange"
  15. @search-reset="searchReset"
  16. @refresh-change="refreshChange"
  17. @current-change="currentChange"
  18. @size-change="sizeChange"
  19. @on-load="onLoad"
  20. @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 326)"
  21. @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 326)" >
  22. <template slot="menuLeft">
  23. <el-button type="primary" size="small" @click="addbtnfun()">新建报关</el-button>
  24. <el-button type="primary"
  25. size="small"
  26. plain @click="CopyDocumentsfun">复制单据
  27. </el-button>
  28. <el-button type="danger"
  29. size="small"
  30. plain
  31. v-if="query.billStatus != 3"
  32. @click="handleDelete">删 除
  33. </el-button>
  34. </template>
  35. <template slot-scope="scope" slot="menu">
  36. <el-button :type="scope.type" :size="scope.size"
  37. icon="el-icon-edit"
  38. @click.stop="rowCellfun(scope.row.id, scope.index)">编辑
  39. </el-button>
  40. </template>
  41. <template slot="billNo" slot-scope="scope">
  42. <span style="color: #1e9fff;cursor: pointer;width: 100%;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;"
  43. @click.stop="rowCellfun(scope.row.id, scope.index)" >{{scope.row.billNo}}</span>
  44. </template>
  45. </avue-crud>
  46. </basic-container>
  47. <bgdetails ref="bgdetails" v-if="!isShow" :detailData="detailData" @goBack="goBack" ></bgdetails>
  48. </div>
  49. </template>
  50. <script>
  51. import bgdetails from "./bgdetails.vue";
  52. import {customsdeclarationList, customsdeclarationRemove} from "@/api/iosBasicData/customsdeclaration";
  53. import {getWorkDicts} from "@/api/system/dictbiz";
  54. import {getBcorpslistByType} from "@/api/iosBasicData/bcorps";
  55. export default {
  56. components:{bgdetails},
  57. data() {
  58. return {
  59. isShow:true, // 详情是否打开
  60. loading:false, // 按钮动画
  61. data:[], // 渲染的数据
  62. // 分页
  63. page: {
  64. pageSize: 10,
  65. currentPage: 1,
  66. total: 0
  67. },
  68. form:{}, // 绑定的对象
  69. query:{}, // 搜索项
  70. option:{},
  71. optionBack:{
  72. height:'auto',
  73. calcHeight: 30,
  74. tip: false,
  75. searchShow: true,
  76. rowKey:'id',
  77. searchIcon: true,
  78. searchIndex: 3,
  79. border: true,
  80. index: true,
  81. selection: true, // 是否有选择框
  82. dialogClickModal: false,
  83. stripe:true,
  84. addBtn:false,
  85. viewBtn:false,
  86. delBtn:false,
  87. editBtn:false,
  88. menuWidth:'auto',
  89. column: [
  90. {
  91. label: "业务类型",
  92. prop: "businessType",
  93. type: 'select',
  94. dicData:[
  95. {
  96. label:'海运报关',
  97. value:'SE'
  98. },
  99. {
  100. label:'海运报关',
  101. value:'SI'
  102. },
  103. {
  104. label:'空运报关',
  105. value:'AE'
  106. },
  107. {
  108. label:'空运报关',
  109. value:'AI'
  110. }
  111. ],
  112. overHidden:true
  113. },
  114. {
  115. label: "进出口",
  116. prop: "seaType",
  117. type: 'select',
  118. dicData:[
  119. {
  120. label:'出口',
  121. value:'E'
  122. },
  123. {
  124. label:'进口',
  125. value:'I'
  126. }
  127. ],
  128. overHidden:true
  129. },
  130. {
  131. label: "单据编号",
  132. prop: "billNo",
  133. search:true,
  134. overHidden:true
  135. },
  136. {
  137. label: "经营单位名称",
  138. prop: "corpCnName",
  139. width:'140',
  140. searchLabelWidth:120,
  141. search:true,
  142. type:'select',
  143. filterable:true,
  144. remote:true,
  145. dicUrl: "/api/blade-los/bcorps/listByType?cnName={{key}}",
  146. dicData:[],
  147. props: {
  148. label: 'cnName',
  149. value: 'cnName',
  150. res:'data.records'
  151. },
  152. overHidden:true
  153. },
  154. {
  155. label: "经营单位英文名称",
  156. prop: "corpEnName",
  157. width:'140',
  158. overHidden:true
  159. },
  160. {
  161. label: "发货单位中文名称",
  162. prop: "deliveryCnName",
  163. width:'140',
  164. overHidden:true
  165. },
  166. {
  167. label: "发货单位英文名称",
  168. prop: "deliveryEnName",
  169. width:'140',
  170. overHidden:true
  171. },
  172. {
  173. label: "订舱号",
  174. prop: "bookingNo",
  175. search:true,
  176. overHidden:true
  177. },
  178. {
  179. label: "提单号",
  180. prop: "mblno",
  181. search:true,
  182. overHidden:true
  183. },
  184. {
  185. label: "三检单号",
  186. prop: "tripleInspectionNumber",
  187. overHidden:true
  188. },
  189. {
  190. label: "报关单号",
  191. prop: "customsDeclarationNumber",
  192. overHidden:true
  193. },
  194. {
  195. label: "备案号",
  196. prop: "recordNumber",
  197. overHidden:true
  198. },
  199. {
  200. label: "提运单号",
  201. prop: "contractAgreementNumber",
  202. overHidden:true
  203. },
  204. {
  205. label: "合同协议号",
  206. prop: "deliveryNumbers",
  207. width:'100',
  208. overHidden:true
  209. },
  210. {
  211. label: "对帐约号",
  212. prop: "reconciliationAgreementNumber",
  213. overHidden:true
  214. },
  215. {
  216. label: "核注清单号",
  217. prop: "approvalListNumber",
  218. width:'100',
  219. overHidden:true
  220. },
  221. {
  222. label: "Reference NO",
  223. prop: "refno",
  224. width:'120',
  225. overHidden:true
  226. },
  227. {
  228. label: "发票号",
  229. prop: "invoiceNumber",
  230. overHidden:true
  231. },
  232. {
  233. label: "接单日期",
  234. prop: "billDate",
  235. overHidden:true
  236. },
  237. {
  238. label: "etd",
  239. prop: "etdDate",
  240. overHidden:true
  241. },
  242. {
  243. label: "报检日期",
  244. prop: "inspectionDeclarationDate",
  245. overHidden:true
  246. },
  247. {
  248. label: "申报日期",
  249. prop: "declareDate",
  250. overHidden:true
  251. },
  252. {
  253. label: "预录日期",
  254. prop: "preRrecordingDate",
  255. overHidden:true
  256. },
  257. {
  258. label: "业务来源",
  259. prop: "srcType",
  260. overHidden:true
  261. },
  262. {
  263. label: "来源中文",
  264. prop: "srcCnName",
  265. overHidden:true
  266. },
  267. {
  268. label: "来源英文",
  269. prop: "srcEnName",
  270. overHidden:true
  271. },
  272. {
  273. label: "代理公司代码",
  274. prop: "agencyCompanytCode",
  275. width:'140',
  276. overHidden:true
  277. },
  278. {
  279. label: "代理公司中文名称",
  280. prop: "agencyCompanytCnName",
  281. width:'140',
  282. overHidden:true
  283. },
  284. {
  285. label: "代理公司英文名称",
  286. prop: "agencyCompanytEnName",
  287. width:'140',
  288. overHidden:true
  289. },
  290. {
  291. label: "企业中文名称",
  292. prop: "enterpriseCnName",
  293. width:'140',
  294. overHidden:true
  295. },
  296. {
  297. label: "企业英文名称",
  298. prop: "enterpriseEnName",
  299. width:'140',
  300. overHidden:true
  301. },
  302. {
  303. label: "企业海关编号",
  304. prop: "enterpriseCode",
  305. width:'140',
  306. overHidden:true
  307. },
  308. {
  309. label: "中文船名",
  310. prop: "vesselCnName",
  311. overHidden:true
  312. },
  313. {
  314. label: "英文船名",
  315. prop: "vesselEnName",
  316. overHidden:true
  317. },
  318. {
  319. label: "申报方式编码",
  320. prop: "declarationMethodCode",
  321. width:'140',
  322. overHidden:true
  323. },
  324. {
  325. label: "申报方式",
  326. prop: "declarationMethodName",
  327. width:'140',
  328. overHidden:true
  329. },
  330. {
  331. label: "贸易方式编码",
  332. prop: "tradeMethodCode",
  333. width:'140',
  334. overHidden:true
  335. },
  336. {
  337. label: "贸易方式",
  338. prop: "tradeMethodName",
  339. overHidden:true
  340. },
  341. {
  342. label: "运输方式",
  343. prop: "transportMethod",
  344. overHidden:true
  345. },
  346. {
  347. label: "运输工具",
  348. prop: "transportTool",
  349. overHidden:true
  350. },
  351. {
  352. label: "结汇方式",
  353. prop: "exchangeSettlementMethod",
  354. overHidden:true
  355. },
  356. {
  357. label: "成交方式",
  358. prop: "dealMethod",
  359. overHidden:true
  360. },
  361. {
  362. label: "出口口岸中文名称",
  363. prop: "exportPortCnName",
  364. width:'140',
  365. overHidden:true
  366. },
  367. {
  368. label: "出口口岸英文名称",
  369. prop: "exportPortEnName",
  370. width:'140',
  371. overHidden:true
  372. },
  373. {
  374. label: "运抵国中文名称",
  375. prop: "destinationCountryCnName",
  376. width:'140',
  377. overHidden:true
  378. },
  379. {
  380. label: "运抵国英文名称",
  381. prop: "destinationCountryEnName",
  382. width:'140',
  383. overHidden:true
  384. },
  385. {
  386. label: "指运港中文名称",
  387. prop: "portOfDestinationCnName",
  388. width:'140',
  389. overHidden:true
  390. },
  391. {
  392. label: "指运港英文名称",
  393. prop: "portOfDestinationEnName",
  394. width:'140',
  395. overHidden:true
  396. },
  397. {
  398. label: "运费",
  399. prop: "amountFreight",
  400. overHidden:true
  401. },
  402. {
  403. label: "杂费",
  404. prop: "amountMiscellaneousExpenses",
  405. overHidden:true
  406. },
  407. {
  408. label: "保费",
  409. prop: "amountPremium",
  410. overHidden:true
  411. },
  412. {
  413. label: "货物金额",
  414. prop: "amountGoods",
  415. overHidden:true
  416. },
  417. {
  418. label: "境内货源地",
  419. prop: "domesticSourceOfGoods",
  420. width:'100',
  421. overHidden:true
  422. },
  423. {
  424. label: "随附单据",
  425. prop: "documentsAttached",
  426. overHidden:true
  427. },
  428. {
  429. label: "其他单据",
  430. prop: "documentsAttachedOther",
  431. overHidden:true
  432. },
  433. {
  434. label: "源操作",
  435. prop: "srcOperation",
  436. overHidden:true
  437. },
  438. {
  439. label: "唛头",
  440. prop: "marks",
  441. overHidden:true
  442. },
  443. {
  444. label: "包装单位",
  445. prop: "packingUnit",
  446. overHidden:true
  447. },
  448. {
  449. label: "件数",
  450. prop: "quantity",
  451. overHidden:true
  452. },
  453. {
  454. label: "毛重 (KGM)",
  455. prop: "grossWeight",
  456. width:'120',
  457. overHidden:true
  458. },
  459. {
  460. label: "净重 (KGM)",
  461. prop: "netWeight",
  462. width:'120',
  463. overHidden:true
  464. },
  465. {
  466. label: "本位币应收(CNY)",
  467. prop: "amountDr",
  468. width:'140',
  469. overHidden:true
  470. },
  471. {
  472. label: "本位币应付(CNY)",
  473. prop: "amountCr",
  474. width:'140',
  475. overHidden:true
  476. },
  477. {
  478. label: "本位币利润(CNY)",
  479. prop: "amountProfit",
  480. width:'140',
  481. overHidden:true
  482. },
  483. {
  484. label: "合计本位币应收(CNY)",
  485. prop: "amountDrLoc",
  486. width:'160',
  487. overHidden:true
  488. },
  489. {
  490. label: "合计本位币应付(CNY)",
  491. prop: "amountCrLoc",
  492. width:'160',
  493. overHidden:true
  494. },
  495. {
  496. label: "合计本位币利润(CNY)",
  497. prop: "amountProfitLoc",
  498. width:'160',
  499. overHidden:true
  500. },
  501. {
  502. label: "应收对账状态",
  503. prop: "checkDrStatus",
  504. width:'120',
  505. type:"select",
  506. dicData: [
  507. {
  508. label: '未开',
  509. value: 0
  510. },
  511. {
  512. label: '部分',
  513. value: 3
  514. },
  515. {
  516. label: '全开',
  517. value: 9
  518. }
  519. ],
  520. overHidden:true
  521. },
  522. {
  523. label: "应收付账状态",
  524. prop: "checkCrStatus",
  525. width:'120',
  526. type:"select",
  527. dicData: [
  528. {
  529. label: '未开',
  530. value: 0
  531. },
  532. {
  533. label: '部分',
  534. value: 3
  535. },
  536. {
  537. label: '全开',
  538. value: 9
  539. }
  540. ],
  541. overHidden:true
  542. },
  543. {
  544. label: "应收结算状态",
  545. prop: "stlDrStatus",
  546. width:'120',
  547. type:"select",
  548. dicData: [
  549. {
  550. label: '未开',
  551. value: 0
  552. },
  553. {
  554. label: '部分',
  555. value: 3
  556. },
  557. {
  558. label: '全开',
  559. value: 9
  560. }
  561. ],
  562. overHidden:true
  563. },
  564. {
  565. label: "应付结算状态",
  566. prop: "stlCrStatus",
  567. width:'120',
  568. type:"select",
  569. dicData: [
  570. {
  571. label: '未开',
  572. value: 0
  573. },
  574. {
  575. label: '部分',
  576. value: 3
  577. },
  578. {
  579. label: '全开',
  580. value: 9
  581. }
  582. ],
  583. overHidden:true
  584. },
  585. {
  586. label: "销项发票开具状态",
  587. prop: "invoiceDrStatus",
  588. width:'140',
  589. type:"select",
  590. dicData: [
  591. {
  592. label: '未开',
  593. value: 0
  594. },
  595. {
  596. label: '部分',
  597. value: 3
  598. },
  599. {
  600. label: '全开',
  601. value: 9
  602. }
  603. ],
  604. overHidden:true
  605. },
  606. {
  607. label: "进项发票开具状态",
  608. prop: "invoiceCrStatus",
  609. width:'140',
  610. type:"select",
  611. dicData: [
  612. {
  613. label: '未开',
  614. value: 0
  615. },
  616. {
  617. label: '部分',
  618. value: 3
  619. },
  620. {
  621. label: '全开',
  622. value: 9
  623. }
  624. ],
  625. overHidden:true
  626. },
  627. {
  628. label: "状态",
  629. prop: "billStatus",
  630. type:"select",
  631. dicData: [],
  632. props: {
  633. label: "dictValue",
  634. value: "dictKey"
  635. },
  636. overHidden:true
  637. },
  638. {
  639. label: "财务状态",
  640. prop: "accountStatus",
  641. type: 'select',
  642. dicData:[],
  643. props: {
  644. label: "dictValue",
  645. value: "dictKey"
  646. },
  647. overHidden:true
  648. },
  649. {
  650. label: "备注",
  651. prop: "remarks",
  652. },
  653. {
  654. label: "创建人",
  655. prop: "createUserName",
  656. overHidden:true
  657. },
  658. {
  659. label: "创建部门",
  660. prop: "createDeptName",
  661. overHidden:true
  662. },
  663. {
  664. label: "创建时间",
  665. prop: "createTime",
  666. overHidden:true
  667. },
  668. {
  669. label: "修改人",
  670. prop: "updateUserName",
  671. overHidden:true
  672. },
  673. {
  674. label: "修改时间",
  675. prop: "updateTime",
  676. overHidden:true
  677. },
  678. {
  679. label: "默认团队名",
  680. prop: "teamName",
  681. width:'100',
  682. overHidden:true
  683. },
  684. ]
  685. },
  686. detailData:{},
  687. }
  688. },
  689. async created() {
  690. this.option = await this.getColumnData(this.getColumnName(326), this.optionBack);
  691. // 首页快捷跳转进来的
  692. if(this.$route.query.home) {
  693. this.addbtnfun()
  694. }
  695. if (this.$route.query.billId) {
  696. // 从审批里查看跳进来的
  697. this.rowCellfun({id:this.$route.query.billId})
  698. }
  699. this.$store.commit('SIBG_IN_DETAIL')
  700. this.accountStatusWorkDictsfun() // 业务状态字典
  701. this.billStatusWorkDictsfun() // 状态字典
  702. this.corpBcorpslistByTypefun() // 经营单位数据
  703. },
  704. methods:{
  705. // 批量删除
  706. handleDelete() {
  707. if (this.selectionList.length === 0) {
  708. this.$message.warning("请选择至少一条数据");
  709. return;
  710. }
  711. // 已经提交请核的提示不让删除
  712. let sumArr = []
  713. const h = this.$createElement
  714. for (let item of this.selectionList) {
  715. if (item.status == 1) {
  716. sumArr.push(h('p', `序号${item.$index + 1}的数据已经提交请核请勿删除`))
  717. }
  718. }
  719. if(sumArr.length != 0) {
  720. this.$confirm('提示', {
  721. message:h('div', sumArr),
  722. confirmButtonText: "确定",
  723. cancelButtonText: "取消",
  724. type: "warning"
  725. })
  726. return;
  727. }
  728. let ids = this.selectionList.map(item=>{
  729. return item.id
  730. })
  731. this.$confirm("确定将选择数据删除?", {
  732. confirmButtonText: "确定",
  733. cancelButtonText: "取消",
  734. type: "warning"
  735. })
  736. .then(() => {
  737. return customsdeclarationRemove(ids.join(','));
  738. })
  739. .then(() => {
  740. this.onLoad(this.page);
  741. this.$message({
  742. type: "success",
  743. message: "操作成功!"
  744. });
  745. this.$refs.crud.toggleSelection();
  746. });
  747. },
  748. // 复制单据
  749. CopyDocumentsfun(){
  750. if (this.selectionList.length !== 1) {
  751. this.$message.warning("请选择一条数据");
  752. return;
  753. }
  754. this.detailData.seeDisabled = false
  755. this.detailData.id = this.selectionList[0].id
  756. this.isShow = false
  757. this.$nextTick(()=>{
  758. this.$refs.bgdetails.pageLoading = true
  759. this.$refs.bgdetails.copyCustomsDeclarationfun(this.selectionList[0].id)
  760. })
  761. },
  762. // 编辑详情打开
  763. rowCellfun(id,index) {
  764. this.detailData = {
  765. seeDisabled: false,
  766. id: id
  767. };
  768. this.isShow = false
  769. this.$nextTick(()=>{
  770. this.$refs.bgdetails.pageLoading = true
  771. this.$refs.bgdetails.customsdeclarationDetailfun(id)
  772. })
  773. },
  774. // 新增弹窗开启
  775. addbtnfun(){
  776. this.detailData.seeDisabled = false
  777. this.isShow = false
  778. },
  779. // 搜索
  780. searchChange(params,done){
  781. this.query = params;
  782. this.page.currentPage = 1;
  783. this.onLoad(this.page, params);
  784. done();
  785. },
  786. // 接口调用 🐢🐢🐢🐢🐢🐢🐢
  787. // 获取财务状态字典数据
  788. accountStatusWorkDictsfun(){
  789. getWorkDicts('account_status').then(res=>{
  790. this.findObject(this.option.column, "accountStatus").dicData = res.data.data;
  791. })
  792. },
  793. // 获取业务状态字典数据
  794. billStatusWorkDictsfun(){
  795. getWorkDicts('bill_status').then(res=>{
  796. this.findObject(this.option.column, "billStatus").dicData = res.data.data;
  797. })
  798. },
  799. // 经营单位数据
  800. corpBcorpslistByTypefun(){
  801. getBcorpslistByType(1,10).then(res=>{
  802. this.findObject(this.option.column, "corpCnName").dicData = res.data.data.records
  803. })
  804. },
  805. // 清空搜索条件
  806. searchReset() {
  807. this.query = {};
  808. this.onLoad(this.page);
  809. },
  810. // 多选
  811. selectionChange(list) {
  812. this.selectionList = list;
  813. },
  814. // 刷新
  815. refreshChange() {
  816. this.onLoad(this.page, this.query);
  817. },
  818. currentChange(currentPage){
  819. this.page.currentPage = currentPage;
  820. },
  821. sizeChange(pageSize){
  822. this.page.pageSize = pageSize;
  823. },
  824. selectionClear() {
  825. this.selectionList = [];
  826. this.$refs.crud.toggleSelection();
  827. },
  828. // 列表数据
  829. onLoad(page, params = {}) {
  830. this.loading = true;
  831. customsdeclarationList(page.currentPage, page.pageSize, {
  832. ...Object.assign(params, this.query),
  833. businessType:'BGSI',
  834. }).then(res => {
  835. const data = res.data.data;
  836. this.page.total = data.total;
  837. this.data = data.records.map(item=>{
  838. item.accountStatus = item.accountStatus + ''
  839. item.billStatus = item.billStatus + ''
  840. return item
  841. })
  842. this.loading = false;
  843. this.selectionClear();
  844. });
  845. },
  846. // 返回列表
  847. goBack(){
  848. // 初始化数据
  849. if (JSON.stringify(this.$route.query) != "{}") {
  850. this.$router.$avueRouter.closeTag();
  851. this.$router.push({
  852. path: "/iosBasicData/reportClose/SEreportClose/index"
  853. });
  854. }
  855. this.isShow = true;
  856. this.onLoad(this.page, this.search);
  857. },
  858. //自定义列保存
  859. async saveColumnTwo(ref, option, optionBack, code) {
  860. /**
  861. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  862. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  863. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  864. */
  865. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  866. if (inSave) {
  867. this.$message.success("保存成功");
  868. //关闭窗口
  869. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  870. }
  871. },
  872. //自定义列重置
  873. async resetColumnTwo(ref, option, optionBack, code) {
  874. this[option] = this[optionBack];
  875. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  876. if (inSave) {
  877. this.$message.success("重置成功");
  878. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  879. }
  880. },
  881. // 更改表格颜色
  882. headerClassName(tab) {
  883. //颜色间隔
  884. let back = ""
  885. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  886. if (tab.columnIndex % 2 === 0) {
  887. back = "back-one"
  888. } else if (tab.columnIndex % 2 === 1) {
  889. back = "back-two"
  890. }
  891. }
  892. return back;
  893. },
  894. }
  895. }
  896. </script>
  897. <style scoped>
  898. ::v-deep#out-table .back-one {
  899. background: #ecf5ff !important;
  900. text-align: center;
  901. }
  902. ::v-deep#out-table .back-two {
  903. background: #ecf5ff !important;
  904. text-align: center;
  905. }
  906. /deep/ .el-col-md-8 {
  907. width: 24.33333%;
  908. }
  909. </style>