Browse Source

feat:[模板管理][烦人的浓度计算]

lkf
luojie 3 months ago
parent
commit
9f33e126f4
5 changed files with 416 additions and 366 deletions
  1. +10
    -1
      src/components/Template/CustomTable.vue
  2. +5
    -2
      src/components/Template/HandleFormItem.vue
  3. +115
    -332
      src/views/business/comps/template/comps/sp/SWYPNBGZYZBB.vue
  4. +271
    -26
      src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
  5. +15
    -5
      src/views/business/comps/template/mixins/templateMixin.js

+ 10
- 1
src/components/Template/CustomTable.vue View File

@ -185,6 +185,16 @@ export default {
this.headerSelectFields = JSON.parse(JSON.stringify(headerSelectFields)) this.headerSelectFields = JSON.parse(JSON.stringify(headerSelectFields))
} }
}, },
localDataSource:{
immediate: true,
deep: true,
handler(newVal,oldVal){
// if(newVal.length == 0){
// return
// }
// this.localDataSource = [...newVal];
}
}
}, },
mounted() { mounted() {
// this.initHeaderSelectValues(); // this.initHeaderSelectValues();
@ -239,7 +249,6 @@ export default {
// //
const validateResult = this.validateFormData(); const validateResult = this.validateFormData();
console.log(validateResult,"validateResult")
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (validateResult.valid) { if (validateResult.valid) {
resolve({ resolve({

+ 5
- 2
src/components/Template/HandleFormItem.vue View File

@ -353,7 +353,8 @@ export default {
// //
const isSame = this.isEqual(this.oldValue, this.inputValue); const isSame = this.isEqual(this.oldValue, this.inputValue);
if (this.oldValue && !isSame && this.templateFillType === "actFill") { if (this.oldValue && !isSame && this.templateFillType === "actFill") {
this.$refs.editSignRef.show()
// this.$refs.editSignRef.show()
this.handleUpdateRecord();
}else{// }else{//
this.handleUpdateRecord() this.handleUpdateRecord()
} }
@ -389,12 +390,14 @@ export default {
newRecord: record, newRecord: record,
resourceList: this.getZdxgjl(), resourceList: this.getZdxgjl(),
} }
EventBus.$emit('onModifyRecord', params,)
// //
this.oldValue = this.inputValue; // this.oldValue = this.inputValue; //
this.$emit("blur", this.inputValue); this.$emit("blur", this.inputValue);
this.$emit('input', this.inputValue); this.$emit('input', this.inputValue);
this.$emit("change", this.inputValue); this.$emit("change", this.inputValue);
setTimeout(() => {
EventBus.$emit('onModifyRecord', params,)
}, 10);
}, },
// //

+ 115
- 332
src/views/business/comps/template/comps/sp/SWYPNBGZYZBB.vue View File

@ -2,8 +2,8 @@
<template> <template>
<div> <div>
<div class="detail-container"> <div class="detail-container">
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{formData.templateMc || "生物样品内标工作液制备表"}}<img
src="@/assets/images/detail-title.png" /></div>
<div class="detail-title"><img src="@/assets/images/detail-title.png">{{ formData.templateMc ||
"生物样品内标工作液制备表" }}<img src="@/assets/images/detail-title.png" /></div>
<div class="detail-content"> <div class="detail-content">
<div class="content"> <div class="content">
<BaseInfoFormPcakge label="试验基本信息" ref="baseInfoRef" :formConfig="baseInfoFormConfig" <BaseInfoFormPcakge label="试验基本信息" ref="baseInfoRef" :formConfig="baseInfoFormConfig"
@ -13,118 +13,70 @@
<BaseInfoFormPcakge label="存储条件" ref="storageConditionRef" :formConfig="storageFormConfig" <BaseInfoFormPcakge label="存储条件" ref="storageConditionRef" :formConfig="storageFormConfig"
:formData="formData" /> :formData="formData" />
<LineLabel label="操作步骤" /> <LineLabel label="操作步骤" />
<div v-if = "fillType === 'preFill'" class = "mt-20">
<div v-if="fillType === 'preFill'" class="mt-20">
<el-button type="primary" @click="handleAddParalle">新增平行配制</el-button> <el-button type="primary" @click="handleAddParalle">新增平行配制</el-button>
<el-button type="primary" @click="handleAddLadder">新增阶梯配制</el-button> <el-button type="primary" @click="handleAddLadder">新增阶梯配制</el-button>
</div> </div>
<!-- 阶梯配制区域 --> <!-- 阶梯配制区域 -->
<div
v-for="(ladderConfig, ladderIndex) in formData.ladderConfigs"
:key="'ladder_' + ladderIndex"
>
<div v-for="(ladderConfig, ladderIndex) in formData.ladderConfigs" :key="'ladder_' + ladderIndex">
<div class="template-form-item"> <div class="template-form-item">
<div class="config-header"> <div class="config-header">
<div>阶梯配制</div> <div>阶梯配制</div>
<el-button
v-if = "fillType === 'preFill'"
type="text"
icon="el-icon-delete"
@click="deleteLadderConfig(ladderIndex)"
>删除</el-button>
<el-button v-if="fillType === 'preFill'" type="text" icon="el-icon-delete"
@click="deleteLadderConfig(ladderIndex)">删除</el-button>
</div> </div>
<BaseInfoFormPcakge
@clickable="handleClickable"
:ref="`ladderStepFormPackageRef_${ladderIndex}`"
:formConfig="ladderStepFormConfig"
@blur="onHandleBlur"
:formData="ladderConfig"
fieldItemLabel = "阶梯配制"
:prefixKey = "'ladder_'+ladderIndex"
/>
<CustomTable
@blur="onHandleTableBlur"
:ref="`ladderStepTableRef_${ladderIndex}`"
:columns="ladderStepColumns"
:formData="ladderConfig"
:prefixKey = "'ladder_'+ladderIndex"
fieldItemLabel = "阶梯配制"
>
<BaseInfoFormPcakge @clickable="(e) => handleClickable('ladder', ladderIndex, e)"
:ref="`ladderStepFormPackageRef_${ladderIndex}`" :formConfig="ladderStepFormConfig"
@blur="onHandleBlur" :formData="ladderConfig" fieldItemLabel="阶梯配制"
:prefixKey="'ladder_' + ladderIndex" />
<CustomTable @blur="(e)=>onHandleTableBlur('ladder', ladderIndex,e)" :ref="`ladderStepTableRef_${ladderIndex}`"
:columns="ladderStepColumns" :formData="ladderConfig" :prefixKey="'ladder_' + ladderIndex"
fieldItemLabel="阶梯配制">
<template slot="operation" slot-scope="{ row, rowIndex}"> <template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'ladder', ladderIndex)"
></TableOpertaion>
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex"
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'ladder', ladderIndex)">
</TableOpertaion>
</template> </template>
</CustomTable> </CustomTable>
<Step
class="mt-0"
:ref="`ladderStepRef_${ladderIndex}`"
:formData="ladderConfig.ladderStepData"
fieldItemLabel = "阶梯配制"
:prefixKey = "'ladder_'+ladderIndex"
></Step>
<Step class="mt-0" :ref="`ladderStepRef_${ladderIndex}`"
:formData="ladderConfig.ladderStepData" fieldItemLabel="阶梯配制"
:prefixKey="'ladder_' + ladderIndex"></Step>
</div> </div>
</div> </div>
<!-- 平行配制区域 --> <!-- 平行配制区域 -->
<div
label="平行配制"
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
:key="'paralle_' + paralleIndex"
>
<div label="平行配制" v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
:key="'paralle_' + paralleIndex">
<div class="template-form-item"> <div class="template-form-item">
<div class="config-header"> <div class="config-header">
<div>平行配制</div> <div>平行配制</div>
<el-button
v-if = "fillType === 'preFill'"
type="text"
icon="el-icon-delete"
@click="deleteParalleConfig(paralleIndex)"
>删除</el-button>
<el-button v-if="fillType === 'preFill'" type="text" icon="el-icon-delete"
@click="deleteParalleConfig(paralleIndex)">删除</el-button>
</div> </div>
<BaseInfoFormPcakge
@clickable="handleClickable"
:ref="`paralleStepFormPackageRef_${paralleIndex}`"
:formConfig="paralleStepFormConfig"
@blur="onHandleBlur"
:formData="paralleConfig"
:prefixKey = "'paralle'+paralleIndex"
fieldItemLabel = "平行配制"
/>
<CustomTable
@blur="onHandleTableBlur"
:ref="`paralleStepTableRef_${paralleIndex}`"
:columns="paralleStepColumns"
:formData="paralleConfig"
:prefixKey = "'paralle'+paralleIndex"
fieldItemLabel = "平行配制"
>
<BaseInfoFormPcakge @clickable="(e) => handleClickable('paralle', paralleIndex, e)"
:ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig"
@blur="onHandleBlur" :formData="paralleConfig" :prefixKey="'paralle' + paralleIndex"
fieldItemLabel="平行配制" />
<CustomTable @blur="(e)=>onHandleTableBlur('paralle', paralleIndex,e)" :ref="`paralleStepTableRef_${paralleIndex}`"
:columns="paralleStepColumns" :formData="paralleConfig"
:prefixKey="'paralle' + paralleIndex" fieldItemLabel="平行配制">
<template slot="operation" slot-scope="{ row, rowIndex}"> <template slot="operation" slot-scope="{ row, rowIndex}">
<TableOpertaion
:fillType="fillType"
:row="row"
:rowIndex="rowIndex"
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)"
></TableOpertaion>
<TableOpertaion :fillType="fillType" :row="row" :rowIndex="rowIndex"
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)">
</TableOpertaion>
</template> </template>
</CustomTable> </CustomTable>
<Step
class="mt-0"
:ref="`paralleStepRef_${paralleIndex}`"
:formData="paralleConfig.paralleStepData"
fieldItemLabel = "平行配制"
:prefixKey = "'paralle'+paralleIndex"
></Step>
<Step class="mt-0" :ref="`paralleStepRef_${paralleIndex}`"
:formData="paralleConfig.paralleStepData" fieldItemLabel="平行配制"
:prefixKey="'paralle' + paralleIndex"></Step>
</div> </div>
</div> </div>
<BaseInfoFormPcakge label="备注" ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
<BaseInfoFormPcakge label="备注" ref="remarkRef" :formConfig="remarkConig" :formData="formData" />
</div> </div>
</div> </div>
@ -145,7 +97,7 @@ import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue'; import CustomTable from '@/components/Template/CustomTable.vue';
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue" import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import {getLadderColumnsConfig,getParallelColumnsConfig} from "../../formConfig/paralleAndLadderConfig.js";
import { getLadderColumnsConfig, getParallelColumnsConfig, getLadderFormConfig, getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig } from "../../formConfig/paralleAndLadderConfig.js";
export default { export default {
name: "SWYPBQGZYZBB", name: "SWYPBQGZYZBB",
components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion }, components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion },
@ -167,217 +119,22 @@ export default {
computed: { computed: {
// //
storageFormConfig() { storageFormConfig() {
return [
{
type: "conditionItem",
config: {
storageCondition1: {
label: "存储条件",
type: "select",
fillType: "preFill",
options: this.getDictOptions('business_cctj'),
otherCode: "other1",
},
}
}
];
return getStorageConditionFormConfig(this);
}, },
// //
remarkConig() { remarkConig() {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: "请输入备注",
maxlength: 1000,
rows: 5
}
}
}
]
return getRemarkFormConfig();
}, },
// //
baseInfoFormConfig() { 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: {
startDate: {
label: "开始时间",
type: "input",
},
endDate: {
label: "结束时间",
type: "input",
},
}
}
]
return getBaseInfoFormConfig(this);
}, },
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",
},
}
}
]
paralleStepFormConfig() {
return getParalleStepFormConfig(this);
}, },
// //
ladderStepFormConfig() { 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",
},
}
}
]
return getLadderFormConfig(this);
}, },
paralleStepColumns() { paralleStepColumns() {
return getParallelColumnsConfig(this); return getParallelColumnsConfig(this);
@ -392,22 +149,9 @@ export default {
selectReagentVisible: false, selectReagentVisible: false,
subSolutionVisible: false, subSolutionVisible: false,
currentSubKey: "",//key currentSubKey: "",//key
currentType: "",//
currentRowIndex: "",//
dataSource: [], 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" },
],
}; };
}, },
@ -420,7 +164,6 @@ export default {
if (!this.formData.paralleConfigs) { if (!this.formData.paralleConfigs) {
this.$set(this.formData, 'paralleConfigs', []); this.$set(this.formData, 'paralleConfigs', []);
} }
// //
this.formData.paralleConfigs.push({ this.formData.paralleConfigs.push({
paralleStepData: [], paralleStepData: [],
@ -434,7 +177,7 @@ export default {
if (!this.formData.ladderConfigs) { if (!this.formData.ladderConfigs) {
this.$set(this.formData, 'ladderConfigs', []); this.$set(this.formData, 'ladderConfigs', []);
} }
// //
this.formData.ladderConfigs.push({ this.formData.ladderConfigs.push({
ladderStepData: [], ladderStepData: [],
@ -452,10 +195,9 @@ export default {
}, },
// //
handleAddRow(type, rowIndex, configIndex = 0) { handleAddRow(type, rowIndex, configIndex = 0) {
const tableRef = type === 'ladder' ?
this.$refs[`ladderStepTableRef_${configIndex}`] :
const tableRef = type === 'ladder' ?
this.$refs[`ladderStepTableRef_${configIndex}`] :
this.$refs[`paralleStepTableRef_${configIndex}`]; this.$refs[`paralleStepTableRef_${configIndex}`];
console.log(tableRef,"refff")
if (tableRef && tableRef[0].addRow) { if (tableRef && tableRef[0].addRow) {
tableRef[0].addRow({}); tableRef[0].addRow({});
} }
@ -475,26 +217,68 @@ export default {
} }
} }
}, },
handleClickable(item) {
//
onHandleTableBlur(type, configIndex, e) {
const { colKey = "",item } = e;
if (colKey === "targetStartSolutionConcentration" || colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") {
if(type === "ladder"){
const volume = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetStartSolution") || 0;
if (volume) {
this.updateTargetStartSolutionVolume(item, volume);
}
}else if(type === "paralle"){
const volumne = item.targetStartSolutionConcentration || 0;
if (volumne) {
this.updateTargetStartSolutionVolume(item, volumne);
}
}
}else if(colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume"){//
if(type === "ladder"){
const targetAcSolution = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetAcSolution") || 0;//
if(targetAcSolution){
this.updateSjmbrynd(item,targetAcSolution);
}
}
}
},
handleClickable(type, rowIndex, item) {
if (this.fillType === "preFill") { if (this.fillType === "preFill") {
// return;
return;
} }
console.log(type, rowIndex, item, "handle")
const { subKey = "" } = item; const { subKey = "" } = item;
if (subKey === "subStartSolution" || subKey === "subSolution") {// if (subKey === "subStartSolution" || subKey === "subSolution") {//
this.selectReagentVisible = true; this.selectReagentVisible = true;
this.currentSubKey = subKey; this.currentSubKey = subKey;
this.currentType = type;
this.currentRowIndex = rowIndex;
} }
}, },
// //
onSelectReagentSubmit(code) {
this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code);
onSelectReagentSubmit(code,row) {
const { currentSubKey } = this;
if (this.currentType === "ladder") {
const packageRef = this.$refs[`ladderStepFormPackageRef_${this.currentRowIndex}`][0];
if (currentSubKey === "subStartSolution") {
packageRef.updateFormData("targetAcSolution", row.sjnd);
}
packageRef.updateFormData(currentSubKey, code);
} else if (this.currentType === "paralle") {
this.$refs.paralleStepFormPackageRef_[this.currentRowIndex].updateFormData(this.currentSubKey, {
reagentCode: code,
});
}
// this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code);
this.selectReagentVisible = false; this.selectReagentVisible = false;
}, },
// //
async validFields(){
async validFields() {
// //
let refsToValidate = ["baseInfoRef", "storageConditionRef", "remarkRef"]; let refsToValidate = ["baseInfoRef", "storageConditionRef", "remarkRef"];
// //
if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) { if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) {
for (let i = 0; i < this.formData.ladderConfigs.length; i++) { for (let i = 0; i < this.formData.ladderConfigs.length; i++) {
@ -503,7 +287,7 @@ export default {
refsToValidate.push(`ladderStepRef_${i}`); refsToValidate.push(`ladderStepRef_${i}`);
} }
} }
// //
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) { if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) { for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
@ -514,10 +298,10 @@ export default {
} }
return await this.validFormFields(refsToValidate); return await this.validFormFields(refsToValidate);
}, },
getFilledFormData(){
const baseData = this.$refs.baseInfoRef.getFilledFormData();
getFilledFormData() {
const baseData = this.$refs.baseInfoRef.getFilledFormData();
const conditionData = this.$refs.storageConditionRef.getFilledFormData(); const conditionData = this.$refs.storageConditionRef.getFilledFormData();
// //
const ladderConfigsData = []; const ladderConfigsData = [];
if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) { if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) {
@ -525,16 +309,16 @@ export default {
const ladderFormData = this.$refs[`ladderStepFormPackageRef_${i}`][0].getFilledFormData(); const ladderFormData = this.$refs[`ladderStepFormPackageRef_${i}`][0].getFilledFormData();
const ladderTableFormData = this.$refs[`ladderStepTableRef_${i}`][0].getFilledFormData(); const ladderTableFormData = this.$refs[`ladderStepTableRef_${i}`][0].getFilledFormData();
const ladderStepData = this.$refs[`ladderStepRef_${i}`][0].getFilledFormData(); const ladderStepData = this.$refs[`ladderStepRef_${i}`][0].getFilledFormData();
ladderConfigsData.push({ ladderConfigsData.push({
...ladderFormData, ...ladderFormData,
...ladderTableFormData, ...ladderTableFormData,
ladderStepData:ladderStepData.stepData,
ladderStepData: ladderStepData.stepData,
showLadderConfig: true showLadderConfig: true
}); });
} }
} }
// //
const paralleConfigsData = []; const paralleConfigsData = [];
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) { if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
@ -542,18 +326,17 @@ export default {
const paralleFormData = this.$refs[`paralleStepFormPackageRef_${i}`][0].getFilledFormData(); const paralleFormData = this.$refs[`paralleStepFormPackageRef_${i}`][0].getFilledFormData();
const paralleTableFormData = this.$refs[`paralleStepTableRef_${i}`][0].getFilledFormData(); const paralleTableFormData = this.$refs[`paralleStepTableRef_${i}`][0].getFilledFormData();
const paralleStepData = this.$refs[`paralleStepRef_${i}`][0].getFilledFormData(); const paralleStepData = this.$refs[`paralleStepRef_${i}`][0].getFilledFormData();
paralleConfigsData.push({ paralleConfigsData.push({
...paralleFormData, ...paralleFormData,
...paralleTableFormData, ...paralleTableFormData,
paralleStepData:paralleStepData.stepData,
paralleStepData: paralleStepData.stepData,
showParalleConfig: true showParalleConfig: true
}); });
} }
} }
const remarkData = this.$refs.remarkRef.getFilledFormData(); const remarkData = this.$refs.remarkRef.getFilledFormData();
return { return {
...baseData, ...baseData,
...conditionData, ...conditionData,
@ -565,7 +348,7 @@ export default {
async getFormData() { async getFormData() {
// //
const validFlag = await this.validFields(); const validFlag = await this.validFields();
if(!validFlag){
if (!validFlag) {
return false; return false;
} }
return this.getFilledFormData(); return this.getFilledFormData();
@ -609,7 +392,7 @@ export default {
color: #f78989; color: #f78989;
} }
.mt-0{
.mt-0 {
margin-top: 0; margin-top: 0;
} }
</style> </style>

+ 271
- 26
src/views/business/comps/template/formConfig/paralleAndLadderConfig.js View File

@ -33,6 +33,7 @@ export const getLadderColumnsConfig = ($this) => {
showBodySub: $this.fillType === "preFill", showBodySub: $this.fillType === "preFill",
bodyPrecisionKey: "targetStartSolutionVolumePrecision", bodyPrecisionKey: "targetStartSolutionVolumePrecision",
bodyMaxlength: 10, bodyMaxlength: 10,
bodyDisabled: true,
bodySubPlaceholder: "请输入保留小数位数", bodySubPlaceholder: "请输入保留小数位数",
}, },
{ {
@ -54,14 +55,14 @@ export const getLadderColumnsConfig = ($this) => {
headerSelectKey: "targetDiluentVolumeUnit", headerSelectKey: "targetDiluentVolumeUnit",
fillType: "preFill", fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
bodyDisabled: true,
bodyType: "inputNumber", bodyType: "inputNumber",
bodySubType: "inputNumber", bodySubType: "inputNumber",
bodySubKey: "targetDiluentVolumePrecision", bodySubKey: "targetDiluentVolumePrecision",
bodyFillType: "preFill", bodyFillType: "preFill",
bodySubFillType: "preFill", bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill", showBodySub: $this.fillType === "preFill",
bodyPrecisionKey: "targetDiluentVolumePrecision", bodyPrecisionKey: "targetDiluentVolumePrecision",
bodyMaxlength: 10, bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数", bodySubPlaceholder: "请输入保留小数位数",
@ -96,14 +97,14 @@ export const getLadderColumnsConfig = ($this) => {
headerSelectKey: "actSolutionConcentrationUnit", headerSelectKey: "actSolutionConcentrationUnit",
fillType: "preFill", fillType: "preFill",
headerOptions: $this.getDictOptions('business_nddw'), headerOptions: $this.getDictOptions('business_nddw'),
bodyDisabled: true,
bodyType: "inputNumber", bodyType: "inputNumber",
bodySubType: "inputNumber", bodySubType: "inputNumber",
bodySubKey: "actSolutionConcentrationPrecision", bodySubKey: "actSolutionConcentrationPrecision",
bodyFillType: "actFill", bodyFillType: "actFill",
bodySubFillType: "preFill", bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill", showBodySub: $this.fillType === "preFill",
bodyPrecisionKey: "actSolutionConcentrationPrecision", bodyPrecisionKey: "actSolutionConcentrationPrecision",
bodyMaxlength: 10, bodyMaxlength: 10,
copyFrom: "targetSolutionConcentration",//复制哪个字段 copyFrom: "targetSolutionConcentration",//复制哪个字段
@ -127,14 +128,14 @@ export const getLadderColumnsConfig = ($this) => {
headerSelectKey: "actSolutionVolumeUnit", headerSelectKey: "actSolutionVolumeUnit",
fillType: "preFill", fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
bodyDisabled: true,
bodyType: "inputNumber", bodyType: "inputNumber",
bodySubType: "inputNumber", bodySubType: "inputNumber",
bodySubKey: "actSolutionVolumePrecision", bodySubKey: "actSolutionVolumePrecision",
bodyFillType: "actFill", bodyFillType: "actFill",
bodySubFillType: "preFill", bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill", showBodySub: $this.fillType === "preFill",
bodyPrecisionKey: "actSolutionVolumePrecision", bodyPrecisionKey: "actSolutionVolumePrecision",
bodyMaxlength: 10, bodyMaxlength: 10,
copyFrom: "targetSolutionVolume",//复制哪个字段 copyFrom: "targetSolutionVolume",//复制哪个字段
@ -149,7 +150,7 @@ export const getParallelColumnsConfig = ($this) => {
label: "目标溶液编号", label: "目标溶液编号",
prop: "targetSolutionCode", prop: "targetSolutionCode",
bodyType: "select", bodyType: "select",
bodyOptions:[{
bodyOptions: [{
label: "溶液1", label: "溶液1",
value: "1", value: "1",
}], }],
@ -176,19 +177,29 @@ export const getParallelColumnsConfig = ($this) => {
headerSelectKey: "actSolutionConcentrationUnit", headerSelectKey: "actSolutionConcentrationUnit",
fillType: "preFill", fillType: "preFill",
headerOptions: $this.getDictOptions('business_nddw'), headerOptions: $this.getDictOptions('business_nddw'),
bodyDisabled: true,
bodyType: "inputNumber", bodyType: "inputNumber",
bodySubType: "inputNumber", bodySubType: "inputNumber",
bodySubKey: "actSolutionConcentrationPrecision", bodySubKey: "actSolutionConcentrationPrecision",
bodyFillType: "actFill", bodyFillType: "actFill",
bodySubFillType: "preFill", bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill", showBodySub: $this.fillType === "preFill",
bodyPrecisionKey: "actSolutionConcentrationPrecision", bodyPrecisionKey: "actSolutionConcentrationPrecision",
bodyMaxlength: 10, bodyMaxlength: 10,
copyFrom: "targetSolutionConcentration",//复制哪个字段 copyFrom: "targetSolutionConcentration",//复制哪个字段
bodySubPlaceholder: "请输入保留小数位数", bodySubPlaceholder: "请输入保留小数位数",
}, },
{
label: "预设目标溶液体积",
prop: "targetSolutionVolume",
width: 280,
headerSelectKey: "targetSolutionVolumeUnit",
fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: "inputNumber",
bodyFillType: "preFill",
bodyMaxlength: 10,
},
{ {
label: "实际目标溶液体积", label: "实际目标溶液体积",
prop: "actSolutionVolume", prop: "actSolutionVolume",
@ -196,14 +207,14 @@ export const getParallelColumnsConfig = ($this) => {
headerSelectKey: "actSolutionVolumeUnit", headerSelectKey: "actSolutionVolumeUnit",
fillType: "preFill", fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
bodyDisabled: true,
bodyType: "inputNumber", bodyType: "inputNumber",
bodySubType: "inputNumber", bodySubType: "inputNumber",
bodySubKey: "actSolutionVolumePrecision", bodySubKey: "actSolutionVolumePrecision",
bodyFillType: "actFill", bodyFillType: "actFill",
bodySubFillType: "preFill", bodySubFillType: "preFill",
showBodySub: $this.fillType === "preFill", showBodySub: $this.fillType === "preFill",
bodyPrecisionKey: "actSolutionVolumePrecision", bodyPrecisionKey: "actSolutionVolumePrecision",
bodyMaxlength: 10, bodyMaxlength: 10,
copyFrom: "targetSolutionVolume",//复制哪个字段 copyFrom: "targetSolutionVolume",//复制哪个字段
@ -216,9 +227,10 @@ export const getParallelColumnsConfig = ($this) => {
fillType: "preFill", fillType: "preFill",
bodyType: "inputNumber", bodyType: "inputNumber",
bodySubType: "select", bodySubType: "select",
showBodySub:true,
bodySubKey: "targetSolutionCyclePrecision", bodySubKey: "targetSolutionCyclePrecision",
bodySubOptions: $this.getDictOptions('business_yxqdw'), bodySubOptions: $this.getDictOptions('business_yxqdw'),
bodyFillType: "actFill",
bodyFillType: "preFill",
bodySubFillType: "preFill", bodySubFillType: "preFill",
bodyMaxlength: 10, bodyMaxlength: 10,
}, },
@ -241,10 +253,11 @@ export const getParallelColumnsConfig = ($this) => {
width: 280, width: 280,
bodyType: "input", bodyType: "input",
bodyFillType: "actFill", bodyFillType: "actFill",
bodyDisabled: true,
}, },
{ {
label: "预设原始溶液浓度", label: "预设原始溶液浓度",
prop: "targetStartSolutionConcentration",
prop: "targetStartSolutionConcentration",
width: 280, width: 280,
bodyType: "inputNumber", bodyType: "inputNumber",
bodyFillType: "preFill", bodyFillType: "preFill",
@ -253,11 +266,20 @@ export const getParallelColumnsConfig = ($this) => {
bodySubOptions: $this.getDictOptions('business_nddw'), bodySubOptions: $this.getDictOptions('business_nddw'),
bodySubFillType: "preFill", bodySubFillType: "preFill",
bodyMaxlength: 10, bodyMaxlength: 10,
showBodySub:true,
},
{
label: "实际原始溶液浓度",
prop: "actStartSolutionConcentration",
width: 280,
bodyType: "inputNumber",
bodyFillType: "actFill",
bodyDisabled: true,
}, },
{ {
label: "预设原始溶液体积", label: "预设原始溶液体积",
prop: "targetStartSolutionVolume",
headerSelectKey: "targetStartSolutionVolumeUnit",
prop: "targetStartSolutionVolume",
headerSelectKey: "targetStartSolutionVolumeUnit",
fillType: "preFill", fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
width: 280, width: 280,
@ -270,46 +292,269 @@ export const getParallelColumnsConfig = ($this) => {
bodyPrecisionKey: "targetStartSolutionVolumePrecision", bodyPrecisionKey: "targetStartSolutionVolumePrecision",
bodyMaxlength: 10, bodyMaxlength: 10,
bodySubPlaceholder: "请输入保留小数位数", bodySubPlaceholder: "请输入保留小数位数",
bodyDisabled: true,
showBodySub:true,
showBodySub: $this.fillType === "preFill",
}, },
{ {
label: "实际原始溶液体积", label: "实际原始溶液体积",
prop: "actStartSolutionVolume",
headerSelectKey: "actStartSolutionVolumeUnit",
prop: "actStartSolutionVolume",
headerSelectKey: "actStartSolutionVolumeUnit",
fillType: "preFill", fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
width: 280, width: 280,
bodyType: "inputNumber", bodyType: "inputNumber",
bodyFillType: "actFill", bodyFillType: "actFill",
bodyMaxlength: 10, bodyMaxlength: 10,
bodyDisabled: true,
}, },
{ {
label: "预计稀释液体积", label: "预计稀释液体积",
prop: "preDiluentVolume",
headerSelectKey: "preDiluentVolumeUnit",
prop: "targetDiluentVolume",
headerSelectKey: "preDiluentVolumeUnit",
fillType: "preFill", fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
width: 280, width: 280,
bodyType: "inputNumber", bodyType: "inputNumber",
bodyFillType: "preFill", bodyFillType: "preFill",
bodySubType: "inputNumber", bodySubType: "inputNumber",
bodySubKey: "preDiluentVolumePrecision",
bodySubKey: "targetDiluentVolumePrecision",
bodySubFillType: "preFill", bodySubFillType: "preFill",
bodyMaxlength: 10, bodyMaxlength: 10,
bodyPrecisionKey: "preDiluentVolumePrecision",
bodyPrecisionKey: "targetDiluentVolumePrecision",
bodySubPlaceholder: "请输入保留小数位数", bodySubPlaceholder: "请输入保留小数位数",
bodyDisabled: true,
showBodySub: $this.fillType === "preFill",
}, },
{ {
label: "实际稀释液体积", label: "实际稀释液体积",
prop: "actDiluentVolume",
headerSelectKey: "actDiluentVolumeUnit",
prop: "actDiluentVolume",
headerSelectKey: "actDiluentVolumeUnit",
fillType: "preFill", fillType: "preFill",
headerOptions: $this.getDictOptions('business_tjdw'), headerOptions: $this.getDictOptions('business_tjdw'),
width: 280, width: 280,
bodyType: "inputNumber", bodyType: "inputNumber",
bodyFillType: "actFill", bodyFillType: "actFill",
bodyMaxlength: 10, bodyMaxlength: 10,
bodyDisabled: true,
},
]
}
//阶梯配置
export const getLadderFormConfig = ($this) => {
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,
},
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",
},
}
}
]
}
//试验基本信息
export const getBaseInfoFormConfig = ($this) => {
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: "conditionItem",
label: "容器材质",
config: {
containerMaterial: {
label: "容器材质",
type: "select",
options: $this.getDictOptions('business_rqcz'),
fillType: "actFill",
multiple: true,
otherCode: "containerMaterialOther",
}
}
}, },
{
type: "cellItem",
label: "处理时间",
config: {
startDate: {
label: "开始时间",
type: "input",
},
endDate: {
label: "结束时间",
type: "input",
},
}
}
]
}
//备注config
export const getRemarkFormConfig = () => {
return [
{
type: "cellItem",
config: {
remark: {
label: "",
type: "textarea",
fillType: "actFill",
span: 1,
placeholder: "请输入备注",
maxlength: 1000,
rows: 5
}
}
}
]
}
//存储条件
export const getStorageConditionFormConfig = ($this) => {
return [
{
type: "conditionItem",
config: {
storageCondition: {
label: "存储条件",
type: "select",
fillType: "preFill",
options: $this.getDictOptions('business_cctj'),
otherCode: "othersSorageCondition",
},
}
}
];
}
//并行步骤配置
export const getParalleStepFormConfig = ($this) => {
return [
{
type: "step",
config: {
solution: {
label: "稀释液",
type: "input",
fillType: "preFill",
subType: "clickable",
subKey: "subSolution",
subFillType: "actFill",
maxlength: 20,
},
paralleStepStorageCondition: {
label: "存储条件",
type: "select",
fillType: "preFill",
options: $this.getDictOptions('business_cctj'),
otherCode: "paralleStepStorageConditionOther",
},
}
}
] ]
}
}

