财务状态bug修复

This commit is contained in:
jhd
2026-05-25 14:13:54 +08:00
parent cd099f2e6b
commit 85bb87e9fb
3 changed files with 66 additions and 33 deletions

View File

@@ -6,8 +6,8 @@
<CustomerSelect v-model="queryParams.customerId" bindField="customerId" @change="handleCustomerChange"
:style="{ width: '240px' }" />
</el-form-item>
<el-form-item label="合同编号" prop="contractCode">
<el-select v-model="queryParams.contractCode" placeholder="请选择合同编号" filterable clearable style="width: 240px;">
<el-form-item label="合同编号" prop="orderId">
<el-select v-model="queryParams.orderId" placeholder="请选择合同编号" filterable clearable style="width: 240px;">
<el-option v-for="item in contractOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
@@ -70,8 +70,8 @@
<CustomerSelect v-model="form.customerId" bindField="customerId" @change="handleFormCustomerChange"
:style="{ width: '100%' }" />
</el-form-item>
<el-form-item label="合同编号" prop="contractCode">
<el-select v-model="form.contractCode" placeholder="请选择合同编号" filterable clearable style="width: 100%;">
<el-form-item label="合同编号" prop="orderId">
<el-select v-model="form.orderId" placeholder="请选择合同编号" filterable clearable style="width: 100%;">
<el-option v-for="item in formContractOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
@@ -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
}));
});