paymentSettleDetailsPage.vue 27 KB

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