paymentSettleDetailsPage.vue 28 KB

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