+ 15
- 5
src/views/business/comps/template/mixins/templateMixin.js View File

@ -32,6 +32,20 @@ export default {
formData: {}, formData: {},
templateDetail: {}, templateDetail: {},
resource: [],//试验试剂信息 resource: [],//试验试剂信息
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() { mounted() {
@ -92,10 +106,7 @@ export default {
deleteRow(index) { deleteRow(index) {
this.$refs.stepTableRef.deleteRow(index); this.$refs.stepTableRef.deleteRow(index);
}, },
//获取版本号
getVersionNum() {
return this.formData.versionNum || "";
},
//统一处理blur事件,因为有效周期和过期日期是相关的,所以需要在有效周期失焦时更新过期日期 //统一处理blur事件,因为有效周期和过期日期是相关的,所以需要在有效周期失焦时更新过期日期
onHandleBlur(fields) { onHandleBlur(fields) {
const { key, effectivePeriodUnit, effectivePeriod, codeSTD, targetStartSolution } = fields; const { key, effectivePeriodUnit, effectivePeriod, codeSTD, targetStartSolution } = fields;
@ -131,7 +142,6 @@ export default {
} }
}else if(colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume"){//实际起始溶液体积和实际目标溶液体积 }else if(colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume"){//实际起始溶液体积和实际目标溶液体积
const targetAcSolution = this.$refs.stepFormPackageRef?.getFormDataByKey("targetAcSolution") || 0;//获取实际起始溶液浓度 const targetAcSolution = this.$refs.stepFormPackageRef?.getFormDataByKey("targetAcSolution") || 0;//获取实际起始溶液浓度
console.log(targetAcSolution,"tart")
if(targetAcSolution){ if(targetAcSolution){
this.updateSjmbrynd(item,targetAcSolution); this.updateSjmbrynd(item,targetAcSolution);
} }

Loading…
Cancel
Save