index.vue 25 KB

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