yxk-20260730
改善提案 修复普通新增表单将附件关联到提案编号的问题。后续新增的改善前、改善后附件统一使用 改善提案主表 ID:分组 保存,与 BPM 只读页的查询规则保持一致。
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="改善前图片" :labelCol="longLabelCol" :wrapperCol="longWrapperCol">
|
||||
<SUploadFile ref="beforeFileRef" :bussiness-id="formData.proposalNo ? `${formData.proposalNo}:before` : ''" :multiple="true" :disabled="disabled" />
|
||||
<SUploadFile ref="beforeFileRef" :bussiness-id="formData.id ? `${formData.id}:before` : ''" :multiple="true" :disabled="disabled" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
@@ -67,7 +67,7 @@
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="改善后图片" :labelCol="longLabelCol" :wrapperCol="longWrapperCol">
|
||||
<SUploadFile ref="afterFileRef" :bussiness-id="formData.proposalNo ? `${formData.proposalNo}:after` : ''" :multiple="true" :disabled="disabled" />
|
||||
<SUploadFile ref="afterFileRef" :bussiness-id="formData.id ? `${formData.id}:after` : ''" :multiple="true" :disabled="disabled" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
@@ -415,13 +415,13 @@
|
||||
}
|
||||
console.log('表单提交数据', values)
|
||||
const result = await saveOrUpdate(values, isUpdate);
|
||||
// 新增时,保存成功后绑定附件的 bussinessId
|
||||
// 新增阶段附件暂不绑定;主表生成 ID 后统一关联,保证普通表单和 BPM 使用同一查询键。
|
||||
if (!isUpdate) {
|
||||
const newId = typeof result === 'string' ? result : (result?.id || result);
|
||||
if (newId) {
|
||||
formData.id = newId;
|
||||
await beforeFileRef.value?.bindBussinessId(`${formData.proposalNo}:before`);
|
||||
await afterFileRef.value?.bindBussinessId(`${formData.proposalNo}:after`);
|
||||
await beforeFileRef.value?.bindBussinessId(`${formData.id}:before`);
|
||||
await afterFileRef.value?.bindBussinessId(`${formData.id}:after`);
|
||||
}
|
||||
}
|
||||
emit('success');
|
||||
|
||||
Reference in New Issue
Block a user