|
@@ -16,39 +16,26 @@
|
|
|
@handleSearch="handleSearch"
|
|
@handleSearch="handleSearch"
|
|
|
:dataForm.sync="dataForm"
|
|
:dataForm.sync="dataForm"
|
|
|
:datasource.sync="datasource"
|
|
:datasource.sync="datasource"
|
|
|
- :recorpayList.sync="recorpayList"
|
|
|
|
|
-
|
|
|
|
|
:dialogType="dialogType"
|
|
:dialogType="dialogType"
|
|
|
></purchase-form>
|
|
></purchase-form>
|
|
|
- <headerTitle title="对账明细" style="margin-top: 30px">
|
|
|
|
|
- <template v-slot>
|
|
|
|
|
- <el-row style="font-weight: 700; color: red">
|
|
|
|
|
- <span>总金额:</span>
|
|
|
|
|
- <span>{{ dataForm.orderTotalAmount || 0 }}</span>
|
|
|
|
|
- <el-divider direction="vertical"></el-divider>
|
|
|
|
|
- <span>已对账金额:</span>
|
|
|
|
|
- <span>{{ dataForm.amountCompletePrice || 0 }}</span>
|
|
|
|
|
- <el-divider direction="vertical"></el-divider>
|
|
|
|
|
- <span>未对账金额:</span>
|
|
|
|
|
- <span>{{ dataForm.amountUnCompletePrice || 0 }}</span>
|
|
|
|
|
- <el-divider direction="vertical"></el-divider>
|
|
|
|
|
- <span>本次对账总金额:</span>
|
|
|
|
|
- <span>{{ dataForm.amountTotalPrice || 0 }}</span>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- </template>
|
|
|
|
|
- </headerTitle>
|
|
|
|
|
- <!-- <recorpayTableList
|
|
|
|
|
- ref="recorpayListRef"
|
|
|
|
|
- :dataForm="dataForm"
|
|
|
|
|
- :recorpayList.sync="recorpayList"
|
|
|
|
|
- :dialogType="dialogType"
|
|
|
|
|
- ></recorpayTableList> -->
|
|
|
|
|
- <inventoryTable
|
|
|
|
|
- ref="inventoryTableref"
|
|
|
|
|
- :datasource.sync="datasource"
|
|
|
|
|
|
|
+ <!-- 应付信息 -->
|
|
|
|
|
+ <headerTitle title="应付信息" style="margin-top: 30px"></headerTitle>
|
|
|
|
|
+ <payables-info
|
|
|
|
|
+ ref="payablesInfoRef"
|
|
|
|
|
+ :dataForm.sync="dataForm"
|
|
|
|
|
+ :payablesList="payablesList"
|
|
|
:dialogType="dialogType"
|
|
:dialogType="dialogType"
|
|
|
- type="purchase"
|
|
|
|
|
- ></inventoryTable>
|
|
|
|
|
|
|
+ ></payables-info>
|
|
|
|
|
+ <headerTitle title="对账明细" style="margin-top: 30px"> </headerTitle>
|
|
|
|
|
+ <account-detail-table
|
|
|
|
|
+ ref="accountDetailTableRef"
|
|
|
|
|
+ :datasource.sync="datasource"
|
|
|
|
|
+ :dialogType="dialogType"
|
|
|
|
|
+ :queryDimension="dataForm.queryDimension"
|
|
|
|
|
+ @totalChange="handleTotalChange"
|
|
|
|
|
+ @countChange="handleCountChange"
|
|
|
|
|
+ @statementAmountChange="handleStatementAmountChange"
|
|
|
|
|
+ ></account-detail-table>
|
|
|
<div slot="footer" class="footer">
|
|
<div slot="footer" class="footer">
|
|
|
<el-button
|
|
<el-button
|
|
|
v-if="dialogType !== 'view'"
|
|
v-if="dialogType !== 'view'"
|
|
@@ -80,13 +67,17 @@
|
|
|
// import InventoryTable from './inventoryTable.vue';
|
|
// import InventoryTable from './inventoryTable.vue';
|
|
|
import InventoryTable from '@/views/saleManage/saleOrder/accountstatement/components/inventoryTable.vue';
|
|
import InventoryTable from '@/views/saleManage/saleOrder/accountstatement/components/inventoryTable.vue';
|
|
|
import purchaseForm from './purchaseForm.vue';
|
|
import purchaseForm from './purchaseForm.vue';
|
|
|
|
|
+ import payablesInfo from './payablesInfo.vue';
|
|
|
|
|
+
|
|
|
import {
|
|
import {
|
|
|
- getStatementRecordListAPI,
|
|
|
|
|
|
|
+ getStatementRecordSummaryAPI,
|
|
|
createAccountStatementAPI,
|
|
createAccountStatementAPI,
|
|
|
accountstatementInfoAPI,
|
|
accountstatementInfoAPI,
|
|
|
accountstatementUpdateAPI
|
|
accountstatementUpdateAPI
|
|
|
} from '@/api/saleManage/accountstatement';
|
|
} from '@/api/saleManage/accountstatement';
|
|
|
import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
|
|
import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
|
|
|
|
|
+ import { paymentTypeOp } from '@/enum/dict';
|
|
|
|
|
+ import AccountDetailTable from '@/views/saleManage/saleOrder/accountstatement/components/accountDetailTable.vue';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'addAccountDialog',
|
|
name: 'addAccountDialog',
|
|
@@ -95,6 +86,8 @@
|
|
|
processSubmitDialog,
|
|
processSubmitDialog,
|
|
|
InventoryTable,
|
|
InventoryTable,
|
|
|
purchaseForm,
|
|
purchaseForm,
|
|
|
|
|
+ payablesInfo,
|
|
|
|
|
+ AccountDetailTable
|
|
|
// recorpayTableList
|
|
// recorpayTableList
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
@@ -103,6 +96,8 @@
|
|
|
fullscreen: false,
|
|
fullscreen: false,
|
|
|
datasource: [],
|
|
datasource: [],
|
|
|
recorpayList: [],
|
|
recorpayList: [],
|
|
|
|
|
+ // 应付信息初始明细(查询/编辑回填),由 payablesInfo 本地维护,提交时取回
|
|
|
|
|
+ payablesList: [],
|
|
|
dataForm: {
|
|
dataForm: {
|
|
|
sourceType: 1,
|
|
sourceType: 1,
|
|
|
dateType: 1,
|
|
dateType: 1,
|
|
@@ -131,6 +126,18 @@
|
|
|
},
|
|
},
|
|
|
computed: {},
|
|
computed: {},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ handleTotalChange(total) {
|
|
|
|
|
+ this.dataForm.amountTotalPrice = total;
|
|
|
|
|
+ },
|
|
|
|
|
+ handleCountChange(count) {
|
|
|
|
|
+ this.dataForm.totalStatementCount = count;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 明细表本次对账金额变化时,按销售单号同步到应收信息对应行
|
|
|
|
|
+ handleStatementAmountChange(summaryMap) {
|
|
|
|
|
+ if (this.$refs.payablesInfoRef) {
|
|
|
|
|
+ this.$refs.payablesInfoRef.syncStatementAmount(summaryMap);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
open(dialogType, row, type = '') {
|
|
open(dialogType, row, type = '') {
|
|
|
this.businessId = row?.id || '';
|
|
this.businessId = row?.id || '';
|
|
|
this.dialogType = dialogType;
|
|
this.dialogType = dialogType;
|
|
@@ -154,6 +161,11 @@
|
|
|
data.amountCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementedAmount * 100), 0) / 100;
|
|
data.amountCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementedAmount * 100), 0) / 100;
|
|
|
data.amountUnCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100;
|
|
data.amountUnCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100;
|
|
|
this.datasource = data.orderList || [];
|
|
this.datasource = data.orderList || [];
|
|
|
|
|
+ // 编辑详情回填应付信息(兼容 payablesList / statPayable 两种字段)
|
|
|
|
|
+ this.payablesList =
|
|
|
|
|
+ data.payablesList ||
|
|
|
|
|
+ (data.statPayable && data.statPayable.statPayableDetailList) ||
|
|
|
|
|
+ [];
|
|
|
this.dataForm = data;
|
|
this.dataForm = data;
|
|
|
switch (this.dataForm.dateType) {
|
|
switch (this.dataForm.dateType) {
|
|
|
case 1:
|
|
case 1:
|
|
@@ -194,36 +206,48 @@
|
|
|
queryDimension: params.queryDimension,
|
|
queryDimension: params.queryDimension,
|
|
|
type: 2
|
|
type: 2
|
|
|
};
|
|
};
|
|
|
- let data = await getStatementRecordListAPI(searchQuery);
|
|
|
|
|
|
|
+ let data = await getStatementRecordSummaryAPI(searchQuery);
|
|
|
// this.recorpayList = data.recorpayList || [];
|
|
// this.recorpayList = data.recorpayList || [];
|
|
|
- this.datasource = data || [];
|
|
|
|
|
|
|
+ this.datasource = data.productList || [];
|
|
|
|
|
+ // 查询接口暂未返回预付信息时,先置空(由 payablesInfo 本地维护)
|
|
|
|
|
+ this.payablesList = data.payablesList ||
|
|
|
|
|
+ (data.statPayable && data.statPayable.statPayableDetailList) ||
|
|
|
|
|
+ [];
|
|
|
this.dataForm = {
|
|
this.dataForm = {
|
|
|
...this.dataForm,
|
|
...this.dataForm,
|
|
|
|
|
+ ...data
|
|
|
// amountPayablePrice: data.amountPayablePrice,
|
|
// amountPayablePrice: data.amountPayablePrice,
|
|
|
// amountReceivablePrice: data.amountReceivablePrice,
|
|
// amountReceivablePrice: data.amountReceivablePrice,
|
|
|
// amountTotalPrice: data.amountTotalPrice,
|
|
// amountTotalPrice: data.amountTotalPrice,
|
|
|
// amountPayablePass: data.amountPayablePass,
|
|
// amountPayablePass: data.amountPayablePass,
|
|
|
// amountReceivablePass: data.amountReceivablePass
|
|
// amountReceivablePass: data.amountReceivablePass
|
|
|
- orderTotalAmount: data.reduce((pre, cur) => pre + Math.round(+cur.orderAmount * 100), 0) / 100,
|
|
|
|
|
- amountTotalPrice: data.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100,
|
|
|
|
|
- amountCompletePrice: data.reduce((pre, cur) => pre + Math.round(+cur.statementedAmount * 100), 0) / 100,
|
|
|
|
|
- amountUnCompletePrice: data.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100
|
|
|
|
|
|
|
+ // orderTotalAmount: data.reduce((pre, cur) => pre + Math.round(+cur.orderAmount * 100), 0) / 100,
|
|
|
|
|
+ // amountTotalPrice: data.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100,
|
|
|
|
|
+ // amountCompletePrice: data.reduce((pre, cur) => pre + Math.round(+cur.statementedAmount * 100), 0) / 100,
|
|
|
|
|
+ // amountUnCompletePrice: data.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100
|
|
|
};
|
|
};
|
|
|
// if (!this.datasource.length) this.$message.warning('暂无订单信息');
|
|
// if (!this.datasource.length) this.$message.warning('暂无订单信息');
|
|
|
},
|
|
},
|
|
|
//保存
|
|
//保存
|
|
|
async save(is) {
|
|
async save(is) {
|
|
|
- if (!this.datasource.length&&!this.recorpayList.length)
|
|
|
|
|
|
|
+ if (!this.datasource.length && !this.recorpayList.length && !this.payablesList.length)
|
|
|
return this.$message.warning('暂无对账信息');
|
|
return this.$message.warning('暂无对账信息');
|
|
|
|
|
|
|
|
let api =
|
|
let api =
|
|
|
this.dialogType == 'add'
|
|
this.dialogType == 'add'
|
|
|
? createAccountStatementAPI
|
|
? createAccountStatementAPI
|
|
|
: accountstatementUpdateAPI;
|
|
: accountstatementUpdateAPI;
|
|
|
|
|
+ // 提交时一次性取回应付信息(本地明细 + 汇总)
|
|
|
|
|
+ const payablesData = this.$refs.payablesInfoRef
|
|
|
|
|
+ ? this.$refs.payablesInfoRef.getSubmitData()
|
|
|
|
|
+ : { payablesList: [], statementAdvanceTotalPrice: 0, receivedTotalPrice: 0 };
|
|
|
let params = {
|
|
let params = {
|
|
|
...this.dataForm,
|
|
...this.dataForm,
|
|
|
orderList: this.datasource,
|
|
orderList: this.datasource,
|
|
|
- recorpayList:this.recorpayList
|
|
|
|
|
|
|
+ recorpayList: this.recorpayList,
|
|
|
|
|
+ payablesList: payablesData.payablesList,
|
|
|
|
|
+ totalAdvanceConfirmAmount: payablesData.statementAdvanceTotalPrice,
|
|
|
|
|
+ totalPayableAmount: payablesData.receivedTotalPrice
|
|
|
};
|
|
};
|
|
|
let data = await api(params);
|
|
let data = await api(params);
|
|
|
if (is == 'sub') {
|
|
if (is == 'sub') {
|
|
@@ -264,6 +288,15 @@
|
|
|
this.$refs.processSubmitDialogRef.init(params);
|
|
this.$refs.processSubmitDialogRef.init(params);
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ // 对账明细本次对账金额变化时,按采购订单号同步到应付信息对应行
|
|
|
|
|
+ handleDiscountPriceChange(statementAmount, tableIndex) {
|
|
|
|
|
+ const order = this.datasource[tableIndex];
|
|
|
|
|
+ if (!order || !order.orderNo) return;
|
|
|
|
|
+ const summaryMap = { [order.orderNo]: statementAmount };
|
|
|
|
|
+ if (this.$refs.payablesInfoRef) {
|
|
|
|
|
+ this.$refs.payablesInfoRef.syncStatementAmount(summaryMap);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
reload() {
|
|
reload() {
|
|
|
this.cancel();
|
|
this.cancel();
|
|
|
//刷新主页面
|
|
//刷新主页面
|