|
|
@@ -273,9 +273,19 @@
|
|
|
},
|
|
|
props: ['dataForm', 'datasource', 'dialogType','recorpayList'],
|
|
|
computed: {
|
|
|
+ /**
|
|
|
+ * 在途判定会剔除「已被其它对账单占用」的数据,修改本单时本单自身也算占用,
|
|
|
+ * 需要用 excludeStatementId 把它自己排除掉,否则本单的供应商在候选列表里选不到。
|
|
|
+ * 新增场景没有自身占用,不传。
|
|
|
+ */
|
|
|
+ excludeStatementId() {
|
|
|
+ return this.dialogType == 'edit' && this.dataForm && this.dataForm.id
|
|
|
+ ? this.dataForm.id
|
|
|
+ : undefined;
|
|
|
+ },
|
|
|
// 对账池客户列表的必填参数:2 = 采购订单(采购侧对账只能选供应商)
|
|
|
poolCustomerQuery() {
|
|
|
- return { type: 2 };
|
|
|
+ return this.withExcludeStatementId({ type: 2 });
|
|
|
},
|
|
|
/**
|
|
|
* 对账池订单列表参数:2 = 采购订单。
|
|
|
@@ -288,7 +298,7 @@
|
|
|
if (contactId) {
|
|
|
params.contactId = contactId;
|
|
|
}
|
|
|
- return params;
|
|
|
+ return this.withExcludeStatementId(params);
|
|
|
},
|
|
|
//计算未对账金额
|
|
|
accountStatementPrice() {
|
|
|
@@ -602,6 +612,14 @@
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 给对账池客户/订单列表的查询参数补上 excludeStatementId(修改场景专用)。
|
|
|
+ * 非修改场景或还没拿到本单 id 时保持参数不变,避免传 undefined 让后端判空出错。
|
|
|
+ */
|
|
|
+ withExcludeStatementId(params) {
|
|
|
+ const id = this.excludeStatementId;
|
|
|
+ return id ? { ...params, excludeStatementId: id } : params;
|
|
|
+ },
|
|
|
/**
|
|
|
* 对账池客户列表接口,作为 prop 传给供应商选择弹框当数据源。
|
|
|
* Vue 2 的模板表达式只能访问实例上的属性,import 进来的模块函数必须挂到 methods,
|