|
|
@@ -3,9 +3,10 @@
|
|
|
<div>
|
|
|
<el-dialog title="选择数据" :visible.sync="dialogVisible" append-to-body width="80%" :before-close="handleClose"
|
|
|
:close-on-click-modal="false">
|
|
|
- <avue-crud :option="option" :table-loading="loading" :data="data.filter(item=>!item.disabled)" ref="crud" id="out-table"
|
|
|
- :header-cell-class-name="headerClassName" @search-change="searchChange" @search-reset="searchReset"
|
|
|
- @selection-change="selectionChange" :search.sync="query" :summary-method="summaryMethod">
|
|
|
+ <avue-crud :option="option" :table-loading="loading" :data="data.filter(item => !item.disabled)" ref="crud"
|
|
|
+ id="out-table" :header-cell-class-name="headerClassName" @search-change="searchChange"
|
|
|
+ @search-reset="searchReset" @selection-change="selectionChange" :search.sync="query"
|
|
|
+ :summary-method="summaryMethod">
|
|
|
<template slot="menuLeft">
|
|
|
<div style="display:flex;">
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
@@ -450,7 +451,7 @@ export default {
|
|
|
this.queryData = []
|
|
|
this.pickData = []
|
|
|
this.dialogVisible = true
|
|
|
- this.activeName='query'
|
|
|
+ this.activeName = 'query'
|
|
|
// this.query = this.deepClone(this.form)
|
|
|
setTimeout(() => {
|
|
|
this.query = {
|
|
|
@@ -502,112 +503,117 @@ export default {
|
|
|
// obj.auditStatus = '0'
|
|
|
obj.businessDateStart = this.form.businessDateStart // 财务开始日期
|
|
|
obj.businessDateEnd = this.form.businessDateEnd // 财务结束日期
|
|
|
- obj = { ...Object.assign(obj, this.query) }
|
|
|
- // 判断是否有对账单号
|
|
|
- if (this.form.checkNo) {
|
|
|
- obj.corpId = this.form.corpId // 结算单位
|
|
|
- obj.checkNo = this.form.checkNo // CHK NO 对账单号
|
|
|
- this.loading = true
|
|
|
- finstlbillsGetByDetail(obj).then(res => {
|
|
|
- let arr = res.data.data.finStlBillsItemsList.map((item) => {
|
|
|
- if (item.curCode == this.getLocalCurrency()) {
|
|
|
- // 发票
|
|
|
- this.$set(item, 'currentInvoiceAmountRMB', item.currentInvoiceAmount)
|
|
|
- // 应结算金额
|
|
|
- this.$set(item, 'amountRMB', item.amount)
|
|
|
- // 已结算金额
|
|
|
- this.$set(item, 'stlTtlAmountRMB', item.stlTtlAmount)
|
|
|
- // 本次金额
|
|
|
- this.$set(item, 'currentStlAmountRMB', item.appliedCurrentStlAmount)
|
|
|
- } else {
|
|
|
- // 发票
|
|
|
- this.$set(item, 'currentInvoiceAmountUSD', item.currentInvoiceAmount)
|
|
|
- // 应结算金额
|
|
|
- this.$set(item, 'amountUSD', item.amount)
|
|
|
- // 已结算金额
|
|
|
- this.$set(item, 'stlTtlAmountUSD', item.stlTtlAmount)
|
|
|
- // 本次金额
|
|
|
- this.$set(item, 'currentStlAmountUSD', item.appliedCurrentStlAmount)
|
|
|
- }
|
|
|
- delete item.id
|
|
|
- return item
|
|
|
- })
|
|
|
- const itemsWithId = this.data.filter(item => item.hasOwnProperty('id'));
|
|
|
- let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
|
|
|
- // 有id 的处理
|
|
|
- if (itemsWithId.length != 0) {
|
|
|
- finstlbillsitemsRemove(arrIds.join(',')).then(res => {
|
|
|
- this.$message.success('操作成功')
|
|
|
+ for (let key in this.query) {
|
|
|
+ if (this.query[key]) {
|
|
|
+ obj = { ...Object.assign(obj, this.query) }
|
|
|
+ // 判断是否有对账单号
|
|
|
+ if (this.form.checkNo) {
|
|
|
+ obj.corpId = this.form.corpId // 结算单位
|
|
|
+ obj.checkNo = this.form.checkNo // CHK NO 对账单号
|
|
|
+ this.loading = true
|
|
|
+ finstlbillsGetByDetail(obj).then(res => {
|
|
|
+ let arr = res.data.data.finStlBillsItemsList.map((item) => {
|
|
|
+ if (item.curCode == this.getLocalCurrency()) {
|
|
|
+ // 发票
|
|
|
+ this.$set(item, 'currentInvoiceAmountRMB', item.currentInvoiceAmount)
|
|
|
+ // 应结算金额
|
|
|
+ this.$set(item, 'amountRMB', item.amount)
|
|
|
+ // 已结算金额
|
|
|
+ this.$set(item, 'stlTtlAmountRMB', item.stlTtlAmount)
|
|
|
+ // 本次金额
|
|
|
+ this.$set(item, 'currentStlAmountRMB', item.appliedCurrentStlAmount)
|
|
|
+ } else {
|
|
|
+ // 发票
|
|
|
+ this.$set(item, 'currentInvoiceAmountUSD', item.currentInvoiceAmount)
|
|
|
+ // 应结算金额
|
|
|
+ this.$set(item, 'amountUSD', item.amount)
|
|
|
+ // 已结算金额
|
|
|
+ this.$set(item, 'stlTtlAmountUSD', item.stlTtlAmount)
|
|
|
+ // 本次金额
|
|
|
+ this.$set(item, 'currentStlAmountUSD', item.appliedCurrentStlAmount)
|
|
|
+ }
|
|
|
+ delete item.id
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ const itemsWithId = this.data.filter(item => item.hasOwnProperty('id'));
|
|
|
+ let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
|
|
|
+ // 有id 的处理
|
|
|
+ if (itemsWithId.length != 0) {
|
|
|
+ finstlbillsitemsRemove(arrIds.join(',')).then(res => {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (arr.length == 0) {
|
|
|
+ this.$message.warning('当前检索暂无数据!')
|
|
|
+ }
|
|
|
+ this.queryData = arr
|
|
|
+ this.data = arr
|
|
|
+ }).finally(() => {
|
|
|
+ this.loading = false;
|
|
|
})
|
|
|
- }
|
|
|
- if (arr.length == 0) {
|
|
|
- this.$message.warning('当前检索暂无数据!')
|
|
|
- }
|
|
|
- this.queryData = arr
|
|
|
- this.data = arr
|
|
|
- }).finally(() => {
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
- } else {
|
|
|
- obj.corpCnName = this.form.corpId // 结算单位
|
|
|
- obj.checkBillNo = this.form.checkNo // CHK NO 对账单号
|
|
|
- this.loading = true
|
|
|
- finstlbillslistAccBillV1(obj).then(res => {
|
|
|
- let arr = res.data.data.map((item, index) => {
|
|
|
- item.accBillId = item.id
|
|
|
- delete item.id
|
|
|
- // 账单编号
|
|
|
- item.accBillNo = item.billNo
|
|
|
- item.currentStlCurCode = item.curCode // 币别
|
|
|
- item.currentStlExrate = item.exrate // 汇率
|
|
|
- // quantity
|
|
|
- // quantityCntrTypesDescr
|
|
|
- item.lineNo = Number(index) + 1
|
|
|
- item.pType = item.businessType
|
|
|
- item.billNo = item.businessBillDivideNo ? item.businessBillDivideNo : item.businessBillNo
|
|
|
- item.accDate = item.billDate
|
|
|
- item.dc = item.accountDc // 收付
|
|
|
- if (item.curCode == this.getLocalCurrency()) {
|
|
|
- // 发票
|
|
|
- this.$set(item, 'currentInvoiceAmountRMB', item.currentInvoiceAmount)
|
|
|
- // 应结算金额
|
|
|
- this.$set(item, 'amountRMB', item.amount)
|
|
|
- // 已结算金额
|
|
|
- this.$set(item, 'stlTtlAmountRMB', item.stlTtlAmount)
|
|
|
- // 本次金额
|
|
|
- this.$set(item, 'currentStlAmountRMB', item.appliedCurrentStlAmount)
|
|
|
- } else {
|
|
|
- // 发票
|
|
|
- this.$set(item, 'currentInvoiceAmountUSD', item.currentInvoiceAmount)
|
|
|
- // 应结算金额
|
|
|
- this.$set(item, 'amountUSD', item.amount)
|
|
|
- // 已结算金额
|
|
|
- this.$set(item, 'stlTtlAmountUSD', item.stlTtlAmount)
|
|
|
- // 本次金额
|
|
|
- this.$set(item, 'currentStlAmountUSD', item.appliedCurrentStlAmount)
|
|
|
- }
|
|
|
- return item
|
|
|
- })
|
|
|
- const itemsWithId = this.data.filter(item => item.hasOwnProperty('id'));
|
|
|
- let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
|
|
|
- // 有id 的处理
|
|
|
- if (itemsWithId.length != 0) {
|
|
|
- finstlbillsitemsRemove(arrIds.join(',')).then(res => {
|
|
|
- this.$message.success('操作成功')
|
|
|
+ } else {
|
|
|
+ obj.corpCnName = this.form.corpId // 结算单位
|
|
|
+ obj.checkBillNo = this.form.checkNo // CHK NO 对账单号
|
|
|
+ this.loading = true
|
|
|
+ finstlbillslistAccBillV1(obj).then(res => {
|
|
|
+ let arr = res.data.data.map((item, index) => {
|
|
|
+ item.accBillId = item.id
|
|
|
+ delete item.id
|
|
|
+ // 账单编号
|
|
|
+ item.accBillNo = item.billNo
|
|
|
+ item.currentStlCurCode = item.curCode // 币别
|
|
|
+ item.currentStlExrate = item.exrate // 汇率
|
|
|
+ // quantity
|
|
|
+ // quantityCntrTypesDescr
|
|
|
+ item.lineNo = Number(index) + 1
|
|
|
+ item.pType = item.businessType
|
|
|
+ item.billNo = item.businessBillDivideNo ? item.businessBillDivideNo : item.businessBillNo
|
|
|
+ item.accDate = item.billDate
|
|
|
+ item.dc = item.accountDc // 收付
|
|
|
+ if (item.curCode == this.getLocalCurrency()) {
|
|
|
+ // 发票
|
|
|
+ this.$set(item, 'currentInvoiceAmountRMB', item.currentInvoiceAmount)
|
|
|
+ // 应结算金额
|
|
|
+ this.$set(item, 'amountRMB', item.amount)
|
|
|
+ // 已结算金额
|
|
|
+ this.$set(item, 'stlTtlAmountRMB', item.stlTtlAmount)
|
|
|
+ // 本次金额
|
|
|
+ this.$set(item, 'currentStlAmountRMB', item.appliedCurrentStlAmount)
|
|
|
+ } else {
|
|
|
+ // 发票
|
|
|
+ this.$set(item, 'currentInvoiceAmountUSD', item.currentInvoiceAmount)
|
|
|
+ // 应结算金额
|
|
|
+ this.$set(item, 'amountUSD', item.amount)
|
|
|
+ // 已结算金额
|
|
|
+ this.$set(item, 'stlTtlAmountUSD', item.stlTtlAmount)
|
|
|
+ // 本次金额
|
|
|
+ this.$set(item, 'currentStlAmountUSD', item.appliedCurrentStlAmount)
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ const itemsWithId = this.data.filter(item => item.hasOwnProperty('id'));
|
|
|
+ let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
|
|
|
+ // 有id 的处理
|
|
|
+ if (itemsWithId.length != 0) {
|
|
|
+ finstlbillsitemsRemove(arrIds.join(',')).then(res => {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (arr.length == 0) {
|
|
|
+ this.$message.warning('当前检索暂无数据!')
|
|
|
+ }
|
|
|
+ this.queryData = arr
|
|
|
+ this.data = arr
|
|
|
+
|
|
|
+ }).finally(() => {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ this.loading = false;
|
|
|
})
|
|
|
}
|
|
|
- if (arr.length == 0) {
|
|
|
- this.$message.warning('当前检索暂无数据!')
|
|
|
- }
|
|
|
- this.queryData = arr
|
|
|
- this.data = arr
|
|
|
-
|
|
|
- }).finally(() => {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.crud.doLayout();
|
|
|
- });
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
//debounce为了防止重复点
|