Browse Source

feat:[模板管理][update]

lkf
luojie 2 months ago
parent
commit
5ed77086a0
4 changed files with 345 additions and 661 deletions
  1. +4
    -5
      src/views/business/comps/template/TemplateTable.vue
  2. +11
    -2
      src/views/business/comps/template/comps/sp/SP0012.vue
  3. +0
    -324
      src/views/business/comps/template/comps/sp/SP002.vue

+ 4
- 5
src/views/business/comps/template/TemplateTable.vue View File

@ -23,8 +23,7 @@ import SelectMixReagentDialog from "./dialog/SelectMixReagentDialog.vue";//选
import EditSign from "./dialog/EditSign.vue";// import EditSign from "./dialog/EditSign.vue";//
// //
import SP001 from "./comps/sp/SP001.vue";
import SP002 from "./comps/sp/SP002.vue";
import SP0012 from "./comps/sp/SP0012.vue";
import SP003 from "./comps/sp/SP003.vue"; import SP003 from "./comps/sp/SP003.vue";
import SP00456 from "./comps/sp/SP00456.vue"; import SP00456 from "./comps/sp/SP00456.vue";
import SP007 from "./comps/sp/SP007.vue"; import SP007 from "./comps/sp/SP007.vue";
@ -61,7 +60,7 @@ export default {
MJYLQSQD, SYWZPZJHB, DMYPPZJLB, MJYLQSQD, SYWZPZJHB, DMYPPZJLB,
// //
// //
SP001, SP002, SP003, SP00456,SP007, SP008, SP009, SP010, SP011, SP012, SP013, SP014, SP015, SP016, SP017, SP018,
SP0012, SP003, SP00456,SP007, SP008, SP009, SP010, SP011, SP012, SP013, SP014, SP015, SP016, SP017, SP018,
// PCR // PCR
PCR001, PCR002 PCR001, PCR002
}, },
@ -89,8 +88,8 @@ export default {
if (!this.componentMap) { if (!this.componentMap) {
this.componentMap = { this.componentMap = {
// //
'SP001': 'SP001',
'SP002': 'SP002',
'SP001': 'SP0012',
'SP002': 'SP0012',
'SP003': 'SP003', 'SP003': 'SP003',
'SP004': 'SP00456', 'SP004': 'SP00456',
'SP005': 'SP00456', 'SP005': 'SP00456',

src/views/business/comps/template/comps/sp/SP001.vue → src/views/business/comps/template/comps/sp/SP0012.vue View File

@ -2,8 +2,7 @@
<template> <template>
<div> <div>
<div class="detail-container"> <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>
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc ||getTemplateName() }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content"> <div class="detail-content">
<div class="content"> <div class="content">
<BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo" <BaseInfoFormPackage fieldItemLabel="template.common.baseInfo" label="template.common.baseInfo"
@ -256,6 +255,16 @@ export default {
}, },
methods: { methods: {
getTemplateName() {
if (this.templateData && this.templateData.templateMc) {
return this.templateData.templateMc
}
const o = {
"SP001": "template.sp.sp001title",
"SP002": "template.sp.sp002.title",
}
return $t(o[this.sn]);
},
// //
printTag() { printTag() {
const printConfig = this.getBasePrintConfig(); const printConfig = this.getBasePrintConfig();

+ 0
- 324
src/views/business/comps/template/comps/sp/SP002.vue View File

@ -1,324 +0,0 @@
<!-- 生物样品分析溶液配制表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.bdmc ||
$t('template.sp.sp002.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" />
<TableList label="template.common.instrumentInfo" :columns="yqColumns" :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">{{ $t('template.common.bqdy') }}</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" />
</div>
</div>
</div>
</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";
export default {
name: "SP002",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable },
mixins: [templateMixin],
props: {
fillType: {
type: String,
default: 'preFill',
},
},
computed: {
//
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: 'template.common.storageConditionLabel',
type: "select",
fillType: "preFill",
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
}
}
];
},
//
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: 'template.common.remarkPlaceholder',
maxlength: 1000,
rows: 5
}
}
}
]
},
//
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: 'template.common.testName',
type: "input",
disabled: true,
},
studySn: {
label: 'template.common.testNumber',
type: "input",
disabled: true,
},
methodCode: {
label: 'template.common.methodCode',
type: "input",
fillType: "preFill",
maxlength: 50
},
versionNum: {
label: 'template.common.versionNumber',
type: "inputNumber",
fillType: "actFill",
prepend: "V",
maxlength: 50
},
}
},
{
type: "conditionItem",
label: 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: 'template.common.actualFill',
type: "select",
fillType: "actFill",
otherCode: "actOther",
multiple: true,
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
label: 'template.common.configurationTime',
config: {
startDate: {
label: 'template.common.startTime',
type: "input",
},
endDate: {
label: 'template.common.endTime',
type: "input",
},
}
}
]
},
//
stepFormConfig() {
return [
{
type: "step",
config: {
targetName: {
label: 'template.common.targetSolutionName',
type: "input",
fillType: "preFill",
maxlength: 50
},
targetCode: {
label: 'template.common.targetSolutionCode',
type: "input",
subType: "span",
fillType: "preFill",
subKey: "targetCodeSn",
maxlength: 20
},
targetPreConcentration: {
label: 'template.common.targetPreConcentration',
type: "inputNumber",
subType: "select",
subKey: "targetPreConcentrationUnit",
fillType: "preFill",
subOptions: this.getDictOptions('business_nddw'),
maxlength: 10,
selectTo: "targetActConcentrationUnit",//
},
targetActConcentration: {
label: 'template.common.targetActConcentration',
type: "inputNumber",
subType: "select",
subKey: "targetActConcentrationUnit",
compareTo: "targetPreConcentration",//
fillType: "actFill",
subFillType: "preFill",
subOptions: this.getDictOptions('business_nddw'),
copyFrom: "targetPreConcentration",//
maxlength: 10
},
targetPreVolume: {
label: 'template.common.targetPreVolume',
type: "inputNumber",
subType: "select",
subKey: "targetPreVolumeUnit",
subOptions: this.getDictOptions('business_tjdw'),
fillType: "preFill",
maxlength: 10,
selectTo: "targetActVolumeUnit",//
},
targetActVolume: {
label: 'template.common.targetActVolume',
type: "inputNumber",
subType: "select",
subKey: "targetActVolumeUnit",
fillType: "actFill",
subFillType: "preFill",
subOptions: this.getDictOptions('business_tjdw'),
compareTo: "targetPreVolume",//
copyFrom: "targetPreVolume",//
maxlength: 10
},
effectivePeriod: {
label: 'template.common.effectivePeriod',
type: "inputNumber",
subType: "select",
subKey: "effectivePeriodUnit",
fillType: "preFill",
subOptions: this.getDictOptions('business_yxqdw'),
maxlength: 10
},
expireDate: {
label: 'template.common.expireDate',
type: "input",
},
}
}
]
},
},
data() {
return {
resource: [],
resourceData1: [],
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 })
},
getStepResource() {
return this.$refs.stepRef.getStepResource()
},
//
async getCode(v) {
const result = await getLatestSn({
count: 1,
pre: v.targetCode,
type: 1
})
if (result.code == 200) {
this.$refs.stepFormPackageRef.updateFormData("targetCodeSn", result.data[0])
}
},
//
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: '',
nd: content.targetActConcentration,
nddw: content.targetActConcentrationUnit,
ndz: content.targetActConcentration + 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;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
</style>

Loading…
Cancel
Save