index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  1. <template>
  2. <div>
  3. <el-row>
  4. <el-col :span="4">
  5. <div class="box">
  6. <el-scrollbar>
  7. <basic-container>
  8. <avue-tree :option="treeOption" :data="feesTypeData" @node-click="nodeClick">
  9. <template slot="addBtn">
  10. <el-tooltip class="item" effect="dark" content="新建分类" placement="top">
  11. <i
  12. class="el-icon-setting"
  13. style="font-size:18px;line-height: 30px;width: 20px;padding: 0 10px;"
  14. @click="corpTypeVisible = true"
  15. ></i>
  16. </el-tooltip>
  17. </template>
  18. </avue-tree>
  19. </basic-container>
  20. </el-scrollbar>
  21. </div>
  22. </el-col>
  23. <el-col :span="20">
  24. <basic-container>
  25. <avue-crud
  26. :option="option"
  27. :table-loading="loading"
  28. :data="data"
  29. :page.sync="page"
  30. :permission="permissionList"
  31. id="out-table"
  32. :header-cell-class-name="headerClassName"
  33. :before-open="beforeOpen"
  34. :search.sync="search"
  35. v-model="form"
  36. ref="crud"
  37. @row-update="rowUpdate"
  38. @row-save="rowSave"
  39. @row-del="rowDel"
  40. @search-change="searchChange"
  41. @search-reset="searchReset"
  42. @selection-change="selectionChange"
  43. @current-change="currentChange"
  44. @size-change="sizeChange"
  45. @refresh-change="refreshChange"
  46. @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 302)"
  47. @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 302)"
  48. @on-load="onLoad"
  49. >
  50. <template slot="menuLeft">
  51. <el-button type="danger" size="small" icon="el-icon-delete" plain @click="handleDelete">删 除 </el-button>
  52. <el-button type="warning" size="small" icon="el-icon-printer" @click="excelBox = true">导入 </el-button>
  53. <el-button type="success" size="small" @click="handleExport" icon="el-icon-printer">导出</el-button>
  54. </template>
  55. <template slot-scope="scope" slot="menu">
  56. <el-button
  57. v-if="scope.row.status == 1"
  58. type="text"
  59. icon="el-icon-turn-off"
  60. style="color: #85e967"
  61. size="small"
  62. @click.stop="statusfun(scope.row.id, 0)"
  63. >
  64. 启用
  65. </el-button>
  66. <el-button
  67. v-if="scope.row.status == 0"
  68. type="text"
  69. icon="el-icon-turn-off"
  70. style="color: #e83c3a"
  71. size="small"
  72. @click.stop="statusfun(scope.row.id, 1)"
  73. >
  74. 停用
  75. </el-button>
  76. </template>
  77. <template slot="codeForm">
  78. <!-- {{ feeInformationCode }}111 -->
  79. <el-input v-model="form.code" placeholder="请输入 编码" size="small" :disabled="form.id && form.code&&feeInformationCode.includes(form.code)"></el-input>
  80. </template>
  81. <template slot="unitNoForm">
  82. <search-query
  83. ref="SearchQuery"
  84. :disabled="searchDisabled"
  85. :selectValue="form.unitNo"
  86. :datalist="unitNoData"
  87. title="计量单位"
  88. :filterable="true"
  89. :clearable="true"
  90. :buttonIf="false"
  91. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  92. @corpChange="unitNoCorpChange"
  93. >
  94. </search-query>
  95. </template>
  96. <template slot="curNoForm">
  97. <search-query
  98. ref="SearchQuery"
  99. :disabled="searchDisabled"
  100. :selectValue="form.curNo"
  101. :datalist="curNoData"
  102. title="币别"
  103. :filterable="true"
  104. :clearable="true"
  105. :remote="true"
  106. :forParameter="{ key: 'id', label: 'code', value: 'code' }"
  107. @remoteMethod="getRateListfun"
  108. @corpChange="curNoCorpChange"
  109. >
  110. <rateManagement></rateManagement>
  111. </search-query>
  112. </template>
  113. <template slot="feesTypeNameForm">
  114. <search-query
  115. ref="SearchQuery"
  116. :disabled="searchDisabled"
  117. :selectValue="form.feesTypeName"
  118. :datalist="feesTypeData"
  119. title="费用类别"
  120. :filterable="true"
  121. :clearable="true"
  122. :remote="true"
  123. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  124. @remoteMethod="bfeesdefineListfun"
  125. @corpChange="feesTypeCorpChange"
  126. >
  127. <bfeesdetype></bfeesdetype>
  128. </search-query>
  129. </template>
  130. </avue-crud>
  131. </basic-container>
  132. </el-col>
  133. </el-row>
  134. <!--类别弹窗-->
  135. <el-dialog title="类别" :visible.sync="corpTypeVisible" append-to-body width="60%" :before-close="corpTypeClose">
  136. <div>
  137. <bfeesdetype></bfeesdetype>
  138. </div>
  139. <span slot="footer" class="dialog-footer">
  140. <el-button @click="corpTypeVisible = false">取 消</el-button>
  141. <el-button type="primary" @click="corpTypeVisible = false">确 定</el-button>
  142. </span>
  143. </el-dialog>
  144. <el-dialog title="导入费用信息" append-to-body :visible.sync="excelBox" width="555px" :close-on-click-modal="false" v-dialog-drag>
  145. <avue-form :option="excelOption" v-model="excelForm" :table-loading="excelLoading" :upload-before="uploadBefore" :upload-after="onSuccess">
  146. <template slot="excelTemplate">
  147. <el-button type="primary" @click="handleGet"> 点击下载<i class="el-icon-download el-icon--right"></i> </el-button>
  148. </template>
  149. </avue-form>
  150. <p style="text-align: center;color: #DC0505">
  151. 温馨提示 第一次导入时请先下载模板
  152. </p>
  153. </el-dialog>
  154. </div>
  155. </template>
  156. <script>
  157. import { bfeesList, bfeesDetail, bfeesSubmit, bfeesRemove } from "@/api/iosBasicData/bfees";
  158. import { mapGetters } from "vuex";
  159. import { bfeesdefineList } from "@/api/iosBasicData/bfeesdefine";
  160. import { getBunitsList } from "@/api/iosBasicData/bunits";
  161. import { getRateList } from "@/api/iosBasicData/rateManagement";
  162. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  163. import bunits from "@/views/iosBasicData/bunits/index.vue";
  164. import bfeesdetype from "@/views/iosBasicData/bfeesdefine/bfeesdetype.vue";
  165. import rateManagement from "@/views/iosBasicData/rateManagement/index.vue";
  166. import baccelements from "@/views/iosBasicData/baccelements/index.vue";
  167. import { isProcurement } from "@/api/basicData/configuration";
  168. import { getToken } from "@/util/auth";
  169. import { getBaccelementsList } from "@/api/iosBasicData/baccelements";
  170. import { getWorkDicts } from "@/api/system/dictbiz";
  171. export default {
  172. name: "费用信息(F)",
  173. components: { bunits, bfeesdetype, rateManagement, SearchQuery, baccelements },
  174. data() {
  175. return {
  176. feeInformationCode:[],
  177. // 是否禁用
  178. searchDisabled: false,
  179. // 类别弹窗的开启
  180. corpTypeVisible: false,
  181. // 费用类别数据
  182. feesTypeData: [],
  183. // 计量单位数据
  184. unitNoData: [],
  185. // 币别数据
  186. curNoData: [],
  187. treeOption: {
  188. nodeKey: "id",
  189. // lazy: true,
  190. // treeLoad: function(node, resolve) {
  191. // const parentId = node.level === 0 ? 0 : node.data.id;
  192. // },
  193. addBtn: false,
  194. menu: false,
  195. size: "small",
  196. props: {
  197. labelText: "标题",
  198. label: "cnName",
  199. value: "value",
  200. children: "children"
  201. }
  202. },
  203. form: {},
  204. query: {},
  205. loading: true,
  206. excelBox: false,
  207. search: {},
  208. excelForm: {},
  209. excelLoading: false,
  210. excelOption: {
  211. submitBtn: false,
  212. emptyBtn: false,
  213. column: [
  214. {
  215. label: "模板下载",
  216. prop: "excelTemplate",
  217. formslot: true,
  218. span: 24
  219. },
  220. {
  221. label: "模板上传",
  222. prop: "excelFile",
  223. type: "upload",
  224. drag: true,
  225. loadText: "模板上传中,请稍等",
  226. span: 24,
  227. propsHttp: {
  228. res: "data"
  229. },
  230. tip: "请上传 .xls,.xlsx 标准格式文件",
  231. action: "/api/blade-los/bfees/importBFees"
  232. }
  233. ]
  234. },
  235. page: {
  236. pageSize: 20,
  237. currentPage: 1,
  238. total: 0,
  239. pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
  240. },
  241. selectionList: [],
  242. option: {
  243. dialogDrag: true
  244. },
  245. optionBack: {
  246. dialogDrag: true,
  247. addBtnText: "新建费用信息",
  248. addTitle: "新建费用信息",
  249. editBtnText: "编辑",
  250. editTitle: "编辑费用信息",
  251. viewBtnText: "查看",
  252. viewTitle: "查看费用信息",
  253. height: "auto",
  254. calcHeight: 30,
  255. tip: false,
  256. searchShow: true,
  257. searchMenuSpan: 24,
  258. border: true,
  259. index: true,
  260. viewBtn: false,
  261. selection: true,
  262. dialogClickModal: false,
  263. menuWidth: 220,
  264. column: [
  265. // {
  266. // label: "凭证",
  267. // prop: "code",
  268. // search: true,
  269. // rules: [{
  270. // required: true,
  271. // message: "请输入费用编码",
  272. // trigger: "blur"
  273. // }]
  274. // },
  275. {
  276. label: "编码",
  277. prop: "code",
  278. width: "180",
  279. search: true,
  280. rules: [
  281. {
  282. required: true,
  283. message: "请输入费用编码",
  284. trigger: "blur"
  285. }
  286. ],
  287. overHidden: true
  288. },
  289. {
  290. label: "中文名称",
  291. prop: "cnName",
  292. width: "180",
  293. search: true,
  294. rules: [
  295. {
  296. required: true,
  297. message: "请输入中文名称",
  298. trigger: "blur"
  299. }
  300. ],
  301. overHidden: true
  302. },
  303. {
  304. label: "英文名称",
  305. prop: "enName",
  306. width: "180",
  307. search: true,
  308. rules: [
  309. {
  310. required: true,
  311. message: "请输入英文名称",
  312. trigger: "blur"
  313. }
  314. ],
  315. overHidden: true
  316. },
  317. {
  318. label: "费用类别",
  319. prop: "feesTypeName",
  320. formslot: true,
  321. overHidden: true
  322. // rules: [{
  323. // required: true,
  324. // message: "请选择费用类别",
  325. // trigger: "blur"
  326. // }]
  327. },
  328. {
  329. label: "计量单位",
  330. prop: "unitNo",
  331. formslot: true,
  332. overHidden: true,
  333. type: "select",
  334. dicData: [],
  335. props: {
  336. label: "dictValue",
  337. value: "dictKey"
  338. },
  339. rules: [
  340. {
  341. required: true,
  342. message: "请输入计量单位",
  343. trigger: "blur"
  344. }
  345. ]
  346. },
  347. {
  348. label: "币别",
  349. prop: "curNo",
  350. formslot: true,
  351. overHidden: true
  352. // rules: [{
  353. // required: true,
  354. // message: "请输入币别",
  355. // trigger: "blur"
  356. // }]
  357. },
  358. // {
  359. // label: "核算ID",
  360. // prop: "accElementId",
  361. // // rules: [{
  362. // // required: true,
  363. // // message: "请输入核算要素ID",
  364. // // trigger: "blur"
  365. // // }]
  366. // },
  367. {
  368. label: "科目 Id",
  369. prop: "accId",
  370. overHidden: true
  371. // rules: [{
  372. // required: true,
  373. // message: "请输入科目 Id",
  374. // trigger: "blur"
  375. // }]
  376. },
  377. {
  378. label: "科目编号",
  379. prop: "accNo",
  380. overHidden: true
  381. // rules: [{
  382. // required: true,
  383. // message: "请输入科目编号",
  384. // trigger: "blur"
  385. // }]
  386. },
  387. {
  388. label: "科目全称",
  389. prop: "accFullName",
  390. overHidden: true
  391. // rules: [{
  392. // required: true,
  393. // message: "请输入科目全称",
  394. // trigger: "blur"
  395. // }]
  396. },
  397. {
  398. label: "版本",
  399. prop: "version",
  400. hide: true,
  401. display: false,
  402. overHidden: true
  403. },
  404. {
  405. label: "收付",
  406. prop: "dc",
  407. type: "select",
  408. dicData: [
  409. {
  410. label: "收",
  411. value: "D"
  412. },
  413. {
  414. label: "付",
  415. value: "C"
  416. }
  417. ],
  418. overHidden: true
  419. },
  420. {
  421. label: "状态",
  422. prop: "status",
  423. type: "select",
  424. search: true,
  425. dicData: [
  426. {
  427. label: "启用",
  428. value: 0
  429. },
  430. {
  431. label: "停用",
  432. value: 1
  433. }
  434. ],
  435. value: 0,
  436. overHidden: true
  437. // rules: [{
  438. // required: true,
  439. // message: "请输入状态",
  440. // trigger: "blur"
  441. // }]
  442. },
  443. {
  444. label: "创建人",
  445. prop: "createUserName",
  446. display: false,
  447. overHidden: true
  448. },
  449. {
  450. label: "创建部门",
  451. prop: "createDeptName",
  452. display: false,
  453. overHidden: true
  454. },
  455. {
  456. label: "创建时间",
  457. prop: "createTime",
  458. width: 160,
  459. display: false,
  460. overHidden: true
  461. },
  462. {
  463. label: "修改人",
  464. prop: "updateUserName",
  465. display: false,
  466. overHidden: true
  467. },
  468. {
  469. label: "修改时间",
  470. prop: "updateTime",
  471. width: 160,
  472. display: false,
  473. overHidden: true
  474. },
  475. {
  476. label: "是否已删除(0 否 1是)",
  477. prop: "isDeleted",
  478. hide: true,
  479. display: false,
  480. overHidden: true
  481. },
  482. {
  483. label: "备注",
  484. prop: "remarks",
  485. span: 24,
  486. type: "textarea",
  487. width: "180",
  488. slot: true,
  489. minRows: 3,
  490. overHidden: true
  491. }
  492. ]
  493. },
  494. data: []
  495. };
  496. },
  497. computed: {
  498. ...mapGetters(["permission"]),
  499. permissionList() {
  500. return {
  501. // addBtn: this.vaildData(this.permission.bfees_add, false),
  502. // viewBtn: this.vaildData(this.permission.bfees_view, false),
  503. // delBtn: this.vaildData(this.permission.bfees_delete, false),
  504. // editBtn: this.vaildData(this.permission.bfees_edit, false)
  505. };
  506. },
  507. ids() {
  508. let ids = [];
  509. this.selectionList.forEach(ele => {
  510. ids.push(ele.id);
  511. });
  512. return ids.join(",");
  513. }
  514. },
  515. async created() {
  516. this.option = await this.getColumnData(this.getColumnName(302), this.optionBack);
  517. this.bfeesdefineListfun();
  518. this.getBunitsListfun();
  519. this.getRateListfun();
  520. isProcurement({ param: "feeInformation.code" }).then(res => {
  521. // res.data.data === '1'
  522. if(res.data.data){
  523. this.feeInformationCode=res.data.data.split(",")
  524. }
  525. });
  526. },
  527. methods: {
  528. // 禁用启用按钮
  529. statusfun(id, status) {
  530. this.$confirm("确定将选择数据更改状态?", {
  531. confirmButtonText: "确定",
  532. cancelButtonText: "取消",
  533. type: "warning"
  534. }).then(() => {
  535. bfeesDetail(id).then(res => {
  536. let obj = res.data.data;
  537. obj.status = status;
  538. bfeesSubmit(obj).then(() => {
  539. this.onLoad(this.page);
  540. this.$message({
  541. type: "success",
  542. message: "操作成功!"
  543. });
  544. });
  545. });
  546. });
  547. },
  548. // 导出
  549. handleExport() {
  550. var condition = "";
  551. for (const key in this.search) {
  552. var value = this.search[key];
  553. if (value) {
  554. condition += `&${key}=${this.search[key]}`;
  555. }
  556. }
  557. this.$confirm("是否导出费用信息?", "提示", {
  558. confirmButtonText: "确定",
  559. cancelButtonText: "取消",
  560. type: "warning"
  561. })
  562. .then(() => {
  563. window.open(`/api/blade-los/bfees/exportBFees?${this.website.tokenHeader}=${getToken()}${condition}`);
  564. })
  565. .catch(() => {
  566. this.$message({
  567. type: "info",
  568. message: "已取消" //
  569. });
  570. });
  571. },
  572. uploadBefore(file, done, loading) {
  573. done();
  574. loading = true;
  575. },
  576. // 上传成功
  577. onSuccess(res, done, loading, column) {
  578. this.excelBox = false;
  579. this.$message.success("导入成功!");
  580. loading = false;
  581. this.onLoad(this.page);
  582. done();
  583. },
  584. // 下载模板
  585. handleGet() {
  586. window.open(`/api/blade-los/bfees/exportBFees/template?${this.website.tokenHeader}=${getToken()}`);
  587. },
  588. // 获取费用类别数据
  589. bfeesdefineListfun() {
  590. bfeesdefineList(1, 10).then(res => {
  591. this.feesTypeData = res.data.data.records;
  592. });
  593. },
  594. // 获取计算单位数据
  595. getBunitsListfun() {
  596. getWorkDicts("number_rule").then(res => {
  597. this.unitNoData = res.data.data;
  598. this.findObject(this.option.column, "unitNo").dicData = res.data.data;
  599. });
  600. },
  601. // 获取币别数据
  602. getRateListfun(cnName) {
  603. getRateList({
  604. current: 1,
  605. size: 10,
  606. cnName
  607. }).then(res => {
  608. this.curNoData = res.data.data.records;
  609. });
  610. },
  611. // 费用信息选中回调
  612. feesTypeCorpChange(value) {
  613. this.feesTypeData.map(item => {
  614. if (item.cnName == value) {
  615. this.form.feesTypeId = item.id;
  616. this.form.feesTypeName = item.cnName;
  617. }
  618. });
  619. },
  620. // 计量单位选中的回调
  621. unitNoCorpChange(value) {
  622. this.form.unitNo = value;
  623. },
  624. // 币别选中回调
  625. curNoCorpChange(value) {
  626. this.form.curNo = value;
  627. },
  628. nodeClick(data) {
  629. this.query.feesTypeId = data.id;
  630. this.page.currentPage = 1;
  631. this.onLoad(this.page);
  632. },
  633. rowSave(row, done, loading) {
  634. row.accElementId = Number(row.accElementId);
  635. row.accId = Number(row.accId);
  636. bfeesSubmit(row).then(
  637. () => {
  638. this.onLoad(this.page);
  639. this.$message({
  640. type: "success",
  641. message: "操作成功!"
  642. });
  643. done();
  644. },
  645. error => {
  646. loading();
  647. window.console.log(error);
  648. }
  649. );
  650. },
  651. rowUpdate(row, index, done, loading) {
  652. row.accElementId = Number(row.accElementId);
  653. row.accId = Number(row.accId);
  654. bfeesSubmit(row).then(
  655. () => {
  656. this.onLoad(this.page);
  657. this.$message({
  658. type: "success",
  659. message: "操作成功!"
  660. });
  661. done();
  662. },
  663. error => {
  664. loading();
  665. console.log(error);
  666. }
  667. );
  668. },
  669. rowDel(row) {
  670. if (row.status === 1) {
  671. this.$confirm("确定将选择数据删除?", {
  672. confirmButtonText: "确定",
  673. cancelButtonText: "取消",
  674. type: "warning"
  675. })
  676. .then(() => {
  677. return bfeesRemove(row.id);
  678. })
  679. .then(() => {
  680. this.onLoad(this.page);
  681. this.$message({
  682. type: "success",
  683. message: "操作成功!"
  684. });
  685. });
  686. } else {
  687. this.$message({
  688. message: "非禁用状态无法删除",
  689. type: "warning"
  690. });
  691. }
  692. },
  693. handleDelete() {
  694. if (this.selectionList.length === 0) {
  695. this.$message.warning("请选择至少一条数据");
  696. return;
  697. }
  698. for (const selection of this.selectionList) {
  699. if (selection.status == 0) {
  700. this.$message.warning("选中的数据中有启用数据,启用数据不可删除!");
  701. return;
  702. }
  703. }
  704. this.$confirm("确定将选择数据删除?", {
  705. confirmButtonText: "确定",
  706. cancelButtonText: "取消",
  707. type: "warning"
  708. })
  709. .then(() => {
  710. return bfeesRemove(this.ids);
  711. })
  712. .then(() => {
  713. this.onLoad(this.page);
  714. this.$message({
  715. type: "success",
  716. message: "操作成功!"
  717. });
  718. this.$refs.crud.toggleSelection();
  719. });
  720. },
  721. beforeOpen(done, type) {
  722. if (["edit", "add"].includes(type)) {
  723. this.searchDisabled = false;
  724. } else {
  725. this.searchDisabled = true;
  726. }
  727. if (["edit", "view"].includes(type)) {
  728. bfeesDetail(this.form.id).then(res => {
  729. this.form = res.data.data;
  730. });
  731. }
  732. done();
  733. },
  734. searchReset() {
  735. this.query = {};
  736. // this.onLoad(this.page);
  737. },
  738. searchChange(params, done) {
  739. this.query = params;
  740. this.page.currentPage = 1;
  741. this.onLoad(this.page, params);
  742. done();
  743. },
  744. selectionChange(list) {
  745. this.selectionList = list;
  746. },
  747. selectionClear() {
  748. this.selectionList = [];
  749. this.$refs.crud.toggleSelection();
  750. },
  751. currentChange(currentPage) {
  752. this.page.currentPage = currentPage;
  753. },
  754. sizeChange(pageSize) {
  755. this.page.pageSize = pageSize;
  756. },
  757. refreshChange() {
  758. this.onLoad(this.page, this.query);
  759. },
  760. onLoad(page, params = {}) {
  761. this.loading = true;
  762. bfeesList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  763. const data = res.data.data;
  764. this.page.total = data.total;
  765. this.data = data.records;
  766. this.loading = false;
  767. this.selectionClear();
  768. });
  769. },
  770. // 类别弹窗关闭
  771. corpTypeClose(done) {
  772. done();
  773. // this.$confirm('确认关闭?')
  774. // .then(_ => {
  775. // done();
  776. // })
  777. // .catch(_ => { });
  778. },
  779. //自定义列保存
  780. async saveColumnTwo(ref, option, optionBack, code) {
  781. /**
  782. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  783. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  784. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  785. */
  786. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  787. if (inSave) {
  788. this.$message.success("保存成功");
  789. //关闭窗口
  790. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  791. }
  792. },
  793. //自定义列重置
  794. async resetColumnTwo(ref, option, optionBack, code) {
  795. this[option] = this[optionBack];
  796. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  797. if (inSave) {
  798. this.$message.success("重置成功");
  799. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  800. }
  801. },
  802. // 更改表格颜色
  803. headerClassName(tab) {
  804. //颜色间隔
  805. let back = "";
  806. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  807. if (tab.columnIndex % 2 === 0) {
  808. back = "back-one";
  809. } else if (tab.columnIndex % 2 === 1) {
  810. back = "back-two";
  811. }
  812. }
  813. return back;
  814. }
  815. }
  816. };
  817. </script>
  818. <style scoped>
  819. ::v-deep#out-table .back-one {
  820. background: #ecf5ff !important;
  821. }
  822. ::v-deep#out-table .back-two {
  823. background: #ecf5ff !important;
  824. }
  825. ::v-deep .el-input-group__append {
  826. padding: 0 0px !important;
  827. }
  828. </style>