2 Commits

8 changed files with 1075 additions and 94 deletions
Split View
  1. +2
    -1
      src/components/Template/BaseInfoFormPcakge.vue
  2. +3
    -1
      src/views/business/comps/template/TemplateTable.vue
  3. +1
    -1
      src/views/business/comps/template/comps/dl/SYWZPZJHB.vue
  4. +15
    -15
      src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue
  5. +8
    -8
      src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue
  6. +8
    -9
      src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue
  7. +985
    -0
      src/views/business/comps/template/comps/sp/SWYPNBGZYZBB.vue
  8. +53
    -59
      src/views/business/comps/template/mixins/templateMixin.js

+ 2
- 1
src/components/Template/BaseInfoFormPcakge.vue View File

@ -235,7 +235,8 @@ export default {
isShowOther(v = []) {
// v
const arr = Array.isArray(v) ? v : [v];
return arr.map(val => String(val)).includes("-1");
//value
return arr.some(item => item<0);
},
// formConfigform
handleFormField() {

+ 3
- 1
src/views/business/comps/template/TemplateTable.vue View File

@ -14,11 +14,12 @@ import SWYPFXRYPZB from "./comps/sp/SWYPFXRYPZB.vue";
import SWYPFXCBYPZB from "./comps/sp/SWYPFXCBYPZB.vue";
import SWYPBQGZYZBB from "./comps/sp/SWYPBQGZYZBB.vue";
import SYWZPZJHB from "./comps/dl/SYWZPZJHB.vue";
import SWYPNBGZYZBB from "./comps/sp/SWYPNBGZYZBB.vue";
import Demo from "./comps/sp/Demo.vue";
export default {
name: "TemplateTable",
components: {
SP001,SWYPFXRYPZB ,Demo,SWYPFXCBYPZB,SWYPBQGZYZBB,SYWZPZJHB,
SP001,SWYPFXRYPZB ,Demo,SWYPFXCBYPZB,SWYPBQGZYZBB,SYWZPZJHB,SWYPNBGZYZBB,
},
props: {
sn: {
@ -42,6 +43,7 @@ export default {
'SP001': 'SWYPFXRYPZB',
'SP002': 'SWYPFXCBYPZB',
'SP003': 'SWYPBQGZYZBB',
'SP004': 'SWYPNBGZYZBB',
'DL001': 'SYWZPZJHB',
// 'SP001': 'Demo',
}

+ 1
- 1
src/views/business/comps/template/comps/dl/SYWZPZJHB.vue View File

@ -235,6 +235,6 @@ export default {
.add-row{
display: flex;
justify-content: center;
margin-top: 20px;
padding: 20px 0;
}
</style>

+ 15
- 15
src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue View File

@ -87,7 +87,7 @@ export default {
label: "存储条件",
type: "select",
fillType: "preFill",
options: this.$store.state.template.conditionOptions,
options: this.getDictOptions('business_cctj'),
otherCode: "other1",
},
@ -155,7 +155,7 @@ export default {
type: "select",
multiple: true,
fillType: "preFill",
options: this.$store.state.template.conditionOptions,
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
@ -164,7 +164,7 @@ export default {
fillType: "actFill",
otherCode: "actOther",
multiple: true,
options: this.$store.state.template.conditionOptions
options: this.getDictOptions('business_pztj')
}
}
},
@ -174,7 +174,7 @@ export default {
containerMaterial: {
label: "容器材质",
type: "select",
options: this.$store.state.template.containerMaterialOptions,
options: this.getDictOptions('business_rqcz'),
fillType: "actFill",
otherCode: "containerMaterialOther",
}
@ -216,7 +216,7 @@ export default {
type: "inputNumber",
subType: "select",
fillType: "preFill",
subOptions: this.$store.state.template.mgOptions,
subOptions: this.getDictOptions('business_nddw'),
subKey: "subTargetStartSolution",
maxlength: 10,
},
@ -246,7 +246,7 @@ export default {
label: "存储条件",
type: "select",
fillType: "preFill",
options: this.$store.state.template.conditionOptions,
options: this.getDictOptions('business_cctj'),
otherCode: "stepStorageConditionOther",
},
@ -256,7 +256,7 @@ export default {
subType: "select",
subKey: "effectivePeriodUnit",
fillType: "preFill",
subOptions: this.$store.state.template.effectivePeriodOptions,
subOptions: this.getDictOptions('business_yxqdw'),
},
expireDate: {
label: "目标溶液失效日",
@ -292,7 +292,7 @@ export default {
width: 280,
headerSelectKey: "targetStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.$store.state.template.volumeOptions,
headerOptions: this.getDictOptions('business_tjdw'),
defaultValue: "mg",
bodyType: "inputNumber",
bodySubType: "inputNumber",
@ -311,7 +311,7 @@ export default {
width: 280,
headerSelectKey: "actStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.$store.state.template.volumeOptions,
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
@ -323,7 +323,7 @@ export default {
width: 280,
headerSelectKey: "targetDiluentVolumeUnit",
fillType: "preFill",
headerOptions: this.$store.state.template.volumeOptions,
headerOptions: this.getDictOptions('business_tjdw'),
defaultValue: "mg",
bodyType: "inputNumber",
bodySubType: "inputNumber",
@ -342,7 +342,7 @@ export default {
width: 280,
headerSelectKey: "actDiluentVolumeUnit",
fillType: "preFill",
headerOptions: this.$store.state.template.volumeOptions,
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
@ -354,7 +354,7 @@ export default {
width: 280,
headerSelectKey: "targetSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: this.$store.state.template.volumeOptions,
headerOptions: this.getDictOptions('business_nddw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
@ -365,7 +365,7 @@ export default {
width: 280,
headerSelectKey: "actSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: this.$store.state.template.volumeOptions,
headerOptions: this.getDictOptions('business_nddw'),
defaultValue: "mg",
bodyType: "inputNumber",
bodySubType: "inputNumber",
@ -385,7 +385,7 @@ export default {
width: 280,
headerSelectKey: "targetSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.$store.state.template.volumeOptions,
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
@ -396,7 +396,7 @@ export default {
width: 280,
headerSelectKey: "actSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.$store.state.template.volumeOptions,
headerOptions: this.getDictOptions('business_tjdw'),
defaultValue: "mg",
bodyType: "inputNumber",
bodySubType: "inputNumber",

+ 8
- 8
src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue View File

@ -68,7 +68,7 @@ export default {
label: "存储条件",
type: "select",
fillType: "preFill",
options: this.$store.state.template.conditionOptions,
options: this.getDictOptions('business_cctj'),
otherCode: "storageConditionOther",
},
@ -131,7 +131,7 @@ export default {
type: "select",
multiple: true,
fillType: "preFill",
options: this.$store.state.template.conditionOptions,
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
@ -140,7 +140,7 @@ export default {
fillType: "actFill",
otherCode: "actOther",
multiple: true,
options: this.$store.state.template.conditionOptions
options: this.getDictOptions('business_pztj'),
}
}
},
@ -183,7 +183,7 @@ export default {
subType: "select",
subKey: "targetPreConcentrationUnit",
fillType: "preFill",
subOptions: this.$store.state.template.mgOptions,
subOptions: this.getDictOptions('business_nddw'),
},
targetActConcentration: {
label: "目标溶液实际浓度",
@ -192,7 +192,7 @@ export default {
subKey: "targetActConcentrationUnit",
fillType: "actFill",
subFillType: "preFill",
subOptions: this.$store.state.template.mgOptions,
subOptions: this.getDictOptions('business_nddw'),
copyFrom: "targetPreConcentration",//
},
targetPreVolume: {
@ -200,7 +200,7 @@ export default {
type: "input",
subType: "select",
subKey: "targetPreVolumeUnit",
subOptions: this.$store.state.template.volumeOptions,
subOptions: this.getDictOptions('business_tjdw'),
fillType: "preFill",
},
targetActVolume: {
@ -210,7 +210,7 @@ export default {
subKey: "targetActVolumeUnit",
fillType: "actFill",
subFillType: "preFill",
subOptions: this.$store.state.template.volumeOptions,
subOptions: this.getDictOptions('business_tjdw'),
copyFrom: "targetPreVolume",//
},
effectivePeriod: {
@ -219,7 +219,7 @@ export default {
subType: "select",
subKey: "effectivePeriodUnit",
fillType: "preFill",
subOptions: this.$store.state.template.effectivePeriodOptions,
subOptions: this.getDictOptions('business_yxqdw'),
},
expireDate: {
label: "失效日",

+ 8
- 9
src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue View File

@ -68,7 +68,7 @@ export default {
label: this.$t('template.common.storageConditionLabel'),
type: "select",
fillType: "preFill",
options: this.$store.state.template.conditionOptions,
options: this.getDictOptions("business_cctj"),
otherCode: "storageConditionOther",
},
@ -133,7 +133,7 @@ export default {
type: "select",
multiple: true,
fillType: "preFill",
options: this.$store.state.template.conditionOptions,
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
@ -142,7 +142,7 @@ export default {
fillType: "actFill",
otherCode: "actOther",
multiple: true,
options: this.$store.state.template.conditionOptions
options: this.getDictOptions('business_pztj')
}
}
},
@ -187,7 +187,7 @@ export default {
subType: "select",
subKey: "targetPreConcentrationUnit",
fillType: "preFill",
subOptions: this.$store.state.template.mgOptions,
subOptions: this.getDictOptions('business_nddw'),
maxlength:10
},
targetActConcentration: {
@ -197,7 +197,7 @@ export default {
subKey: "targetActConcentrationUnit",
fillType: "actFill",
subFillType: "preFill",
subOptions: this.$store.state.template.mgOptions,
subOptions: this.getDictOptions('business_nddw'),
copyFrom: "targetPreConcentration",//
maxlength:10
},
@ -206,7 +206,7 @@ export default {
type: "inputNumber",
subType: "select",
subKey: "targetPreVolumeUnit",
subOptions: this.$store.state.template.volumeOptions,
subOptions: this.getDictOptions('business_tjdw'),
fillType: "preFill",
maxlength:10
},
@ -217,7 +217,7 @@ export default {
subKey: "targetActVolumeUnit",
fillType: "actFill",
subFillType: "preFill",
subOptions: this.$store.state.template.volumeOptions,
subOptions: this.getDictOptions('business_tjdw'),
copyFrom: "targetPreVolume",//
maxlength:10
},
@ -227,7 +227,7 @@ export default {
subType: "select",
subKey: "effectivePeriodUnit",
fillType: "preFill",
subOptions: this.$store.state.template.effectivePeriodOptions,
subOptions: this.getDictOptions('business_yxqdw'),
maxlength:10
},
expireDate: {
@ -264,7 +264,6 @@ export default {
this.formData = {
effectivePeriodUnit:"days",//
createTime: "2026-01-02 18:05:36",//
targetPreConcentration:2,
}
}
},

+ 985
- 0
src/views/business/comps/template/comps/sp/SWYPNBGZYZBB.vue View File

@ -0,0 +1,985 @@
<!-- 生物样品内标工作液制备表 -->
<template>
<div>
<div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">生物样品内标工作液制备表<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-content">
<div class="content">
<BaseInfoFormPcakge label="试验基本信息" ref="baseInfoRef" :formConfig="baseInfoFormConfig"
:formData="formData" />
<TableList label="试验试剂信息" :columns="sysjColumns" :dataSource="dataSource" />
<TableList label="仪器使用信息" :columns="yqsColumns" :dataSource="dataSource" />
<BaseInfoFormPcakge label="存储条件" ref="storageConditionRef" :formConfig="storageFormConfig"
:formData="formData" />
<LineLabel label="操作步骤" />
<div class = "mt-20">
<el-button type="primary" @click="handleAddParalle">新增平行配制</el-button>
<el-button type="primary" @click="handleAddLadder">新增阶梯配制</el-button>
</div>
<!-- 阶梯配制区域 -->
<div
label="阶梯配制"
v-for="(ladderConfig, ladderIndex) in formData.ladderConfigs"
:key="'ladder_' + ladderIndex"
>
<div class="template-form-item">
<div class="config-header">
<div>阶梯配制</div>
<el-button
type="text"
icon="el-icon-delete"
@click="deleteLadderConfig(ladderIndex)"
>删除</el-button>
</div>
<BaseInfoFormPcakge
@clickable="handleClickable"
:ref="`ladderStepFormPackageRef_${ladderIndex}`"
:formConfig="ladderStepFormConfig"
@blur="onHandleBlur"
:formData="ladderConfig"
/>
<CustomTable
@blur="onHandleTableBlur"
:showOperation="fillType === 'actFill'"
:ref="`ladderStepTableRef_${ladderIndex}`"
:columns="ladderStepColumns"
:formData="ladderConfig"
>
<template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'ladder', ladderIndex)"
></TableOpertaion>
</template>
</CustomTable>
<div class="add-row">
<el-button @click="handleAddRow('ladder', undefined, ladderIndex)">添加行</el-button>
</div>
<Step
class="mt-0"
:ref="`ladderStepRef_${ladderIndex}`"
:formData="ladderConfig.ladderStepData"
></Step>
</div>
</div>
<!-- 平行配制区域 -->
<div
label="平行配制"
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
:key="'paralle_' + paralleIndex"
>
<div class="template-form-item">
<div class="config-header">
<div>平行配制</div>
<el-button
type="text"
icon="el-icon-delete"
@click="deleteParalleConfig(paralleIndex)"
>删除</el-button>
</div>
<BaseInfoFormPcakge
@clickable="handleClickable"
:ref="`paralleStepFormPackageRef_${paralleIndex}`"
:formConfig="paralleStepFormConfig"
@blur="onHandleBlur"
:formData="paralleConfig"
/>
<CustomTable
@blur="onHandleTableBlur"
:showOperation="fillType === 'actFill'"
:ref="`paralleStepTableRef_${paralleIndex}`"
:columns="paralleStepColumns"
:formData="paralleConfig"
>
<template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)"
></TableOpertaion>
</template>
</CustomTable>
<div class="add-row">
<el-button @click="handleAddRow('paralle', undefined, paralleIndex)">添加行</el-button>
</div>
<Step
class="mt-0"
:ref="`paralleStepRef_${paralleIndex}`"
:formData="paralleConfig.paralleStepData"
></Step>
</div>
</div>
<BaseInfoFormPcakge label="备注" ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div>
</div>
<button @click="onSave">保存</button>
</div>
<SelectReagentDialog @submit="onSelectReagentSubmit" @cancel="selectReagentVisible = false"
ref="selectReagentDialogRef" :visible.sync="selectReagentVisible">
</SelectReagentDialog>
</div>
</template>
<script>
import BaseInfoFormPcakge from "@/components/Template/BaseInfoFormPcakge";
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 SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
export default {
name: "SWYPBQGZYZBB",
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion },
mixins: [templateMixin],
props: {
value: {
type: {},
default: () => { },
},
fillType: {
type: String,
default: 'preFill',
},
},
watch: {
value: {
immediate: true,
handler(v) {
//
if (v && Object.keys(v).length > 0) {
this.formData = { ...this.formData, ...v };
//
if (v.ladderConfigs && Array.isArray(v.ladderConfigs) && v.ladderConfigs.length > 0) {
// ladderConfigs
if (!this.formData.ladderConfigs || !Array.isArray(this.formData.ladderConfigs)) {
this.$set(this.formData, 'ladderConfigs', []);
}
//
v.ladderConfigs.forEach((ladderConfig, index) => {
//
if (!this.formData.ladderConfigs[index]) {
this.formData.ladderConfigs[index] = {
ladderStepData: [],
ladderTableFormData: [],
showLadderConfig: true
};
}
//
if (ladderConfig.ladderTableFormData && ladderConfig.ladderTableFormData.length > 0 && this.$refs[`ladderStepTableRef_${index}`]) {
this.$refs[`ladderStepTableRef_${index}`].updateDataSource(ladderConfig.ladderTableFormData);
}
//
if (!ladderConfig.ladderStepData) {
this.$set(this.formData.ladderConfigs[index], 'ladderStepData', []);
}
//
if (ladderConfig.showLadderConfig === undefined) {
this.$set(this.formData.ladderConfigs[index], 'showLadderConfig', !!ladderConfig.ladderStepData && ladderConfig.ladderStepData.length > 0);
}
});
}
//
if (v.paralleConfigs && Array.isArray(v.paralleConfigs) && v.paralleConfigs.length > 0) {
// paralleConfigs
if (!this.formData.paralleConfigs || !Array.isArray(this.formData.paralleConfigs)) {
this.$set(this.formData, 'paralleConfigs', []);
}
//
v.paralleConfigs.forEach((paralleConfig, index) => {
//
if (!this.formData.paralleConfigs[index]) {
this.formData.paralleConfigs[index] = {
paralleStepData: [],
paralleTableFormData: [],
showParalleConfig: true
};
}
//
if (paralleConfig.paralleTableFormData && paralleConfig.paralleTableFormData.length > 0 && this.$refs[`paralleStepTableRef_${index}`]) {
this.$refs[`paralleStepTableRef_${index}`].updateDataSource(paralleConfig.paralleTableFormData);
}
//
if (!paralleConfig.paralleStepData) {
this.$set(this.formData.paralleConfigs[index], 'paralleStepData', []);
}
//
if (paralleConfig.showParalleConfig === undefined) {
this.$set(this.formData.paralleConfigs[index], 'showParalleConfig', !!paralleConfig.paralleStepData && paralleConfig.paralleStepData.length > 0);
}
});
}
//
if (v.ladderTableFormData && v.ladderTableFormData.length > 0 && (!v.ladderConfigs || v.ladderConfigs.length === 0)) {
this.formData.ladderConfigs = [{
ladderStepData: v.ladderStepData || [],
ladderTableFormData: v.ladderTableFormData,
showLadderConfig: v.showLadderConfig !== undefined ? v.showLadderConfig : true
}];
}
if (v.paralleTableFormData && v.paralleTableFormData.length > 0 && (!v.paralleConfigs || v.paralleConfigs.length === 0)) {
this.formData.paralleConfigs = [{
paralleStepData: v.paralleStepData || [],
paralleTableFormData: v.paralleTableFormData,
showParalleConfig: v.showParalleConfig !== undefined ? v.showParalleConfig : true
}];
}
}
}
},
fillType: {
immediate: true,
handler(v) {
console.log(v, "fillType")
}
},
},
computed: {
//
storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition1: {
label: "存储条件",
type: "select",
fillType: "preFill",
options: this.getDictOptions('business_cctj'),
otherCode: "other1",
},
}
}
];
},
//
remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: "请输入备注",
maxlength: 1000,
rows: 5
}
}
}
]
},
//
baseInfoFormConfig() {
return [
{
type: "cardItem",
config: {
studyMc: {
label: "试验名称",
type: "input",
disabled: true,
},
studySn: {
label: "试验编号",
type: "input",
disabled: true,
},
methodCode: {
label: "方法编号",
type: "input",
fillType: "preFill",
maxlength: 50,
},
versionNum: {
label: "版本号",
type: "inputNumber",
fillType: "actFill",
prepend: "V",
maxlength: 50,
},
}
},
{
type: "conditionItem",
label: "试验配制条件",
config: {
pre: {
label: "预填",
type: "select",
multiple: true,
fillType: "preFill",
options: this.getDictOptions('business_pztj'),
otherCode: "preOther",
},
act: {
label: "实际",
type: "select",
fillType: "actFill",
otherCode: "actOther",
multiple: true,
options: this.getDictOptions('business_pztj')
}
}
},
{
type: "cellItem",
config: {
containerMaterial: {
label: "容器材质",
type: "select",
options: this.getDictOptions('business_rqcz'),
fillType: "actFill",
otherCode: "containerMaterialOther",
}
}
},
{
type: "cellItem",
label: "处理时间",
config: {
createTime: {
label: "开始时间",
type: "input",
},
endTime: {
label: "结束时间",
type: "input",
},
}
}
]
},
paralleStepFormConfig(){
return[
{
type:"step",
config:{
solution: {
label: "稀释液",
type: "input",
fillType: "preFill",
subType: "clickable",
subKey: "subSolution",
subFillType: "actFill",
maxlength: 20,
},
stepStorageCondition: {
label: "存储条件",
type: "select",
fillType: "preFill",
options: this.getDictOptions('business_cctj'),
otherCode: "stepStorageConditionOther",
},
}
}
]
},
//
ladderStepFormConfig() {
return [
{
type: "step",
config: {
startSolution: {
label: "起始源溶液",
type: "input",
fillType: "preFill",
subType: "clickable",
subKey: "subStartSolution",
subFillType: "actFill",
maxlength: 20,
},
targetStartSolution: {
label: "预设起始源溶液浓度",
type: "inputNumber",
subType: "select",
fillType: "preFill",
subOptions: this.getDictOptions('business_nddw'),
subKey: "subTargetStartSolution",
maxlength: 10,
},
targetAcSolution: {
label: "实际起始源溶液浓度",
type: "input",
fillType: "actFill",
disabled: true,
maxlength: 10,
},
solution: {
label: "稀释液",
type: "input",
fillType: "preFill",
subType: "clickable",
subKey: "subSolution",
subFillType: "actFill",
maxlength: 20,
},
codeSTD: {
label: "起始编号STD",
type: "input",
maxlength: 10,
fillType: "preFill",
},
stepStorageCondition: {
label: "存储条件",
type: "select",
fillType: "preFill",
options: this.getDictOptions('business_cctj'),
otherCode: "stepStorageConditionOther",
},
effectivePeriod: {
label: "目标溶液有效周期",
type: "input",
subType: "select",
subKey: "effectivePeriodUnit",
fillType: "preFill",
subOptions: this.getDictOptions('business_yxqdw'),
},
expireDate: {
label: "目标溶液失效日",
type: "input",
},
}
}
]
},
paralleStepColumns() {
return [
{
label: "目标溶液编号",
prop: "targetSolutionCode",
bodyType: "input",
subType: "span",
subKey: "subTargetSolutionCode",
bodyFillType: "preFill",
width: 280
},
{
label: "起始溶液编号",
prop: "startSolutionCode",
width: 280,
bodyType: "input",
bodyFillType: "actFill",
bodyMaxlength: 10,
},
{
label: "预设起始溶液体积",
prop: "targetStartSolutionVolume",
width: 280,
headerSelectKey: "targetStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
defaultValue: "mg",
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "targetStartSolutionVolumePrecision",
bodyFillType: "preFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "targetStartSolutionVolumePrecision",
bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际起始溶液体积",
prop: "actStartSolutionVolume",
width: 280,
headerSelectKey: "actStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
copyFrom: "targetStartSolutionVolume",//
},
{
label: "预设稀释液体积",
prop: "targetDiluentVolume",
width: 280,
headerSelectKey: "targetDiluentVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
defaultValue: "mg",
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "targetDiluentVolumePrecision",
bodyFillType: "preFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "targetDiluentVolumePrecision",
bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际稀释液体积",
prop: "actDiluentVolume",
width: 280,
headerSelectKey: "actDiluentVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
copyFrom: "targetDiluentVolume",//
},
{
label: "预设目标溶液浓度",
prop: "targetSolutionConcentration",
width: 280,
headerSelectKey: "targetSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_nddw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
},
{
label: "实际目标溶液浓度",
prop: "actSolutionConcentration",
width: 280,
headerSelectKey: "actSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_nddw'),
defaultValue: "mg",
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "actSolutionConcentrationPrecision",
bodyFillType: "actFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "actSolutionConcentrationPrecision",
bodyMaxlength: 10,
copyFrom: "targetSolutionConcentration",//
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "预设目标溶液体积",
prop: "targetSolutionVolume",
width: 280,
headerSelectKey: "targetSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
},
{
label: "实际目标溶液体积",
prop: "actSolutionVolume",
width: 280,
headerSelectKey: "actSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
defaultValue: "mg",
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "actSolutionVolumePrecision",
bodyFillType: "actFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "actSolutionVolumePrecision",
bodyMaxlength: 10,
copyFrom: "targetSolutionVolume",//
bodySubPlaceholder: "请输入保留小数位数",
},
]
},
//
ladderStepColumns() {
return [
{
label: "目标溶液编号",
prop: "targetSolutionCode",
bodyType: "input",
subType: "span",
subKey: "subTargetSolutionCode",
bodyFillType: "preFill",
width: 280
},
{
label: "起始溶液编号",
prop: "startSolutionCode",
width: 280,
bodyType: "input",
bodyFillType: "actFill",
bodyMaxlength: 10,
},
{
label: "预设起始溶液体积",
prop: "targetStartSolutionVolume",
width: 280,
headerSelectKey: "targetStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
defaultValue: "mg",
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "targetStartSolutionVolumePrecision",
bodyFillType: "preFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "targetStartSolutionVolumePrecision",
bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际起始溶液体积",
prop: "actStartSolutionVolume",
width: 280,
headerSelectKey: "actStartSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
copyFrom: "targetStartSolutionVolume",//
},
{
label: "预设稀释液体积",
prop: "targetDiluentVolume",
width: 280,
headerSelectKey: "targetDiluentVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
defaultValue: "mg",
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "targetDiluentVolumePrecision",
bodyFillType: "preFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "targetDiluentVolumePrecision",
bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "实际稀释液体积",
prop: "actDiluentVolume",
width: 280,
headerSelectKey: "actDiluentVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyMaxlength: 10,
copyFrom: "targetDiluentVolume",//
},
{
label: "预设目标溶液浓度",
prop: "targetSolutionConcentration",
width: 280,
headerSelectKey: "targetSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_nddw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
},
{
label: "实际目标溶液浓度",
prop: "actSolutionConcentration",
width: 280,
headerSelectKey: "actSolutionConcentrationUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_nddw'),
defaultValue: "mg",
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "actSolutionConcentrationPrecision",
bodyFillType: "actFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "actSolutionConcentrationPrecision",
bodyMaxlength: 10,
copyFrom: "targetSolutionConcentration",//
bodySubPlaceholder: "请输入保留小数位数",
},
{
label: "预设目标溶液体积",
prop: "targetSolutionVolume",
width: 280,
headerSelectKey: "targetSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
},
{
label: "实际目标溶液体积",
prop: "actSolutionVolume",
width: 280,
headerSelectKey: "actSolutionVolumeUnit",
fillType: "preFill",
headerOptions: this.getDictOptions('business_tjdw'),
defaultValue: "mg",
bodyType: "inputNumber",
bodySubType: "inputNumber",
bodySubKey: "actSolutionVolumePrecision",
bodyFillType: "actFill",
bodySubFillType: "preFill",
showBodySub: this.fillType === "preFill",
bodyDisabled: true,
bodyPrecisionKey: "actSolutionVolumePrecision",
bodyMaxlength: 10,
copyFrom: "targetSolutionVolume",//
bodySubPlaceholder: "请输入保留小数位数",
},
]
},
},
data() {
return {
selectReagentVisible: false,
subSolutionVisible: false,
currentSubKey: "",//key
dataSource: [],
stepTableDataSource: [],
sysjColumns: [
{ label: "试剂名称", prop: "reagentName" },
{ label: "编号", prop: "reagentCode" },
{ label: "批号", prop: "reagentNo" },
{ label: "浓度/含量/纯度", prop: "concentration" },
{ label: "来源", prop: "source" },
{ label: "失效日", prop: "expireDate" },
],
yqsColumns: [
{ label: "仪器名称", prop: "instrumentName" },
{ label: "仪器型号", prop: "instrumentModel" },
{ label: "仪器编号", prop: "instrumentCode" },
{ label: "下次测试/校准/检定日期", prop: "nextTestDate" },
],
};
},
mounted() {
if (this.fillType === "preFill") {
this.formData = {
effectivePeriodUnit: "days",//
createTime: "2026-01-02 18:05:36",//
versionNum: 1,
stepTableFormData: [],
ladderConfigs: [], //
paralleConfigs: [], //
headerSelectFields: {
targetStartSolutionVolumeUnit: "mg",
actStartSolutionVolumeUnit: "mg",
targetDiluentVolumeUnit: "mg",
actDiluentVolumeUnit: "mg",
targetSolutionConcentrationUnit: "mg",
actSolutionConcentrationUnit: "mg",
targetSolutionVolumeUnit: "mg",
actSolutionVolumeUnit: "mg",
}
}
}
},
methods: {
//
handleAddParalle() {
//
if (!this.formData.paralleConfigs) {
this.$set(this.formData, 'paralleConfigs', []);
}
//
this.formData.paralleConfigs.push({
paralleStepData: [],
paralleTableFormData: [],
showParalleConfig: true
});
},
//
handleAddLadder() {
//
if (!this.formData.ladderConfigs) {
this.$set(this.formData, 'ladderConfigs', []);
}
//
this.formData.ladderConfigs.push({
ladderStepData: [],
ladderTableFormData: [],
showLadderConfig: true
});
},
//
deleteLadderConfig(index) {
this.formData.ladderConfigs.splice(index, 1);
},
//
deleteParalleConfig(index) {
this.formData.paralleConfigs.splice(index, 1);
},
//
handleAddRow(type, rowIndex, configIndex = 0) {
const tableRef = type === 'ladder' ?
this.$refs[`ladderStepTableRef_${configIndex}`] :
this.$refs[`paralleStepTableRef_${configIndex}`];
console.log(tableRef,"refff")
if (tableRef && tableRef[0].addRow) {
tableRef[0].addRow({});
}
},
//
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.deleteRow(rowIndex);
}
}
},
handleClickable(item) {
if (this.fillType === "preFill") {
// return;
}
const { subKey = "" } = item;
if (subKey === "subStartSolution" || subKey === "subSolution") {//
this.selectReagentVisible = true;
this.currentSubKey = subKey;
}
},
//
onSelectReagentSubmit(code) {
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code);
this.selectReagentVisible = false;
},
async getFormData() {
const baseData = await this.$refs.baseInfoRef.getFormData();
const conditionData = await this.$refs.storageConditionRef.getFormData();
//
const ladderConfigsData = [];
if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) {
for (let i = 0; i < this.formData.ladderConfigs.length; i++) {
const ladderFormData = await this.$refs[`ladderStepFormPackageRef_${i}`][0].getFormData();
const ladderTableFormData = await this.$refs[`ladderStepTableRef_${i}`][0].getFormData();
const ladderStepData = await this.$refs[`ladderStepRef_${i}`][0].getFormData();
ladderConfigsData.push({
...ladderFormData,
...ladderTableFormData,
ladderStepData,
showLadderConfig: true
});
}
}
//
const paralleConfigsData = [];
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
const paralleFormData = await this.$refs[`paralleStepFormPackageRef_${i}`][0].getFormData();
const paralleTableFormData = await this.$refs[`paralleStepTableRef_${i}`][0].getFormData();
const paralleStepData = await this.$refs[`paralleStepRef_${i}`][0].getFormData();
paralleConfigsData.push({
...paralleFormData,
...paralleTableFormData,
paralleStepData,
showParalleConfig: true
});
}
}
const remarkData = await this.$refs.remarkRef.getFormData();
return {
...baseData,
...conditionData,
ladderConfigs: ladderConfigsData,
paralleConfigs: paralleConfigsData,
...remarkData
}
},
async onSave() {
const formData = await this.getFormData();
console.log(formData, "formData")
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss">
.mt-20 {
margin-top: 20px;
}
.config-section {
margin-bottom: 20px;
padding: 15px;
border: 1px solid #ebeef5;
border-radius: 4px;
background-color: #fafafa;
}
.config-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
font-weight: bold;
font-size: 16px;
color: #303133;
}
.config-header .el-button {
color: #f56c6c;
font-size: 14px;
}
.config-header .el-button:hover {
color: #f78989;
}
.add-row {
display: flex;
align-items: center;
padding: 20px 0;
border-bottom: 1px solid #ebeef5;
}
.mt-0{
margin-top: 0;
}
</style>

+ 53
- 59
src/views/business/comps/template/mixins/templateMixin.js View File

@ -1,53 +1,47 @@
import moment from "moment";
export default {
dicts: ['business_pztj','business_cctj','business_nddw','business_tjdw','business_yxqdw','business_rqcz'],
props: {
templateData: {
type: Object,
default: () => {},
default: () => { },
},
},
watch: {
templateData: {
immediate: true,
handler(v) {
if(v){
let n = {...v};
if(v.bdnr){
this.formData = {...n,...JSON.parse(v.bdnr)};
templateData: {
immediate: true,
handler(v) {
if (v) {
let n = { ...v };
if (v.bdnr) {
this.formData = { ...n, ...JSON.parse(v.bdnr) };
}
this.templateDetail = n;
this.setTemplateData(n);
}
}
}
},
}
}
},
data() {
return {
formData: {},
templateDetail:{}
templateDetail: {}
}
},
mounted() {
setTimeout(() => {
this.setConditionOptions(
[
{ label: "条件5", value: "1" },
{ label: "条件6", value: "2" },
{ label: "条件7", value: "3" },
{ label: "其他", value: "-1" },
]
)
}, 1000);
// this.setTemplateStatus("actFill");
this.setTemplateStatus(this.fillType)
// this.setTemplateStatus("actFill");
this.setTemplateStatus(this.fillType);
},
unmounted() {
this.setTemplateStatus("");
this.setTemplateData({});
},
methods: {
//试验配制条件options
getDictOptions(dictType) {
return this.dict.type[dictType] || [];
},
setTemplateStatus(status) {
this.$store.commit('template/SET_TEMPLATE_STATUS', status)
},
@ -62,58 +56,58 @@ export default {
this.$refs.stepTableRef.deleteRow(index);
},
//获取版本号
getVersionNum(){
getVersionNum() {
return this.formData.versionNum || "";
},
//统一处理blur事件,因为有效周期和过期日期是相关的,所以需要在有效周期失焦时更新过期日期
onHandleBlur(fields){
const {key ,effectivePeriodUnit,effectivePeriod,codeSTD,targetStartSolution} = fields;
const {createTime} = this.formData;
if(key ==="effectivePeriod"){//统一处理有效周期失焦,计算失效事件,保证字段名不能变
const start = moment(createTime);
const end = start.add(Number(effectivePeriod), effectivePeriodUnit).format("YYYY-MM-DD HH:mm:ss");
this.$refs.stepFormPackageRef.updateFormData("expireDate", end);
}else if(key === "codeSTD"){//起始编号STD失焦时,更新stepDataSource
const arr = Array.from({length:codeSTD},(item,index) => ({
actSolutionVolumePrecision:3,//小数点精度默认为3
actSolutionConcentrationPrecision:3,//小数点精度默认为3
targetDiluentVolumePrecision:3,//小数点精度默认为3
targetStartSolutionVolumePrecision:3,//小数点精度默认为3
targetSolutionCode:`STD${Number(codeSTD)-index}`
onHandleBlur(fields) {
const { key, effectivePeriodUnit, effectivePeriod, codeSTD, targetStartSolution } = fields;
const { createTime } = this.formData;
if (key === "effectivePeriod") {//统一处理有效周期失焦,计算失效事件,保证字段名不能变
const start = moment(createTime);
const end = start.add(Number(effectivePeriod), effectivePeriodUnit).format("YYYY-MM-DD HH:mm:ss");
this.$refs.stepFormPackageRef.updateFormData("expireDate", end);
} else if (key === "codeSTD") {//起始编号STD失焦时,更新stepDataSource
const arr = Array.from({ length: codeSTD }, (item, index) => ({
actSolutionVolumePrecision: 3,//小数点精度默认为3
actSolutionConcentrationPrecision: 3,//小数点精度默认为3
targetDiluentVolumePrecision: 3,//小数点精度默认为3
targetStartSolutionVolumePrecision: 3,//小数点精度默认为3
targetSolutionCode: `STD${Number(codeSTD) - index}`
}));
this.$refs.stepTableRef.updateDataSource(arr);
}else if(key === "targetStartSolution"){//起始溶液体积失焦时,更新目标溶液预计浓度
} else if (key === "targetStartSolution") {//起始溶液体积失焦时,更新目标溶液预计浓度
const arr = this.$refs.stepTableRef.getDataSource();
arr.forEach((item,rowIndex) => {
this.updateTargetStartSolutionVolume(rowIndex,item,targetStartSolution);
arr.forEach((item, rowIndex) => {
this.updateTargetStartSolutionVolume(rowIndex, item, targetStartSolution);
})
}
},
},
//统一处理table失焦事件
onHandleTableBlur(params){
const {rowIndex, colKey, value,item} = params;
console.log(rowIndex, colKey, value,item, "params")
if(colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision"){
onHandleTableBlur(params) {
const { rowIndex, colKey, value, item } = params;
console.log(rowIndex, colKey, value, item, "params")
if (colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") {
const volume = this.$refs.stepFormPackageRef.getFormDataByKey("targetStartSolution") || 0;
if(volume){
this.updateTargetStartSolutionVolume(rowIndex,item,volume);
if (volume) {
this.updateTargetStartSolutionVolume(rowIndex, item, volume);
}
}
},
//更新起始溶液体积时,更新目标溶液预计浓度
updateTargetStartSolutionVolume(rowIndex,item,volume){
updateTargetStartSolutionVolume(rowIndex, item, volume) {
const precision = item.targetStartSolutionVolumePrecision || 0;
const concentration = item.targetSolutionConcentration || 0;
const targetVolume = item.targetSolutionVolume || 0;
//目标溶液预计浓度:(目标溶液预计体积 乘以 起始溶液浓度)除以 起始溶液体积
const result = ((concentration * targetVolume) / volume).toFixed(precision);
this.$refs.stepTableRef.updateDataSourceByRowIndex(rowIndex,{targetStartSolutionVolume:result});
if(targetVolume){
//预设稀释液体积:目标溶液预计体积 减去 源溶液预计体积;
const precision1 = item.targetDiluentVolumePrecision || 0;
const result1 = (targetVolume - result).toFixed(precision1);
this.$refs.stepTableRef.updateDataSourceByRowIndex(rowIndex,{targetDiluentVolume:result1});
}
this.$refs.stepTableRef.updateDataSourceByRowIndex(rowIndex, { targetStartSolutionVolume: result });
if (targetVolume) {
//预设稀释液体积:目标溶液预计体积 减去 源溶液预计体积;
const precision1 = item.targetDiluentVolumePrecision || 0;
const result1 = (targetVolume - result).toFixed(precision1);
this.$refs.stepTableRef.updateDataSourceByRowIndex(rowIndex, { targetDiluentVolume: result1 });
}
}
},

Loading…
Cancel
Save