Browse Source

feat:[模板管理][update]

ouqian
luojie 1 month ago
parent
commit
f7aeda8c94
12 changed files with 543 additions and 412 deletions
  1. +31
    -0
      src/components/Template/BaseInfoFormPackage.vue
  2. +5
    -1
      src/components/Template/Step.vue
  3. +1
    -0
      src/components/Template/mixins/formPackageMixins.js
  4. +2
    -2
      src/components/Template/mixins/stepMixins.js
  5. +2
    -1
      src/views/business/comps/template/TemplateTable.vue
  6. +5
    -0
      src/views/business/comps/template/comps/sp/SP0020.vue
  7. +262
    -247
      src/views/business/comps/template/comps/sp/SP00456.vue
  8. +4
    -9
      src/views/business/comps/template/comps/sp/comps/LadderConfig.vue
  9. +96
    -46
      src/views/business/comps/template/formConfig/paralleAndLadderConfig.js
  10. +1
    -1
      src/views/business/comps/template/formConfig/sp/SP0019.js
  11. +67
    -40
      src/views/business/comps/template/formConfig/sp/SP0020.js
  12. +67
    -65
      src/views/business/comps/template/mixins/templateMixin.js

+ 31
- 0
src/components/Template/BaseInfoFormPackage.vue View File

