|
|
|
@ -251,9 +251,6 @@ export default { |
|
|
|
bodyType: 'checkboxTree', |
|
|
|
bodyFillType: 'actFill', |
|
|
|
width: 280, |
|
|
|
bodyLayout: 'horizontal',//水平 |
|
|
|
optionCode:"ypmcTaOptions", |
|
|
|
noBorder: true, |
|
|
|
bodyOptions: this.ypmcTaOptions, |
|
|
|
}, |
|
|
|
{ |
|
|
|
@ -318,10 +315,7 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
if(this.fillType === "actFill"){ |
|
|
|
console.log(this.formData, "this.formData") |
|
|
|
this.ypmcTaOptions = this.formData.ypmcTaOptions || [] |
|
|
|
} |
|
|
|
this.getTabletoCheck() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 删除表格行 |
|
|
|
@ -331,25 +325,11 @@ export default { |
|
|
|
|
|
|
|
// 获取已填写的表单数据 |
|
|
|
getFilledFormData() { |
|
|
|
const filledData = this.getFilledFormDataByRefs(refNames); |
|
|
|
if(this.formData.ypmcTaOptions){ |
|
|
|
filledData.ypmcTaOptions = this.formData.ypmcTaOptions |
|
|
|
} |
|
|
|
return filledData |
|
|
|
return this.getFilledFormDataByRefs(refNames) |
|
|
|
}, |
|
|
|
// 获取填写完成的表单数据 |
|
|
|
async getFormData() { |
|
|
|
const formData = await this.validFields(); |
|
|
|
if(this.fillType === "preFill" && !!formData){ |
|
|
|
const filledData = this.getFilledFormData(); |
|
|
|
const {stepTableFormData_1 = []} = filledData; |
|
|
|
const options = stepTableFormData_1.map(item => ({ |
|
|
|
value: item.ypmc, |
|
|
|
label: item.ypmc, |
|
|
|
})) |
|
|
|
formData.ypmcTaOptions = options |
|
|
|
} |
|
|
|
return formData |
|
|
|
return await this.validFormFields(refNames) |
|
|
|
}, |
|
|
|
// 只做校验 |
|
|
|
async validFields() { |
|
|
|
@ -358,9 +338,9 @@ export default { |
|
|
|
getResource() { |
|
|
|
// const stepResource = this.$refs.yqsyTableRef.getStepResource() |
|
|
|
// 使用的试剂、仪器 |
|
|
|
// this.resourceTmp = stepResource.sjResource || [] |
|
|
|
// this.yqResourceTmp = stepResource.yqResource || [] |
|
|
|
// return this.resourceTmp |
|
|
|
this.resourceTmp = [] |
|
|
|
this.yqResourceTmp = [] |
|
|
|
return this.resourceTmp |
|
|
|
}, |
|
|
|
|
|
|
|
// 保存 |
|
|
|
@ -377,6 +357,24 @@ export default { |
|
|
|
) |
|
|
|
|
|
|
|
}, |
|
|
|
//获取表格数据并赋值 |
|
|
|
getTabletoCheck() { |
|
|
|
let { stepTableFormData_1 = [] } = this.getFilledFormData() |
|
|
|
const firstList = stepTableFormData_1 |
|
|
|
.filter(item => item && item.ypmc && item.ypmc.trim()) // 严格过滤空值 |
|
|
|
.map(item => ({ |
|
|
|
label: item.ypmc, |
|
|
|
value: item.ypmc, |
|
|
|
})) |
|
|
|
// 去重优化 |
|
|
|
.filter((item, index, arr) => { |
|
|
|
return arr.findIndex(i => i.value === item.value) === index; |
|
|
|
}); |
|
|
|
// 响应式更新 |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.ypmcTaOptions = firstList; |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|