receiptSettleDetailsPage.vue 27 KB

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