diff --git a/klp-ui/src/views/crm/components/ReceiveTable.vue b/klp-ui/src/views/crm/components/ReceiveTable.vue
index b4f78aae..f84330f8 100644
--- a/klp-ui/src/views/crm/components/ReceiveTable.vue
+++ b/klp-ui/src/views/crm/components/ReceiveTable.vue
@@ -180,15 +180,16 @@ export default {
},
immediate: true,
},
- currentCustomerId: {
- handler(newVal) {
- if (newVal) {
- this.queryParams.customerId = newVal;
- this.getList();
- }
- },
- immediate: true,
- }
+ // 移除 customerId 查询条件,只根据 orderId 查询收款明细
+ // currentCustomerId: {
+ // handler(newVal) {
+ // if (newVal) {
+ // this.queryParams.customerId = newVal;
+ // this.getList();
+ // }
+ // },
+ // immediate: true,
+ // }
},
data() {
return {
diff --git a/klp-ui/src/views/crm/contract/fin_sta/index.vue b/klp-ui/src/views/crm/contract/fin_sta/index.vue
index dc7af7fd..0947af59 100644
--- a/klp-ui/src/views/crm/contract/fin_sta/index.vue
+++ b/klp-ui/src/views/crm/contract/fin_sta/index.vue
@@ -6,8 +6,8 @@
-
-
+
+
@@ -70,8 +70,8 @@
-
-
+
+
@@ -151,7 +151,7 @@ export default {
},
created() {
this.getList();
- this.loadContracts(); // 加载所有合同编号,支持独立查询
+ this.loadContracts(); // 加载所有合同编号,作为独立筛选条件
},
methods: {
getList() {
@@ -173,30 +173,30 @@ export default {
this.reset();
},
handleCustomerChange(customer) {
- // 根据客户ID获取合同列表(可选)
+ // 客户和合同编号是独立的筛选条件,互不关联
if (customer && customer.customerId) {
- this.loadContracts(customer.customerId);
+ this.queryParams.customerId = customer.customerId;
} else {
- // 不传客户ID,加载所有合同
- this.loadContracts();
+ this.queryParams.customerId = undefined;
}
},
- loadContracts(customerId) {
- listOrder({ customerId: customerId || undefined, pageNum: 1, pageSize: 100 }).then(res => {
+ loadContracts() {
+ // 加载所有合同编号,不根据客户ID过滤
+ listOrder({ pageNum: 1, pageSize: 100 }).then(res => {
this.contractOptions = (res.rows || []).map(item => ({
- value: item.contractCode,
+ value: item.orderId,
label: item.contractCode
}));
});
},
handleFormCustomerChange(customer) {
// 清空合同选择
- this.form.contractCode = undefined;
+ this.form.orderId = undefined;
// 根据客户ID获取合同列表
if (customer && customer.customerId) {
listOrder({ customerId: customer.customerId, pageNum: 1, pageSize: 100 }).then(res => {
this.formContractOptions = (res.rows || []).map(item => ({
- value: item.contractCode,
+ value: item.orderId,
label: item.contractCode
}));
});
diff --git a/klp-ui/src/views/crm/customer/index.vue b/klp-ui/src/views/crm/customer/index.vue
index c0e6fc26..02a5270d 100644
--- a/klp-ui/src/views/crm/customer/index.vue
+++ b/klp-ui/src/views/crm/customer/index.vue
@@ -86,7 +86,7 @@
-
+
{{ parseTime(scope.row.dueDate, '{y}-{m}-{d}') }}
@@ -186,8 +186,11 @@
-
-
+
+
+
+
{
- this.financeList = response.data.financeList || [];
- this.objectionList = response.data.oobjectionList || [];
- this.wmsDeliveryWaybills = response.data.wmsDeliveryWaybills || [];
+ listReceivable({
+ pageNum: 1,
+ pageSize: 100,
+ customerId: this.currentCustomerId
+ }).then(response => {
+ this.financeList = response.rows || [];
}).catch(() => {
this.$message.error('获取客户财务状态失败');
});
},
+ // 获取客户订单列表
+ getOrderList() {
+ if (!this.currentCustomerId) return;
+ listOrder({
+ pageNum: 1,
+ pageSize: 100,
+ customerId: this.currentCustomerId
+ }).then(response => {
+ this.orderList = response.rows || [];
+ }).catch(() => {
+ this.$message.error('获取客户订单列表失败');
+ });
+ },
+
/** 查询合同配卷列表 */
getCoilList() {
listCoilByCustomerId(this.currentCustomerId).then(response => {
@@ -371,6 +392,7 @@ export default {
this.currentCustomer = { ...item };
this.getFinanceList();
this.getCoilList();
+ this.getOrderList();
this.activeTab = 'detail';
},
@@ -449,7 +471,8 @@ export default {
handleFinanceAdd() {
this.financeForm = {
customerId: this.currentCustomerId,
- customerName: this.currentCustomer.companyName
+ customerName: this.currentCustomer.companyName,
+ orderId: undefined
};
this.financeTitle = "添加收款记录";
this.financeOpen = true;
@@ -458,10 +481,19 @@ export default {
const receivableId = row.receivableId || this.financeIds;
getReceivable(receivableId).then(response => {
this.financeForm = response.data;
+ // 将 contractCode 转换为 orderId 用于显示
+ this.financeForm.orderId = response.data.orderId;
this.financeTitle = "修改收款记录";
this.financeOpen = true;
});
},
+
+ // 根据 orderId 获取合同编号
+ getContractCode(orderId) {
+ if (!orderId) return '-';
+ const order = this.orderList.find(item => item.orderId === orderId);
+ return order ? order.contractCode : orderId;
+ },
handleFinanceDelete(row) {
const receivableIds = row.receivableId || this.financeIds;
this.$modal.confirm('是否确认删除收款记录?').then(() => {