|
|
@ -15,17 +15,12 @@ |
|
|
:formConfig="storageFormConfig" :formData="formData" /> |
|
|
:formConfig="storageFormConfig" :formData="formData" /> |
|
|
<div v-if="isLba"> |
|
|
<div v-if="isLba"> |
|
|
<LineLabel label="template.lba.lba004.xbxx" /> |
|
|
<LineLabel label="template.lba.lba004.xbxx" /> |
|
|
<CustomTable |
|
|
|
|
|
:isBorder="false" |
|
|
|
|
|
:ref="`jcbRef`" |
|
|
|
|
|
:columns="jcbColumns" |
|
|
|
|
|
:formData="formData" |
|
|
|
|
|
:prefixKey = "`jcb`" |
|
|
|
|
|
fieldItemLabel = "template.lba.lba004.xbxx" |
|
|
|
|
|
:showOperation="fillType === 'preFill'" |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
<CustomTable :isBorder="false" :ref="`jcbRef`" :columns="jcbColumns" :formData="formData" |
|
|
|
|
|
:prefixKey="`jcb`" fieldItemLabel="template.lba.lba004.xbxx" |
|
|
|
|
|
:showOperation="fillType === 'preFill'"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" @deleteRow="deleteJcbRow" ></TableOpertaionDelete> |
|
|
|
|
|
|
|
|
<TableOpertaionDelete :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
|
|
@deleteRow="deleteJcbRow"></TableOpertaionDelete> |
|
|
</template> |
|
|
</template> |
|
|
</CustomTable> |
|
|
</CustomTable> |
|
|
</div> |
|
|
</div> |
|
|
@ -40,97 +35,24 @@ |
|
|
<!-- 阶梯配制区域 --> |
|
|
<!-- 阶梯配制区域 --> |
|
|
<div v-for="(ladderConfig, ladderIndex) in formData.ladderConfigs" |
|
|
<div v-for="(ladderConfig, ladderIndex) in formData.ladderConfigs" |
|
|
:key="'ladder_' + ladderConfig.id"> |
|
|
:key="'ladder_' + ladderConfig.id"> |
|
|
<LadderConfig |
|
|
|
|
|
:currentFormConfig="ladderStepFormConfig" |
|
|
|
|
|
:currentFormData = "ladderConfig" |
|
|
|
|
|
|
|
|
<LadderConfig :currentFormConfig="ladderStepFormConfig" :currentFormData="ladderConfig" |
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
:tableColumns = "ladderStepColumns" |
|
|
|
|
|
:prefixKey="'ladder_'+ladderIndex" |
|
|
|
|
|
:ref="`ladderRef_${ladderIndex}`" |
|
|
|
|
|
:fieldItemLabel="$t('template.common.jtpz')" |
|
|
|
|
|
:fillType="fillType" |
|
|
|
|
|
|
|
|
|
|
|
/> |
|
|
|
|
|
<!-- <div class="template-form-item"> |
|
|
|
|
|
<div class="config-header"> |
|
|
|
|
|
<div>{{ $t('template.common.jtpz') }}</div> |
|
|
|
|
|
<el-button v-if="fillType === 'preFill'" type="text" icon="el-icon-delete" |
|
|
|
|
|
@click="deleteConfig('ladderConfigs', ladderConfig)">{{ |
|
|
|
|
|
$t('template.common.deleteBtn') |
|
|
|
|
|
}}</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
<BaseInfoFormPackage @onRegentSubmit="(e) => onRegentSubmit('ladder', ladderIndex, e)" |
|
|
|
|
|
@beforeReagentSubmit="(data) => onBeforeReagentSubmit(data, ladderIndex, ladderConfig)" |
|
|
|
|
|
:ref="`ladderStepFormPackageRef_${ladderIndex}`" :formConfig="ladderStepFormConfig" |
|
|
|
|
|
:formData="ladderConfig" :fieldItemLabel="$t('template.common.jtpz')" |
|
|
|
|
|
@blur="(e) => onHandleBlur(e, 'ladder', ladderIndex)" |
|
|
|
|
|
@select="(e) => onHandleBlur(e, 'ladder', ladderIndex)" |
|
|
|
|
|
:prefixKey="'ladder_' + ladderIndex" /> |
|
|
|
|
|
<CustomTable @blur="(e) => onHandleTableBlur('ladder', ladderIndex, e)" |
|
|
|
|
|
:ref="`ladderStepTableRef_${ladderIndex}`" |
|
|
|
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
|
|
|
:columns="ladderStepColumns" :formData="ladderConfig" |
|
|
|
|
|
@beforeSaveRecord="(data) => onBeforeSaveRecord(data, 'ladder', ladderIndex)" |
|
|
|
|
|
@headerSelectChange="(data) => onHeaderSelectChange(data, 'ladder', ladderIndex)" |
|
|
|
|
|
:prefixKey="'ladder_' + ladderIndex" :fieldItemLabel="$t('template.common.jtpz')"> |
|
|
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
|
|
<TableOpertaion @printTag="(e) => printTag(e, 'ladderConfigs', ladderIndex)" |
|
|
|
|
|
@startConfig="(val) => startConfig(val, 'ladderConfigs', ladderIndex)" |
|
|
|
|
|
@configComplete="(val) => configComplete(val, 'ladderConfigs', ladderIndex)" |
|
|
|
|
|
@subPackageSubmit="(val) => subPackageSubmit(val, 'ladderConfigs', ladderIndex)" |
|
|
|
|
|
:fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
|
|
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'ladder', ladderIndex)"> |
|
|
|
|
|
</TableOpertaion> |
|
|
|
|
|
</template> |
|
|
|
|
|
</CustomTable> |
|
|
|
|
|
|
|
|
|
|
|
<Step class="mt-0 s-container" :ref="`ladderStepRef_${ladderIndex}`" |
|
|
|
|
|
:formData="ladderConfig.ladderStepData" :fieldItemLabel="$t('template.common.jtpz')" |
|
|
|
|
|
:prefixKey="'ladder_' + ladderIndex"></Step> |
|
|
|
|
|
</div> --> |
|
|
|
|
|
|
|
|
:tableColumns="ladderStepColumns" :prefixKey="'ladder_' + ladderIndex" |
|
|
|
|
|
:ref="`ladderRef_${ladderIndex}`" :fieldItemLabel="$t('template.common.jtpz')" |
|
|
|
|
|
@deleteConfig="deleteConfig('ladderConfigs',ladderConfig)" |
|
|
|
|
|
:fillType="fillType" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 平行配制区域 --> |
|
|
<!-- 平行配制区域 --> |
|
|
<div :label="$t('template.common.pxpz')" |
|
|
<div :label="$t('template.common.pxpz')" |
|
|
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs" |
|
|
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs" |
|
|
:key="'paralle_' + paralleConfig.id"> |
|
|
:key="'paralle_' + paralleConfig.id"> |
|
|
|
|
|
|
|
|
<div class="template-form-item"> |
|
|
|
|
|
<div class="config-header"> |
|
|
|
|
|
<div>{{ $t('template.common.pxpz') }}</div> |
|
|
|
|
|
<el-button v-if="fillType === 'preFill'" type="text" icon="el-icon-delete" |
|
|
|
|
|
@click="deleteConfig('paralleConfigs', paralleConfig)">{{ |
|
|
|
|
|
$t('template.common.deleteBtn') |
|
|
|
|
|
}}</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
<BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)" |
|
|
|
|
|
:ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig" |
|
|
|
|
|
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" |
|
|
|
|
|
:fieldItemLabel="$t('template.common.pxpz')" /> |
|
|
|
|
|
<CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)" |
|
|
|
|
|
:ref="`paralleStepTableRef_${paralleIndex}`" |
|
|
|
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
|
|
|
:columns="paralleStepColumns" @bodySelectChange="bodySelectChange" |
|
|
|
|
|
@headerSelectChange="(data) => onHeaderSelectChange(data, 'paralle', paralleIndex)" |
|
|
|
|
|
@beforeReagentSubmit="(data) => onTableBeforeReagentSubmit(data, paralleIndex, paralleConfig)" |
|
|
|
|
|
@onRegentSubmit="(data) => onTableRegentSubmit('paralle', paralleIndex, data)" |
|
|
|
|
|
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" |
|
|
|
|
|
:fieldItemLabel="$t('template.common.pxpz')"> |
|
|
|
|
|
<template slot="operation" slot-scope="{ row, rowIndex, columns }"> |
|
|
|
|
|
<TableOpertaion @printTag="(e) => printTag(e, 'paralleConfigs', paralleIndex)" |
|
|
|
|
|
@startConfig="(val) => startConfig(val, 'paralleConfigs', paralleIndex)" |
|
|
|
|
|
@configComplete="(val) => configComplete(val, 'paralleConfigs', paralleIndex)" |
|
|
|
|
|
@subPackageSubmit="(val) => subPackageSubmit(val, 'paralleConfigs', paralleIndex)" |
|
|
|
|
|
:fillType="fillType" :row="row" :rowIndex="rowIndex" :columns="columns" |
|
|
|
|
|
@deleteRow="(rowIndex) => deleteRow(rowIndex, 'paralle', paralleIndex)"> |
|
|
|
|
|
</TableOpertaion> |
|
|
|
|
|
</template> |
|
|
|
|
|
</CustomTable> |
|
|
|
|
|
|
|
|
|
|
|
<Step class="mt-0 s-container" :ref="`paralleStepRef_${paralleIndex}`" |
|
|
|
|
|
:formData="paralleConfig.paralleStepData" :fieldItemLabel="$t('template.common.pxpz')" |
|
|
|
|
|
:prefixKey="'paralle' + paralleIndex"></Step> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<LadderConfig :currentFormConfig="paralleStepFormConfig" :currentFormData="paralleConfig" |
|
|
|
|
|
:showOperation="fillType === 'actFill' || fillType === 'preFill'" |
|
|
|
|
|
:tableColumns="paralleStepColumns" :prefixKey="'paralle_' + paralleIndex" |
|
|
|
|
|
:ref="`paralleRef_${paralleIndex}`" :fieldItemLabel="$t('template.common.pxpz')" |
|
|
|
|
|
@deleteConfig="deleteConfig('paralleConfigs',paralleConfig)" |
|
|
|
|
|
:fillType="fillType" /> |
|
|
</div> |
|
|
</div> |
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
<BaseInfoFormPackage fieldItemLabel="template.common.remark" label="template.common.remark" |
|
|
ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> |
|
|
ref="remarkRef" :formConfig="remarkConig" :formData="formData" /> |
|
|
@ -156,16 +78,15 @@ import TableOpertaionDelete from "@/components/Template/operation/TableOpertaion |
|
|
import { getExpireDate, duplicateResource } from "@/utils/index.js"; |
|
|
import { getExpireDate, duplicateResource } from "@/utils/index.js"; |
|
|
import { getuuid } from "@/utils/index.js"; |
|
|
import { getuuid } from "@/utils/index.js"; |
|
|
import { isCommonUnit } from "@/utils/conTools"; |
|
|
import { isCommonUnit } from "@/utils/conTools"; |
|
|
import moment from "moment"; |
|
|
|
|
|
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools"; |
|
|
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools"; |
|
|
import { |
|
|
|
|
|
getLadderColumnsConfig, getParallelColumnsConfig, getLadderFormConfig, |
|
|
|
|
|
getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig ,getJcbColumnsConfig |
|
|
|
|
|
|
|
|
import { |
|
|
|
|
|
getLadderColumnsConfig, getParallelColumnsConfig, getLadderFormConfig, |
|
|
|
|
|
getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig, getJcbColumnsConfig |
|
|
} from "../../formConfig/paralleAndLadderConfig.js"; |
|
|
} from "../../formConfig/paralleAndLadderConfig.js"; |
|
|
import LadderConfig from "@/views/business/comps/template/comps/sp/comps/LadderConfig.vue"; |
|
|
import LadderConfig from "@/views/business/comps/template/comps/sp/comps/LadderConfig.vue"; |
|
|
export default { |
|
|
export default { |
|
|
name: "SP00456", |
|
|
name: "SP00456", |
|
|
components: { LadderConfig,BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion, TableOpertaionDelete, LadderConfig }, |
|
|
|
|
|
|
|
|
components: { LadderConfig, BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion, TableOpertaionDelete, LadderConfig }, |
|
|
mixins: [templateMixin], |
|
|
mixins: [templateMixin], |
|
|
props: { |
|
|
props: { |
|
|
fillType: { |
|
|
fillType: { |
|
|
@ -187,7 +108,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
//选板信息; |
|
|
//选板信息; |
|
|
jcbColumns(){ |
|
|
|
|
|
|
|
|
jcbColumns() { |
|
|
return getJcbColumnsConfig(this); |
|
|
return getJcbColumnsConfig(this); |
|
|
}, |
|
|
}, |
|
|
// 存储条件表单配置 |
|
|
// 存储条件表单配置 |
|
|
@ -218,7 +139,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
const labArr = ["LBA005","LBA007"] |
|
|
|
|
|
|
|
|
const labArr = ["LBA005", "LBA007"] |
|
|
return { |
|
|
return { |
|
|
subSolutionVisible: false, |
|
|
subSolutionVisible: false, |
|
|
currentSubKey: "",//当前点击的子项key |
|
|
currentSubKey: "",//当前点击的子项key |
|
|
@ -241,144 +162,12 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
deleteJcbRow(rowIndex){ |
|
|
|
|
|
|
|
|
deleteJcbRow(rowIndex) { |
|
|
const jcbRef = this.$refs['jcbRef']; |
|
|
const jcbRef = this.$refs['jcbRef']; |
|
|
if (jcbRef) { |
|
|
if (jcbRef) { |
|
|
jcbRef.deleteRow(rowIndex); |
|
|
jcbRef.deleteRow(rowIndex); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onBeforeSaveRecord(data, type, configIndex) { |
|
|
|
|
|
if (type === "ladder") { |
|
|
|
|
|
const formFields = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFilledFormData(); |
|
|
|
|
|
this.onCommonVerifyNdException(formFields, data); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
bodySelectChange(data) { |
|
|
|
|
|
this.paralleUpdateTargetStartSolutionVolume(data.item, data.headerSelectFields); |
|
|
|
|
|
}, |
|
|
|
|
|
//平行配置更新体积 |
|
|
|
|
|
paralleUpdateTargetStartSolutionVolume(item, headerSelectFields) { |
|
|
|
|
|
const volumne = item.targetStartSolutionConcentration; |
|
|
|
|
|
const subTargetStartSolution = item.targetStartSolutionConcentrationPrecision; |
|
|
|
|
|
const params = { |
|
|
|
|
|
headerSelectFields, |
|
|
|
|
|
subTargetStartSolution |
|
|
|
|
|
} |
|
|
|
|
|
if (volumne) { |
|
|
|
|
|
this.updateTargetStartSolutionVolume(item, volumne, params); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
onHandleBlur(e, type, configIndex) { |
|
|
|
|
|
const { targetStartSolution, subTargetStartSolution } = e; |
|
|
|
|
|
const { stepTableFormData, headerSelectFields } = this.$refs[`ladderStepTableRef_${configIndex}`][0]?.getFilledFormData(); |
|
|
|
|
|
const params = { |
|
|
|
|
|
subTargetStartSolution, |
|
|
|
|
|
headerSelectFields |
|
|
|
|
|
} |
|
|
|
|
|
this.batchUpdateTargetStartSolutionVolume(stepTableFormData, targetStartSolution, params) |
|
|
|
|
|
}, |
|
|
|
|
|
//选择table header下拉框也要更新体积 |
|
|
|
|
|
onHeaderSelectChange(data, type, configIndex) { |
|
|
|
|
|
const { key, headerSelectFields, dataSource = [] } = data; |
|
|
|
|
|
const keys = [ |
|
|
|
|
|
'targetStartSolutionVolumeUnit', |
|
|
|
|
|
'targetDiluentVolumeUnit', |
|
|
|
|
|
'targetSolutionConcentrationUnit', |
|
|
|
|
|
'targetSolutionVolumeUnit', |
|
|
|
|
|
] |
|
|
|
|
|
console.log(key, "key") |
|
|
|
|
|
if (keys.includes(key)) { |
|
|
|
|
|
if (type === 'ladder') { |
|
|
|
|
|
const { targetStartSolution, subTargetStartSolution } = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFilledFormData(); |
|
|
|
|
|
const params = { |
|
|
|
|
|
subTargetStartSolution, |
|
|
|
|
|
headerSelectFields |
|
|
|
|
|
} |
|
|
|
|
|
this.batchUpdateTargetStartSolutionVolume(dataSource, targetStartSolution, params) |
|
|
|
|
|
} else { |
|
|
|
|
|
dataSource.forEach(item => { |
|
|
|
|
|
this.paralleUpdateTargetStartSolutionVolume(item, headerSelectFields); |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
//分装 |
|
|
|
|
|
subPackageSubmit(data, configType, index) { |
|
|
|
|
|
const { fzsj, rowData, headerSelectFields } = data; |
|
|
|
|
|
const { fzList = [], dw = "", mybh } = fzsj; |
|
|
|
|
|
if (fzList && fzList.length > 0) { |
|
|
|
|
|
const list = fzList.map((item) => { |
|
|
|
|
|
return { |
|
|
|
|
|
bh: mybh + item.preCode + item.subCode, |
|
|
|
|
|
kc: item.num, |
|
|
|
|
|
kcdw: dw, |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
let postData = { |
|
|
|
|
|
studyId: this.formData.studyId, |
|
|
|
|
|
studyFormId: this.formData.id, |
|
|
|
|
|
bh: mybh, |
|
|
|
|
|
nd: rowData.actSolutionConcentration || 0, |
|
|
|
|
|
nddw: headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
studySubjectId: this.formData.studySubjectId, |
|
|
|
|
|
studyId: this.formData.studyId, |
|
|
|
|
|
studyFormId: this.formData.id, |
|
|
|
|
|
list: list |
|
|
|
|
|
} |
|
|
|
|
|
this.subPackageRequest(postData); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
startConfig(val) { |
|
|
|
|
|
const { rowData } = val; |
|
|
|
|
|
console.log(rowData, "rowData") |
|
|
|
|
|
let postData = { |
|
|
|
|
|
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode, |
|
|
|
|
|
studySubjectId: this.formData.studySubjectId, |
|
|
|
|
|
studyId: this.formData.studyId, |
|
|
|
|
|
studyFormId: this.formData.id, |
|
|
|
|
|
} |
|
|
|
|
|
this.startConfigRequest(postData); |
|
|
|
|
|
}, |
|
|
|
|
|
configComplete(val) { |
|
|
|
|
|
const { rowData, headerSelectFields } = val; |
|
|
|
|
|
//计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积) |
|
|
|
|
|
const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit]) |
|
|
|
|
|
debugger |
|
|
|
|
|
let postData = { |
|
|
|
|
|
mc: null, |
|
|
|
|
|
bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode, |
|
|
|
|
|
nd: rowData.actSolutionConcentration,//实际目标溶液浓度 |
|
|
|
|
|
nddw: headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
|
|
studySubjectId: this.formData.studySubjectId, |
|
|
|
|
|
studyId: this.formData.studyId, |
|
|
|
|
|
studyFormId: this.formData.id, |
|
|
|
|
|
kc: total, |
|
|
|
|
|
kcdw: unit, |
|
|
|
|
|
} |
|
|
|
|
|
this.configCompleteRequest(postData); |
|
|
|
|
|
}, |
|
|
|
|
|
//标签打印 |
|
|
|
|
|
printTag(e, configType, index) { |
|
|
|
|
|
const { nickName, name } = this.$store.getters; |
|
|
|
|
|
const { printCode, row, type } = e; |
|
|
|
|
|
const currentForm = this.formData[configType][index]; |
|
|
|
|
|
const { stepStorageCondition, startDate, expireDate, paralleStepStorageCondition } = currentForm; |
|
|
|
|
|
const targetSolutionExpirationDate = row.targetSolutionExpirationDate; |
|
|
|
|
|
const lang = this.$i18n.locale; |
|
|
|
|
|
const printConfig = { |
|
|
|
|
|
"品名": "暂时还不知道品名是哪个字段", |
|
|
|
|
|
"存储条件": stepStorageCondition || paralleStepStorageCondition, |
|
|
|
|
|
"配制日期": moment(startDate).format("YYYY-MM-DD"), |
|
|
|
|
|
"有效期至": moment(targetSolutionExpirationDate || expireDate).format("YYYY-MM-DD HH:mm"), |
|
|
|
|
|
"配置者": lang === "zh_CN" ? nickName : name, |
|
|
|
|
|
//type==="subPackage"从分装打印过来的, |
|
|
|
|
|
//type==="row" 从列表上点过来的 |
|
|
|
|
|
"编号": type === "subPackage" ? printCode : (row.targetSolutionCode + row.subTargetSolutionCode), |
|
|
|
|
|
} |
|
|
|
|
|
console.log(printConfig, "printConfig") |
|
|
|
|
|
EventBus.$emit('showTagPrintDialog', { printConfig }) |
|
|
|
|
|
}, |
|
|
|
|
|
// 为指定的表单数据数组分配编号 |
|
|
// 为指定的表单数据数组分配编号 |
|
|
async assignNumbersToTableData(config) { |
|
|
async assignNumbersToTableData(config) { |
|
|
return new Promise(async (resolve, reject) => { |
|
|
return new Promise(async (resolve, reject) => { |
|
|
@ -387,7 +176,7 @@ export default { |
|
|
// 检查paralleConfigs中的paralleTableFormData数组 |
|
|
// 检查paralleConfigs中的paralleTableFormData数组 |
|
|
if (configs && configs.length > 0) { |
|
|
if (configs && configs.length > 0) { |
|
|
for (let i = 0; i < configs.length; i++) { |
|
|
for (let i = 0; i < configs.length; i++) { |
|
|
const ref = config === "paralleConfigs" ? `paralleStepTableRef_${i}` : `ladderStepTableRef_${i}`; |
|
|
|
|
|
|
|
|
const ref = config === "paralleConfigs" ? `paralleRef_${i}` : `ladderRef_${i}`; |
|
|
const { stepTableFormData = [], effectivePeriod, effectivePeriodUnit, expireDate } = configs[i]; |
|
|
const { stepTableFormData = [], effectivePeriod, effectivePeriodUnit, expireDate } = configs[i]; |
|
|
if (!expireDate && config === "ladderConfigs") { |
|
|
if (!expireDate && config === "ladderConfigs") { |
|
|
const date = getExpireDate(startDate, effectivePeriod, effectivePeriodUnit); |
|
|
const date = getExpireDate(startDate, effectivePeriod, effectivePeriodUnit); |
|
|
@ -468,8 +257,8 @@ export default { |
|
|
this.justUpdateFilledFormData(); |
|
|
this.justUpdateFilledFormData(); |
|
|
}, |
|
|
}, |
|
|
// 删除阶梯配制配置 |
|
|
// 删除阶梯配制配置 |
|
|
deleteConfig(type, config) { |
|
|
|
|
|
const configIndex = this.formData[type].findIndex(config => config.id === config.id); |
|
|
|
|
|
|
|
|
deleteConfig(type, con) { |
|
|
|
|
|
const configIndex = this.formData[type].findIndex(config => config.id === con.id); |
|
|
if (configIndex !== -1) { |
|
|
if (configIndex !== -1) { |
|
|
// 创建新数组,确保响应式更新 |
|
|
// 创建新数组,确保响应式更新 |
|
|
const newConfigs = [...this.formData[type]]; |
|
|
const newConfigs = [...this.formData[type]]; |
|
|
@ -486,199 +275,24 @@ export default { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 添加表格行 |
|
|
|
|
|
handleAddRow(type, rowIndex, configIndex = 0) { |
|
|
|
|
|
const tableRef = type === 'ladder' ? |
|
|
|
|
|
this.$refs[`ladderStepTableRef_${configIndex}`] : |
|
|
|
|
|
this.$refs[`paralleStepTableRef_${configIndex}`]; |
|
|
|
|
|
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[0].deleteRow(rowIndex); |
|
|
|
|
|
} |
|
|
|
|
|
} else if (type === 'paralle') { |
|
|
|
|
|
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`]; |
|
|
|
|
|
if (tableRef) { |
|
|
|
|
|
tableRef[0].deleteRow(rowIndex); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
getLadderNdParamsByIndex(configIndex) { |
|
|
|
|
|
const { headerSelectFields = [] } = this.$refs[`ladderStepTableRef_${configIndex}`][0].getFilledFormData(); |
|
|
|
|
|
const subTargetAcSolutionUnit = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("subTargetAcSolutionUnit");//获取实际起始溶液浓度 |
|
|
|
|
|
return { |
|
|
|
|
|
targetStartSolutionUnit: subTargetAcSolutionUnit, |
|
|
|
|
|
headerSelectFields |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
getParalleNdParamsByIndex(item, configIndex) { |
|
|
|
|
|
const { headerSelectFields = [] } = this.$refs[`paralleStepTableRef_${configIndex}`][0].getFilledFormData(); |
|
|
|
|
|
const subTargetAcSolutionUnit = item.subTargetAcSolutionUnit || "";//获取实际起始溶液浓度单位 |
|
|
|
|
|
return { |
|
|
|
|
|
targetStartSolutionUnit: subTargetAcSolutionUnit, |
|
|
|
|
|
headerSelectFields |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 表格失去焦点事件 |
|
|
|
|
|
onHandleTableBlur(type, configIndex, e) { |
|
|
|
|
|
const { colKey = "", item, rowIndex, headerSelectFields } = e; |
|
|
|
|
|
if (colKey === "targetStartSolutionConcentration" || colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") { |
|
|
|
|
|
if (type === "ladder") { |
|
|
|
|
|
const { targetStartSolution, subTargetStartSolution } = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFilledFormData(); |
|
|
|
|
|
const params = { |
|
|
|
|
|
subTargetStartSolution, |
|
|
|
|
|
headerSelectFields |
|
|
|
|
|
} |
|
|
|
|
|
if (targetStartSolution) { |
|
|
|
|
|
this.updateTargetStartSolutionVolume(item, targetStartSolution, params); |
|
|
|
|
|
} |
|
|
|
|
|
} else if (type === "paralle") { |
|
|
|
|
|
this.paralleUpdateTargetStartSolutionVolume(item, headerSelectFields); |
|
|
|
|
|
} |
|
|
|
|
|
} else if (colKey === "actStartSolutionVolume" || colKey === "actDiluentVolume") {//实际起始溶液体积和实际目标溶液体积 |
|
|
|
|
|
if (type === "ladder") { |
|
|
|
|
|
const targetAcSolution = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetAcSolution");//获取实际起始溶液浓度 |
|
|
|
|
|
const params = this.getLadderNdParamsByIndex(configIndex); |
|
|
|
|
|
if (targetAcSolution) { |
|
|
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution, params); |
|
|
|
|
|
if (!volResult) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.$refs[`ladderStepTableRef_${configIndex}`][0]?.updateDataSourceByRowIndex(rowIndex, { |
|
|
|
|
|
actSolutionVolume: volResult.actVol, |
|
|
|
|
|
actSolutionConcentration: volResult.actNd, |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} else if (type === "paralle") { |
|
|
|
|
|
const targetAcSolution = item.targetAcSolution || 0;//获取实际起始溶液浓度 |
|
|
|
|
|
const params = this.getParalleNdParamsByIndex(item, configIndex); |
|
|
|
|
|
if (targetAcSolution) { |
|
|
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution, params); |
|
|
|
|
|
if (!volResult) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.$refs[`paralleStepTableRef_${configIndex}`][0]?.updateDataSourceByRowIndex(rowIndex, { |
|
|
|
|
|
actSolutionVolume: volResult.actVol, |
|
|
|
|
|
actSolutionConcentration: volResult.actNd, |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
onTableBeforeReagentSubmit(data) { |
|
|
|
|
|
const { selectData, callback, key, rowData } = data; |
|
|
|
|
|
if (key === "actStartSolutionCode" && !isCommonUnit(selectData.row.nddw, [rowData.targetStartSolutionConcentrationPrecision])) {//选择起始源溶液需要同步更新table的变更记录。 |
|
|
|
|
|
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。'); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
//平行配置 table选择试剂确定弹窗 |
|
|
|
|
|
onTableRegentSubmit(type, configIndex, data) { |
|
|
|
|
|
const { selectInfo, rowIndex, key, rowData } = data; |
|
|
|
|
|
const { row, selectedId } = selectInfo; |
|
|
|
|
|
if (key === "actStartSolutionCode") {//实际原始溶液编号点击事件 |
|
|
|
|
|
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`][0]; |
|
|
|
|
|
const params = this.getParalleNdParamsByIndex(rowData, configIndex); |
|
|
|
|
|
if (tableRef) { |
|
|
|
|
|
const volResult = this.updateSjmbrynd(rowData, row.nd, params); |
|
|
|
|
|
//第一次选择溶液的时候,可能其他值没填入,就需要先把浓度和code一起更新 |
|
|
|
|
|
tableRef.updateDataSourceByRowIndex(rowIndex, { |
|
|
|
|
|
actStartSolutionCode: selectedId, |
|
|
|
|
|
targetAcSolution: row.nd, |
|
|
|
|
|
subTargetAcSolutionUnit: row.nddw, |
|
|
|
|
|
}) |
|
|
|
|
|
if (!volResult) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
tableRef.updateDataSourceByRowIndex(rowIndex, { |
|
|
|
|
|
actSolutionVolume: volResult.actVol, |
|
|
|
|
|
actSolutionConcentration: volResult.actNd, |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//选择试剂提交事件 |
|
|
|
|
|
onRegentSubmit(type, rowIndex, data) { |
|
|
|
|
|
const { selectInfo, key } = data; |
|
|
|
|
|
const { row } = selectInfo; |
|
|
|
|
|
if (key) { |
|
|
|
|
|
const ref = type === "ladder" ? "ladderStepFormPackageRef_" : "paralleStepFormPackageRef_" |
|
|
|
|
|
const packageRef = this.$refs[`${ref}${rowIndex}`][0]; |
|
|
|
|
|
if (key === "subStartSolution") { |
|
|
|
|
|
packageRef.updateFormData("targetAcSolution", row.nd); |
|
|
|
|
|
packageRef.updateFormData("subTargetAcSolutionUnit", row.nddw); |
|
|
|
|
|
packageRef.onValueChangeCompareTo("targetAcSolution", row.nd, "targetStartSolution"); |
|
|
|
|
|
packageRef.onValueChangeCompareTo("subTargetAcSolutionUnit", row.nddw, "subTargetStartSolution"); |
|
|
|
|
|
this.updateTableNd(row, rowIndex); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
updateRecord() { |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
EventBus.$emit('onModifyRecord', { |
|
|
|
|
|
type: "fieldChanged", |
|
|
|
|
|
newRecord: null, |
|
|
|
|
|
resourceList: null, |
|
|
|
|
|
},) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
//选择实际的时候更新table的浓度 |
|
|
|
|
|
updateTableNd(row, rowIndex) { |
|
|
|
|
|
const { stepTableFormData = [], headerSelectFields = [] } = this.$refs[`ladderStepTableRef_${rowIndex}`][0].getFilledFormData(); |
|
|
|
|
|
const newData = JSON.parse(JSON.stringify(stepTableFormData)); |
|
|
|
|
|
const params = this.getLadderNdParamsByIndex(rowIndex); |
|
|
|
|
|
// 遍历数据,按要求更新起始溶液编号 |
|
|
|
|
|
newData.forEach((item, index) => { |
|
|
|
|
|
let initNd = row.nd;//起始浓度是上一条记录的实际目标溶液浓度 |
|
|
|
|
|
if (index === 0) { |
|
|
|
|
|
item.startSolutionCode = row.bh; |
|
|
|
|
|
} else { |
|
|
|
|
|
item.startSolutionCode = newData[index - 1].targetSolutionCode + newData[index - 1].subTargetSolutionCode; |
|
|
|
|
|
initNd = newData[index - 1].actSolutionConcentration; |
|
|
|
|
|
} |
|
|
|
|
|
const volResult = this.updateSjmbrynd(item, initNd, params); |
|
|
|
|
|
if (!volResult) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
item.actSolutionVolume = volResult.actVol; |
|
|
|
|
|
item.actSolutionConcentration = volResult.actNd; |
|
|
|
|
|
// 更新stepTableRef组件的数据 |
|
|
|
|
|
}) |
|
|
|
|
|
this.$refs[`ladderStepTableRef_${rowIndex}`][0].updateDataSource(newData); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
//只做校验 |
|
|
//只做校验 |
|
|
async validFields() { |
|
|
async validFields() { |
|
|
const { isLba } = this; |
|
|
const { isLba } = this; |
|
|
const refsToValidate = isLba ? ["baseInfoRef", "jcbRef", "remarkRef"]: ["baseInfoRef", "storageConditionRef", "remarkRef"] |
|
|
|
|
|
|
|
|
const refsToValidate = isLba ? ["baseInfoRef", "jcbRef", "remarkRef"] : ["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++) { |
|
|
refsToValidate.push(`ladderStepFormPackageRef_${i}`); |
|
|
|
|
|
refsToValidate.push(`ladderStepTableRef_${i}`); |
|
|
|
|
|
refsToValidate.push(`ladderStepRef_${i}`); |
|
|
|
|
|
|
|
|
refsToValidate.push(`ladderRef_${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++) { |
|
|
refsToValidate.push(`paralleStepFormPackageRef_${i}`); |
|
|
|
|
|
refsToValidate.push(`paralleStepTableRef_${i}`); |
|
|
|
|
|
refsToValidate.push(`paralleStepRef_${i}`); |
|
|
|
|
|
|
|
|
refsToValidate.push(`paralleRef_${i}`); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return await this.validFormFields(refsToValidate); |
|
|
return await this.validFormFields(refsToValidate); |
|
|
@ -716,14 +330,16 @@ export default { |
|
|
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++) { |
|
|
const id = this.formData.paralleConfigs[i].id; |
|
|
const id = this.formData.paralleConfigs[i].id; |
|
|
const paralleFormData = this.$refs[`paralleStepFormPackageRef_${i}`][0].getFilledFormData(); |
|
|
|
|
|
const paralleTableFormData = this.$refs[`paralleStepTableRef_${i}`][0].getFilledFormData(); |
|
|
|
|
|
const paralleStepData = this.$refs[`paralleStepRef_${i}`][0].getFilledFormData(); |
|
|
|
|
|
|
|
|
const { |
|
|
|
|
|
baseFormData, |
|
|
|
|
|
tableData, |
|
|
|
|
|
stepData, |
|
|
|
|
|
} = this.$refs[`paralleRef_${i}`][0].getFilledFormData(); |
|
|
|
|
|
|
|
|
paralleConfigsData.push({ |
|
|
paralleConfigsData.push({ |
|
|
...paralleFormData, |
|
|
|
|
|
...paralleTableFormData, |
|
|
|
|
|
paralleStepData: paralleStepData.stepData, |
|
|
|
|
|
|
|
|
...baseFormData, |
|
|
|
|
|
...tableData, |
|
|
|
|
|
paralleStepData: stepData, |
|
|
showParalleConfig: true, |
|
|
showParalleConfig: true, |
|
|
id |
|
|
id |
|
|
}); |
|
|
}); |
|
|
@ -958,14 +574,14 @@ export default { |
|
|
const sjResource = [], yqResource = []; |
|
|
const sjResource = [], yqResource = []; |
|
|
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++) { |
|
|
const paralleResource = this.$refs[`paralleStepRef_${i}`][0].getStepResource(); |
|
|
|
|
|
|
|
|
const paralleResource = this.$refs[`paralleRef_${i}`][0].getStepResource(); |
|
|
sjResource.push(...paralleResource.sjResource); |
|
|
sjResource.push(...paralleResource.sjResource); |
|
|
yqResource.push(...paralleResource.yqResource); |
|
|
yqResource.push(...paralleResource.yqResource); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
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++) { |
|
|
const ladderResource = this.$refs[`ladderStepRef_${i}`][0].getStepResource(); |
|
|
|
|
|
|
|
|
const ladderResource = this.$refs[`ladderRef_${i}`][0].getStepResource(); |
|
|
sjResource.push(...ladderResource.sjResource); |
|
|
sjResource.push(...ladderResource.sjResource); |
|
|
yqResource.push(...ladderResource.yqResource); |
|
|
yqResource.push(...ladderResource.yqResource); |
|
|
} |
|
|
} |
|
|
|