|
|
|
@ -1,4 +1,4 @@ |
|
|
|
<!-- 试验物质配制记录表(平行稀释) --> |
|
|
|
<!-- 试剂配制记录表(平行稀释) --> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div class="detail-container"> |
|
|
|
@ -16,19 +16,18 @@ |
|
|
|
label="template.gsp.GSP003.calcConditionLabel" ref="calcConditionRef" |
|
|
|
:formConfig="calcFormConfig" :formData="formData" /> |
|
|
|
<LineLabel label="template.common.operationSteps" /> |
|
|
|
<!-- 平行配制区域 --> |
|
|
|
<div :label="$t('template.common.pxpz')" |
|
|
|
v-for="(paralleConfig, paralleIndex) in formData.paralleConfigs" |
|
|
|
:key="'paralle_' + paralleIndex"> |
|
|
|
|
|
|
|
<div class="template-form-item"> |
|
|
|
<div class="config-header-right"> |
|
|
|
<!-- <div class="config-header-right"> |
|
|
|
<el-button type="primary" v-if="fillType === 'preFill'" @click="handleAddParalle">{{ |
|
|
|
$t('template.common.addBtn') }}</el-button> |
|
|
|
<el-button v-if="fillType === 'preFill' && formData.paralleConfigs.length > 1" |
|
|
|
type="danger" @click="deleteParalleConfig(paralleIndex)">{{ |
|
|
|
$t('template.common.deleteBtn') }}</el-button> |
|
|
|
</div> |
|
|
|
</div> --> |
|
|
|
<BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)" |
|
|
|
:ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig" |
|
|
|
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" |
|
|
|
@ -80,7 +79,7 @@ import { isCommonUnit } from "@/utils/conTools"; |
|
|
|
import moment from "moment"; |
|
|
|
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools"; |
|
|
|
export default { |
|
|
|
name: "GSP004", |
|
|
|
name: "GSP002", |
|
|
|
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion }, |
|
|
|
mixins: [templateMixin], |
|
|
|
props: { |
|
|
|
@ -230,12 +229,10 @@ export default { |
|
|
|
sfxyzjfx: { |
|
|
|
label: 'template.gsp.GSP003.sfxyzjfx', |
|
|
|
type: "select", |
|
|
|
with:'100%', |
|
|
|
span:1, |
|
|
|
fillType: "actFill", |
|
|
|
options: [ |
|
|
|
{label:'是',value:'是'}, |
|
|
|
{label:'否',value:'否'} |
|
|
|
{ label: '是', value: '是' }, |
|
|
|
{ label: '否', value: '否' } |
|
|
|
] |
|
|
|
}, |
|
|
|
solution: { |
|
|
|
@ -294,7 +291,7 @@ export default { |
|
|
|
headerSelectKey: 'actSolutionConcentrationUnit', |
|
|
|
fillType: 'preFill', |
|
|
|
headerOptions: this.getDictOptions('business_nddw'), |
|
|
|
bodyDisabled: true, |
|
|
|
bodyDisabled: this.fillType !== 'actFill', |
|
|
|
bodyType: 'inputNumber', |
|
|
|
bodySubType: 'inputNumber', |
|
|
|
bodySubKey: 'actSolutionConcentrationPrecision', |
|
|
|
@ -327,7 +324,7 @@ export default { |
|
|
|
headerSelectKey: 'actSolutionVolumeUnit', |
|
|
|
fillType: 'preFill', |
|
|
|
headerOptions: this.getDictOptions('business_tjdw'), |
|
|
|
bodyDisabled: true, |
|
|
|
bodyDisabled: this.fillType !== 'actFill', |
|
|
|
bodyType: 'inputNumber', |
|
|
|
bodySubType: 'inputNumber', |
|
|
|
bodySubKey: 'actSolutionVolumePrecision', |
|
|
|
@ -342,7 +339,7 @@ export default { |
|
|
|
{ |
|
|
|
label: 'template.sp.sp00456.mbryyxzq', |
|
|
|
prop: 'targetSolutionCycle', |
|
|
|
width: 280, |
|
|
|
width: 360, |
|
|
|
showWidth: 160, |
|
|
|
fillType: 'preFill', |
|
|
|
bodyType: 'inputNumber', |
|
|
|
@ -399,7 +396,7 @@ export default { |
|
|
|
showWidth: 120, |
|
|
|
bodyType: 'inputNumber', |
|
|
|
bodyFillType: 'actFill', |
|
|
|
bodyDisabled: true, |
|
|
|
bodyDisabled: this.fillType !== 'actFill', |
|
|
|
compareTo: 'targetStartSolutionConcentration', //比较哪个字段 |
|
|
|
}, |
|
|
|
{ |
|
|
|
@ -408,7 +405,7 @@ export default { |
|
|
|
headerSelectKey: 'targetStartSolutionVolumeUnit', |
|
|
|
fillType: 'preFill', |
|
|
|
headerOptions: this.getDictOptions('business_tjdw'), |
|
|
|
width: 280, |
|
|
|
width: 360, |
|
|
|
showWidth: 120, |
|
|
|
bodyType: 'inputNumber', |
|
|
|
bodyFillType: 'preFill', |
|
|
|
@ -419,8 +416,7 @@ export default { |
|
|
|
bodyPrecisionKey: 'targetStartSolutionVolumePrecision', |
|
|
|
bodyMaxlength: 10, |
|
|
|
bodySubPlaceholder: 'template.common.xswsPlaceholder', |
|
|
|
bodyDisabled: true, |
|
|
|
showBodySub: true, |
|
|
|
bodyDisabled: this.fillType !== 'preFill', |
|
|
|
showBodySub: this.fillType === 'preFill', |
|
|
|
headerSelectTo: "actStartSolutionVolumeUnit", |
|
|
|
}, |
|
|
|
@ -446,7 +442,7 @@ export default { |
|
|
|
headerSelectKey: 'preDiluentVolumeUnit', |
|
|
|
fillType: 'preFill', |
|
|
|
headerOptions: this.getDictOptions('business_tjdw'), |
|
|
|
width: 280, |
|
|
|
width: 340, |
|
|
|
showWidth: 120, |
|
|
|
bodyType: 'inputNumber', |
|
|
|
bodyFillType: 'preFill', |
|
|
|
@ -456,7 +452,7 @@ export default { |
|
|
|
bodyMaxlength: 10, |
|
|
|
bodyPrecisionKey: 'targetDiluentVolumePrecision', |
|
|
|
bodySubPlaceholder: 'template.common.xswsPlaceholder', |
|
|
|
bodyDisabled: true, |
|
|
|
bodyDisabled: this.fillType !== 'preFill', |
|
|
|
showBodySub: this.fillType === 'preFill', |
|
|
|
headerSelectTo: "actDiluentVolumeUnit", |
|
|
|
}, |
|
|
|
@ -650,25 +646,7 @@ export default { |
|
|
|
showParalleConfig: true |
|
|
|
}); |
|
|
|
}, |
|
|
|
//新增阶梯配制 |
|
|
|
handleAddLadder() { |
|
|
|
// 初始化阶梯配制配置列表 |
|
|
|
if (!this.formData.ladderConfigs) { |
|
|
|
this.$set(this.formData, 'ladderConfigs', []); |
|
|
|
} |
|
|
|
|
|
|
|
// 添加新的阶梯配制配置 |
|
|
|
this.formData.ladderConfigs.push({ |
|
|
|
ladderStepData: [], |
|
|
|
ladderTableFormData: [], |
|
|
|
showLadderConfig: true |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 删除阶梯配制配置 |
|
|
|
deleteLadderConfig(index) { |
|
|
|
this.formData.ladderConfigs.splice(index, 1); |
|
|
|
}, |
|
|
|
// 删除平行配制配置 |
|
|
|
//删除平行配制配置 |
|
|
|
deleteParalleConfig(index) { |
|
|
|
this.formData.paralleConfigs.splice(index, 1); |
|
|
|
}, |
|
|
|
@ -687,11 +665,9 @@ export default { |
|
|
|
tableRef[0].deleteRow(rowIndex); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 表格失去焦点事件 |
|
|
|
onHandleTableBlur(type, configIndex, e) { |
|
|
|
const { colKey = "", item, rowIndex } = e; |
|
|
|
debugger |
|
|
|
if (colKey === "targetStartSolutionConcentration" || colKey === "targetSolutionVolume" || colKey === "targetSolutionConcentration" || colKey === "targetStartSolutionVolumePrecision" || colKey === "targetDiluentVolumePrecision") { |
|
|
|
if (type === "paralle") { |
|
|
|
const volumne = item.targetStartSolutionConcentration || 0; |
|
|
|
@ -703,7 +679,15 @@ export default { |
|
|
|
if (type === "paralle") { |
|
|
|
const targetAcSolution = item.targetAcSolution || 0;//获取实际起始溶液浓度 |
|
|
|
if (targetAcSolution) { |
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution); |
|
|
|
const tableRef = this.$refs[`paralleStepTableRef_${configIndex}`][0]; |
|
|
|
//实际起始溶液体积和实际目标溶液体积 |
|
|
|
const formData = tableRef.getFilledFormData(); |
|
|
|
const headerSelectFields = formData.headerSelectFields; |
|
|
|
const p = { |
|
|
|
targetStartSolutionUnit: formData.stepTableFormData[configIndex].targetStartSolutionConcentrationPrecision, |
|
|
|
headerSelectFields |
|
|
|
} |
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution, p); |
|
|
|
if (!volResult) { |
|
|
|
return |
|
|
|
} |
|
|
|
@ -722,14 +706,21 @@ export default { |
|
|
|
callback.prevent('浓度单位与预制不符,请重新选择或申请废止并重新预制。'); |
|
|
|
} |
|
|
|
}, |
|
|
|
//平行配置 table选择试剂确定弹窗 |
|
|
|
// 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 formData = tableRef.getFilledFormData(); |
|
|
|
const headerSelectFields = formData.headerSelectFields; |
|
|
|
const p = { |
|
|
|
targetStartSolutionUnit: rowData.targetStartSolutionConcentrationPrecision, |
|
|
|
headerSelectFields |
|
|
|
} |
|
|
|
if (tableRef) { |
|
|
|
const volResult = this.updateSjmbrynd(rowData, row.nd); |
|
|
|
const volResult = this.updateSjmbrynd(rowData, row.nd, p); |
|
|
|
//第一次选择溶液的时候,可能其他值没填入,就需要先把浓度和code一起更新 |
|
|
|
tableRef.updateDataSourceByRowIndex(rowIndex, { |
|
|
|
actStartSolutionCode: selectedId, |
|
|
|
@ -745,57 +736,10 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
//选择试剂提交事件 |
|
|
|
onRegentSubmit(type, rowIndex, data) { |
|
|
|
const { selectInfo, key } = data; |
|
|
|
const { row } = selectInfo; |
|
|
|
if (key) { |
|
|
|
const packageRef = this.$refs[`paralleStepFormPackageRef_${rowIndex}`][0]; |
|
|
|
if (key === "subStartSolution") { |
|
|
|
packageRef.updateFormData("targetAcSolution", row.nd); |
|
|
|
packageRef.onValueChangeCompareTo("targetAcSolution", row.nd, "targetStartSolution"); |
|
|
|
this.updateTableNd(row, rowIndex); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
updateRecord() { |
|
|
|
this.$nextTick(() => { |
|
|
|
EventBus.$emit('onModifyRecord', { |
|
|
|
type: "fieldChanged", |
|
|
|
newRecord: null, |
|
|
|
resourceList: null, |
|
|
|
},) |
|
|
|
}) |
|
|
|
}, |
|
|
|
//选择实际的时候更新table的浓度 |
|
|
|
updateTableNd(row, rowIndex) { |
|
|
|
const { stepTableFormData = [] } = this.$refs[`ladderStepTableRef_${rowIndex}`][0].getFilledFormData(); |
|
|
|
const newData = JSON.parse(JSON.stringify(stepTableFormData)); |
|
|
|
// 遍历数据,按要求更新起始溶液编号 |
|
|
|
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[i - 1].actSolutionConcentration; |
|
|
|
} |
|
|
|
const volResult = this.updateSjmbrynd(item, initNd); |
|
|
|
if (!volResult) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
item.actSolutionVolume = volResult.actVol; |
|
|
|
item.actSolutionConcentration = volResult.actNd; |
|
|
|
// 更新stepTableRef组件的数据 |
|
|
|
}) |
|
|
|
this.$refs[`ladderStepTableRef_${rowIndex}`][0].updateDataSource(newData); |
|
|
|
|
|
|
|
}, |
|
|
|
//只做校验 |
|
|
|
async validFields() { |
|
|
|
// 构建需要验证的引用数组 |
|
|
|
let refsToValidate = ["baseInfoRef","storageConditionRef", "remarkRef"]; |
|
|
|
let refsToValidate = ["baseInfoRef", "remarkRef"]; |
|
|
|
|
|
|
|
// 添加平行配制相关的引用 |
|
|
|
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) { |
|
|
|
@ -809,7 +753,7 @@ export default { |
|
|
|
}, |
|
|
|
getFilledFormData() { |
|
|
|
const baseData = this.$refs.baseInfoRef.getFilledFormData(); |
|
|
|
const calcConditionData = this.$refs.calcConditionRef.getFilledFormData(); |
|
|
|
|
|
|
|
// 获取所有平行配制数据 |
|
|
|
const paralleConfigsData = []; |
|
|
|
if (this.formData.paralleConfigs && this.formData.paralleConfigs.length > 0) { |
|
|
|
@ -817,7 +761,6 @@ export default { |
|
|
|
const paralleFormData = this.$refs[`paralleStepFormPackageRef_${i}`][0].getFilledFormData(); |
|
|
|
const paralleTableFormData = this.$refs[`paralleStepTableRef_${i}`][0].getFilledFormData(); |
|
|
|
const paralleStepData = this.$refs[`paralleStepRef_${i}`][0].getFilledFormData(); |
|
|
|
|
|
|
|
paralleConfigsData.push({ |
|
|
|
...paralleFormData, |
|
|
|
...paralleTableFormData, |
|
|
|
@ -830,7 +773,6 @@ export default { |
|
|
|
const remarkData = this.$refs.remarkRef.getFilledFormData(); |
|
|
|
return { |
|
|
|
...baseData, |
|
|
|
...calcConditionData, |
|
|
|
paralleConfigs: paralleConfigsData, |
|
|
|
...remarkData |
|
|
|
} |
|
|
|
@ -864,7 +806,7 @@ export default { |
|
|
|
//生成resource |
|
|
|
let tmpResource = [] |
|
|
|
if (this.fillType === "actFill") { |
|
|
|
//平行配置 |
|
|
|
// |
|
|
|
if (content.paralleConfigs && content.paralleConfigs.length > 0) { |
|
|
|
for (let i = 0; i < content.paralleConfigs.length; i++) { |
|
|
|
let paralleConfigs = content.paralleConfigs[i] |
|
|
|
@ -935,6 +877,24 @@ export default { |
|
|
|
yxzq: null, |
|
|
|
yxzqdw: null, |
|
|
|
}) |
|
|
|
//原始溶液 |
|
|
|
tmpResource.push({ |
|
|
|
mc: null, |
|
|
|
bh: stepTableFormData[j].actStartSolutionCode, |
|
|
|
ph: null, |
|
|
|
nd: null, |
|
|
|
nddw: null, |
|
|
|
ndz: null, |
|
|
|
ly: null, |
|
|
|
sxrq: null, |
|
|
|
kc: null, |
|
|
|
kcdw: null, |
|
|
|
type: 1, |
|
|
|
syl: stepTableFormData[j].actStartSolutionVolume, |
|
|
|
syldw: paralleConfigs.headerSelectFields.actStartSolutionVolumeUnit, |
|
|
|
yxzq: null, |
|
|
|
yxzqdw: null, |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|