paymentSettleDetailsPage.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823
  1. <template>
  2. <div class="borderless">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList">返回列表
  7. </el-button>
  8. <div class="upper_right_button">
  9. <el-button type="primary" size="small" @click="editHandle" v-if="editDisable">编 辑</el-button>
  10. <el-button type="warning" class="el-button--small-yh" size="small" :loading="buttonLoading" v-if="form.id"
  11. :disabled="!form.id || editDisable" @click.stop="confirmSettlement">{{ financeDisabled ? "付费" : "撤销付费" }}
  12. </el-button>
  13. <el-button class="el-button--small-yh" type="primary" size="small" :loading="buttonLoading"
  14. @click.stop="saveSettlement" :disabled="editDisable">保存数据
  15. </el-button>
  16. </div>
  17. </div>
  18. </div>
  19. <div class="customer-main">
  20. <containerTitle title="基础信息"></containerTitle>
  21. <basic-container>
  22. <avue-form class="trading-form" ref="form" v-model="form" :option="option">
  23. <template slot="caseOverPayment">
  24. <el-input placeholder="请输入" clearable v-model="form.caseOverPayment" @change="caseOverPaymentChange"
  25. v-input-limit="2" :disabled="dataList.length == 0 || (!financeDisabled && form.id) || editDisable">
  26. </el-input>
  27. </template>
  28. <template slot="corpId">
  29. <crop-select v-model="form.corpId" corpType="KG" :disabled="(!financeDisabled && form.id) || editDisable"
  30. @getCorpData="returnBack" style="width: 100%"></crop-select>
  31. </template>
  32. <template slot="salesCompany">
  33. <crop-select v-model="form.salesCompany" corpType="GS"
  34. :disabled="(!financeDisabled && form.id) || editDisable" @getCorpData="getGSName" style="width: 100%">
  35. </crop-select>
  36. </template>
  37. <template slot="accountNo">
  38. <el-select v-model="form.accountNo" placeholder="请选择"
  39. :disabled="(!financeDisabled && form.id) || editDisable" @change="accountNoChange" clearable filterable>
  40. <el-option v-for="(item, index) in form.bankList" :key="index" :label="item.accountNo"
  41. :value="item.accountNo">
  42. </el-option>
  43. </el-select>
  44. </template>
  45. <template slot="remark">
  46. <el-input type="textarea" v-model="form.remark" size="small" rows="2" autocomplete="off" placeholder="">
  47. </el-input>
  48. </template>
  49. </avue-form>
  50. </basic-container>
  51. <containerTitle title="明细列表"></containerTitle>
  52. <basic-container>
  53. <avue-crud :option="itemsOption" :data="dataList" ref="crud" v-model="itemsForm" :page.sync="page"
  54. :cell-style="cellStyle" @search-reset="searchReset" @row-update="rowUpdate"
  55. @selection-change="selectionChange">
  56. <template slot="menuLeft">
  57. <el-button type="primary" size="small" :loading="buttonLoading" icon="el-icon-shopping-cart-2"
  58. :disabled="!financeButton || editDisable" @click="selectPurchase">选择采购合同
  59. </el-button>
  60. <el-button class="el-icon-download" type="info" size="small" :disabled="!form.id" @click="openReport">报表打印</el-button>
  61. </template>
  62. <template slot-scope="{ row,index }" slot="menu">
  63. <el-button type="text" size="small" icon="el-icon-edit" :disabled="!financeButton || editDisable"
  64. @click.stop="rowCell(row,index)"> {{row.$cellEdit ? '修改完成' : '修改' }}
  65. </el-button>
  66. <el-button type="text" size="small" icon="el-icon-delete" :disabled="!financeButton || editDisable"
  67. @click.stop="rowDel(row,index)">删除
  68. </el-button>
  69. </template>
  70. <template slot="srcOrderno" slot-scope="scope">
  71. <span style="color: #409EFF;cursor: pointer"
  72. @click="jumpPage(scope.row, scope.index)">{{ scope.row.srcOrderno }}</span>
  73. </template>
  74. <template slot-scope="{ row }" slot="currency">
  75. <el-select v-if="row.$cellEdit" v-model="row.currency" size="small" placeholder="请选择 币别" clearable
  76. filterable>
  77. <el-option v-for="(item, index) in currencyDic" :key="index" :label="item.dictValue"
  78. :value="item.dictValue"></el-option>
  79. </el-select>
  80. <span v-else>{{ row.currency }}</span>
  81. </template>
  82. <template slot="thisAmount" slot-scope="{ row }">
  83. <span v-if="row.$cellEdit" class="required_fields">*</span>
  84. <el-input v-if="row.$cellEdit" v-model="row.thisAmount" style="width: 90%" placeholder="请输入" size="small"
  85. @input="thisAmountVerify(row)"
  86. oninput='this.value=this.value.replace(/[^(\d.)]/g,"").replace(/^(\d+)\.(\d\d).*$/, "$1.$2")'></el-input>
  87. <span v-else>{{ row.thisAmount }}</span>
  88. </template>
  89. </avue-crud>
  90. </basic-container>
  91. <el-dialog title="导入采购" append-to-body class="el-dialogDeep" :visible.sync="billDetailDialog" width="60%"
  92. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" top="10vh" v-dialog-drag>
  93. <bill-detail :params="params" :billType="billType" :flag="1" @closeFun="closeBillDetail"
  94. @importProMent="importProMent">
  95. </bill-detail>
  96. </el-dialog>
  97. <!-- 报表-->
  98. <report-dialog
  99. :switchDialog="switchDialog"
  100. :reportId="form.id"
  101. reportName="付款"
  102. @onClose="onClose()"
  103. />
  104. </div>
  105. </div>
  106. </template>
  107. <script>
  108. import option from "./configuration/detailsPage.json";
  109. import { getDetail} from "@/api/financialManagement/financialManagement"
  110. import { getDetails, modify, cancelModify, saveOrEdit, deleteDetail } from "@/api/financialManagement/paymentRequest";
  111. import { contrastObj, contrastList } from "@/util/contrastData";
  112. import billDetail from "@/components/bill/billDetails";
  113. import { getlistBankBy } from "@/api/financialManagement/paymentRequest";
  114. import { getlistBankBy as GYSGetBank } from "@/api/basicData/configuration"
  115. import _ from "lodash";
  116. import { getUserInfo } from "@/api/system/user";
  117. import { getCorpDetail } from "@/api/maintenance/overpayment";
  118. import reportDialog from "@/components/report-dialog/main.vue";
  119. export default {
  120. name: "paymentDetailsPage",
  121. props: {
  122. detailData: {
  123. type: Object
  124. }
  125. },
  126. data() {
  127. return {
  128. form: {},
  129. switchDialog:false,
  130. itemsForm: {},
  131. itemsOption: option,
  132. billDetailDialog: false,
  133. buttonLoading: false,
  134. financeDisabled: false,
  135. financeButton: true,
  136. billType: "申请",
  137. params: {},
  138. id: "",
  139. dataList: [],
  140. currencyDic: [],
  141. page: {
  142. pageSize: 10,
  143. pagerCount: 5,
  144. total: 0,
  145. },
  146. query: {},
  147. option: {
  148. menuBtn: false,
  149. labelWidth: 100,
  150. column: [
  151. {
  152. label: '所属公司',
  153. prop: 'salesCompany',
  154. sort: true,
  155. span: 8,
  156. rules: [
  157. {
  158. required: true,
  159. message: ' ',
  160. trigger: 'blur'
  161. }
  162. ]
  163. },
  164. {
  165. label: '合同号',
  166. prop: 'srcOrderno',
  167. span: 8,
  168. rules: [
  169. {
  170. required: false,
  171. message: ' ',
  172. trigger: 'blur'
  173. }
  174. ]
  175. },
  176. {
  177. label: '系统号',
  178. prop: 'sysNo',
  179. span: 8,
  180. disabled: true
  181. },
  182. {
  183. label: '银行账号',
  184. prop: 'accountNo',
  185. span: 8,
  186. rules: [
  187. {
  188. required: false,
  189. message: ' ',
  190. trigger: 'blur'
  191. }
  192. ]
  193. },
  194. {
  195. label: '开户银行',
  196. prop: 'accountBank',
  197. span: 8,
  198. rules: [
  199. {
  200. required: false,
  201. message: ' ',
  202. trigger: 'blur'
  203. }
  204. ]
  205. }, {
  206. label: '银行户头',
  207. prop: 'accountName',
  208. span: 8,
  209. rules: [
  210. {
  211. required: false,
  212. message: ' ',
  213. trigger: 'blur'
  214. }
  215. ]
  216. }, {
  217. label: '科目编码',
  218. prop: 'subjectNumber',
  219. span: 8,
  220. rules: [
  221. {
  222. required: false,
  223. message: ' ',
  224. trigger: 'blur'
  225. }
  226. ]
  227. },
  228. {
  229. label: '往来单位',
  230. prop: 'corpId',
  231. sort: true,
  232. span: 8,
  233. rules: [
  234. {
  235. required: true,
  236. message: ' ',
  237. trigger: 'blur'
  238. }
  239. ]
  240. },
  241. {
  242. label: '付款日期',
  243. prop: 'settlementDate',
  244. format: "yyyy-MM-dd",
  245. valueFormat: "yyyy-MM-dd 00:00:00",
  246. span: 8,
  247. type: "date",
  248. rules: [
  249. {
  250. required: true,
  251. message: ' ',
  252. trigger: 'blur'
  253. }
  254. ]
  255. },
  256. {
  257. label: '制单人',
  258. prop: 'createUserName',
  259. span: 8,
  260. disabled: true,
  261. rules: [
  262. {
  263. required: false,
  264. message: ' ',
  265. trigger: 'blur'
  266. }
  267. ]
  268. },
  269. {
  270. label: '人民币金额',
  271. prop: 'amount',
  272. span: 8,
  273. rules: [
  274. {
  275. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  276. message: ' ',
  277. trigger: 'blur'
  278. },
  279. {
  280. required: false,
  281. message: ' ',
  282. trigger: 'blur'
  283. }
  284. ]
  285. },
  286. {
  287. label: '外币金额',
  288. prop: 'foreignAmount',
  289. span: 8,
  290. rules: [
  291. {
  292. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  293. message: ' ',
  294. trigger: 'blur'
  295. }
  296. ]
  297. },
  298. {
  299. label: '使用溢付款',
  300. prop: 'caseOverPayment',
  301. display: false,
  302. span: 8,
  303. rules: [
  304. {
  305. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  306. message: ' ',
  307. trigger: 'blur'
  308. }
  309. ]
  310. },
  311. {
  312. label: '溢付款余额',
  313. prop: 'overPayment',
  314. display: false,
  315. disabled: true,
  316. span: 8,
  317. rules: [
  318. {
  319. pattern: /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
  320. message: ' ',
  321. trigger: 'blur'
  322. }
  323. ]
  324. },
  325. {
  326. label: '制单日期',
  327. prop: 'createTime',
  328. span: 8,
  329. type: "date",
  330. disabled: true,
  331. rules: [
  332. {
  333. required: false,
  334. message: ' ',
  335. trigger: 'blur'
  336. }
  337. ]
  338. },
  339. {
  340. label: '备注',
  341. prop: 'remark',
  342. span: 24,
  343. minRows: 2,
  344. rules: [
  345. {
  346. required: false,
  347. message: ' ',
  348. trigger: 'blur'
  349. }
  350. ]
  351. },
  352. ],
  353. },
  354. financeStatusDic: [{
  355. label: '正常',
  356. value: 0
  357. }, {
  358. label: '停用',
  359. value: 1
  360. }],
  361. //顶部from数据
  362. oldForm: {},
  363. oldDataList: [],
  364. category: '',
  365. allAmount: 0,
  366. editDisable: false,
  367. }
  368. },
  369. components: {
  370. billDetail,reportDialog
  371. },
  372. created() {
  373. // 人民币金额默认为0
  374. this.$set(this.form, "amount", 0)
  375. getUserInfo().then(res => {
  376. this.category = res.data.data.billType
  377. if (this.category == 2) {
  378. this.$set(this.form, "overPayment", 0)
  379. this.$set(this.form, "caseOverPayment", 0)
  380. this.option.column.forEach(item => {
  381. if (item.prop == 'caseOverPayment' || item.prop == 'overPayment') {
  382. item.display = true
  383. }
  384. if (item.prop == 'foreignAmount') {
  385. item.display = false
  386. }
  387. })
  388. }
  389. })
  390. //币别
  391. this.getWorkDicts("currency").then(res => {
  392. this.currencyDic = res.data.data
  393. })
  394. this.detailData.disabled && (this.editDisable = true)
  395. if (this.detailData.id) {
  396. this.buttonLoading = true
  397. this.id = this.detailData.id;//字符串转数字 超长用BigInt
  398. getDetail(this.id).then(res => {
  399. this.afterEcho(res.data.data)
  400. }).finally(() => {
  401. this.buttonLoading = false
  402. })
  403. } else {
  404. this.form.financeStatus = "待结算"
  405. this.oldForm.financeStatus = "待结算"
  406. }
  407. if (this.detailData.params) {
  408. this.buttonLoading = true
  409. getDetails(this.detailData.params).then(res => {
  410. delete res.data.data.id;
  411. delete res.data.data.sysNo;
  412. delete res.data.data.billType;
  413. res.data.data.itemsList.map((items) => {
  414. delete items.id;
  415. items.thisAmount = items.amount
  416. })
  417. this.afterEcho(res.data.data)
  418. }).finally(() => {
  419. this.buttonLoading = false
  420. })
  421. }
  422. },
  423. mounted() {
  424. },
  425. methods: {
  426. // 报表
  427. openReport() {
  428. this.switchDialog = !this.switchDialog;
  429. },
  430. // 报表关闭
  431. onClose(val) {
  432. this.switchDialog = val;
  433. },
  434. //选择客户
  435. returnBack(corpValue) {
  436. this.corpId = corpValue.id
  437. if (this.category != 2) {
  438. getlistBankBy(corpValue.id).then(res => {
  439. this.$set(this.form, "bankList", res.data)
  440. })
  441. }
  442. // 溢付款余额获取
  443. if (this.category == 2) {
  444. getCorpDetail({ corpId: corpValue.id }).then(res => {
  445. this.form.overPayment = res.data.data ? res.data.data.balanceOverpaymen : 0
  446. })
  447. }
  448. },
  449. //选择卡号
  450. accountNoChange(value) {
  451. let isTrue = false
  452. this.form.bankList.forEach(item => {
  453. if (item.accountNo == value) {
  454. this.$set(this.form, "accountBank", item.accountBank)
  455. this.$set(this.form, "accountName", item.accountName)
  456. this.$set(this.form, "subjectNumber", item.subjectNumber)
  457. isTrue = true
  458. }
  459. })
  460. this.$nextTick(() => {
  461. if (!isTrue) {
  462. this.$set(this.form, 'accountBank', null)
  463. this.$set(this.form, 'accountName', null)
  464. this.$set(this.form, "subjectNumber", null)
  465. }
  466. })
  467. },
  468. //本次金额验证
  469. thisAmountVerify(row) {
  470. if (parseFloat(row.thisAmount) > parseFloat(row.amount)) {
  471. this.$message.warning('本次金额不得大于金额!')
  472. this.$set(row, 'thisAmount', '')
  473. }
  474. },
  475. selectPurchase() {
  476. if (!this.form.corpId) {
  477. this.$message.warning("请先选择客户!")
  478. return
  479. }
  480. this.params = {
  481. corpId: this.form.corpId
  482. }
  483. this.billDetailDialog = true;
  484. },
  485. closeBillDetail() {
  486. this.billDetailDialog = false;
  487. },
  488. importProMent(list) {
  489. list.forEach((item, index) => {
  490. item.accId = item.id;
  491. item.srcOrderno = item.accSysNo
  492. item.billNo = item.srcBillNo
  493. item.thisAmount = item.amount
  494. delete item.id;
  495. this.$refs.crud.rowCellAdd(item);
  496. })
  497. this.$set(this.form, 'srcOrderno', Array.from(new Set(this.dataList.map(item => { if (item.srcOrderno) { return item.srcOrderno } }))).join(','))
  498. this.billDetailDialog = false;
  499. },
  500. rowUpdate(row, index, done) {
  501. done(row);
  502. },
  503. rowCell(row, index) {
  504. if (row.$cellEdit == true) {
  505. this.$set(row, "$cellEdit", false);
  506. } else {
  507. this.$set(row, "$cellEdit", true);
  508. }
  509. // row.$cellEdit = !row.$cellEdit
  510. },
  511. rowDel(row, index) {
  512. if (row.id) {
  513. deleteDetail({ids: row.id}).then(res => {
  514. this.$message({
  515. type: "success",
  516. message: "操作成功!"
  517. });
  518. this.dataList.splice(index, 1);
  519. })
  520. } else {
  521. this.dataList.splice(index, 1);
  522. }
  523. },
  524. searchReset() {
  525. console.log('1')
  526. },
  527. selectionChange() {
  528. console.log('1')
  529. },
  530. confirmSettlement(status) {
  531. this.$refs["form"].validate((valid, done) => {
  532. done();
  533. if (valid && this.verificationData('付费')) {
  534. this.$confirm("是否确认" + (this.financeDisabled ? '付费' : '撤销付费'), "提示", {
  535. confirmButtonText: "确认",
  536. cancelButtonText: "取消",
  537. type: "warning",
  538. }).then(() => {
  539. for (let i = 0; i < this.dataList.length; i++) {
  540. if (this.dataList[i].thisAmount == null || this.dataList[i].thisAmount == 0) {
  541. return this.$message.error(`第${i + 1}行的本次金额不能为空`);
  542. }
  543. }
  544. this.form.billNo = this.dataList.map(item => { return item.billNo }).join(",")
  545. if (this.category == 2 && this.financeDisabled) {
  546. this.allAmount = 0;
  547. this.form.amount = this.form.amount ? this.form.amount : 0
  548. this.dataList.forEach(e => {
  549. this.allAmount = Number(this.allAmount) + Number(e.thisAmount)
  550. })
  551. if (this.allAmount == 0 && this.form.amount == 0) {
  552. return this.$message.error('人民币金额不能为空')
  553. } else if (Number(this.allAmount) > 0 && (Number(this.form.amount) > Number(this.allAmount))) {
  554. this.form.caseOverPayment = 0;
  555. } else if (Number(this.allAmount) > 0 && (Number(this.form.amount) < Number(this.allAmount))) {
  556. this.form.caseOverPayment = Number(this.allAmount) - Number(this.form.amount)
  557. if (Number(this.form.caseOverPayment) > Number(this.form.overPayment)) {
  558. return this.$message.error('溢付款余额不足,无法付费')
  559. }
  560. }
  561. }
  562. const params = {
  563. ...this.form,
  564. billType: "付费",
  565. itemsList: this.dataList
  566. }
  567. this.buttonLoading = true
  568. if (this.financeButton) {
  569. modify(params).then(res => {
  570. this.$message.success("操作成功!")
  571. this.afterEcho(res.data.data)
  572. }).finally(() => {
  573. this.buttonLoading = false
  574. })
  575. } else {
  576. cancelModify(params).then(res => {
  577. this.$message.success("操作成功!")
  578. this.afterEcho(res.data.data)
  579. }).finally(() => {
  580. this.buttonLoading = false
  581. })
  582. }
  583. })
  584. if (status === true) {
  585. this.$emit("goBack");
  586. this.leaveDetailsKey(this.$route.name)
  587. }
  588. }
  589. })
  590. },
  591. saveSettlement(type) {
  592. this.$refs["form"].validate((valid, done) => {
  593. if (valid) {
  594. for (let i = 0; i < this.dataList.length; i++) {
  595. if (this.dataList[i].thisAmount == (null || "")) {
  596. return this.$message.error(`第输入${i + 1}行的本次金额`);
  597. }
  598. }
  599. this.buttonLoading = true
  600. this.form.billNo = this.dataList.map(item => { return item.billNo }).join(",")
  601. const params = {
  602. ...this.form,
  603. billType: "付费",
  604. itemsList: this.dataList,
  605. settlementType: 1
  606. }
  607. // 如果有id解锁,没有跳过
  608. // this.form.id && this.unLock({moduleName: 'ff',tableName: 'finance_settlement', billId: this.form.id})
  609. saveOrEdit(params).then(res => {
  610. this.$message.success("操作成功!")
  611. // this.detailData.disabled = true
  612. // this.editDisable = true
  613. this.afterEcho(res.data.data, type)
  614. done();
  615. }).finally(() => {
  616. this.buttonLoading = false
  617. })
  618. }
  619. })
  620. },
  621. async afterEcho(data, type) {
  622. this.form = data;
  623. this.financeDisabled = this.form.financeStatus == "待结算" ? true : false;
  624. if (this.category == 2) {
  625. await getCorpDetail({ corpId: this.form.corpId }).then(res => {
  626. if (Number(this.form.overPayment) != (res.data.data ? res.data.data.balanceOverpaymen : '0.00')) {
  627. this.form.overPayment = res.data.data ? res.data.data.balanceOverpaymen : '0.00'
  628. }
  629. })
  630. }
  631. this.oldForm = Object.assign({}, this.form);
  632. //审核状态为空时 说明为新单进来
  633. if (this.financeDisabled || !this.editDisable) {
  634. this.financeButton = true
  635. this.option.column.forEach(item => {
  636. if (item.prop === "remark" || item.prop === "settlementDate") {
  637. this.$set(item, "disabled", false)
  638. } else if (item.prop === "createUserName" || item.prop === "createTime" || item.prop === "sysNo") {
  639. this.$set(item, "disabled", true)
  640. } else {
  641. this.$set(item, "disabled", false)
  642. }
  643. })
  644. }
  645. if (!this.financeDisabled || this.editDisable) {
  646. this.financeButton = false
  647. this.option.column.forEach(item => {
  648. if (item.prop === "remark") {
  649. this.$set(item, "disabled", false)
  650. } else if (item.prop === "createUserName" || item.prop === "createTime" || item.prop === "sysNo") {
  651. this.$set(item, "disabled", true)
  652. } else {
  653. this.$set(item, "disabled", true)
  654. }
  655. })
  656. }
  657. if (data.itemsList) {
  658. this.dataList = data.itemsList
  659. this.oldDataList = this.deepClone(data.itemsList)
  660. }
  661. if (type == '付费') {
  662. this.confirmSettlement()
  663. }
  664. },
  665. verificationData(type) {
  666. if (contrastObj(this.form, this.oldForm) || contrastList(this.dataList, this.oldDataList)
  667. ) {
  668. this.$confirm("数据发生变化,请先提交保存!", "提示", {
  669. confirmButtonText: "保存",
  670. cancelButtonText: "取消",
  671. type: "warning",
  672. }).then(() => {
  673. this.saveSettlement(type)
  674. }).catch(() => {
  675. return false
  676. })
  677. } else {
  678. return true
  679. }
  680. },
  681. backToList() {
  682. if (contrastObj(this.form, this.oldForm) || contrastList(this.dataList, this.oldDataList)
  683. ) {
  684. this.$confirm("是否保存当前页面?", "提示", {
  685. confirmButtonText: "保存",
  686. cancelButtonText: "取消",
  687. type: "warning",
  688. }).then(() => {
  689. this.saveSettlement()
  690. }).catch(() => {
  691. !this.editDisable && this.form.id && this.unLock({ moduleName: 'ff', tableName: 'finance_settlement', billId: this.form.id })
  692. this.$emit("goBack");
  693. this.leaveDetailsKey(this.$route.name)
  694. })
  695. } else {
  696. !this.editDisable && this.form.id && this.unLock({ moduleName: 'ff', tableName: 'finance_settlement', billId: this.form.id })
  697. this.$emit("goBack");
  698. this.leaveDetailsKey(this.$route.name)
  699. }
  700. },
  701. // 溢付款更改时
  702. caseOverPaymentChange() {
  703. if (!this.form.caseOverPayment) this.form.caseOverPayment = 0;
  704. if (Number(this.form.caseOverPayment) > Number(this.form.overPayment)) {
  705. this.form.caseOverPayment = 0;
  706. return this.$message.error('本次使用的溢付款不能超过总溢付款')
  707. }
  708. },
  709. editHandle() {
  710. const data = {
  711. moduleName: 'ff',
  712. tableName: 'finance_settlement',
  713. billId: this.form.id,
  714. no: localStorage.getItem('browserID'),
  715. billNo: this.form.srcOrderno
  716. }
  717. this.checkLock(data).then(res => {
  718. if (res.data.code == 200) {
  719. this.onLock(data).then(response => {
  720. })
  721. this.inDetailsKey(this.$route.name, {
  722. moduleName: 'ff',
  723. tableName: 'finance_settlement',
  724. billId: this.form.id,
  725. })
  726. this.detailData.disabled = false;
  727. this.editDisable = false;
  728. this.buttonLoading = true
  729. getDetail(this.form.id).then(data => {
  730. this.afterEcho(data.data.data)
  731. }).finally(() => {
  732. this.buttonLoading = false
  733. })
  734. }
  735. }).catch(error => {
  736. }).finally(() => {
  737. this.buttonLoading = false
  738. })
  739. },
  740. getGSName(row) {
  741. this.form.belongCompany = row.cname
  742. if (this.category == 2) {
  743. GYSGetBank(row.id).then(res => {
  744. this.$set(this.form, "bankList", res.data)
  745. console.log(res.data)
  746. if (this.form.bankList.length > 0) {
  747. this.form.accountNo = this.form.bankList[0].accountNo
  748. this.form.accountName = this.form.bankList[0].accountName
  749. this.form.accountBank = this.form.bankList[0].accountBank
  750. this.form.subjectNumber = this.form.bankList[0].subjectNumber
  751. }
  752. })
  753. }
  754. },
  755. cellStyle() {
  756. return "padding:0;height:40px;";
  757. },
  758. // 跳转页面
  759. jumpPage(row, index) {
  760. if (this.category == 2) {
  761. this.$router.$avueRouter.closeTag("/businessManagement/purchaseOrder/index");
  762. this.$router.push({
  763. path: "/businessManagement/purchaseOrder/index",
  764. query: {
  765. params: row.srcParentId
  766. },
  767. });
  768. } else if (this.category == 3) {
  769. this.$router.$avueRouter.closeTag("/purchase/contract/index");
  770. this.$router.push({
  771. path: "/purchase/contract/index",
  772. query: {
  773. params: row.srcParentId
  774. },
  775. });
  776. } else if (this.category == 4) {
  777. this.$router.$avueRouter.closeTag("/exportTrade/purchaseContract/index");
  778. this.$router.push({
  779. path: "/exportTrade/purchaseContract/index",
  780. query: {
  781. params: row.srcParentId
  782. },
  783. });
  784. }
  785. },
  786. }
  787. }
  788. </script>
  789. <style lang="scss" scoped>
  790. ::v-deep .el-form-item {
  791. margin-bottom: 0;
  792. }
  793. .trading-form ::v-deep .el-form-item {
  794. margin-bottom: 8px !important;
  795. }
  796. .required_fields {
  797. color: #F56C6C;
  798. display: inline-block;
  799. width: 7%
  800. }
  801. .upper_right_button {
  802. display: flex;
  803. position: fixed;
  804. right: 12px;
  805. top: 47px;
  806. }
  807. </style>