|
|
|
@ -29,6 +29,9 @@ |
|
|
|
<el-button type="danger" plain @click="deleteParalleConfig(paralleIndex)">{{ $t('template.lba.lba004.sc')}}</el-button> |
|
|
|
</div> |
|
|
|
<BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)" |
|
|
|
@beforeReagentSubmit="(data) => onTableBeforeReagentSubmit(data, paralleIndex, paralleConfig)" |
|
|
|
@onRegentSubmit="(data) => onTableRegentSubmit('paralle', paralleIndex, data)" |
|
|
|
|
|
|
|
:ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig" |
|
|
|
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" |
|
|
|
:fieldItemLabel="$t('template.lba.lba004.xszj')" /> |
|
|
|
@ -163,7 +166,7 @@ export default { |
|
|
|
}, |
|
|
|
xz: { |
|
|
|
label: 'template.gsp.gsp009.xz', |
|
|
|
type: "sj", |
|
|
|
type: "mix", |
|
|
|
fillType: "actFill", |
|
|
|
subType:"text", |
|
|
|
subText:this.sn=='GSP009'?'template.gsp.gsp009.zw':'template.gsp.gsp011.zw' |
|
|
|
@ -180,8 +183,30 @@ export default { |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.handleAddParalle(true); |
|
|
|
const formData = this.getFormDataByTemplateData(); |
|
|
|
if(this.fillType === "actFill"){ |
|
|
|
this.getCode(formData); |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//获取目标溶液编号 |
|
|
|
async getCode(content){ |
|
|
|
if (content.paralleConfigs && content.paralleConfigs.length > 0 && !content.paralleConfigs[0].ypBh) { |
|
|
|
const codes = content.paralleConfigs.map((item) => ({ pre: item.yp, type: 1 })); |
|
|
|
const snList = await this.getLatestSnArr(codes); |
|
|
|
content.paralleConfigs.forEach((row, idx) => { |
|
|
|
this.$refs[`paralleStepFormPackageRef_${idx}`][0].updateFormData('ypBh',snList[idx]) |
|
|
|
}); |
|
|
|
const params = { |
|
|
|
type: "fieldChanged", |
|
|
|
newRecord: null, |
|
|
|
resourceList: null, |
|
|
|
} |
|
|
|
setTimeout(() => { |
|
|
|
EventBus.$emit('onModifyRecord', params,) |
|
|
|
}, 10); |
|
|
|
} |
|
|
|
}, |
|
|
|
//获取已填写的表单数据 |
|
|
|
getFilledFormData() { |
|
|
|
const baseData = this.$refs.baseInfoRef.getFilledFormData(); |
|
|
|
@ -230,8 +255,45 @@ export default { |
|
|
|
}, |
|
|
|
getResource() { |
|
|
|
let content = this.getFilledFormData(); |
|
|
|
//生成resource |
|
|
|
let tmpResource = [] |
|
|
|
if (this.fillType === "actFill") { |
|
|
|
//平行配置 |
|
|
|
if (content.paralleConfigs && content.paralleConfigs.length > 0) { |
|
|
|
for (let i = 0; i < content.paralleConfigs.length; i++) { |
|
|
|
let paralleConfigs = content.paralleConfigs[i] |
|
|
|
//使用量 |
|
|
|
tmpResource.push({ |
|
|
|
mc: null, |
|
|
|
bh: paralleConfigs.xz, |
|
|
|
ph: null, |
|
|
|
nd: null, |
|
|
|
nddw: null, |
|
|
|
ndz: null, |
|
|
|
ly: null, |
|
|
|
sxrq: null, |
|
|
|
kc: null, |
|
|
|
kcdw: null, |
|
|
|
type: 1, |
|
|
|
syl: null, |
|
|
|
syldw: null, |
|
|
|
yxzq: null, |
|
|
|
yxzqdw: null, |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (tmpResource.length > 0) { |
|
|
|
tmpResource = uniqeResourceOne(tmpResource) |
|
|
|
} |
|
|
|
tmpResource.forEach((row, idx) => { |
|
|
|
row.syldw = null |
|
|
|
row.syl = null |
|
|
|
}); |
|
|
|
|
|
|
|
debugger |
|
|
|
//使用的试剂、仪器 |
|
|
|
this.resourceTmp = [] |
|
|
|
this.resourceTmp = tmpResource |
|
|
|
this.yqResourceTmp = [] |
|
|
|
return this.resourceTmp; |
|
|
|
}, |
|
|
|
@ -242,7 +304,6 @@ export default { |
|
|
|
}, |
|
|
|
//新增平行配制 |
|
|
|
handleAddParalle(init) { |
|
|
|
debugger |
|
|
|
let isAdd = !init |
|
|
|
if(init && (!this.formData.paralleConfigs || this.formData.paralleConfigs.length===0)){ |
|
|
|
isAdd = true |
|
|
|
@ -258,7 +319,6 @@ export default { |
|
|
|
}); |
|
|
|
} |
|
|
|
//todo: 需要回调保存? |
|
|
|
debugger |
|
|
|
}, |
|
|
|
// 删除平行配制配置 |
|
|
|
deleteParalleConfig(index) { |
|
|
|
@ -268,21 +328,12 @@ export default { |
|
|
|
} |
|
|
|
this.formData.paralleConfigs.splice(index, 1); |
|
|
|
}, |
|
|
|
// 删除表格行 |
|
|
|
deleteRow(rowIndex, type, configIndex = 0) { |
|
|
|
// 根据类型删除对应的表格行 |
|
|
|
if (type === 'ladder') { |
|
|
|
const tableRef = this.$refs[`ladderStepTableRef_${configIndex}`]; |
|
|
|
if (tableRef) { |
|
|
|
tableRef.deleteRow(rowIndex); |
|
|
|
} |
|
|
|
} else if (type === 'paralle') { |
|
|
|
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`]; |
|
|
|
if (tableRef) { |
|
|
|
tableRef[0].deleteRow(rowIndex); |
|
|
|
} |
|
|
|
} |
|
|
|
onTableBeforeReagentSubmit(val1,va2,va3){ |
|
|
|
debugger |
|
|
|
}, |
|
|
|
onTableRegentSubmit(val1,va2,va3){ |
|
|
|
debugger |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|