From 09535d884c6d1ab8c6ab7995b15ff2eae87dd8dc Mon Sep 17 00:00:00 2001 From: jhd <1684074631@qq.com> Date: Sat, 23 May 2026 16:20:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B4=A2=E5=8A=A1=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E9=A1=B5=E9=9D=A2=20=20=E5=AE=A2=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E8=B4=A2=E5=8A=A1=E7=8A=B6=E6=80=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/crm/components/ReceiveTable.vue | 19 +- .../src/views/crm/contract/fin_sta/index.vue | 400 ++++++++++++++++++ klp-ui/src/views/crm/customer/index.vue | 113 ++++- 3 files changed, 527 insertions(+), 5 deletions(-) create mode 100644 klp-ui/src/views/crm/contract/fin_sta/index.vue diff --git a/klp-ui/src/views/crm/components/ReceiveTable.vue b/klp-ui/src/views/crm/components/ReceiveTable.vue index 120e2f74..ee0f31fc 100644 --- a/klp-ui/src/views/crm/components/ReceiveTable.vue +++ b/klp-ui/src/views/crm/components/ReceiveTable.vue @@ -149,14 +149,18 @@ export default { order: { type: Object, default: undefined + }, + customerId: { + type: [Number, String], + default: undefined } }, computed: { orderId() { return this.order ? this.order.orderId : undefined; }, - customerId() { - return this.order ? this.order.customerId : undefined; + currentCustomerId() { + return this.customerId || (this.order ? this.order.customerId : undefined); }, receivedAmount() { return this.receivableList.reduce((total, item) => total + parseFloat(item.amount), 0); @@ -174,6 +178,15 @@ export default { } }, immediate: true, + }, + currentCustomerId: { + handler(newVal) { + if (newVal) { + this.queryParams.customerId = newVal; + this.getList(); + } + }, + immediate: true, } }, data() { @@ -344,7 +357,7 @@ export default { this.receiveForm = { receivableId: row.receivableId, amount: row.balanceAmount, - balanceAmount: row.balanceAmount + balanceAmount: row.balanceAmount }; this.receiveOpen = true; }, diff --git a/klp-ui/src/views/crm/contract/fin_sta/index.vue b/klp-ui/src/views/crm/contract/fin_sta/index.vue new file mode 100644 index 00000000..16655f04 --- /dev/null +++ b/klp-ui/src/views/crm/contract/fin_sta/index.vue @@ -0,0 +1,400 @@ + + + + + diff --git a/klp-ui/src/views/crm/customer/index.vue b/klp-ui/src/views/crm/customer/index.vue index 8da69c16..c0e6fc26 100644 --- a/klp-ui/src/views/crm/customer/index.vue +++ b/klp-ui/src/views/crm/customer/index.vue @@ -70,7 +70,23 @@ - + + + + 新增 + + + 修改 + + + 删除 + + + + + + + @@ -171,6 +221,7 @@ import CoilTable from '../components/CoilTable.vue' import DeliveryTable from '../components/DeliveryTable.vue' import { listCustomer, addCustomer, updateCustomer, delCustomer, listCoilByCustomerId, listFinanceByCustomerId } from '@/api/crm/customer' +import { getReceivable, delReceivable, addReceivable, updateReceivable } from '@/api/finance/receivable' export default { name: 'CustomerPage', @@ -209,6 +260,13 @@ export default { buttonLoading: false, updateLoading: false, debounceTimer: null, + // 财务状态相关 + financeIds: [], + financeSingle: true, + financeMultiple: true, + financeOpen: false, + financeTitle: "", + financeForm: {}, rules: { customerCode: [{ required: true, message: '请输入客户编码', trigger: 'blur' }], companyName: [{ required: true, message: '请输入公司名称', trigger: 'blur' }], @@ -380,6 +438,57 @@ export default { }).catch(() => { this.$message.info('已取消删除'); }); + }, + + // 财务状态操作 + handleFinanceSelectionChange(selection) { + this.financeIds = selection.map(item => item.receivableId); + this.financeSingle = selection.length !== 1; + this.financeMultiple = !selection.length; + }, + handleFinanceAdd() { + this.financeForm = { + customerId: this.currentCustomerId, + customerName: this.currentCustomer.companyName + }; + this.financeTitle = "添加收款记录"; + this.financeOpen = true; + }, + handleFinanceUpdate(row) { + const receivableId = row.receivableId || this.financeIds; + getReceivable(receivableId).then(response => { + this.financeForm = response.data; + this.financeTitle = "修改收款记录"; + this.financeOpen = true; + }); + }, + handleFinanceDelete(row) { + const receivableIds = row.receivableId || this.financeIds; + this.$modal.confirm('是否确认删除收款记录?').then(() => { + return delReceivable(receivableIds); + }).then(() => { + this.getFinanceList(); + this.$modal.msgSuccess("删除成功"); + }); + }, + financeSubmitForm() { + if (this.financeForm.receivableId != null) { + updateReceivable(this.financeForm).then(response => { + this.$modal.msgSuccess("修改成功"); + this.financeOpen = false; + this.getFinanceList(); + }); + } else { + addReceivable(this.financeForm).then(response => { + this.$modal.msgSuccess("新增成功"); + this.financeOpen = false; + this.getFinanceList(); + }); + } + }, + financeCancel() { + this.financeOpen = false; + this.financeForm = {}; } }, } @@ -395,4 +504,4 @@ export default { .dialog-footer { text-align: center; } - \ No newline at end of file +