|
|
@ -26,10 +26,11 @@ |
|
|
</el-popconfirm> |
|
|
</el-popconfirm> |
|
|
</div> |
|
|
</div> |
|
|
<BaseInfoFormPackage fieldItemLabel="样本说明" :ref="`ybsmFormPackageRef${index}`" |
|
|
<BaseInfoFormPackage fieldItemLabel="样本说明" :ref="`ybsmFormPackageRef${index}`" |
|
|
|
|
|
:prefixKey = "'ybsm_'+index" |
|
|
:formConfig="ybsmFormConfig" @blur="onHandleBlur" :formData="item" /> |
|
|
:formConfig="ybsmFormConfig" @blur="onHandleBlur" :formData="item" /> |
|
|
<el-button v-if="fillType === 'actFill'" type="primary" |
|
|
<el-button v-if="fillType === 'actFill'" type="primary" |
|
|
@click="onImportAnimal(item, index)">导入动物</el-button> |
|
|
@click="onImportAnimal(item, index)">导入动物</el-button> |
|
|
<CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns" |
|
|
|
|
|
|
|
|
<CustomTable :ref="`ybsmTableRef${index}`" :columns="ybsmColumns" :prefixKey = "'ybsm_table_'+index" |
|
|
:showOperation="fillType === 'actFill'" :showAddRow="fillType === 'actFill'" |
|
|
:showOperation="fillType === 'actFill'" :showAddRow="fillType === 'actFill'" |
|
|
:formData="item" @clickButton="(e, rowIndex,colIndex,ee,data)=>handleClickButton(e, rowIndex,colIndex,ee,data,index)"> |
|
|
:formData="item" @clickButton="(e, rowIndex,colIndex,ee,data)=>handleClickButton(e, rowIndex,colIndex,ee,data,index)"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
@ -38,7 +39,7 @@ |
|
|
</TableOpertaionDelete> |
|
|
</TableOpertaionDelete> |
|
|
</template> |
|
|
</template> |
|
|
</CustomTable> |
|
|
</CustomTable> |
|
|
<Step :ref="`stepRef${index}`" :formData="item.stepData || []"></Step> |
|
|
|
|
|
|
|
|
<Step :ref="`stepRef${index}`" :prefixKey = "'ybsm_step_'+index" :formData="item.stepData || []"></Step> |
|
|
</div> |
|
|
</div> |
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
:ref="refConfig.remarkRef" :formConfig="remarkConig" :formData="formData" /> |
|
|
:ref="refConfig.remarkRef" :formConfig="remarkConig" :formData="formData" /> |
|
|
@ -208,19 +209,17 @@ export default { |
|
|
//获取填写完成的表单数据 |
|
|
//获取填写完成的表单数据 |
|
|
async getFormData() { |
|
|
async getFormData() { |
|
|
// 基础表单验证 |
|
|
// 基础表单验证 |
|
|
let content = await this.validFormFields(compRefs); |
|
|
|
|
|
if (!content) return null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const refs = []; |
|
|
// 验证多个样本说明项 |
|
|
// 验证多个样本说明项 |
|
|
for (let index = 0; index < this.formData.ybsmDataList.length; index++) { |
|
|
for (let index = 0; index < this.formData.ybsmDataList.length; index++) { |
|
|
|
|
|
refs.push(`ybsmFormPackageRef${index}`) |
|
|
|
|
|
refs.push(`ybsmTableRef${index}`) |
|
|
|
|
|
refs.push(`stepRef${index}`) |
|
|
// 验证样本说明表单 |
|
|
// 验证样本说明表单 |
|
|
const ybsmFormValid = await this.$refs[`ybsmFormPackageRef${index}`][0]?.getFormData() || true; |
|
|
|
|
|
if (!ybsmFormValid) return null; |
|
|
|
|
|
|
|
|
|
|
|
// 验证步骤数据 |
|
|
|
|
|
const stepValid = await this.$refs[`stepRef${index}`][0]?.getFormData() || true; |
|
|
|
|
|
if (!stepValid) return null; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
let content = await this.validFormFields([...compRefs, ...refs]); |
|
|
|
|
|
if (!content) return null; |
|
|
|
|
|
|
|
|
// 获取所有数据 |
|
|
// 获取所有数据 |
|
|
return this.getFilledFormData(); |
|
|
return this.getFilledFormData(); |
|
|
@ -232,23 +231,23 @@ export default { |
|
|
//使用的试剂、仪器 |
|
|
//使用的试剂、仪器 |
|
|
let allSjResource = []; |
|
|
let allSjResource = []; |
|
|
let allYqResource = []; |
|
|
let allYqResource = []; |
|
|
|
|
|
const {ybsmDataList = []} = content |
|
|
// 收集所有样本说明项的步骤资源 |
|
|
// 收集所有样本说明项的步骤资源 |
|
|
for (let index = 0; index < this.formData.ybsmDataList.length; index++) { |
|
|
|
|
|
const stepResource = this.$refs[`stepRef${index}`][0]?.getStepResource() || { sjResource: [], yqResource: [] }; |
|
|
|
|
|
|
|
|
for (let index = 0; index < ybsmDataList.length; index++) { |
|
|
|
|
|
const stepResource = ybsmDataList[index].stepData || { sjResource: [], yqResource: [] }; |
|
|
allSjResource = [...allSjResource, ...(stepResource.sjResource || [])]; |
|
|
allSjResource = [...allSjResource, ...(stepResource.sjResource || [])]; |
|
|
allYqResource = [...allYqResource, ...(stepResource.yqResource || [])]; |
|
|
allYqResource = [...allYqResource, ...(stepResource.yqResource || [])]; |
|
|
} |
|
|
} |
|
|
for(var i=0;i<this.formData.ybsmDataList.length;i++){ |
|
|
|
|
|
|
|
|
for(var i=0;i<ybsmDataList.length;i++){ |
|
|
allYqResource.push({ |
|
|
allYqResource.push({ |
|
|
mc: this.formData.ybsmDataList[i].selectInfo_xztp.mc, |
|
|
|
|
|
xh: this.formData.ybsmDataList[i].selectInfo_xztp.xh, |
|
|
|
|
|
bh: this.formData.ybsmDataList[i].selectInfo_xztp.bh, |
|
|
|
|
|
jzrq: this.formData.ybsmDataList[i].selectInfo_xztp.jzrq, |
|
|
|
|
|
|
|
|
mc: ybsmDataList[i].selectInfo_xztp.mc, |
|
|
|
|
|
xh: ybsmDataList[i].selectInfo_xztp.xh, |
|
|
|
|
|
bh: ybsmDataList[i].selectInfo_xztp.bh, |
|
|
|
|
|
jzrq: ybsmDataList[i].selectInfo_xztp.jzrq, |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
this.resourceTmp = uniqeResource(tmpResource, allSjResource) |
|
|
this.resourceTmp = uniqeResource(tmpResource, allSjResource) |
|
|
this.yqResourceTmp = uniqeYqOne(allYqResource) |
|
|
this.yqResourceTmp = uniqeYqOne(allYqResource) |
|
|
debugger |
|
|
|
|
|
return this.resourceTmp; |
|
|
return this.resourceTmp; |
|
|
}, |
|
|
}, |
|
|
//保存 |
|
|
//保存 |
|
|
|