|
|
|
@ -3,32 +3,29 @@ |
|
|
|
<div> |
|
|
|
<div class="detail-container"> |
|
|
|
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc || |
|
|
|
$t('template.sp.sp001.title') }}<img src="@/assets/images/detail-title.png" /></div> |
|
|
|
$t('template.sp.sp001.title') }}<img src="@/assets/images/detail-title.png" /></div> |
|
|
|
<div class="detail-content"> |
|
|
|
<div class="content"> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" ref="baseInfoRef" |
|
|
|
:formConfig="baseInfoFormConfig" :formData="formData" /> |
|
|
|
<TableList label="template.common.reagentInfo" :columns="sysjColumns" |
|
|
|
:dataSource="resource" /> |
|
|
|
<TableList label="template.common.instrumentInfo" :columns="yqsColumns" |
|
|
|
:dataSource="yqResource" /> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" label="template.common.storageCondition" ref="storageConditionRef" |
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" |
|
|
|
ref="baseInfoRef" :formConfig="baseInfoFormConfig" :formData="formData" /> |
|
|
|
<TableList label="template.common.reagentInfo" :columns="sysjColumns" :dataSource="resource" /> |
|
|
|
<TableList label="template.common.instrumentInfo" :columns="yqsColumns" :dataSource="yqResource" /> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" |
|
|
|
label="template.common.storageCondition" ref="storageConditionRef" |
|
|
|
:formConfig="storageFormConfig" :formData="formData" /> |
|
|
|
<LineLabel label="template.common.operationSteps" /> |
|
|
|
<div class="template-form-item"> |
|
|
|
|
|
|
|
<el-button class="print-btn" v-if = "fillType === 'actFill'" type="primary" @click="printTag">标签打印</el-button> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" :formConfig="stepFormConfig" @blur="onHandleBlur" |
|
|
|
:formData="formData" /> |
|
|
|
<el-button class="print-btn" v-if="fillType === 'actFill'" type="primary" |
|
|
|
@click="printTag">标签打印</el-button> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef" |
|
|
|
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" /> |
|
|
|
</div> |
|
|
|
<Step ref="stepRef" :formData="formData.stepData"></Step> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" ref="remarkRef" :formConfig="remarkConig" |
|
|
|
:formData="formData" /> |
|
|
|
|
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
|
ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- <button @click = "onSave">保存</button> --> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -41,6 +38,7 @@ import templateMixin from "../../mixins/templateMixin"; |
|
|
|
import CustomTable from '@/components/Template/CustomTable.vue'; |
|
|
|
import { getLatestSn } from '@/api/template'; |
|
|
|
import { EventBus } from "@/utils/eventBus"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "Sp001", |
|
|
|
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable }, |
|
|
|
@ -52,6 +50,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
// 配置条件 |
|
|
|
storageFormConfig() { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
@ -64,11 +63,11 @@ export default { |
|
|
|
options: this.getDictOptions("business_cctj"), |
|
|
|
otherCode: "storageConditionOther", |
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
]; |
|
|
|
}, |
|
|
|
// 备注表单配置 |
|
|
|
remarkConig() { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
@ -87,7 +86,7 @@ export default { |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
|
|
|
|
// 试验基本信息表单配置 |
|
|
|
baseInfoFormConfig() { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
@ -113,7 +112,7 @@ export default { |
|
|
|
label: 'template.common.versionNumber', |
|
|
|
type: "inputNumber", |
|
|
|
fillType: "actFill", |
|
|
|
prepend:"V", |
|
|
|
prepend: "V", |
|
|
|
maxlength: 50 |
|
|
|
}, |
|
|
|
|
|
|
|
@ -158,6 +157,7 @@ export default { |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
// 操作步骤表单配置 |
|
|
|
stepFormConfig() { |
|
|
|
return [ |
|
|
|
{ |
|
|
|
@ -185,7 +185,7 @@ export default { |
|
|
|
fillType: "preFill", |
|
|
|
subOptions: this.getDictOptions('business_nddw'), |
|
|
|
maxlength: 10, |
|
|
|
selectTo:"targetActConcentrationUnit",//下拉选择后,赋值到对应字段 |
|
|
|
selectTo: "targetActConcentrationUnit",//下拉选择后,赋值到对应字段 |
|
|
|
}, |
|
|
|
targetActConcentration: { |
|
|
|
label: 'template.common.targetActConcentration', |
|
|
|
@ -207,7 +207,7 @@ export default { |
|
|
|
subOptions: this.getDictOptions('business_tjdw'), |
|
|
|
fillType: "preFill", |
|
|
|
maxlength: 10, |
|
|
|
selectTo:"targetActVolumeUnit",//下拉选择后,赋值到对应字段 |
|
|
|
selectTo: "targetActVolumeUnit",//下拉选择后,赋值到对应字段 |
|
|
|
}, |
|
|
|
targetActVolume: { |
|
|
|
label: 'template.common.targetActVolume', |
|
|
|
@ -251,43 +251,45 @@ export default { |
|
|
|
formData: { |
|
|
|
immediate: true, |
|
|
|
handler(v) { |
|
|
|
if(!v.targetCodeSn && this.fillType === "actFill"){ |
|
|
|
if (!v.targetCodeSn && this.fillType === "actFill") { |
|
|
|
this.getCode(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
printTag(){ |
|
|
|
//打印标签 |
|
|
|
printTag() { |
|
|
|
const printConfig = this.getBasePrintConfig(); |
|
|
|
const {storageCondition,targetCodeSn} = this.formData; |
|
|
|
const { storageCondition, targetCodeSn } = this.formData; |
|
|
|
printConfig["存储条件"] = storageCondition; |
|
|
|
printConfig["编号"] = targetCodeSn; |
|
|
|
printConfig["编号"] = targetCodeSn; |
|
|
|
|
|
|
|
EventBus.$emit('showTagPrintDialog', {printConfig}) |
|
|
|
EventBus.$emit('showTagPrintDialog', { printConfig }) |
|
|
|
}, |
|
|
|
//获取目标溶液编号 |
|
|
|
async getCode(){ |
|
|
|
async getCode() { |
|
|
|
const result = await getLatestSn({ |
|
|
|
count: 1, |
|
|
|
}) |
|
|
|
if(result.code == 200){ |
|
|
|
this.$refs.stepFormPackageRef.updateFormData("targetCodeSn",result.data[0]) |
|
|
|
if (result.code == 200) { |
|
|
|
this.$refs.stepFormPackageRef.updateFormData("targetCodeSn", result.data[0]) |
|
|
|
} |
|
|
|
}, |
|
|
|
//获取已填写的表单数据 |
|
|
|
getFilledFormData(){ |
|
|
|
getFilledFormData() { |
|
|
|
return this.getFilledFormDataByRefs(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]) |
|
|
|
}, |
|
|
|
//获取填写完成的表单数据 |
|
|
|
async getFormData() { |
|
|
|
let content = await this.validFormFields(["baseInfoRef", "storageConditionRef", "stepFormPackageRef", "stepRef", "remarkRef"]); |
|
|
|
//生成resource |
|
|
|
let tmpResource = [] |
|
|
|
if(this.fillType === "actFill"){ |
|
|
|
if (this.fillType === "actFill") { |
|
|
|
//配置的试剂 |
|
|
|
tmpResource.push({ |
|
|
|
mc: content.targetName, |
|
|
|
bh: content.targetCode+content.targetCodeSn, |
|
|
|
bh: content.targetCode + content.targetCodeSn, |
|
|
|
ph: '', |
|
|
|
nd: content.targetActConcentration + content.targetActConcentrationUnit, |
|
|
|
source: 'ELN配制', |
|
|
|
@ -297,22 +299,15 @@ export default { |
|
|
|
kc: content.targetActVolume, |
|
|
|
kcdw: content.targetActVolumeUnit, |
|
|
|
syl: null, |
|
|
|
syldw:content.targetActVolumeUnit, |
|
|
|
yxzq:content.effectivePeriod, |
|
|
|
yxzqdw:content.effectivePeriodUnit, |
|
|
|
syldw: content.targetActVolumeUnit, |
|
|
|
yxzq: content.effectivePeriod, |
|
|
|
yxzqdw: content.effectivePeriodUnit, |
|
|
|
}) |
|
|
|
} |
|
|
|
//使用的试剂 |
|
|
|
this.resourceTmp=tmpResource |
|
|
|
|
|
|
|
this.resourceTmp = tmpResource |
|
|
|
return content; |
|
|
|
}, |
|
|
|
async onSave() { |
|
|
|
const formData = await this.validFormFields(["stepRef"]); |
|
|
|
|
|
|
|
console.log(formData, "formData") |
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
@ -320,7 +315,8 @@ export default { |
|
|
|
.mt-20 { |
|
|
|
margin-top: 20px; |
|
|
|
} |
|
|
|
.print-btn{ |
|
|
|
|
|
|
|
.print-btn { |
|
|
|
margin-bottom: 20px; |
|
|
|
} |
|
|
|
</style> |