receiptSettleDetailsPage.vue 29 KB

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