fee-infosimple.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839
  1. <template>
  2. <div>
  3. <avue-crud v-if="feeType == 'D' || feeType == 'All'" :option="optionD" :table-loading="loading"
  4. :data="form.feeCenterListD" id="out-table" ref="crudD" @selection-change="selectionDChange"
  5. @resetColumn="resetColumn('crudD', 'optionD', 'optionDBack', 385)"
  6. @saveColumn="saveColumn('crudD', 'optionD', 'optionDBack', 385)">
  7. <template slot="menuLeft">
  8. <div style="display: inline-block;margin-right: 20px" class="disabledBox fontSize">
  9. <i class="el-icon-coin"></i>
  10. <span>应收费用</span>
  11. </div>
  12. <!-- <el-button type="success" plain size="small" :disabled="disabled"
  13. @click="allClick('确认首款', 'D')">确认首款</el-button>
  14. <el-button type="primary" plain size="small" :disabled="disabled"
  15. @click="allClick('确认尾款', 'D')">确认尾款</el-button> -->
  16. </template>
  17. <template slot="index" slot-scope="{row,index}">
  18. <span>{{ index + 1 }}</span>
  19. </template>
  20. <template slot="corpCnName" slot-scope="{ row }">
  21. <dic-select v-if="row.$cellEdit" v-model="row.corpCnName" placeholder="往来单位" key="id" label="cnName"
  22. res="records" url="/blade-los/bcorps/listByType?corpTypeName=客户" :filterable="true" :remote="true" dataName="cnName"
  23. @selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
  24. <span v-else>{{ row.corpCnName }}</span>
  25. </template>
  26. <template slot="feeCnName" slot-scope="{ row }">
  27. <dic-select v-if="row.$cellEdit" v-model="row.feeCnName" placeholder="费用名称" key="id" label="cnName"
  28. res="records" url="/blade-los/bfees/list" :filterable="true" :remote="true" dataName="cnName"
  29. @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
  30. <span v-else>{{ row.feeCnName }}</span>
  31. </template>
  32. <template slot="unitNo" slot-scope="{ row }">
  33. <dic-select v-if="row.$cellEdit" v-model="row.unitNo" placeholder="收费标准" key="id" label="code"
  34. url="/blade-los/bunits/selectList" :filterable="true"
  35. @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
  36. <span v-else>{{ row.unitNo }}</span>
  37. </template>
  38. <tempalte slot="quantity" slot-scope="{ row }">
  39. <el-input-number v-if="row.$cellEdit" v-model="row.quantity" @change="countChange(row)" :controls="false"
  40. placeholder="请输入 数量" size="small" style="width: 100%;"></el-input-number>
  41. <span v-else>{{ row.quantity }}</span>
  42. </tempalte>
  43. <tempalte slot="price" slot-scope="{ row }">
  44. <el-input-number v-if="row.$cellEdit" v-model="row.price" @change="countChange(row)" :controls="false"
  45. placeholder="请输入 单价" size="small" style="width: 100%;"></el-input-number>
  46. <span v-else>{{ row.price }}</span>
  47. </tempalte>
  48. <template slot="curCode" slot-scope="{ row }">
  49. <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" key="id" label="code"
  50. :url="'/blade-los/bcurrency/getExrate?date=' + form.businessDate + '&dc=' + row.dc" :filterable="true"
  51. @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
  52. <span v-else>{{ row.curCode }}</span>
  53. </template>
  54. <tempalte slot="exrate" slot-scope="{ row }">
  55. <el-input-number v-if="row.$cellEdit" v-model="row.exrate" @change="countChange(row)" :controls="false"
  56. placeholder="请输入 汇率" size="small" style="width: 100%;"></el-input-number>
  57. <span v-else>{{ row.exrate }}</span>
  58. </tempalte>
  59. <tempalte slot="stlExrate" slot-scope="{ row }">
  60. <el-input-number v-if="row.$cellEdit" v-model="row.stlExrate" :controls="false" placeholder="请输入 结算汇率"
  61. size="small" style="width: 100%;"></el-input-number>
  62. <span v-else>{{ row.stlExrate }}</span>
  63. </tempalte>
  64. </avue-crud>
  65. <avue-crud v-if="feeType == 'C' || feeType == 'All'" style="margin-top: 10px;" :option="optionC"
  66. :table-loading="loading" :data="form.feeCenterListC" id="out-table" ref="crudC"
  67. @selection-change="selectionCChange" @resetColumn="resetColumn('crudC', 'optionC', 'optionCBack', 386)"
  68. @saveColumn="saveColumn('crudC', 'optionC', 'optionCBack', 386)">
  69. <template slot="menuLeft">
  70. <div style="display: inline-block;margin-right: 20px" class="disabledBox fontSize">
  71. <i class="el-icon-coin"></i>
  72. <span>应付费用</span>
  73. </div>
  74. <el-button type="info" plain size="small" :disabled="disabled"
  75. @click="allClick('一键保存', 'C')">一键保存</el-button>
  76. <el-button type="info" plain size="small" :disabled="disabled"
  77. @click="allClick('一键编辑', 'C')">一键编辑</el-button>
  78. <el-button type="danger" plain size="small" :disabled="disabled || selectionCList.length == 0"
  79. @click="allClick('批量删除', 'C')">批量删除</el-button>
  80. <!-- <el-button type="success" plain size="small" :disabled="disabled"
  81. @click="allClick('确认首款', 'C')">确认首款</el-button>
  82. <el-button type="primary" plain size="small" :disabled="disabled"
  83. @click="allClick('确认尾款', 'C')">确认尾款</el-button> -->
  84. </template>
  85. <template slot="indexHeader" slot-scope="{row,index}">
  86. <el-button type="primary" size="mini" icon="el-icon-plus" :disabled="disabled" circle @click="addRow('C')">
  87. </el-button>
  88. </template>
  89. <template slot="index" slot-scope="{row,index}">
  90. <span>{{ index + 1 }}</span>
  91. </template>
  92. <template slot="corpCnNameForm" slot-scope="{ row }">
  93. <dic-select v-if="row.$cellEdit" v-model="row.corpCnName" placeholder="往来单位" key="id" label="cnName"
  94. res="records" url="/blade-los/bcorps/listByType?corpTypeName=客户" :filterable="true" :remote="true" dataName="cnName"
  95. @selectChange="rowDicChange('corpCnName', $event, row)"></dic-select>
  96. <span v-else>{{ row.corpCnName }}</span>
  97. </template>
  98. <template slot="feeCnNameForm" slot-scope="{ row }">
  99. <dic-select v-if="row.$cellEdit" v-model="row.feeCnName" placeholder="费用名称" key="id" label="cnName"
  100. res="records" url="/blade-los/bfees/list" :filterable="true" :remote="true" dataName="cnName"
  101. @selectChange="rowDicChange('feeCnName', $event, row)"></dic-select>
  102. <span v-else>{{ row.feeCnName }}</span>
  103. </template>
  104. <template slot="unitNo" slot-scope="{ row }">
  105. <dic-select v-if="row.$cellEdit" v-model="row.unitNo" placeholder="收费标准" key="id" label="code"
  106. url="/blade-los/bunits/selectList" :filterable="true"
  107. @selectChange="rowDicChange('unitNo', $event, row)"></dic-select>
  108. <span v-else>{{ row.unitNo }}</span>
  109. </template>
  110. <tempalte slot="quantityForm" slot-scope="{ row }">
  111. <el-input-number v-if="row.$cellEdit" v-model="row.quantity" @change="countChange(row)" :controls="false"
  112. placeholder="请输入 数量" size="small" style="width: 100%;"></el-input-number>
  113. <span v-else>{{ row.quantity }}</span>
  114. </tempalte>
  115. <tempalte slot="priceForm" slot-scope="{ row }">
  116. <el-input-number v-if="row.$cellEdit" v-model="row.price" @change="countChange(row)" :controls="false"
  117. placeholder="请输入 单价" size="small" style="width: 100%;"></el-input-number>
  118. <span v-else>{{ row.price }}</span>
  119. </tempalte>
  120. <template slot="curCodeForm" slot-scope="{ row }">
  121. <dic-select v-if="row.$cellEdit" v-model="row.curCode" placeholder="币别" key="id" label="code"
  122. :url="'/blade-los/bcurrency/getExrate?date=' + form.businessDate + '&dc=' + row.dc" :filterable="true"
  123. @selectChange="rowDicChange('curCode', $event, row)"></dic-select>
  124. <span v-else>{{ row.curCode }}</span>
  125. </template>
  126. <tempalte slot="exrate" slot-scope="{ row }">
  127. <el-input-number v-if="row.$cellEdit" v-model="row.exrate" @change="countChange(row)" :controls="false"
  128. placeholder="请输入 汇率" size="small" style="width: 100%;"></el-input-number>
  129. <span v-else>{{ row.exrate }}</span>
  130. </tempalte>
  131. <tempalte slot="stlExrateForm" slot-scope="{ row }">
  132. <el-input-number v-if="row.$cellEdit" v-model="row.stlExrate" @change="countChange(row, 'C')"
  133. :controls="false" placeholder="请输入 结算汇率" size="small" style="width: 100%;"></el-input-number>
  134. <span v-else>{{ row.stlExrate }}</span>
  135. </tempalte>
  136. </avue-crud>
  137. </div>
  138. </template>
  139. <script>
  140. import dicSelect from "@/components/dicSelect/main";
  141. import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
  142. import { submitListTrade, feeRemove, confirmCollectionOfPayments, confirmThePayment, confirmReceived } from "@/api/tradeAgency/exchangePurchasing";
  143. import _ from "lodash";
  144. export default {
  145. components: {
  146. dicSelect
  147. },
  148. props: {
  149. detailData: {},
  150. disabled: {
  151. type: Boolean,
  152. default: false,
  153. },
  154. feeType: {
  155. type: String,
  156. default: 'All'
  157. },
  158. form: {
  159. type: Object,
  160. default: () => {
  161. }
  162. }
  163. },
  164. data() {
  165. return {
  166. optionD: {},
  167. optionDBack: {
  168. height: 'auto',
  169. calcHeight: 30,
  170. menuWidth: 140,
  171. tip: false,
  172. border: true,
  173. addBtn: false,
  174. viewBtn: false,
  175. editBtn: false,
  176. delBtn: false,
  177. menu: false,
  178. refreshBtn: false,
  179. selection: true,
  180. align: 'center',
  181. column: [
  182. {
  183. label: "账单",
  184. prop: "accStatus",
  185. width: '80',
  186. overHidden: true,
  187. dicData: [{
  188. label: '否',
  189. value: 0
  190. }, {
  191. label: '是',
  192. value: 1
  193. }]
  194. },
  195. {
  196. label: "收费状态",
  197. prop: "stlStatus",
  198. width: '120',
  199. overHidden: true,
  200. dicData: [{
  201. label: '未确认',
  202. value: 0
  203. }, {
  204. label: '已确认',
  205. value: 1
  206. }]
  207. },
  208. {
  209. label: "往来单位",
  210. prop: "corpCnName",
  211. width: '160',
  212. overHidden: true,
  213. },
  214. {
  215. label: "提单号",
  216. prop: "mblno",
  217. width: '160',
  218. overHidden: true,
  219. },
  220. {
  221. label: '合同号',
  222. prop: "billNo",
  223. width: '160',
  224. overHidden: true,
  225. },
  226. {
  227. label: "费用名称",
  228. prop: "feeCnName",
  229. width: '120',
  230. overHidden: true,
  231. },
  232. {
  233. label: "收费标准",
  234. prop: "unitNo",
  235. width: '120',
  236. overHidden: true,
  237. },
  238. {
  239. label: "单价",
  240. prop: "price",
  241. overHidden: true,
  242. },
  243. {
  244. label: "数量",
  245. prop: "quantity",
  246. overHidden: true,
  247. },
  248. {
  249. label: "金额",
  250. prop: "amount",
  251. overHidden: true,
  252. },
  253. {
  254. label: "币别",
  255. prop: "curCode",
  256. overHidden: true,
  257. },
  258. {
  259. label: "外币金额",
  260. prop: "amountLoc",
  261. overHidden: true,
  262. },
  263. {
  264. label: "汇率",
  265. prop: "exrate",
  266. overHidden: true,
  267. },
  268. {
  269. label: "结算汇率",
  270. prop: "stlExrate",
  271. overHidden: true,
  272. },
  273. {
  274. label: "结算日期",
  275. // prop: "stlDate",
  276. width: "120",
  277. cell: true,
  278. type: "date",
  279. format: "yyyy-MM-dd",
  280. valueFormat: "yyyy-MM-dd 00:00:00",
  281. overHidden: true
  282. },
  283. {
  284. label: "备注",
  285. prop: "remarks",
  286. cell: true,
  287. width: '200',
  288. overHidden: true,
  289. },
  290. ]
  291. },
  292. optionC: {},
  293. optionCBack: {
  294. height: 'auto',
  295. calcHeight: 30,
  296. menuWidth: 140,
  297. tip: false,
  298. border: true,
  299. addBtn: false,
  300. viewBtn: false,
  301. editBtn: false,
  302. delBtn: false,
  303. menu: false,
  304. refreshBtn: false,
  305. selection: true,
  306. align: 'center',
  307. column: [
  308. {
  309. label: "index",
  310. prop: "index",
  311. width: "55",
  312. headerslot: true,
  313. },
  314. {
  315. label: "账单",
  316. prop: "accStatus",
  317. width: '80',
  318. overHidden: true,
  319. dicData: [{
  320. label: '否',
  321. value: 0
  322. }, {
  323. label: '是',
  324. value: 1
  325. }]
  326. },
  327. {
  328. label: "付费状态",
  329. prop: "stlStatus",
  330. width: '120',
  331. overHidden: true,
  332. dicData: [{
  333. label: '未确认',
  334. value: 0
  335. }, {
  336. label: '已确认',
  337. value: 1
  338. }]
  339. },
  340. {
  341. label: "往来单位",
  342. prop: "corpCnName",
  343. width: '160',
  344. cell: true,
  345. slot: true,
  346. formslot: true,
  347. overHidden: true,
  348. rules: [
  349. {
  350. required: true,
  351. message: '请选择往来单位',
  352. trigger: 'blur'
  353. }
  354. ]
  355. },
  356. {
  357. label: "提单号",
  358. prop: "mblno",
  359. width: '160',
  360. overHidden: true,
  361. },
  362. {
  363. label: '合同号',
  364. prop: "billNo",
  365. width: '160',
  366. overHidden: true,
  367. },
  368. {
  369. label: "费用名称",
  370. prop: "feeCnName",
  371. width: '120',
  372. cell: true,
  373. slot: true,
  374. formslot: true,
  375. overHidden: true,
  376. rules: [
  377. {
  378. required: true,
  379. message: '请选择费用名称',
  380. trigger: 'blur'
  381. }
  382. ]
  383. },
  384. {
  385. label: "收费标准",
  386. prop: "unitNo",
  387. width: '120',
  388. overHidden: true,
  389. },
  390. {
  391. label: "单价",
  392. prop: "price",
  393. cell: true,
  394. slot: true,
  395. formslot: true,
  396. overHidden: true,
  397. rules: [
  398. {
  399. required: true,
  400. message: '请输入单价',
  401. trigger: 'blur'
  402. }
  403. ]
  404. },
  405. {
  406. label: "数量",
  407. prop: "quantity",
  408. cell: true,
  409. slot: true,
  410. formslot: true,
  411. overHidden: true,
  412. rules: [
  413. {
  414. required: true,
  415. message: '请输入数量',
  416. trigger: 'blur'
  417. }
  418. ]
  419. },
  420. {
  421. label: "金额",
  422. prop: "amount",
  423. overHidden: true,
  424. },
  425. {
  426. label: "币别",
  427. prop: "curCode",
  428. cell: true,
  429. slot: true,
  430. formslot: true,
  431. overHidden: true,
  432. rules: [
  433. {
  434. required: true,
  435. message: '请选择币别',
  436. trigger: 'blur'
  437. }
  438. ]
  439. },
  440. {
  441. label: "外币金额",
  442. prop: "amountLoc",
  443. overHidden: true,
  444. },
  445. {
  446. label: "汇率",
  447. prop: "exrate",
  448. overHidden: true,
  449. },
  450. {
  451. label: "结算汇率",
  452. prop: "stlExrate",
  453. cell: true,
  454. slot: true,
  455. formslot: true,
  456. overHidden: true,
  457. rules: [
  458. {
  459. required: true,
  460. message: '请输入结算汇率',
  461. trigger: 'blur'
  462. }
  463. ]
  464. },
  465. {
  466. label: "结算日期",
  467. // prop: "stlDate",
  468. width: "120",
  469. cell: true,
  470. type: "date",
  471. format: "yyyy-MM-dd",
  472. valueFormat: "yyyy-MM-dd 00:00:00",
  473. overHidden: true
  474. },
  475. {
  476. label: "优惠汇率",
  477. prop: "discountExrate",
  478. cell: true,
  479. type: 'number',
  480. controls: false,
  481. width: "120",
  482. overHidden: true,
  483. },
  484. {
  485. label: "利润",
  486. prop: "profit",
  487. overHidden: true,
  488. },
  489. {
  490. label: "备注",
  491. prop: "remarks",
  492. cell: true,
  493. width: '200',
  494. overHidden: true,
  495. },
  496. ]
  497. },
  498. selectionDList: [],
  499. selectionCList: []
  500. }
  501. },
  502. async created() {
  503. this.optionD = await this.getColumnData(this.getColumnName(385), this.optionDBack);
  504. this.optionC = await this.getColumnData(this.getColumnName(386), this.optionCBack);
  505. },
  506. methods: {
  507. addRow(type) {
  508. if (type == 'C') {
  509. this.form.feeCenterListC.push({
  510. $cellEdit: true,
  511. pid: this.form.id,
  512. dc: type,
  513. accStatus: 0,
  514. businessType: this.form.businessType,
  515. billNo: this.form.businessNo,
  516. billDate: this.form.businessDate,
  517. discountExrate: 0,
  518. })
  519. }
  520. },
  521. countChange(row, type) {
  522. row.amount = _.multiply(Number(row.quantity ? row.quantity : 0), Number(row.price ? row.price : 0))
  523. if (row.feeCode == 'SFK' || row.feeCode == 'WK') {
  524. if (type == 'C') {
  525. row.amount = _.multiply(Number(row.amountLoc ? row.amountLoc : 0), Number(row.stlExrate ? row.stlExrate : 0))
  526. } else {
  527. row.amount = _.multiply(Number(row.amountLoc ? row.amountLoc : 0), Number(row.exrate ? row.exrate : 0))
  528. }
  529. }
  530. },
  531. selectionDChange(list) {
  532. this.selectionDList = list
  533. },
  534. selectionCChange(list) {
  535. this.selectionCList = list
  536. },
  537. rowDicChange(name, row, el) {
  538. if (name == 'corpCnName') {
  539. if (row) {
  540. el.corpId = row.id
  541. el.corpEnName = row.enName
  542. el.billCorpId = row.id
  543. el.billCorpCnName = row.cnName
  544. } else {
  545. el.corpId = null
  546. el.corpEnName = null
  547. el.billCorpId = null
  548. el.billCorpCnName = null
  549. }
  550. }
  551. if (name == 'feeCnName') {
  552. if (row) {
  553. el.feeId = row.id
  554. el.feeCode = row.code
  555. el.feeEnName = row.enName
  556. el.curCode = row.curNo
  557. el.elementsId = row.accElementId
  558. el.elementsCode = row.elementsCode
  559. el.elementsCnName = row.accElementName
  560. el.elementsEnName = row.elementsEnName
  561. bcurrencyGetExrate({ date: this.form.businessDate, dc: el.dc }).then(res => {
  562. res.data.data.forEach(e => {
  563. if (row.curNo == e.code) {
  564. this.$set(el, 'exrate', e.exrate)
  565. }
  566. })
  567. })
  568. } else {
  569. el.feeId = null
  570. el.feeCode = null
  571. el.feeEnName = null
  572. el.curCode = null
  573. el.elementsId = null
  574. el.elementsCode = null
  575. el.elementsCnName = null
  576. el.elementsEnName = null
  577. }
  578. }
  579. if (name == 'curCode') {
  580. if (row) {
  581. bcurrencyGetExrate({ date: this.form.businessDate, dc: el.dc }).then(res => {
  582. res.data.data.forEach(e => {
  583. if (el.curCode == e.code) {
  584. this.$set(el, 'exrate', e.exrate)
  585. }
  586. })
  587. })
  588. } else {
  589. el.exrate = null
  590. }
  591. }
  592. },
  593. allClick(name, type) {
  594. if (name == '一键保存') {
  595. if (type == 'C') {
  596. for (let row of this.form.feeCenterListC) {
  597. if (!row.corpCnName || !row.feeCnName || !row.price || !row.quantity || !row.curCode || !Number(row.stlExrate)) {
  598. this.$refs.crudC.rowCell(row, row.$index)
  599. return this.$message.error("请完善应付费用信息");
  600. }
  601. }
  602. for (let index in this.form.feeCenterListC) {
  603. if (this.form.feeCenterListC[index].feeCnName == '首款' || this.form.feeCenterListC[index].feeCnName == '尾款' || this.form.feeCenterListC[index].feeCnName == '手续费') {
  604. if (!this.form.feeCenterListC[index].discountExrate) return this.$message.error("第" + (Number(index) + 1) + "行" + this.form.feeCenterListC[index].feeCnName + "费用优惠汇率不能为空");
  605. }
  606. }
  607. this.form.feeCenterListC.forEach(e => {
  608. this.$set(e, '$cellEdit', false)
  609. })
  610. // const loading = this.$loading({
  611. // lock: true,
  612. // text: '加载中',
  613. // spinner: 'el-icon-loading',
  614. // background: 'rgba(255,255,255,0.7)'
  615. // });
  616. // submitListTrade(this.form.feeCenterListC).then(res => {
  617. // this.form.feeCenterListC = res.data.data
  618. // this.$message.success("保存成功");
  619. // }).finally(() => {
  620. // loading.close();
  621. // })
  622. }
  623. }
  624. if (name == '一键编辑') {
  625. if (type == 'C') {
  626. this.form.feeCenterListC.forEach(e => {
  627. this.$set(e, '$cellEdit', true)
  628. })
  629. }
  630. }
  631. if (name == '批量删除') {
  632. let multiList = []
  633. let arr = []
  634. for (let index in this.selectionCList) {
  635. if (this.selectionCList[index].feeType == 1 || this.selectionCList[index].feeType == 2) return this.$message.error("第" + (Number(this.selectionCList[index].$index) + 1) + "行不允许删除");
  636. }
  637. if (type == 'C') {
  638. this.$confirm("确定将选择数据删除?", {
  639. confirmButtonText: "确定",
  640. cancelButtonText: "取消",
  641. type: "warning"
  642. }).then(() => {
  643. multiList = this.selectionCList
  644. arr = this.form.feeCenterListC
  645. const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
  646. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  647. multiList.forEach((item) => {
  648. for (let index in arr) {
  649. if (JSON.stringify(item) == JSON.stringify(arr[index])) {
  650. arr.splice(Number(index), 1)
  651. }
  652. }
  653. })
  654. if (itemsWithId.length != 0) {
  655. console.log(arrIds)
  656. feeRemove({ ids: arrIds.join(',') }).then(res => {
  657. this.$message.success("删除成功");
  658. })
  659. }
  660. })
  661. }
  662. }
  663. if (name == '确认首款') {
  664. let obj = {}
  665. obj = {
  666. ...this.form,
  667. paidApplication: 'SK'
  668. }
  669. if (type == 'D') {
  670. this.$confirm("是否确认首款?", {
  671. confirmButtonText: "确定",
  672. cancelButtonText: "取消",
  673. type: "warning"
  674. }).then(() => {
  675. const loading = this.$loading({
  676. lock: true,
  677. text: '加载中',
  678. spinner: 'el-icon-loading',
  679. background: 'rgba(255,255,255,0.7)'
  680. });
  681. confirmCollectionOfPayments(obj).then(res => {
  682. this.$emit('getDetails', this.form.id)
  683. this.$message.success("确认成功");
  684. }).finally(() => {
  685. loading.close();
  686. })
  687. })
  688. }
  689. if (type == 'C') {
  690. confirmReceived(obj).then(res => {
  691. this.$confirm(res.data.data, {
  692. confirmButtonText: "确定",
  693. cancelButtonText: "取消",
  694. type: "warning"
  695. }).then(() => {
  696. const loading = this.$loading({
  697. lock: true,
  698. text: '加载中',
  699. spinner: 'el-icon-loading',
  700. background: 'rgba(255,255,255,0.7)'
  701. });
  702. confirmThePayment(obj).then(res => {
  703. this.$emit('getDetails', this.form.id)
  704. this.$message.success("确认成功");
  705. }).finally(() => {
  706. loading.close();
  707. })
  708. })
  709. })
  710. }
  711. }
  712. if (name == '确认尾款') {
  713. let obj = {}
  714. obj = {
  715. ...this.form,
  716. paidApplication: 'WK'
  717. }
  718. if (type == 'D') {
  719. this.$confirm("是否确认尾款?", {
  720. confirmButtonText: "确定",
  721. cancelButtonText: "取消",
  722. type: "warning"
  723. }).then(() => {
  724. const loading = this.$loading({
  725. lock: true,
  726. text: '加载中',
  727. spinner: 'el-icon-loading',
  728. background: 'rgba(255,255,255,0.7)'
  729. });
  730. confirmCollectionOfPayments(obj).then(res => {
  731. this.$emit('getDetails', this.form.id)
  732. this.$message.success("确认成功");
  733. }).finally(() => {
  734. loading.close();
  735. })
  736. })
  737. }
  738. if (type == 'C') {
  739. confirmReceived(obj).then(res => {
  740. this.$confirm(res.data.data, {
  741. confirmButtonText: "确定",
  742. cancelButtonText: "取消",
  743. type: "warning"
  744. }).then(() => {
  745. const loading = this.$loading({
  746. lock: true,
  747. text: '加载中',
  748. spinner: 'el-icon-loading',
  749. background: 'rgba(255,255,255,0.7)'
  750. });
  751. confirmThePayment(obj).then(res => {
  752. this.$emit('getDetails', this.form.id)
  753. this.$message.success("确认成功");
  754. }).finally(() => {
  755. loading.close();
  756. })
  757. })
  758. })
  759. }
  760. }
  761. },
  762. submitValidate() {
  763. for (let row of this.form.feeCenterListC) {
  764. if (!row.corpCnName || !row.feeCnName || !row.price || !row.quantity || !row.curCode || !Number(row.stlExrate)) {
  765. this.$refs.crudC.rowCell(row, row.$index)
  766. this.$message.error("请完善应付费用信息");
  767. return false
  768. }
  769. if (row.feeCnName == '首款' || row.feeCnName == '尾款' || row.feeCnName == '手续费') {
  770. if (Number(row.discountExrate) == 0) {
  771. row.discountExrate = this.form.exchangeRate
  772. }
  773. }
  774. }
  775. return true
  776. },
  777. //自定义列保存
  778. async saveColumn(ref, option, optionBack, code) {
  779. /**
  780. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  781. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  782. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  783. */
  784. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  785. if (inSave) {
  786. this.$message.success("保存成功");
  787. //关闭窗口
  788. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  789. }
  790. },
  791. //自定义列重置
  792. async resetColumn(ref, option, optionBack, code) {
  793. this[option] = this[optionBack];
  794. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  795. if (inSave) {
  796. this.$message.success("重置成功");
  797. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  798. }
  799. },
  800. },
  801. }
  802. </script>
  803. <style scoped lang="scss">
  804. .disabledBox {
  805. display: flex;
  806. align-items: center;
  807. }
  808. .fontSize {
  809. font-size: 16px;
  810. color: #81B337;
  811. }
  812. .meetSize {
  813. font-size: 16px;
  814. color: #54BCBD;
  815. }
  816. ::v-deep#out-table .back-one {
  817. background: #ecf5ff !important;
  818. text-align: center;
  819. padding: 4px 0;
  820. }
  821. ::v-deep#out-table .back-two {
  822. background: #ecf5ff !important;
  823. text-align: center;
  824. padding: 4px 0;
  825. }
  826. </style>