@ -153,6 +153,19 @@
</div>
</template>
<div class="flex flex-wrap" v-else-if="item.type === 'explainItem'">
<div v-for="(sItem, key) in item.config" :key="key" class="explain-item">
<div v-if="sItem.type === 'input' || sItem.type === 'textarea' || sItem.type === 'inputNumber'" class="m-r-10">
<HandleFormItem :field-item-label="fieldItemLabel" :field-key="prefixKey + '_' + key"
:type="sItem.type" :item="sItem" style="width: auto;flex:1" :style = "{'width': sItem.formWidth ? sItem.formWidth + 'px' : 'auto'}" v-model="formFields[key]"
@copy="onCopy(sItem, key)" @change="(e, type) => onSelectChange(key, e, type)"
:error="errors[key]" @update:error="errors[key] = false"
:orange-bg="orangeBgFields[key]" />
</div>
<span v-else-if="sItem.type === 'span'" class="explain-title">{{ $t(sItem.label) }}</span>
</div>
</div>
<template v-else-if="item.type === 'step'">
<div class="grid-container gap2">
<div v-for="(sItem, key) in item.config" class="c-Item flex item-center"
@ -526,6 +539,24 @@ export default {
.p-r-20 {
padding-right: 20px;
}
.explain-title{
font-size: 14px;
font-weight: normal;
color: #606266;
padding-right: 10px;
}
.explain-item{
display: flex;
align-items: center;
padding: 10px 0;
}
.flex-wrap{
flex-wrap: wrap;
}
.m-r-10{
margin-right: 10px;
}
.p-l-20 {
padding-left: 20px;

+ 5
- 1
src/components/Template/Step.vue View File

@ -11,7 +11,7 @@
v-model="step.type" @change="onTypeChange(index)" />
<!-- 根据步骤类型显示对应的表单 -->
<component class="flex1" :sn="step.type" :is="getStepComponent(step.type)" :formData="step.formData"
@update="onFormUpdate(index, $event)" :stepIndex = "index" :ref="'stepCompRef_' + index">
@update="onFormUpdate(index, $event)" :stepIndex = "prefixKey + index" :ref="'stepCompRef_' + index">
</component>
<div v-if="templateFillType === 'preFill'" class="step-header-item">
<el-popconfirm
@ -279,6 +279,10 @@ export default {
formData: {
type: Array,
default: () => []
},
prefixKey: {
type: String,
default: ''
}
},
data() {

+ 1
- 0
src/components/Template/mixins/formPackageMixins.js View File

@ -410,6 +410,7 @@ export default {
//再筛选出需要显示其他输入框的选项
const otherOptions = allCheckedOptions.filter((label)=>isShowOtherByCheckboxTree(label))
const isHasOtherInfo = otherOptions.every(item => otherValues[item]);
console.log(isChecked,isHasOtherInfo,"isChecked")
if (!isChecked || !isHasOtherInfo) {
errors.push({
field: key,

+ 2
- 2
src/components/Template/mixins/stepMixins.js View File

@ -10,8 +10,8 @@ export default {
default: () => ({})
},
stepIndex: {
type: Number,
default: 0
type: String,
default: ''
}
},
methods: {

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

@ -267,6 +267,7 @@ export default {
'PCR003': 'PCR003',
'PCR004': 'PCR004',
'PCR005': 'PCR005',
'PCR006': 'SP0020',
'PCR007': 'PCR007',
'PCR008': 'PCR008',
'PCR009': 'PCR009',
@ -279,7 +280,7 @@ export default {
'LBA004': 'LBA004',
'LBA005': 'SP00456',
'LBA006': 'LBA006',
'LBA007': 'LBA007',
'LBA007': 'SP00456',
//ADA
'ADA001': 'SP001',
'ADA002': 'LBA002',

+ 5
- 0
src/views/business/comps/template/comps/sp/SP0020.vue View File

@ -13,6 +13,7 @@
<BaseInfoFormPackage fieldItemLabel="仪器结果" label="仪器结果"
:ref="refConfig.yqjgRef" :formConfig="yqjgFormConfig" :formData="formData" />
<BaseInfoFormPackage fieldItemLabel="采集日期" label="采集日期"
v-if="sn ==='SP0020'"
:ref="refConfig.cjrqRef" :formConfig="cjrqFormConfig" :formData="formData" />
<BaseInfoFormPackage fieldItemLabel="分析批数据文件" label="分析批数据文件"
:ref="refConfig.fxpsjwjRef" :formConfig="fxpsjwjFormConfig" :formData="formData" />
@ -57,6 +58,10 @@ export default {
type: String,
default: 'preFill',
},
sn: {
type: String,
default: '',
},
},
computed: {
//

+ 262
- 247
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -26,9 +26,11 @@
</div>
<LineLabel :label="getOperationStepsLabel()" />
<div v-if="fillType === 'preFill'" class="mt-20">
<el-button type="primary" @click="handleAddConfig('paralleConfigs')">{{ $t('template.common.xzpxpz')
<el-button type="primary" @click="handleAddConfig('paralleConfigs')">{{
$t('template.common.xzpxpz')
}}</el-button>
<el-button type="primary" @click="handleAddConfig('ladderConfigs')">{{ $t('template.common.xzjtpz')
<el-button type="primary" @click="handleAddConfig('ladderConfigs')">{{
$t('template.common.xzjtpz')
}}</el-button>
</div>
<!-- 阶梯配制区域 -->
@ -37,30 +39,29 @@
<LadderConfig :currentFormConfig="ladderStepFormConfig" :currentFormData="ladderConfig"
:showOperation="fillType === 'actFill' || fillType === 'preFill'"
:tableColumns="ladderStepColumns" :prefixKey="'ladder_' + ladderIndex"
:configType="'ladder'"
:ref="`ladderRef_${ladderIndex}`" :fieldItemLabel="'template.common.jtpz'"
@deleteConfig="deleteConfig('ladderConfigs',ladderConfig)"
:fillType="fillType" />
:configType="'ladder'" :ref="`ladderRef_${ladderIndex}`"
:fieldItemLabel="'template.common.jtpz'"
@deleteConfig="deleteConfig('ladderConfigs', ladderConfig)" :fillType="fillType" />
</div>
<!-- 平行配制区域 -->
<div
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
<div v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs"
:key="'paralle_' + paralleConfig.id">
<LadderConfig :currentFormConfig="paralleStepFormConfig" :currentFormData="paralleConfig"
:showOperation="fillType === 'actFill' || fillType === 'preFill'"
:tableColumns="paralleStepColumns" :prefixKey="'paralle_' + paralleIndex"
:configType="'paralle'"
:ref="`paralleRef_${paralleIndex}`" :fieldItemLabel="'template.common.pxpz'"
@deleteConfig="deleteConfig('paralleConfigs',paralleConfig)"
:fillType="fillType" />
:configType="'paralle'" :ref="`paralleRef_${paralleIndex}`"
:fieldItemLabel="'template.common.pxpz'"
@deleteConfig="deleteConfig('paralleConfigs', paralleConfig)" :fillType="fillType" />
</div>
<template v-if="sn === 'LBA005'">
<LineLabel :label="$t('template.lba.lba005.zkpz')" />
<div v-if="fillType === 'preFill'" class="mt-20">
<el-button type="primary" @click="handleAddConfig('paralleConfigs_1')">{{ $t('template.common.xzpxpz')
<el-button type="primary" @click="handleAddConfig('paralleConfigs_1')">{{
$t('template.common.xzpxpz')
}}</el-button>
<el-button type="primary" @click="handleAddConfig('ladderConfigs_1')">{{ $t('template.common.xzjtpz')
<el-button type="primary" @click="handleAddConfig('ladderConfigs_1')">{{
$t('template.common.xzjtpz')
}}</el-button>
</div>
<!-- 阶梯配制区域 -->
@ -69,23 +70,20 @@
<LadderConfig :currentFormConfig="ladderStepFormConfig" :currentFormData="ladderConfig"
:showOperation="fillType === 'actFill' || fillType === 'preFill'"
:tableColumns="ladderStepColumns" :prefixKey="'ladder_1_' + ladderIndex"
:configType="'ladder'"
:ref="`ladderRef_1_${ladderIndex}`" :fieldItemLabel="'template.common.jtpz'"
@deleteConfig="deleteConfig('ladderConfigs_1',ladderConfig)"
:fillType="fillType" />
:configType="'ladder'" :ref="`ladderRef_1_${ladderIndex}`"
:fieldItemLabel="'template.common.jtpz'"
@deleteConfig="deleteConfig('ladderConfigs_1', ladderConfig)" :fillType="fillType" />
</div>
<!-- 平行配制区域 -->
<div
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs_1"
<div v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs_1"
:key="'paralle_1_' + paralleConfig.id">
<LadderConfig :currentFormConfig="paralleStepFormConfig" :currentFormData="paralleConfig"
:showOperation="fillType === 'actFill' || fillType === 'preFill'"
:tableColumns="paralleStepColumns" :prefixKey="'paralle_1_' + paralleIndex"
:configType="'paralle'"
:ref="`paralleRef_1_${paralleIndex}`" :fieldItemLabel="'template.common.pxpz'"
@deleteConfig="deleteConfig('paralleConfigs_1',paralleConfig)"
:fillType="fillType" />
:configType="'paralle'" :ref="`paralleRef_1_${paralleIndex}`"
:fieldItemLabel="'template.common.pxpz'"
@deleteConfig="deleteConfig('paralleConfigs_1', paralleConfig)" :fillType="fillType" />
</div>
</template>
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark"
@ -109,8 +107,7 @@ import CustomTable from '@/components/Template/CustomTable.vue';
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
import TableOpertaionDelete from "@/components/Template/operation/TableOpertaionDelete.vue"
import { getExpireDate, duplicateResource } from "@/utils/index.js";
import { getuuid } from "@/utils/index.js";
import { getExpireDate, duplicateResource, justUpdateFilledFormData, getuuid } from "@/utils/index.js";
import { isCommonUnit } from "@/utils/conTools";
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
import {
@ -118,7 +115,7 @@ import {
getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig, getJcbColumnsConfig
} from "../../formConfig/paralleAndLadderConfig.js";
import LadderConfig from "@/views/business/comps/template/comps/sp/comps/LadderConfig.vue";
const configTyps =[
const configTyps = [
{
configType: "paralle",
ref: "paralleRef",
@ -222,7 +219,7 @@ export default {
getOperationStepsLabel() {
const obj = {
"LBA005": "template.lba.lba005.bzqxpz",//线
"LBA007": "template.lba.lba005.bzqxpz",//
// "LBA007": "template.lba.lba005.bzqxpz",//
}
return obj[this.sn] || 'template.common.operationSteps';//
},
@ -234,15 +231,16 @@ export default {
},
//
async assignNumbersToTableData(config) {
const { configType, ref, configName } = config;
return new Promise(async (resolve, reject) => {
const configs = this.formData[config]
const configs = this.formData[configName]
const { startDate } = this.formData;
// paralleConfigsparalleTableFormData
if (configs && configs.length > 0) {
for (let i = 0; i < configs.length; i++) {
const ref = config === "paralleConfigs" ? `paralleRef_${i}` : `ladderRef_${i}`;
const currentRef = `${ref}_${i}`;
const { stepTableFormData = [], effectivePeriod, effectivePeriodUnit, expireDate } = configs[i];
if (!expireDate && config === "ladderConfigs") {
if (!expireDate && configType === "ladder") {
const date = getExpireDate(startDate, effectivePeriod, effectivePeriodUnit);
configs[i].expireDate = date;
}
@ -257,13 +255,13 @@ export default {
const snList = await this.getLatestSnArr(codes);
tableDataArray.forEach((row, idx) => {
let expDate = {};
if (config === "paralleConfigs" && !row.targetSolutionExpirationDate) {
if (configType === "paralle" && !row.targetSolutionExpirationDate) {
let date = getExpireDate(startDate, row.targetSolutionCycle, row.targetSolutionCyclePrecision);
expDate = {
targetSolutionExpirationDate: date
}
}
this.$refs[ref][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate });
this.$refs[currentRef][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate });
});
resolve()
} else {
@ -272,37 +270,36 @@ export default {
}
}
} else {
resolve()
}
})
},
async handleUpdateCode() {
Promise.all([this.assignNumbersToTableData("ladderConfigs"), this.assignNumbersToTableData("paralleConfigs")
]).then(() => {
const pros = configTyps.map(item => this.assignNumbersToTableData(item));
Promise.all(pros).then(() => {
//
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
EventBus.$emit('onModifyRecord', params,)
justUpdateFilledFormData();
})
},
//
handleAddConfig(configType) {
//
if (!this.formData[configType]) {
// formdatabug
this.formData = { ...this.formData, ...this.getFilledFormData() };
this.$set(this.formData, configType, []);
// this.formData[configType] = [];
}
//
this.formData[configType].push({
id: getuuid(),
stepData: [],
paralleTableFormData: [],
showParalleConfig: true
});
this.justUpdateFilledFormData();
justUpdateFilledFormData();
},
//
deleteConfig(type, con) {
@ -314,12 +311,7 @@ export default {
this.$set(this.formData, type, newConfigs);
this.$nextTick(() => {
//
const params = {
type: "fieldChanged",
newRecord: null,
resourceList: null,
}
EventBus.$emit('onModifyRecord', params,)
justUpdateFilledFormData();
})
}
},
@ -329,28 +321,37 @@ export default {
const { isLba } = this;
const refsToValidate = isLba ? ["baseInfoRef", "jcbRef", "remarkRef"] : ["baseInfoRef", "storageConditionRef", "remarkRef"]
//
configTyps.map((item) => {
const { ref, configName } = item;
const configs = this.formData[configName] || [];
configs.map((config, i) => {
if (this.$refs[`${ref}_${i}`]) {
refsToValidate.push(`${ref}_${i}`);
}
})
//
if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) {
for (let i = 0; i < this.formData.ladderConfigs.length; i++) {
refsToValidate.push(`ladderRef_${i}`);
}
}
})
// //
// if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) {
// for (let i = 0; i < this.formData.ladderConfigs.length; i++) {
// refsToValidate.push(`ladderRef_${i}`);
// }
// }
//
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
refsToValidate.push(`paralleRef_${i}`);
}
}
// //
// if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
// for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
// refsToValidate.push(`paralleRef_${i}`);
// }
// }
return await this.validFormFields(refsToValidate);
},
getFilledFormData() {
const baseData = this.$refs.baseInfoRef.getFilledFormData();
let conditionData = {},jcbData = [];
let conditionData = {}, jcbData = [];
if (!this.isLba) {
conditionData = this.$refs.storageConditionRef.getFilledFormData();
}else{
} else {
jcbData = this.$refs.jcbRef.getFilledFormData();
}
const remarkData = this.$refs.remarkRef.getFilledFormData();
@ -360,12 +361,12 @@ export default {
...jcbData,
...remarkData
}
configTyps.map((item)=>{
configTyps.map((item) => {
const { ref, configName } = item;
const configs = this.formData[configName] || [];
const configData= [];
configs.map((sItem,index)=>{
const {id} = sItem;
const configData = [];
configs.map((sItem, index) => {
const { id } = sItem;
const {
baseFormData,
tableData,
@ -391,16 +392,18 @@ export default {
}
let content = this.getFilledFormData();
if (content) {
const { ladderConfigs = [], paralleConfigs = [] } = content;
if (ladderConfigs.length > 0) {
const ladderConUnitDiff = ladderConfigs.every(item => isCommonUnit(item.subTargetStartSolution, [item.headerSelectFields.actSolutionConcentrationUnit, item.headerSelectFields.targetSolutionConcentrationUnit]));
const { ladderConfigs = [], paralleConfigs = [], paralleConfigs_1 = [], ladderConfigs_1 = [] } = content;
const lConfig = ladderConfigs || ladderConfigs_1;
const pConfig = paralleConfigs || paralleConfigs_1;
if (lConfig.length > 0) {
const ladderConUnitDiff = lConfig.every(item => isCommonUnit(item.subTargetStartSolution, [item.headerSelectFields.actSolutionConcentrationUnit, item.headerSelectFields.targetSolutionConcentrationUnit]));
if (!ladderConUnitDiff) {
this.$message.error("起始浓度单位与目标浓度单位不符,请重新选择!");
return false;
}
}
if (paralleConfigs.length > 0) {
const paralleConUnitDiff = paralleConfigs.every(item => {
if (pConfig.length > 0) {
const paralleConUnitDiff = pConfig.every(item => {
const { stepTableFormData = [], headerSelectFields = {} } = item;
const conUnits = stepTableFormData.map(item => item.targetStartSolutionConcentrationPrecision);
const { actSolutionConcentrationUnit, targetSolutionConcentrationUnit } = headerSelectFields;
@ -419,175 +422,175 @@ export default {
//resource
let tmpResource = []
if (this.fillType === "actFill") {
debugger
//
if (content.ladderConfigs && content.ladderConfigs.length > 0) {
for (let i = 0; i < content.ladderConfigs.length; i++) {
let ladderConfigs = content.ladderConfigs[i]
let stepTableFormData = ladderConfigs.stepTableFormData
for (let j = 0; j < stepTableFormData.length; j++) {
configTyps.map((item) => {
const { configName, configType } = item;
const configs = content[configName] || [];
if (configType === "ladder") {
for (let i = 0; i < configs.length; i++) {
let ladderConfigs = configs[i]
let stepTableFormData = ladderConfigs.stepTableFormData
for (let j = 0; j < stepTableFormData.length; j++) {
//
let fzTotal = 0//
let fzsj = stepTableFormData[j].fzsj
if (fzsj && fzsj.fzList) {
for (let k = 0; k < fzsj.fzList.length; k++) {
let fzItem = fzsj.fzList[k]
tmpResource.push({
mc: null,
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode,
ph: null,
nd: stepTableFormData[j].actSolutionConcentration,
nddw: ladderConfigs.headerSelectFields.actSolutionConcentrationUnit,
ndz: stepTableFormData[j].actSolutionConcentration + ladderConfigs.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: ladderConfigs.expireDate,
kc: fzItem.num,
kcdw: fzsj.dw,
type: null,
elnType: this.product,
syl: null,
syldw: ladderConfigs.headerSelectFields.actSolutionVolumeUnit,
yxzq: ladderConfigs.effectivePeriod,
yxzqdw: ladderConfigs.effectivePeriodUnit,
})
fzTotal = addDecimals(fzTotal, fzItem.num)
//
let fzTotal = 0//
let fzsj = stepTableFormData[j].fzsj
if (fzsj && fzsj.fzList) {
for (let k = 0; k < fzsj.fzList.length; k++) {
let fzItem = fzsj.fzList[k]
tmpResource.push({
mc: null,
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode,
ph: null,
nd: stepTableFormData[j].actSolutionConcentration,
nddw: ladderConfigs.headerSelectFields.actSolutionConcentrationUnit,
ndz: stepTableFormData[j].actSolutionConcentration + ladderConfigs.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: ladderConfigs.expireDate,
kc: fzItem.num,
kcdw: fzsj.dw,
type: null,
elnType: this.product,
syl: null,
syldw: ladderConfigs.headerSelectFields.actSolutionVolumeUnit,
yxzq: ladderConfigs.effectivePeriod,
yxzqdw: ladderConfigs.effectivePeriodUnit,
})
fzTotal = addDecimals(fzTotal, fzItem.num)
}
}
//
//(+)
const { total, unit } = addTj([stepTableFormData[j].actStartSolutionVolume, stepTableFormData[j].actDiluentVolume], [ladderConfigs.headerSelectFields.actStartSolutionVolumeUnit, ladderConfigs.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({
mc: null,
bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode,
ph: null,
ndz: stepTableFormData[j].actSolutionConcentration + ladderConfigs.headerSelectFields.actSolutionConcentrationUnit,
nd: stepTableFormData[j].actSolutionConcentration,
nddw: ladderConfigs.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: ladderConfigs.expireDate,
kc: total,
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal > 0 ? fzTotal : null,
syldw: fzTotal > 0 ? fzsj.dw : unit,
yxzq: ladderConfigs.effectivePeriod,
yxzqdw: ladderConfigs.effectivePeriodUnit,
})
//
tmpResource.push({
mc: null,
bh: ladderConfigs.subStartSolution,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: stepTableFormData[j].actStartSolutionVolume,
syldw: ladderConfigs.headerSelectFields.actStartSolutionVolumeUnit,
yxzq: null,
yxzqdw: null,
})
//
tmpResource.push({
mc: null,
bh: ladderConfigs.subSolution,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: stepTableFormData[j].actDiluentVolume,
syldw: ladderConfigs.headerSelectFields.actDiluentVolumeUnit,
yxzq: null,
yxzqdw: null,
})
}
//
//(+)
const { total, unit } = addTj([stepTableFormData[j].actStartSolutionVolume, stepTableFormData[j].actDiluentVolume], [ladderConfigs.headerSelectFields.actStartSolutionVolumeUnit, ladderConfigs.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({
mc: null,
bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode,
ph: null,
ndz: stepTableFormData[j].actSolutionConcentration + ladderConfigs.headerSelectFields.actSolutionConcentrationUnit,
nd: stepTableFormData[j].actSolutionConcentration,
nddw: ladderConfigs.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: ladderConfigs.expireDate,
kc: total,
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal > 0 ? fzTotal : null,
syldw: fzTotal > 0 ? fzsj.dw : unit,
yxzq: ladderConfigs.effectivePeriod,
yxzqdw: ladderConfigs.effectivePeriodUnit,
})
//
tmpResource.push({
mc: null,
bh: ladderConfigs.subStartSolution,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: stepTableFormData[j].actStartSolutionVolume,
syldw: ladderConfigs.headerSelectFields.actStartSolutionVolumeUnit,
yxzq: null,
yxzqdw: null,
})
//
tmpResource.push({
mc: null,
bh: ladderConfigs.subSolution,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: stepTableFormData[j].actDiluentVolume,
syldw: ladderConfigs.headerSelectFields.actDiluentVolumeUnit,
yxzq: null,
yxzqdw: null,
})
}
}
}
//
if (content.paralleConfigs && content.paralleConfigs.length > 0) {
for (let i = 0; i < content.paralleConfigs.length; i++) {
let paralleConfigs = content.paralleConfigs[i]
let stepTableFormData = paralleConfigs.stepTableFormData
for (let j = 0; j < stepTableFormData.length; j++) {
//
let fzTotal = 0//
let fzsj = stepTableFormData[j].fzsj
if (fzsj && fzsj.fzList) {
for (let k = 0; k < fzsj.fzList.length; k++) {
let fzItem = fzsj.fzList[k]
tmpResource.push({
mc: null,
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode,
ph: null,
ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
nd: stepTableFormData[j].actSolutionConcentration,
nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: paralleConfigs.expireDate,
kc: fzItem.num,
kcdw: fzsj.dw,
type: null,
elnType: this.product,
syl: null,
syldw: paralleConfigs.headerSelectFields.actSolutionVolumeUnit,
yxzq: paralleConfigs.effectivePeriod,
yxzqdw: paralleConfigs.effectivePeriodUnit,
})
fzTotal = addDecimals(fzTotal, fzItem.num)
} else {
for (let i = 0; i < configs.length; i++) {
let paralleConfigs = configs[i]
let stepTableFormData = paralleConfigs.stepTableFormData
for (let j = 0; j < stepTableFormData.length; j++) {
//
let fzTotal = 0//
let fzsj = stepTableFormData[j].fzsj
if (fzsj && fzsj.fzList) {
for (let k = 0; k < fzsj.fzList.length; k++) {
let fzItem = fzsj.fzList[k]
tmpResource.push({
mc: null,
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode,
ph: null,
ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
nd: stepTableFormData[j].actSolutionConcentration,
nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: paralleConfigs.expireDate,
kc: fzItem.num,
kcdw: fzsj.dw,
type: null,
elnType: this.product,
syl: null,
syldw: paralleConfigs.headerSelectFields.actSolutionVolumeUnit,
yxzq: paralleConfigs.effectivePeriod,
yxzqdw: paralleConfigs.effectivePeriodUnit,
})
fzTotal = addDecimals(fzTotal, fzItem.num)
}
}
//
const { total, unit } = addTj([stepTableFormData[j].actSolutionVolume, stepTableFormData[j].actDiluentVolume], [paralleConfigs.headerSelectFields.actSolutionVolumeUnit, paralleConfigs.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({
mc: null,
bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode,
ph: null,
nd: stepTableFormData[j].actSolutionConcentration,
ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: stepTableFormData[j].targetSolutionExpirationDate,
kc: total,
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal > 0 ? fzTotal : null,
syldw: fzTotal > 0 ? fzsj.dw : unit,
yxzq: stepTableFormData[j].targetSolutionCycle,
yxzqdw: stepTableFormData[j].targetSolutionCyclePrecision,
})
//
tmpResource.push({
mc: null,
bh: paralleConfigs.subSolution,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: stepTableFormData[j].actDiluentVolume,
syldw: paralleConfigs.headerSelectFields.actDiluentVolumeUnit,
yxzq: null,
yxzqdw: null,
})
}
//
const { total, unit } = addTj([stepTableFormData[j].actSolutionVolume, stepTableFormData[j].actDiluentVolume], [paralleConfigs.headerSelectFields.actSolutionVolumeUnit, paralleConfigs.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({
mc: null,
bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode,
ph: null,
nd: stepTableFormData[j].actSolutionConcentration,
ndz: stepTableFormData[j].actSolutionConcentration + paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
nddw: paralleConfigs.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: stepTableFormData[j].targetSolutionExpirationDate,
kc: total,
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal > 0 ? fzTotal : null,
syldw: fzTotal > 0 ? fzsj.dw : unit,
yxzq: stepTableFormData[j].targetSolutionCycle,
yxzqdw: stepTableFormData[j].targetSolutionCyclePrecision,
})
//
tmpResource.push({
mc: null,
bh: paralleConfigs.subSolution,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: stepTableFormData[j].actDiluentVolume,
syldw: paralleConfigs.headerSelectFields.actDiluentVolumeUnit,
yxzq: null,
yxzqdw: null,
})
}
}
}
})
}
if (tmpResource.length > 0) {
tmpResource = uniqeResourceOne(tmpResource)
@ -596,24 +599,36 @@ export default {
const stepResource = this.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || []
console.log(this.resourceTmp,"resourceTmp")
return this.resourceTmp;
},
getStepResource() {
const sjResource = [], yqResource = [];
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
const paralleResource = this.$refs[`paralleRef_${i}`][0].getStepResource();
sjResource.push(...paralleResource.sjResource);
yqResource.push(...paralleResource.yqResource);
}
}
if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) {
for (let i = 0; i < this.formData.ladderConfigs.length; i++) {
const ladderResource = this.$refs[`ladderRef_${i}`][0].getStepResource();
sjResource.push(...ladderResource.sjResource);
yqResource.push(...ladderResource.yqResource);
}
}
configTyps.map((item) => {
const { ref, configName } = item;
const configs = this.formData[configName] || [];
configs.map((config, i) => {
if (this.$refs[`${ref}_${i}`]) {
sjResource.push(...this.$refs[`${ref}_${i}`][0].getStepResource().sjResource);
yqResource.push(...this.$refs[`${ref}_${i}`][0].getStepResource().yqResource);
}
})
})
// if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) {
// for (let i = 0; i < this.formData.paralleConfigs.length; i++) {
// const paralleResource = this.$refs[`paralleRef_${i}`][0].getStepResource();
// sjResource.push(...paralleResource.sjResource);
// yqResource.push(...paralleResource.yqResource);
// }
// }
// if (this.formData.ladderConfigs && this.formData.ladderConfigs.length > 0) {
// for (let i = 0; i < this.formData.ladderConfigs.length; i++) {
// const ladderResource = this.$refs[`ladderRef_${i}`][0].getStepResource();
// sjResource.push(...ladderResource.sjResource);
// yqResource.push(...ladderResource.yqResource);
// }
// }
//
const { sj, yq } = duplicateResource(sjResource, yqResource)
return { sjResource: sj, yqResource: yq };

+ 4
- 9
src/views/business/comps/template/comps/sp/comps/LadderConfig.vue View File

@ -108,15 +108,10 @@ export default {
},
// getFormData
async getFormData() {
const baseFormData = await this.$refs.formPackageRef?.getFormData();
const tableData = await this.$refs.tableRef?.getFormData();
const stepData =await this.$refs.stepRef?.getFormData();
//
if (!baseFormData || !tableData || !stepData) {
return false;
}
return true;
const refs = ['formPackageRef', 'tableRef', 'stepRef']
const pros = refs.map((ref)=>this.$refs[ref]?.getFormData())
const result = await Promise.all(pros);
return result;
},
//
onRegentSubmit(data) {

+ 96
- 46
src/views/business/comps/template/formConfig/paralleAndLadderConfig.js View File

@ -1,3 +1,40 @@
const explainConfig = {
type: 'explainItem',
config: {
text1: {
label: '配制说明:配制',
type: 'span',
},
yb: {
type: "input",
fillType: 'preFill',
maxlength: 100,
formWidth: 280
},
text2:{
label:"样本,分别配制",
type: 'span',
},
ybs: {
type: "inputNumber",
fillType: 'preFill',
precision: 0,
},
text3:{
label:"套, 序列号为:",
type: 'span',
},
ybh: {
type: "input",
fillType: 'preFill',
},
text4:{
label:",单套配制过程如下:",
type: 'span',
},
}
}
// 阶梯配置表格列配置
export const getLadderColumnsConfig = ($this) => {
return [
@ -38,11 +75,11 @@ export const getLadderColumnsConfig = ($this) => {
bodySubFillType: 'preFill',
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'targetStartSolutionVolumePrecision',
subPrecision:0,
subPrecision: 0,
bodyMaxlength: 10,
bodyDisabled: true,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
headerSelectTo:"actStartSolutionVolumeUnit",
headerSelectTo: "actStartSolutionVolumeUnit",
},
{
label: 'template.sp.sp00456.sjqsrytj',
@ -75,10 +112,10 @@ export const getLadderColumnsConfig = ($this) => {
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'targetDiluentVolumePrecision',
subPrecision:0,
subPrecision: 0,
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
headerSelectTo:"actDiluentVolumeUnit",
headerSelectTo: "actDiluentVolumeUnit",
},
{
label: 'template.sp.sp00456.sjxsytj',
@ -105,7 +142,7 @@ export const getLadderColumnsConfig = ($this) => {
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
headerSelectTo:"actSolutionConcentrationUnit",
headerSelectTo: "actSolutionConcentrationUnit",
},
{
label: 'template.sp.sp00456.sjmbrynd',
@ -124,7 +161,7 @@ export const getLadderColumnsConfig = ($this) => {
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'actSolutionConcentrationPrecision',
subPrecision:0,
subPrecision: 0,
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
compareTo: 'targetSolutionConcentration', //比较哪个字段
@ -140,7 +177,7 @@ export const getLadderColumnsConfig = ($this) => {
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
headerSelectTo:"actSolutionVolumeUnit",
headerSelectTo: "actSolutionVolumeUnit",
},
{
label: 'template.sp.sp00456.sjmbrytj',
@ -159,7 +196,7 @@ export const getLadderColumnsConfig = ($this) => {
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'actSolutionVolumePrecision',
subPrecision:0,
subPrecision: 0,
bodyMaxlength: 10,
// copyFrom: 'targetSolutionVolume', //复制哪个字段
bodySubPlaceholder: 'template.common.xswsPlaceholder',
@ -171,16 +208,17 @@ export const getLadderColumnsConfig = ($this) => {
export const getParallelColumnsConfig = ($this) => {
const sn = $this.sn;
let o = {
"SP004":"business_sp_nbgzy",
"SP005":"business_sp_zkgzy",
"SP006":"business_sp_bzqxzkypzbb",
"SP004": "business_sp_nbgzy",
"SP005": "business_sp_zkgzy",
"SP006": "business_sp_bzqxzkypzbb",
}
const dic = o[sn] || 'business_sp_nbgzy';
return [
{
label: 'template.sp.sp00456.mbrybh',
prop: 'targetSolutionCode',
bodyType: 'select',
bodyOptions: $this.getDictOptions(o[sn]),
bodyOptions: $this.getDictOptions(dic),
bodySubType: 'span',
bodySubKey: 'subTargetSolutionCode',
bodyFillType: 'preFill',
@ -201,7 +239,7 @@ export const getParallelColumnsConfig = ($this) => {
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
headerSelectTo:"actSolutionConcentrationUnit",
headerSelectTo: "actSolutionConcentrationUnit",
},
{
label: 'template.sp.sp00456.sjmbrynd',
@ -219,7 +257,7 @@ export const getParallelColumnsConfig = ($this) => {
bodySubFillType: 'preFill',
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'actSolutionConcentrationPrecision',
subPrecision:0,
subPrecision: 0,
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
compareTo: 'targetSolutionConcentration', //比较哪个字段
@ -235,7 +273,7 @@ export const getParallelColumnsConfig = ($this) => {
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10,
headerSelectTo:"actSolutionVolumeUnit",
headerSelectTo: "actSolutionVolumeUnit",
},
{
label: 'template.sp.sp00456.sjmbrytj',
@ -253,7 +291,7 @@ export const getParallelColumnsConfig = ($this) => {
bodySubFillType: 'preFill',
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'actSolutionVolumePrecision',
subPrecision:0,
subPrecision: 0,
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
compareTo: 'targetSolutionVolume', //比较哪个字段
@ -321,9 +359,9 @@ export const getParallelColumnsConfig = ($this) => {
bodyDisabled: true,
compareTo: 'targetStartSolutionConcentration', //比较哪个字段
bodySubKey: 'subTargetAcSolutionUnit',
bodySubType:"input",
bodySubCompareTo:"targetStartSolutionConcentrationPrecision",
bodySubFillType:"actFill",
bodySubType: "input",
bodySubCompareTo: "targetStartSolutionConcentrationPrecision",
bodySubFillType: "actFill",
bodySubDisabled: true,
},
{
@ -341,13 +379,13 @@ export const getParallelColumnsConfig = ($this) => {
bodySubFillType: 'preFill',
bodyMaxlength: 10,
bodyPrecisionKey: 'targetStartSolutionVolumePrecision',
subPrecision:0,
subPrecision: 0,
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
bodyDisabled: true,
showBodySub: true,
showBodySub: $this.fillType === 'preFill',
headerSelectTo:"actStartSolutionVolumeUnit",
headerSelectTo: "actStartSolutionVolumeUnit",
},
{
@ -380,11 +418,11 @@ export const getParallelColumnsConfig = ($this) => {
bodySubFillType: 'preFill',
bodyMaxlength: 10,
bodyPrecisionKey: 'targetDiluentVolumePrecision',
subPrecision:0,
subPrecision: 0,
bodySubPlaceholder: 'template.common.xswsPlaceholder',
bodyDisabled: true,
showBodySub: $this.fillType === 'preFill',
headerSelectTo:"actDiluentVolumeUnit",
headerSelectTo: "actDiluentVolumeUnit",
},
{
label: 'template.sp.sp00456.sjxsytj',
@ -397,7 +435,7 @@ export const getParallelColumnsConfig = ($this) => {
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodyMaxlength: 10,
copyFrom:"targetDiluentVolume",
copyFrom: "targetDiluentVolume",
compareTo: 'targetDiluentVolume' //比较哪个字段
}
]
@ -405,7 +443,8 @@ export const getParallelColumnsConfig = ($this) => {
//阶梯配置
export const getLadderFormConfig = ($this) => {
return [
const sn = $this.sn;
const defaultConfig = [
{
type: 'step',
config: {
@ -435,9 +474,9 @@ export const getLadderFormConfig = ($this) => {
maxlength: 10,
compareTo: 'targetStartSolution', //比较哪个字段
subKey: "subTargetAcSolutionUnit",
subType:"input",
subDisabled:true,
subCompareTo:"subTargetStartSolution",
subType: "input",
subDisabled: true,
subCompareTo: "subTargetStartSolution",
},
solution: {
label: 'template.sp.sp00456.xsy',
@ -471,12 +510,16 @@ export const getLadderFormConfig = ($this) => {
}
}
]
if (sn === "LBA007") {
defaultConfig.unshift(explainConfig)
}
return defaultConfig
}
//试验基本信息
export const getBaseInfoFormConfig = ($this) => {
const sn = $this.sn;
const labArr = ["LBA005","LBA007"]
const labArr = ["LBA005", "LBA007"]
const isLba = labArr.includes(sn);
return [
{
@ -509,7 +552,7 @@ export const getBaseInfoFormConfig = ($this) => {
},
{
type: 'conditionItem',
label:isLba? 'template.lba.lba002.cztj':'template.common.testConfigurationConditions',
label: isLba ? 'template.lba.lba002.cztj' : 'template.common.testConfigurationConditions',
config: {
pre: {
label: 'template.common.preFill',
@ -530,7 +573,7 @@ export const getBaseInfoFormConfig = ($this) => {
}
}
},
isLba?{}:{
isLba ? {} : {
type: 'conditionItem',
label: 'template.sp.sp00456.rqcz',
config: {
@ -546,7 +589,7 @@ export const getBaseInfoFormConfig = ($this) => {
},
{
type: 'cellItem',
label: isLba?'template.lba.lba002.czsj':'template.common.configurationTime',
label: isLba ? 'template.lba.lba002.czsj' : 'template.common.configurationTime',
config: {
startDate: {
label: 'template.common.startTime',
@ -601,12 +644,13 @@ export const getStorageConditionFormConfig = ($this) => {
//平行步骤配置
export const getParalleStepFormConfig = ($this) => {
return [
const defaultConfig = [
{
type: 'step',
config: {
solution: {
label: 'template.sp.sp00456.xsy',
labelWidth:80,
type: 'input',
fillType: 'preFill',
subType: 'sj',
@ -616,6 +660,7 @@ export const getParalleStepFormConfig = ($this) => {
},
paralleStepStorageCondition: {
label: 'template.sp.sp00456.cctj',
labelWidth:80,
type: 'select',
fillType: 'preFill',
options: $this.getDictOptions('business_cctj'),
@ -624,22 +669,27 @@ export const getParalleStepFormConfig = ($this) => {
}
}
]
const sn = $this.sn;
if(sn === "LBA007"){
defaultConfig.unshift(explainConfig)
}
return defaultConfig
}
//选板信息;
export const getJcbColumnsConfig = ($this) => {
return [{
label: 'template.lba.lba002.jcbmc',
prop: 'jcb',
bodyType: 'input',
bodyFillType: 'preFill',
width: 280,
bodyMaxlength:20
},{
label: '',
prop: 'jcbBh',
bodyType: 'jcb',
bodyFillType: 'actFill',
width: 280
}]
label: 'template.lba.lba002.jcbmc',
prop: 'jcb',
bodyType: 'input',
bodyFillType: 'preFill',
width: 280,
bodyMaxlength: 20
}, {
label: '',
prop: 'jcbBh',
bodyType: 'jcb',
bodyFillType: 'actFill',
width: 280
}]
}

+ 1
- 1
src/views/business/comps/template/formConfig/sp/SP0019.js View File

@ -22,7 +22,7 @@ export const getBaseInfoFormConfig = (formType) => {
versionNum: {
label: 'template.common.versionNumber',
type: 'inputNumber',
fillType: 'preFill',
fillType: 'actFill',
prepend: 'V',
maxlength: 50
},

+ 67
- 40
src/views/business/comps/template/formConfig/sp/SP0020.js View File

@ -1,9 +1,6 @@
// checkboxTree 类型的配置
const checkboxTreeOptions = [
{
label: '方法学验证',
value: '方法学验证',
children: [
const getOptions = (sn) => {
let children = [
{ label: '储备液比对', value: '储备液比对' },
{ label: '标准曲线线性范围', value: '标准曲线线性范围' },
{ label: '准确度与精密度&灵敏度', value: '准确度与精密度&灵敏度' },
@ -24,34 +21,64 @@ const checkboxTreeOptions = [
{ label: '储备液长期稳定性', value: '储备液长期稳定性' },
{ label: '工作液短期稳定性', value: '工作液短期稳定性' },
{ label: '工作液长期稳定性', value: '工作液长期稳定性' }
]
},
{
label: '样品分析',
value: '样品分析',
children: [
{ label: '样品信息', value: '样品信息' }
]
},
{
label: '其他',
value: '其他',
children: []
];
if (sn === 'PCR006') {
children = [
{ label: '基质效应', value: '基质效应' },
{ label: '选择性', value: '选择性' },
{ label: '特异性', value: '特异性' },
{ label: '方法耐用性', value: '方法耐用性' },
{ label: '精密度与准确性', value: '精密度与准确性' },
{ label: '检测限', value: '检测限' },
{ label: '提取精密度', value: '提取精密度' },
{ label: '提取前样品稳定性', value: '提取前样品稳定性' },
{ label: '提取后样品稳定性', value: '提取后样品稳定性' },
{ label: 'cDNA样品稳定性', value: 'cDNA样品稳定性' },
{ label: '方法适用性', value: '方法适用性' },
{ label: '基因组DNA残留测定', value: '基因组DNA残留测定' },
{ label: '稀释线性', value: '稀释线性' },
{ label: '反复动态稳定性', value: '反复动态稳定性' },
{ label: '标准工作液稳定性', value: '标准工作液稳定性' }
]
}
]
return [
{
label: '方法学验证',
value: '方法学验证',
children
},
{
label: '样品分析',
value: '样品分析',
children: [
{ label: '样品信息', value: '样品信息' }
]
},
{
label: '其他',
value: '其他',
children: []
}
]
}
//试验内容
export const getSynrFormConfig = ()=>{
export const getSynrFormConfig = ($this) => {
return [
{
type: 'checkboxList',
config: {
ffxyz: {
type: 'checkboxTree',
type: 'checkboxTree',
label: '方法学验证',
options:checkboxTreeOptions,
span:1,
fillType:"actFill"
options: getOptions($this.sn),
span: 1,
fillType: "actFill"
},
}
},
@ -59,36 +86,36 @@ export const getSynrFormConfig = ()=>{
}
//仪器结果
export const getYqjgFormConfig = ()=>{
export const getYqjgFormConfig = () => {
return [
{
type: 'checkboxList',
config: {
jg: {
type: 'checkboxTree',
type: 'checkboxTree',
label: '结果',
options:[
options: [
{ label: '分析批接受', value: '分析批接受' },
{ label: '分析批拒绝', value: '分析批拒绝' },
{ label: '部分接受', value: '部分接受' },
],
span:1,
fillType:"actFill"
span: 1,
fillType: "actFill"
},
yzkcjg: {
type: 'textarea',
label: '验证考察结果',
span:1,
fillType:"actFill",
span: 1,
fillType: "actFill",
maxlength: 1000,
rows: 5
rows: 5
},
}
},
]
}
//分析批数据文件
export const getFxpsjwjFormConfig = ()=>{
export const getFxpsjwjFormConfig = () => {
return [
{
type: 'checkboxList',
@ -96,15 +123,15 @@ export const getFxpsjwjFormConfig = ()=>{
fxpsjwjm: {
type: 'input',
label: '分析批数据文件名',
span:1,
fillType:"actFill",
span: 1,
fillType: "actFill",
maxlength: 100,
},
fxpsjlj: {
type: 'input',
label: '分析批数据路径',
span:1,
fillType:"actFill",
span: 1,
fillType: "actFill",
maxlength: 150,
},
}
@ -113,7 +140,7 @@ export const getFxpsjwjFormConfig = ()=>{
}
//采集日期
export const getCjrqFormConfig = ()=>{
export const getCjrqFormConfig = () => {
return [
{
type: 'cellItem',
@ -121,12 +148,12 @@ export const getCjrqFormConfig = ()=>{
cjksrq: {
type: 'datePicker',
label: '采集开始日期',
fillType:"actFill"
fillType: "actFill"
},
cjjsrq: {
type: 'datePicker',
label: '采集结束日期',
fillType:"actFill"
fillType: "actFill"
},
}
},

+ 67
- 65
src/views/business/comps/template/mixins/templateMixin.js View File

@ -3,8 +3,8 @@ import { getLatestSn, getLatestSnArr } from '@/api/template';
import { isValueEmpty, getStringWidth } from '@/utils/index';
import { isCommonUnit } from "@/utils/conTools";
import { sj_subpackage, sj_startConfiguration, sj_configurationCompleted } from '@/api/business/sj/sj';
import {convertConcentration} from "@/utils/conConverter";//浓度单位转换
import {volumeConverter} from "@/utils/volConverter";//体积单位转换
import { convertConcentration } from "@/utils/conConverter";//浓度单位转换
import { volumeConverter } from "@/utils/volConverter";//体积单位转换
import * as XLSX from 'xlsx'
import { EventBus } from "@/utils/eventBus";
@ -95,7 +95,7 @@ export default {
// this.resourceWz = _.filter(JSON.parse(v.resource), function (o) {
// return o.type == 3 || o.type == 5 || o.type == 7 || o.elnType == 3|| o.elnType == 5 || o.elnType == 7
// })
//试验试剂信息
//试验试剂信息
this.resourceSj = _.filter(JSON.parse(v.resource), function (o) {
return o.type == 1 || o.elnType == 1
})
@ -126,8 +126,8 @@ export default {
studySn,
templateMc,
templateMcEn,
templateId,
templateSn,
templateId,
templateSn,
startDate,
bdmc,
endDate,
@ -141,7 +141,7 @@ export default {
studySn,
templateMc,
templateMcEn,
templateId,
templateId,
templateSn,
startDate,
bdmc,
@ -188,13 +188,13 @@ export default {
yqResource: [], //仪器信息
jcbList: [], //检测板信息
xbxj: [], //细胞细菌信息
resourceTmp: [],//试验试剂信息提交用
yqResourceTmp: [], //仪器信息提交用
jcbListTmp: [], //检测板信息提交用
xbxjTmp:[],//细胞细菌信息提交用
sjColumns: [
xbxjTmp: [],//细胞细菌信息提交用
sjColumns: [
{ label: 'template.common.reagentName', prop: "mc" },//名称
{ label: 'template.common.reagentCode', prop: "bh" },//编号
{ label: 'template.common.reagentNo', prop: "ph" },//批号 试剂,供试品才有
@ -202,7 +202,7 @@ export default {
{ label: 'template.common.source', prop: "ly" },//来源
{ label: 'template.common.reagentExpireDate', prop: "sxrq" },//失效日期
],
gspColumns: [
gspColumns: [
{ label: 'template.common.wzName', prop: "mc" },//名称
{ label: 'template.common.wzCode', prop: "bh" },//编号
{ label: 'template.common.reagentNo', prop: "ph" },//批号 试剂,供试品才有
@ -255,7 +255,7 @@ export default {
},
methods: {
// 只是更新已填写的表单数据,不触发校验
justUpdateFilledFormData(){
justUpdateFilledFormData() {
const params = {
type: "fieldChanged",
newRecord: null,
@ -264,11 +264,11 @@ export default {
EventBus.$emit('onModifyRecord', params,)
},
//试剂弹窗确认前
onBeforeReagentSubmit(data){
const {selectData, callback, key, formFields} = data;
const {subTargetStartSolution} = formFields;
onBeforeReagentSubmit(data) {
const { selectData, callback, key, formFields } = data;
const { subTargetStartSolution } = formFields;
//判断选择的浓度单位和预制的浓度单位是否一致
if(key === "subStartSolution" && !isCommonUnit(selectData.row.nddw,[subTargetStartSolution])){//选择起始源溶液需要同步更新table的变更记录。
if (key === "subStartSolution" && !isCommonUnit(selectData.row.nddw, [subTargetStartSolution])) {//选择起始源溶液需要同步更新table的变更记录。
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。');
}
},
@ -381,10 +381,12 @@ export default {
let result = {}
const refs = refArr.map((ref) => {
let refData = {}
if (this.$refs[ref][0]) {
refData = this.$refs[ref][0]?.getFormData() || {}
} else {
refData = this.$refs[ref]?.getFormData() || {}
if (this.$refs[ref]) {
if (this.$refs[ref][0]) {
refData = this.$refs[ref][0]?.getFormData() || {}
} else {
refData = this.$refs[ref]?.getFormData() || {}
}
}
return refData
})
@ -427,8 +429,8 @@ export default {
this.$store.commit('template/SET_TEMPLATE_DATA', data)
},
//统一处理删除行
deleteRow(index,ref) {
if(ref){
deleteRow(index, ref) {
if (ref) {
this.$refs[ref].deleteRow(index);
return;
}
@ -436,14 +438,14 @@ export default {
},
//统一处理浓度校验异常
onCommonVerifyNdException(formFields,data){
const {callback,rowIndex, key,dataSource} = data;
onCommonVerifyNdException(formFields, data) {
const { callback, rowIndex, key, dataSource } = data;
const keys = [
'actStartSolutionVolume',
'actDiluentVolume',
]
if(keys.includes(key)){
const {targetAcSolution} = formFields;
if (keys.includes(key)) {
const { targetAcSolution } = formFields;
if (rowIndex === 0) {//第一行的浓度取选择的溶液,
if (isValueEmpty(targetAcSolution)) {
callback.prevent("请先选择起始源溶液")
@ -481,7 +483,7 @@ export default {
} else if (key === 'targetStartSolution' || key === 'subTargetStartSolution') {
//起始溶液体积失焦时,更新目标溶液预计浓度
const arr = this.$refs.stepTableRef?.getDataSource();
const {headerSelectFields} = this.$refs.stepTableRef?.getFilledFormData();
const { headerSelectFields } = this.$refs.stepTableRef?.getFilledFormData();
const params = {
subTargetStartSolution,
headerSelectFields
@ -508,7 +510,7 @@ export default {
},
//统一处理table失焦事件
onHandleTableBlur(params) {
const { rowIndex, colKey, value, item, dataSource,headerSelectFields } = params
const { rowIndex, colKey, value, item, dataSource, headerSelectFields } = params
if (
colKey === 'targetSolutionVolume' ||
colKey === 'targetSolutionConcentration' ||
@ -524,37 +526,37 @@ export default {
'subTargetStartSolution'
)
const params = {
subTargetStartSolution:subTargetStartSolution,
subTargetStartSolution: subTargetStartSolution,
headerSelectFields
}
if (isValueEmpty(volume)) {
this.$message.error('请先选择预设起始源溶液浓度')
} else {
this.updateTargetStartSolutionVolume(item, volume,params)
this.updateTargetStartSolutionVolume(item, volume, params)
}
} else if (
colKey === 'actStartSolutionVolume' ||
colKey === 'actDiluentVolume'
) {
//实际起始溶液体积和实际目标溶液体积
const {targetAcSolution,subTargetAcSolutionUnit} =
this.$refs.stepFormPackageRef?.getFilledFormData() //获取实际起始溶液浓度
const {headerSelectFields} = this.$refs.stepTableRef?.getFilledFormData();
const { targetAcSolution, subTargetAcSolutionUnit } =
this.$refs.stepFormPackageRef?.getFilledFormData() //获取实际起始溶液浓度
const { headerSelectFields } = this.$refs.stepTableRef?.getFilledFormData();
const p = {
targetStartSolutionUnit:subTargetAcSolutionUnit,
targetStartSolutionUnit: subTargetAcSolutionUnit,
headerSelectFields
}
let initNd = 0;
if(rowIndex === 0){
if (rowIndex === 0) {
initNd = targetAcSolution;
}else{
} else {
initNd = dataSource[rowIndex - 1].actSolutionConcentration;
}
if (isValueEmpty(initNd)) {
this.$message.error('请先选择起始源溶液')
return
} else {
const volResult = this.updateSjmbrynd(item, initNd,p)
const volResult = this.updateSjmbrynd(item, initNd, p)
if (!volResult) {
return
}
@ -564,14 +566,14 @@ export default {
},
//计算目标溶液浓度
calcNd(item, targetAcSolution,params) {
console.log(params,"ppp")
calcNd(item, targetAcSolution, params) {
console.log(params, "ppp")
// debugger
//targetStartSolutionUnit(实际起始源溶液浓度单位)
const {targetStartSolutionUnit,headerSelectFields} = params;
const { targetStartSolutionUnit, headerSelectFields } = params;
//actStartSolutionVolumeUnit(实际起始源溶液体积单位)actSolutionVolumeUnit(实际目标溶液体积单位)
//actDiluentVolumeUnit(实际稀释液体积单位)actSolutionConcentrationUnit(实际目标溶液浓度单位)
const {actStartSolutionVolumeUnit,actSolutionVolumeUnit,actDiluentVolumeUnit,actSolutionConcentrationUnit} = headerSelectFields;
const { actStartSolutionVolumeUnit, actSolutionVolumeUnit, actDiluentVolumeUnit, actSolutionConcentrationUnit } = headerSelectFields;
//实际源溶液浓度÷(实际终体积÷源溶液加入体积);
const precision = item.actSolutionConcentrationPrecision
const volPrecision = item.actSolutionVolumePrecision;
@ -579,24 +581,24 @@ export default {
const actDiluentVolume = item.actDiluentVolume
//实际起始源溶液体积
const actStartSolutionVolume = item.actStartSolutionVolume
if(isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(targetStartSolutionUnit)){
if (isValueEmpty(actStartSolutionVolume) || isValueEmpty(actDiluentVolume) || isValueEmpty(targetStartSolutionUnit)) {
return false
}
const converActDiluentVolume = volumeConverter.convert(actDiluentVolume+actDiluentVolumeUnit,actSolutionVolumeUnit)
const converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume+actStartSolutionVolumeUnit,actSolutionVolumeUnit)
const converActDiluentVolume = volumeConverter.convert(actDiluentVolume + actDiluentVolumeUnit, actSolutionVolumeUnit)
const converActStartSolutionVolume = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, actSolutionVolumeUnit)
//实际源溶液加入体积+实际稀释液加入体积
const actVol = (
Number(converActDiluentVolume) + Number(converActStartSolutionVolume)
).toFixed(volPrecision)
const targetStartVolUnit = actSolutionConcentrationUnit.split("/")[1];//先按照预设目标溶液浓度的单位标准
const converActVol = volumeConverter.convert(actVol+actSolutionVolumeUnit,targetStartVolUnit)
const converActDiluentVolume1 = volumeConverter.convert(actStartSolutionVolume+actStartSolutionVolumeUnit,targetStartVolUnit)
const converTargetAcSolution = convertConcentration.convert(targetAcSolution+targetStartSolutionUnit,actSolutionConcentrationUnit)
const converActVol = volumeConverter.convert(actVol + actSolutionVolumeUnit, targetStartVolUnit)
const converActDiluentVolume1 = volumeConverter.convert(actStartSolutionVolume + actStartSolutionVolumeUnit, targetStartVolUnit)
const converTargetAcSolution = convertConcentration.convert(targetAcSolution + targetStartSolutionUnit, actSolutionConcentrationUnit)
// 实际目标溶液浓度 = 实际源溶液浓度÷(实际终体积÷源溶液加入体积);
const actNd = (
parseFloat(converTargetAcSolution) / (
parseFloat(converActVol)/parseFloat(converActDiluentVolume1)
parseFloat(converActVol) / parseFloat(converActDiluentVolume1)
)
).toFixed(precision)
const nd = actNd === 'Infinity' ? 0 : Number(actNd)
@ -606,38 +608,38 @@ export default {
},
//计算并更新实际目标溶液浓度 先计算实际目标溶液体积再计算实际目标溶液浓度
updateSjmbrynd(item, targetAcSolution,params) {
return this.calcNd(item, targetAcSolution,params)
updateSjmbrynd(item, targetAcSolution, params) {
return this.calcNd(item, targetAcSolution, params)
},
//更新起始溶液体积时,计算预设起始溶液体积和预设稀释液体积
updateTargetStartSolutionVolume(item, volume,unitParams) {
updateTargetStartSolutionVolume(item, volume, unitParams) {
const precision = item.targetStartSolutionVolumePrecision || 0
const concentration = item.targetSolutionConcentration
const targetVolume = item.targetSolutionVolume
const {subTargetStartSolution,headerSelectFields} = unitParams
const {targetSolutionConcentrationUnit,targetSolutionVolumeUnit,targetStartSolutionVolumeUnit,targetDiluentVolumeUnit} = headerSelectFields
if(
const { subTargetStartSolution, headerSelectFields } = unitParams
const { targetSolutionConcentrationUnit, targetSolutionVolumeUnit, targetStartSolutionVolumeUnit, targetDiluentVolumeUnit } = headerSelectFields
if (
isValueEmpty(concentration) ||
isValueEmpty(targetVolume)||
isValueEmpty(subTargetStartSolution)||
isValueEmpty(targetSolutionConcentrationUnit)||
isValueEmpty(targetSolutionVolumeUnit)||
isValueEmpty(targetStartSolutionVolumeUnit)||
isValueEmpty(targetVolume) ||
isValueEmpty(subTargetStartSolution) ||
isValueEmpty(targetSolutionConcentrationUnit) ||
isValueEmpty(targetSolutionVolumeUnit) ||
isValueEmpty(targetStartSolutionVolumeUnit) ||
isValueEmpty(targetDiluentVolumeUnit)
){
) {
return;
}
const targetStartVolUnit = targetSolutionConcentrationUnit.split("/")[1];//先按照预设目标溶液浓度的单位标准
//将起始溶液浓度转换为和预设目标溶液浓度一样的单位再计算;
const converStartCon = convertConcentration.convert(volume+subTargetStartSolution,targetSolutionConcentrationUnit)
const converStartCon = convertConcentration.convert(volume + subTargetStartSolution, targetSolutionConcentrationUnit)
//将预设目标溶液体积转换为和预设目标溶液浓度单位的分母一样的单位再计算;如:预设目标溶液浓度单位为mg/mL,预设目标溶液体积单位为uL,则将预设目标溶液体积转换为mL
const convertTargetVol = volumeConverter.convert(targetVolume+targetSolutionVolumeUnit,targetStartVolUnit)
const convertTargetVol = volumeConverter.convert(targetVolume + targetSolutionVolumeUnit, targetStartVolUnit)
//预设起始溶液体积:(目标溶液预计浓度 乘以 目标溶液预计体积)除以 起始溶液浓度
const result = Number((concentration * convertTargetVol) / converStartCon)
//根据预设起始溶液体积单位转换计算后的数据
const convertYsVol = volumeConverter.convert(result+targetStartVolUnit,targetStartSolutionVolumeUnit)
const convertYsVol = volumeConverter.convert(result + targetStartVolUnit, targetStartSolutionVolumeUnit)
item.targetStartSolutionVolume = Number(convertYsVol.toFixed(
precision
))
@ -646,9 +648,9 @@ export default {
//预设稀释液体积:目标溶液预计体积 减去 源溶液预计体积;
const precision1 = item.targetDiluentVolumePrecision || 0;
//将预设目标溶液体积转换为和预设起始溶液体积单位一样的单位再计算;
const convertTargetVol1 = volumeConverter.convert(targetVolume+targetSolutionVolumeUnit,targetStartSolutionVolumeUnit)
const convertTargetVol1 = volumeConverter.convert(targetVolume + targetSolutionVolumeUnit, targetStartSolutionVolumeUnit)
const result1 = (convertTargetVol1 - convertYsVol)
item.targetDiluentVolume = Number(volumeConverter.convert(result1+targetStartSolutionVolumeUnit,targetDiluentVolumeUnit).toFixed(precision1))
item.targetDiluentVolume = Number(volumeConverter.convert(result1 + targetStartSolutionVolumeUnit, targetDiluentVolumeUnit).toFixed(precision1))
// this.$refs.stepTableRef.updateDataSourceByRowIndex(rowIndex, { targetDiluentVolume: result1 });
}
},

Loading…
Cancel
Save