|
|
|
@ -116,6 +116,14 @@ export default { |
|
|
|
console.log(v, "fillType") |
|
|
|
} |
|
|
|
}, |
|
|
|
formData: { |
|
|
|
immediate: true, |
|
|
|
handler(v) { |
|
|
|
if(v &&this.fillType === "actFill"){ |
|
|
|
this.handleUpdateCode(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
// 存储条件表单配置 |
|
|
|
@ -160,6 +168,48 @@ export default { |
|
|
|
mounted() { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 为指定的表单数据数组分配编号 |
|
|
|
async assignNumbersToTableData(tableDataArray) { |
|
|
|
if (!tableDataArray || tableDataArray.length === 0) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 检查表单数据中是否有任何一行的subTargetSolutionCode有值 |
|
|
|
const hasAnyWithValue = tableDataArray.some(row => |
|
|
|
row.subTargetSolutionCode && row.subTargetSolutionCode.trim() !== ''); |
|
|
|
|
|
|
|
// 如果没有任何一行有值,则为所有行分配编号 |
|
|
|
if (!hasAnyWithValue) { |
|
|
|
const length = tableDataArray.length; |
|
|
|
const snList = await this.getLatestSn(length); |
|
|
|
tableDataArray.forEach((row, idx) => { |
|
|
|
row.subTargetSolutionCode = snList[idx] || ''; |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async handleUpdateCode() { |
|
|
|
|
|
|
|
// 检查paralleConfigs中的paralleTableFormData数组 |
|
|
|
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) { |
|
|
|
for (let i = 0; i < this.formData.paralleConfigs.length; i++) { |
|
|
|
const config = this.formData.paralleConfigs[i]; |
|
|
|
if (config.stepTableFormData && config.stepTableFormData.length > 0) { |
|
|
|
await this.assignNumbersToTableData(config.stepTableFormData); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 检查ladderConfigs中的ladderTableFormData数组 |
|
|
|
if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) { |
|
|
|
for (let i = 0; i < this.formData.ladderConfigs.length; i++) { |
|
|
|
const config = this.formData.ladderConfigs[i]; |
|
|
|
if (config.stepTableFormData && config.stepTableFormData.length > 0) { |
|
|
|
await this.assignNumbersToTableData(config.stepTableFormData); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
//新增平行配制 |
|
|
|
handleAddParalle() { |
|
|
|
// 初始化平行配制配置列表 |
|
|
|
|