|
|
|
@ -0,0 +1,158 @@ |
|
|
|
<!-- 生物样品分析溶液配制表 --> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div class="detail-container"> |
|
|
|
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc || |
|
|
|
$t('template.sp.sp007.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.wzInfo" :columns="sywzColumns" :dataSource="resourceWz" v-if="resourceWz.length>0"/> |
|
|
|
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :dataSource="yqResource" /> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.storageCondition" |
|
|
|
label="template.common.storageCondition" ref="storageConditionRef" |
|
|
|
:formConfig="storageFormConfig" :formData="formData" /> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="样本说明" label="样本说明" |
|
|
|
ref="ybRef" :formConfig="ybFormConfig" :formData="formData" /> |
|
|
|
<Step ref="stepRef" :formData="formData.stepData"></Step> |
|
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
|
ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- <button @click="onSave">保存</button> --> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import BaseInfoFormPackage from "@/components/Template/BaseInfoFormPackage"; |
|
|
|
import LineLabel from "@/components/Template/LineLabel"; |
|
|
|
import TableList from "@/components/Template/Table"; |
|
|
|
import Step from "@/components/Template/Step"; |
|
|
|
import templateMixin from "../../mixins/templateMixin"; |
|
|
|
import CustomTable from '@/components/Template/CustomTable.vue'; |
|
|
|
import { getLatestSn } from '@/api/template'; |
|
|
|
import { EventBus } from "@/utils/eventBus"; |
|
|
|
import { uniqeResource } from "@/utils/calUnitTools"; |
|
|
|
import { debounce } from 'lodash-es'; |
|
|
|
import {getBaseInfoFormConfig, getRemarkFormConfig,getStorageFormConfig,getYbFormConfig} from "../../formConfig/sp/SP007"; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "SP007", |
|
|
|
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable }, |
|
|
|
mixins: [templateMixin], |
|
|
|
props: { |
|
|
|
fillType: { |
|
|
|
type: String, |
|
|
|
default: 'preFill', |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
// 配置条件 |
|
|
|
storageFormConfig() { |
|
|
|
return getStorageFormConfig(this); |
|
|
|
}, |
|
|
|
// 备注表单配置 |
|
|
|
remarkConig() { |
|
|
|
return getRemarkFormConfig(); |
|
|
|
}, |
|
|
|
// 样本说明 |
|
|
|
ybFormConfig() { |
|
|
|
return getYbFormConfig(); |
|
|
|
}, |
|
|
|
// 试验基本信息表单配置 |
|
|
|
baseInfoFormConfig() { |
|
|
|
return getBaseInfoFormConfig(this); |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
formData: {} |
|
|
|
}; |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
const formData = this.getFormDataByTemplateData(); |
|
|
|
if(!formData.targetCodeSn&& this.fillType === "actFill"){ |
|
|
|
this.getCode(formData); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
//打印标签 |
|
|
|
printTag() { |
|
|
|
const printConfig = this.getBasePrintConfig(); |
|
|
|
const { storageCondition, targetCodeSn } = this.formData; |
|
|
|
printConfig["存储条件"] = storageCondition; |
|
|
|
printConfig["编号"] = targetCodeSn; |
|
|
|
|
|
|
|
EventBus.$emit('showTagPrintDialog', { printConfig }) |
|
|
|
}, |
|
|
|
//获取目标溶液编号 |
|
|
|
getCode: debounce(async function (v) { |
|
|
|
const result = await getLatestSn({ |
|
|
|
count: 1, |
|
|
|
pre:v.targetCode, |
|
|
|
type:1 |
|
|
|
}) |
|
|
|
if (result.code == 200) { |
|
|
|
this.$refs.stepFormPackageRef.updateFormData("targetCodeSn", result.data[0]) |
|
|
|
} |
|
|
|
}, 100), |
|
|
|
//获取已填写的表单数据 |
|
|
|
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") { |
|
|
|
//配置的试剂 |
|
|
|
tmpResource.push({ |
|
|
|
mc: content.targetName, |
|
|
|
bh: content.targetCode + content.targetCodeSn, |
|
|
|
ph: '', |
|
|
|
ndz: content.targetActConcentration + content.targetActConcentrationUnit, |
|
|
|
nd: content.targetActConcentration, |
|
|
|
nddw: content.targetActConcentrationUnit, |
|
|
|
ly: 'ELN配制', |
|
|
|
sxrq: content.expireDate, |
|
|
|
kc: content.targetActVolume, |
|
|
|
kcdw: content.targetActVolumeUnit, |
|
|
|
syl: null, |
|
|
|
type: null, |
|
|
|
elnType: this.product, |
|
|
|
syldw: content.targetActVolumeUnit, |
|
|
|
yxzq: content.effectivePeriod, |
|
|
|
yxzqdw: content.effectivePeriodUnit, |
|
|
|
}) |
|
|
|
} |
|
|
|
//使用的试剂、仪器 |
|
|
|
const stepResource = this.$refs.stepRef.getStepResource() |
|
|
|
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[]) |
|
|
|
this.yqResourceTmp = stepResource.yqResource||[] |
|
|
|
return content; |
|
|
|
}, |
|
|
|
//保存 |
|
|
|
async onSave() { |
|
|
|
let content =await this.$refs.stepRef.getFormData(); |
|
|
|
console.log(content); |
|
|
|
|
|
|
|
}, |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style rel="stylesheet/scss" lang="scss"> |
|
|
|
.mt-20 { |
|
|
|
margin-top: 20px; |
|
|
|
} |
|
|
|
|
|
|
|
.print-btn { |
|
|
|
margin-bottom: 20px; |
|
|
|
} |
|
|
|
</style> |