main.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838
  1. <template>
  2. <div>
  3. <containerTitle title="费用明细"></containerTitle>
  4. <basic-container>
  5. <avue-crud
  6. ref="feeCrud"
  7. :data="feeData"
  8. :option="feeOption"
  9. @saveColumn="saveColumn"
  10. @resetColumn="resetColumn"
  11. @selection-change="selectionChange"
  12. :summary-method="summaryMethod"
  13. :cell-style="cellStyle"
  14. >
  15. <template slot="menuLeft">
  16. <el-tabs v-model="activeName" @tab-click="tabHandle">
  17. <el-tab-pane label="应收" name="first" :key="'first'">
  18. </el-tab-pane>
  19. <el-tab-pane label="应付" name="second" :key="'second'">
  20. </el-tab-pane>
  21. </el-tabs>
  22. <el-button
  23. type="primary"
  24. icon="el-icon-plus"
  25. size="small"
  26. @click.stop="rowAdd"
  27. :loading="buttonLoading"
  28. :disabled="disabled"
  29. >录入明细</el-button
  30. >
  31. <el-button
  32. type="warning"
  33. size="small"
  34. @click.stop="billingDetails('收费')"
  35. :loading="buttonLoading"
  36. :disabled="
  37. (financeDisabled && disabled) || selectionList.length == 0
  38. "
  39. v-if="selectTab === 1"
  40. >生成账单</el-button
  41. >
  42. <el-button
  43. type="warning"
  44. size="small"
  45. @click.stop="billingDetails('申请')"
  46. :loading="buttonLoading"
  47. :disabled="
  48. (financeDisabled && disabled) || selectionList.length == 0
  49. "
  50. v-if="selectTab === 2"
  51. >申请付费</el-button
  52. >
  53. </template>
  54. <template slot="menu" slot-scope="{ row, index }">
  55. <el-button
  56. size="small"
  57. icon="el-icon-edit"
  58. type="text"
  59. @click="rowCell(row, index)"
  60. :disabled="disabled"
  61. >{{ row.$cellEdit ? "保存" : "修改" }}</el-button
  62. >
  63. <el-button
  64. size="small"
  65. icon="el-icon-delete"
  66. type="text"
  67. @click="rowDel(row, index)"
  68. :disabled="disabled"
  69. >删 除</el-button
  70. >
  71. </template>
  72. <template slot="corpId" slot-scope="{ row, index }">
  73. <span v-if="row.$cellEdit" class="required_fields">*</span>
  74. <crop-select
  75. ref="corp"
  76. style="width: 90% !important;display: inline-block"
  77. v-if="row.$cellEdit"
  78. v-model="row.corpId"
  79. :cropIndex="index"
  80. @getCorpData="getCorpData"
  81. :treeType="optionType"
  82. corpType="KG"
  83. ></crop-select>
  84. <span v-else>{{ row.corpName }}</span>
  85. </template>
  86. <template slot="feeName" slot-scope="{ row }">
  87. <span v-if="row.$cellEdit" class="required_fields">*</span>
  88. <breakdown-select
  89. v-if="row.$cellEdit"
  90. v-model="row.itemId"
  91. @selectValue="value => selectValue(value, row)"
  92. :configuration="breakConfiguration"
  93. >
  94. </breakdown-select>
  95. <span v-else>{{ row.feeName }}</span>
  96. </template>
  97. <template slot="billNo" slot-scope="{ row }">
  98. <el-select
  99. v-if="row.$cellEdit"
  100. v-model="row.billNo"
  101. size="small"
  102. filterable
  103. allow-create
  104. default-first-option
  105. clearable
  106. >
  107. <el-option
  108. v-for="(item, index) in billNoList"
  109. :key="index"
  110. :label="item"
  111. :value="item"
  112. >
  113. </el-option>
  114. </el-select>
  115. <span v-else>{{ row.billNo }}</span>
  116. </template>
  117. <template slot="price" slot-scope="{ row }">
  118. <el-input
  119. v-if="row.$cellEdit"
  120. v-model="row.price"
  121. placeholder="请输入"
  122. size="small"
  123. @input="countChange(row)"
  124. ></el-input>
  125. <span v-else>{{ row.price | micrometerFormat }}</span>
  126. </template>
  127. <template slot="quantity" slot-scope="{ row }">
  128. <el-input
  129. v-if="row.$cellEdit"
  130. v-model="row.quantity"
  131. size="small"
  132. placeholder="请输入"
  133. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d\d\d\d\d).*$/, "$1.$2")'
  134. @input="countChange(row)"
  135. ></el-input>
  136. <span v-else>{{ row.quantity | IntegerFormat }}</span>
  137. </template>
  138. <template slot="amount" slot-scope="{ row }">
  139. <span>{{ row.amount | micrometerFormat }}</span>
  140. </template>
  141. <template slot="exchangeRate" slot-scope="{ row }">
  142. <el-input
  143. v-if="row.$cellEdit"
  144. v-model="row.exchangeRate"
  145. size="small"
  146. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'
  147. @change="rateChange(row)"
  148. placeholder="请输入"
  149. ></el-input>
  150. <span v-else>{{ row.exchangeRate }}</span>
  151. </template>
  152. <template slot="currency" slot-scope="{ row }">
  153. <el-select
  154. v-if="row.$cellEdit"
  155. v-model="row.currency"
  156. filterable
  157. allow-create
  158. default-first-option
  159. placeholder="请选择"
  160. size="small"
  161. @change="currencyChange(row)"
  162. >
  163. <el-option
  164. v-for="(item, index) in currencyList"
  165. :key="index"
  166. :label="item.dictValue"
  167. :value="item.dictValue"
  168. >
  169. </el-option>
  170. </el-select>
  171. <span v-else>{{ row.currency }}</span>
  172. </template>
  173. <template slot="unit" slot-scope="{ row }">
  174. <el-select
  175. v-if="row.$cellEdit"
  176. v-model="row.unit"
  177. filterable
  178. placeholder="请选择"
  179. size="small"
  180. >
  181. <el-option
  182. v-for="(item, index) in unitList"
  183. :key="index"
  184. :label="item.dictValue"
  185. :value="item.dictValue"
  186. >
  187. </el-option>
  188. </el-select>
  189. <span v-else>{{ row.unit }}</span>
  190. </template>
  191. </avue-crud>
  192. </basic-container>
  193. <el-dialog
  194. title="导入费用"
  195. append-to-body
  196. :visible.sync="feeDialog"
  197. top="5vh"
  198. width="60%"
  199. :close-on-click-modal="false"
  200. @closed="feeClose"
  201. class="el-dialogDeep"
  202. v-dialog-drag
  203. >
  204. <el-row style="height: 0;">
  205. <el-col :span="5">
  206. <div style="margin-top:45px">
  207. <el-scrollbar>
  208. <basic-container>
  209. <avue-tree
  210. :option="treeOption"
  211. :data="treeData"
  212. @node-click="nodeClick"
  213. />
  214. </basic-container>
  215. </el-scrollbar>
  216. </div>
  217. </el-col>
  218. <el-col :span="19">
  219. <avue-crud
  220. :option="option"
  221. :table-loading="loading"
  222. :data="data"
  223. ref="crud"
  224. @refresh-change="refreshChange"
  225. @selection-change="selectionChange"
  226. @current-change="currentChange"
  227. @size-change="sizeChange"
  228. :page.sync="page"
  229. @on-load="onLoad"
  230. :cell-style="cellStyle"
  231. >
  232. </avue-crud>
  233. </el-col>
  234. </el-row>
  235. <div class="dialogButton">
  236. <el-button @click="feeDialog = false">取 消</el-button>
  237. <el-button
  238. type="primary"
  239. @click="importData"
  240. :disabled="this.selectionList.length == 0"
  241. >
  242. 导入
  243. </el-button>
  244. </div>
  245. </el-dialog>
  246. <crop-dialog ref="cropDialog" @importCorp="importCorp"></crop-dialog>
  247. </div>
  248. </template>
  249. <script>
  250. import feeOption from "./config/feeInfo.json";
  251. import option from "./config/feeList.json";
  252. import { getDeptLazyTree, customerList } from "@/api/basicData/basicFeesDesc";
  253. import { delItem } from "@/api/feeInfo/fee-info";
  254. import { isPercentage, micrometerFormat, IntegerFormat } from "@/util/validate";
  255. import cropDialog from "@/components/crop-dialog/main";
  256. import _ from "lodash";
  257. import ApplyPayment from "../finance/applyPayment";
  258. import {
  259. applyLoan,
  260. paymentApply
  261. } from "@/api/financialManagement/paymentRequest";
  262. import { contrastList } from "@/util/contrastData";
  263. import { allCropList } from "@/api/basicData/customerInformation";
  264. import { getCustomerCode, getCustomerName } from "@/enums/management-type";
  265. export default {
  266. name: "feeInfo",
  267. data() {
  268. return {
  269. option: option,
  270. feeOption: {},
  271. feeDialog: false,
  272. buttonLoading: false,
  273. treeOption: {
  274. nodeKey: "id",
  275. lazy: true,
  276. treeLoad: function(node, resolve) {
  277. const parentId = node.level === 0 ? 0 : node.data.id;
  278. getDeptLazyTree(parentId).then(res => {
  279. resolve(
  280. res.data.data.map(item => {
  281. return {
  282. ...item,
  283. leaf: !item.hasChildren
  284. };
  285. })
  286. );
  287. });
  288. },
  289. addBtn: false,
  290. menu: false,
  291. size: "small",
  292. props: {
  293. labelText: "标题",
  294. label: "title",
  295. value: "value",
  296. children: "children"
  297. }
  298. },
  299. page: {
  300. pageSize: 10,
  301. currentPage: 1,
  302. total: 0
  303. },
  304. treeDeptId: null,
  305. loading: false,
  306. receivableButton: "primary",
  307. copeWithButton: "",
  308. data: [],
  309. feeData: [],
  310. selectionList: [],
  311. reData: null,
  312. currencyList: [],
  313. unitList: [],
  314. breakConfiguration: {
  315. multipleChoices: false,
  316. multiple: false,
  317. disabled: false,
  318. searchShow: true,
  319. collapseTags: false,
  320. clearable: true,
  321. placeholder: "请点击右边按钮选择",
  322. dicData: []
  323. },
  324. allData: [],
  325. data_one: [],
  326. data_two: [],
  327. selectTab: 1,
  328. activeName: "first",
  329. enableName: "first",
  330. tab1: true,
  331. tab2: false,
  332. corpList: []
  333. };
  334. },
  335. props: {
  336. orderFeesList: {
  337. type: Array
  338. },
  339. disabled: {
  340. type: Boolean
  341. },
  342. feeUrl: {
  343. type: String
  344. },
  345. billUrl: {
  346. type: String
  347. },
  348. optionType: {
  349. type: String
  350. },
  351. itemType: {
  352. type: String
  353. },
  354. srcType: {
  355. type: Number,
  356. default: 2
  357. },
  358. corpId: {
  359. type: String
  360. },
  361. billNoList: {
  362. type: Array
  363. },
  364. financeDisabled: {
  365. type: Boolean,
  366. default: true
  367. }
  368. },
  369. filters: {
  370. isPercentage(val) {
  371. return isPercentage(val);
  372. },
  373. micrometerFormat(val) {
  374. return micrometerFormat(val);
  375. },
  376. decimalFormat(num) {
  377. return num ? Number(num).toFixed(2) : "0.00";
  378. },
  379. IntegerFormat(num) {
  380. return IntegerFormat(num);
  381. }
  382. },
  383. async created() {
  384. this.feeOption = await this.getColumnData(
  385. this.getColumnName(33),
  386. feeOption
  387. );
  388. if (this.$store.getters.userInfo.tenant_id === "888390") {
  389. this.feeOption.column.forEach(item => {
  390. if (item.prop === "billNo") {
  391. item.hide = false;
  392. }
  393. });
  394. }
  395. this.getWorkDicts("currency").then(res => {
  396. this.currencyList = res.data.data;
  397. });
  398. this.getWorkDicts("unit").then(res => {
  399. this.unitList = res.data.data;
  400. });
  401. allCropList({
  402. corpType: getCustomerCode("KG")
  403. }).then(res => {
  404. this.corpList = res.data.data;
  405. });
  406. },
  407. components: {
  408. cropDialog,
  409. ApplyPayment
  410. },
  411. watch: {
  412. orderFeesList(newVla, oldVal) {
  413. if (newVla !== oldVal) {
  414. this.allData = newVla;
  415. this.data_one = newVla.filter(item => item.feesType === 1); //应收
  416. this.data_two = newVla.filter(item => item.feesType === 2); //应付
  417. if (this.selectTab === 1) {
  418. this.feeData = this.data_one;
  419. } else {
  420. this.feeData = this.data_two;
  421. }
  422. }
  423. },
  424. activeName(newVla, oldVal) {
  425. if (newVla !== oldVal) {
  426. if (newVla === "first") {
  427. this.tab1 = true;
  428. this.tab2 = false;
  429. this.data_two = this.feeData;
  430. this.selectTab = 1;
  431. this.feeData = this.data_one;
  432. } else {
  433. this.tab1 = false;
  434. this.tab2 = true;
  435. this.data_one = this.feeData;
  436. this.selectTab = 2;
  437. this.feeData = this.data_two;
  438. }
  439. }
  440. }
  441. },
  442. methods: {
  443. //选择费用
  444. selectValue(value, row) {
  445. this.$set(row, "feeName", value.cname);
  446. this.$set(row, "ename", value.ename);
  447. this.currencyChange(row);
  448. },
  449. //选择应收应付
  450. // handleClick(tab){
  451. // if(tab.name === "first"){
  452. // this.tab1 = true;
  453. // this.tab2 = false;
  454. //
  455. // this.data_two = this.feeData
  456. //
  457. // this.selectTab = 1
  458. // this.feeData = this.data_one
  459. // }else{
  460. // this.tab1 = false;
  461. // this.tab2 = true;
  462. //
  463. // this.data_one = this.feeData
  464. //
  465. // this.selectTab = 2
  466. // this.feeData = this.data_two
  467. // }
  468. // },
  469. cellStyle() {
  470. return "padding:0;height:40px;";
  471. },
  472. importCorp(row) {
  473. this.feeData.push({
  474. itemId: null,
  475. corpId: row.id,
  476. corpName: row.name,
  477. ename: null,
  478. feeName: null,
  479. price: null,
  480. unit: null,
  481. quantity: null,
  482. amount: null,
  483. currency: "CNY",
  484. exchangeRate: 1,
  485. remarks: null,
  486. $cellEdit: true,
  487. feesType: this.selectTab
  488. });
  489. },
  490. //带出汇率
  491. currencyChange(row) {
  492. this.currencyList.forEach(item => {
  493. if (item.dictValue === row.currency) {
  494. this.$set(row, "exchangeRate", item.remark);
  495. }
  496. });
  497. },
  498. rowDel(row, index) {
  499. this.$confirm("确定删除数据?", {
  500. confirmButtonText: "确定",
  501. cancelButtonText: "取消",
  502. type: "warning"
  503. }).then(() => {
  504. //费用判断是否需要调用删除接口
  505. if (row.id) {
  506. delItem(row.id, this.feeUrl).then(res => {
  507. this.$message({
  508. type: "success",
  509. message: "删除成功!"
  510. });
  511. this.feeData.splice(index, 1);
  512. });
  513. } else {
  514. this.$message({
  515. type: "success",
  516. message: "删除成功!"
  517. });
  518. this.feeData.splice(index, 1);
  519. }
  520. });
  521. },
  522. getCorpData(row) {
  523. console.log(row);
  524. this.feeData[row.index].corpName = row.cname;
  525. },
  526. countChange(row) {
  527. if (row.price && row.quantity) {
  528. row.amount = _.multiply(row.quantity, row.price).toFixed(2);
  529. }
  530. },
  531. rateChange(row) {
  532. if (row.exchangeRate >= 100) {
  533. row.exchangeRate = 0;
  534. this.$message.error("汇率不能超过100%");
  535. }
  536. },
  537. currentChange(val) {
  538. this.page.currentPage = val;
  539. },
  540. sizeChange(val) {
  541. this.page.currentPage = 1;
  542. this.page.pageSize = val;
  543. },
  544. //刷新
  545. refreshChange() {
  546. this.page.currentPage = 1;
  547. this.onLoad(this.page);
  548. },
  549. //多选
  550. selectionChange(list) {
  551. this.selectionList = list;
  552. },
  553. rePick(row, index) {
  554. this.reData = {
  555. ...row,
  556. index: index
  557. };
  558. this.feeDialog = true;
  559. this.onLoad(this.page);
  560. },
  561. //费用编辑
  562. rowCell(row, index) {
  563. if (row.$cellEdit == true) {
  564. this.$set(row, "$cellEdit", false);
  565. } else {
  566. this.$set(row, "$cellEdit", true);
  567. }
  568. },
  569. //新增
  570. rowAdd() {
  571. if (this.optionType == "CK") {
  572. this.$refs.feeCrud.rowCellAdd({});
  573. } else {
  574. if (this.optionType != "CK") {
  575. if (!this.corpId) return this.$message.error("请选择往来单位");
  576. }
  577. if (this.$store.getters.userInfo.tenant_id === "888390") {
  578. this.$emit("getBillNo");
  579. }
  580. let corpName = this.corpList.find(item => this.corpId == item.id).cname;
  581. const params = {
  582. feesType: this.selectTab,
  583. corpId: this.corpId,
  584. corpName: corpName
  585. };
  586. this.$refs.feeCrud.rowCellAdd(params);
  587. }
  588. },
  589. onLoad(page) {
  590. this.loading = true;
  591. let data = {
  592. size: page.pageSize,
  593. current: page.currentPage,
  594. parentId: 0,
  595. feesTypeId: this.treeDeptId
  596. };
  597. customerList(data).then(res => {
  598. const data = res.data.data;
  599. this.page.total = data.total;
  600. this.data = data.records;
  601. this.loading = false;
  602. if (this.page.total) {
  603. this.option.height = window.innerHeight - 350;
  604. }
  605. });
  606. },
  607. //导入页左费用类型查询
  608. nodeClick(data) {
  609. this.treeDeptId = data.id;
  610. this.page.currentPage = 1;
  611. this.onLoad(this.page);
  612. },
  613. feeClose() {
  614. this.selectionList = [];
  615. this.page = {
  616. pageSize: 10,
  617. currentPage: 1,
  618. total: 0
  619. };
  620. this.treeDeptId = null;
  621. this.loading = false;
  622. this.data = [];
  623. this.reData = null;
  624. },
  625. importData() {
  626. if (this.reData) {
  627. this.selectionList.length;
  628. if (this.selectionList.length != 1) {
  629. return this.$message.error("重新选择的时候只能选择一条数据");
  630. } else {
  631. this.selectionList.forEach(e => {
  632. this.feeData.forEach((item, index) => {
  633. if (index == this.reData.index) {
  634. item.itemId = e.id;
  635. item.corpId = this.reData.corpId;
  636. item.feeName = e.cname;
  637. item.price = this.reData.price;
  638. // item.unit = e.unitno;
  639. item.quantity = this.reData.quantity;
  640. item.amount = this.reData.amount;
  641. item.remarks = this.reData.remarks;
  642. item.$cellEdit = true;
  643. }
  644. });
  645. });
  646. }
  647. } else {
  648. this.selectionList.forEach(e => {
  649. this.feeData.push({
  650. itemId: e.id,
  651. corpId: null,
  652. feeName: e.cname,
  653. price: 0,
  654. // unit: e.unitno,
  655. quantity: 0,
  656. amount: 0,
  657. remarks: null,
  658. $cellEdit: true
  659. });
  660. });
  661. }
  662. this.feeDialog = false;
  663. },
  664. submitData() {
  665. let list = [];
  666. //保存时 将所出的tab页数据赋值到相应 data上
  667. if (this.selectTab === 1) {
  668. this.data_one = this.feeData;
  669. } else {
  670. this.data_two = this.feeData;
  671. }
  672. list.push(...this.data_one, ...this.data_two);
  673. return list;
  674. },
  675. billingDetails(type) {
  676. //查看是否改动过数据
  677. this.$emit("beforeFinance", this.submitData(), params => {
  678. if (params.valid) {
  679. for (let i = 0; i < this.selectionList.length; i++) {
  680. if (this.selectionList[i].corpId != this.selectionList[0].corpId) {
  681. return this.$message.error("批量操作结算单位必须一致");
  682. }
  683. if (this.selectionList[i].isCheck == 1) {
  684. return this.$message.error(
  685. "选中的数据已" + type + ",请勿重复操作!"
  686. );
  687. }
  688. }
  689. this.selectionList.map(item => {
  690. // item.url = this.billUrl
  691. item.srcOrderno = params.srcOrderno;
  692. item.srcParentId = params.parentId;
  693. item.corpsName = item.corpName;
  694. item.srcFeesId = item.id;
  695. item.costType = item.itemId;
  696. item.itemType = this.itemType;
  697. item.optionType = this.optionType;
  698. item.srcType = this.srcType; //费用明细申请
  699. item.tradeType = this.optionType;
  700. });
  701. let data = {
  702. billType: type,
  703. itemsList: this.selectionList
  704. };
  705. if (type === "申请") {
  706. this.$confirm("您确定申请付费吗?", "提示", {
  707. confirmButtonText: "确定",
  708. cancelButtonText: "取消",
  709. type: "warning"
  710. }).then(() => {
  711. this.buttonLoading = true;
  712. data.checkType = "ffsq";
  713. data.url = "/financialManagement/paymentRequest/index";
  714. data.pageStatus = "this.$store.getters.pqStatus";
  715. data.pageLabel = "付费申请";
  716. applyLoan(data)
  717. .then(res => {
  718. if (res.data.success) {
  719. this.$message.success("操作成功!");
  720. this.$emit("afterFinance");
  721. //跳转付费申请页面
  722. // if(this.$store.getters.pqStatus){
  723. // this.$alert("无法自动跳转,因为付费申请页面已存在!", "温馨提示", {
  724. // confirmButtonText: "确定",
  725. // type: 'warning',
  726. // callback: action => {
  727. // }
  728. // });
  729. // }else{
  730. // //关闭一下存在的列表页 跳转
  731. // this.$router.$avueRouter.closeTag('/financialManagement/paymentRequest/index');
  732. // this.$router.push({
  733. // path: "/financialManagement/paymentRequest/index",
  734. // query: {params: res.data.data.id},
  735. // });
  736. // }
  737. }
  738. })
  739. .finally(() => {
  740. this.buttonLoading = false;
  741. });
  742. });
  743. } else {
  744. this.$confirm("您确定生成账单吗?", "提示", {
  745. confirmButtonText: "确定",
  746. cancelButtonText: "取消",
  747. type: "warning"
  748. }).then(() => {
  749. this.buttonLoading = true;
  750. paymentApply(data)
  751. .then(res => {
  752. if (res.data.success) {
  753. this.$message.success("操作成功!");
  754. this.$emit("afterFinance");
  755. }
  756. })
  757. .finally(() => {
  758. this.buttonLoading = false;
  759. });
  760. });
  761. }
  762. }
  763. });
  764. },
  765. summaryMethod({ columns, data }) {
  766. const sums = [];
  767. if (columns.length > 0) {
  768. columns.forEach((item, index) => {
  769. sums[0] = "合计";
  770. if (item.property == "quantity" || item.property == "amount") {
  771. let qtySum = 0;
  772. let amountSum = 0;
  773. data.forEach(e => {
  774. qtySum = _.add(qtySum, Number(e.quantity));
  775. amountSum = _.add(amountSum, Number(e.amount));
  776. });
  777. //数量总计
  778. if (item.property == "quantity") {
  779. sums[index] = qtySum ? qtySum.toFixed(2) : "0.00";
  780. }
  781. //金额总计
  782. if (item.property == "amount") {
  783. sums[index] = micrometerFormat(amountSum);
  784. }
  785. }
  786. });
  787. }
  788. return sums;
  789. },
  790. async saveColumn() {
  791. const inSave = await this.saveColumnData(
  792. this.getColumnName(33),
  793. this.feeOption
  794. );
  795. if (inSave) {
  796. this.$message.success("保存成功");
  797. //关闭窗口
  798. this.$refs.feeCrud.$refs.dialogColumn.columnBox = false;
  799. }
  800. },
  801. async resetColumn() {
  802. const inSave = await this.delColumnData(
  803. this.getColumnName(33),
  804. feeOption
  805. );
  806. if (inSave) {
  807. this.$message.success("重置成功");
  808. this.feeOption = feeOption;
  809. //关闭窗口
  810. this.$refs.feeCrud.$refs.dialogColumn.columnBox = false;
  811. }
  812. },
  813. tabHandle(data) {
  814. // if (data.name == this.enableName) return
  815. // this.enableName = data.name
  816. }
  817. }
  818. };
  819. </script>
  820. <style lang="scss" scoped>
  821. .required_fields {
  822. color: #f56c6c;
  823. display: inline-block;
  824. width: 7%;
  825. }
  826. </style>