|
|
|
@ -32,8 +32,7 @@ |
|
|
|
@resetRecord="(e) => resetRecord('ladder', ladderIndex, e)" |
|
|
|
@onSureModifyRecord="(e) => onSureModifyRecord('ladder', ladderIndex, e)" |
|
|
|
:ref="`ladderStepFormPackageRef_${ladderIndex}`" :formConfig="ladderStepFormConfig" |
|
|
|
:formData="ladderConfig" fieldItemLabel="阶梯配制" |
|
|
|
:prefixKey="'ladder_' + ladderIndex" /> |
|
|
|
:formData="ladderConfig" fieldItemLabel="阶梯配制" :prefixKey="'ladder_' + ladderIndex" /> |
|
|
|
<CustomTable @blur="(e) => onHandleTableBlur('ladder', ladderIndex, e)" |
|
|
|
:ref="`ladderStepTableRef_${ladderIndex}`" :columns="ladderStepColumns" |
|
|
|
:formData="ladderConfig" :prefixKey="'ladder_' + ladderIndex" fieldItemLabel="阶梯配制"> |
|
|
|
@ -66,8 +65,7 @@ |
|
|
|
</div> |
|
|
|
<BaseInfoFormPackage @clickable="(e) => handleClickable('paralle', paralleIndex, e)" |
|
|
|
:ref="`paralleStepFormPackageRef_${paralleIndex}`" :formConfig="paralleStepFormConfig" |
|
|
|
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" |
|
|
|
fieldItemLabel="平行配制" /> |
|
|
|
:formData="paralleConfig" :prefixKey="'paralle' + paralleIndex" fieldItemLabel="平行配制" /> |
|
|
|
<CustomTable @blur="(e) => onHandleTableBlur('paralle', paralleIndex, e)" |
|
|
|
:ref="`paralleStepTableRef_${paralleIndex}`" :columns="paralleStepColumns" |
|
|
|
@clickable="(e, tableRowIndex, rowData) => handleTableClickable('paralle', paralleIndex, e, tableRowIndex, rowData)" |
|
|
|
@ -110,9 +108,9 @@ import templateMixin from "../../mixins/templateMixin.js"; |
|
|
|
import CustomTable from '@/components/Template/CustomTable.vue'; |
|
|
|
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; |
|
|
|
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"; |
|
|
|
import { getExpireDate,duplicateResource } from "@/utils/index.js"; |
|
|
|
import { getExpireDate, duplicateResource } from "@/utils/index.js"; |
|
|
|
import moment from "moment"; |
|
|
|
import { addTj,uniqeResource } from "@/utils/calUnitTools"; |
|
|
|
import { addTj, uniqeResource } from "@/utils/calUnitTools"; |
|
|
|
import { getLadderColumnsConfig, getParallelColumnsConfig, getLadderFormConfig, getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig } from "../../formConfig/paralleAndLadderConfig.js"; |
|
|
|
export default { |
|
|
|
name: "SP00456", |
|
|
|
@ -239,7 +237,7 @@ export default { |
|
|
|
this.configCompleteRequest(postData); |
|
|
|
}, |
|
|
|
getTemplateName() { |
|
|
|
if (this.templateData&&this.templateData.templateMc) { |
|
|
|
if (this.templateData && this.templateData.templateMc) { |
|
|
|
return this.templateData.templateMc |
|
|
|
} |
|
|
|
const o = { |
|
|
|
@ -272,41 +270,46 @@ export default { |
|
|
|
}, |
|
|
|
// 为指定的表单数据数组分配编号 |
|
|
|
async assignNumbersToTableData(config) { |
|
|
|
const configs = this.formData[config] |
|
|
|
const { startDate } = this.formData; |
|
|
|
// 检查paralleConfigs中的paralleTableFormData数组 |
|
|
|
if (configs && configs.length > 0) { |
|
|
|
for (let i = 0; i < configs.length; i++) { |
|
|
|
const ref = config === "paralleConfigs" ? `paralleStepTableRef_${i}` : `ladderStepTableRef_${i}`; |
|
|
|
const { stepTableFormData = [], effectivePeriod, effectivePeriodUnit, expireDate } = configs[i]; |
|
|
|
if (!expireDate && config === "ladderConfigs") { |
|
|
|
const date = getExpireDate(startDate, effectivePeriod, effectivePeriodUnit); |
|
|
|
configs[i].expireDate = date; |
|
|
|
} |
|
|
|
if (stepTableFormData && stepTableFormData.length > 0) { |
|
|
|
const tableDataArray = stepTableFormData; |
|
|
|
// 检查表单数据中是否有任何一行的subTargetSolutionCode有值 |
|
|
|
const hasAnyWithValue = tableDataArray.some(row => |
|
|
|
row.subTargetSolutionCode && row.subTargetSolutionCode.trim() !== ''); |
|
|
|
// 如果没有任何一行有值,则为所有行分配编号 |
|
|
|
if (!hasAnyWithValue) { |
|
|
|
const codes = stepTableFormData.map((item) => ({prex:item.targetSolutionCode,type:1})); |
|
|
|
const snList = await this.getLatestSnArr(codes); |
|
|
|
tableDataArray.forEach((row, idx) => { |
|
|
|
let expDate = {}; |
|
|
|
if (config === "paralleConfigs" && !row.targetSolutionExpirationDate) { |
|
|
|
let date = getExpireDate(startDate, row.targetSolutionCycle, row.targetSolutionCyclePrecision); |
|
|
|
expDate = { |
|
|
|
targetSolutionExpirationDate: date |
|
|
|
return new Promise(async (resolve, reject) => { |
|
|
|
const configs = this.formData[config] |
|
|
|
const { startDate } = this.formData; |
|
|
|
// 检查paralleConfigs中的paralleTableFormData数组 |
|
|
|
if (configs && configs.length > 0) { |
|
|
|
for (let i = 0; i < configs.length; i++) { |
|
|
|
const ref = config === "paralleConfigs" ? `paralleStepTableRef_${i}` : `ladderStepTableRef_${i}`; |
|
|
|
const { stepTableFormData = [], effectivePeriod, effectivePeriodUnit, expireDate } = configs[i]; |
|
|
|
if (!expireDate && config === "ladderConfigs") { |
|
|
|
const date = getExpireDate(startDate, effectivePeriod, effectivePeriodUnit); |
|
|
|
configs[i].expireDate = date; |
|
|
|
} |
|
|
|
if (stepTableFormData && stepTableFormData.length > 0) { |
|
|
|
const tableDataArray = stepTableFormData; |
|
|
|
// 检查表单数据中是否有任何一行的subTargetSolutionCode有值 |
|
|
|
const hasAnyWithValue = tableDataArray.some(row => |
|
|
|
row.subTargetSolutionCode && row.subTargetSolutionCode.trim() !== ''); |
|
|
|
// 如果没有任何一行有值,则为所有行分配编号 |
|
|
|
if (!hasAnyWithValue) { |
|
|
|
const codes = stepTableFormData.map((item) => ({ prex: item.targetSolutionCode, type: 1 })); |
|
|
|
const snList = await this.getLatestSnArr(codes); |
|
|
|
tableDataArray.forEach((row, idx) => { |
|
|
|
let expDate = {}; |
|
|
|
if (config === "paralleConfigs" && !row.targetSolutionExpirationDate) { |
|
|
|
let date = getExpireDate(startDate, row.targetSolutionCycle, row.targetSolutionCyclePrecision); |
|
|
|
expDate = { |
|
|
|
targetSolutionExpirationDate: date |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.$refs[ref][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate }); |
|
|
|
}); |
|
|
|
Promise.resolve(); |
|
|
|
this.$refs[ref][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate }); |
|
|
|
}); |
|
|
|
resolve() |
|
|
|
}else{ |
|
|
|
reject() |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
@ -402,25 +405,25 @@ export default { |
|
|
|
const targetAcSolution = this.$refs[`ladderStepFormPackageRef_${configIndex}`][0]?.getFormDataByKey("targetAcSolution") || 0;//获取实际起始溶液浓度 |
|
|
|
if (targetAcSolution) { |
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution); |
|
|
|
if(!volResult){ |
|
|
|
if (!volResult) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.$refs[`ladderStepTableRef_${configIndex}`][0]?.updateDataSourceByRowIndex(rowIndex, { |
|
|
|
actSolutionVolume: volResult.actVol, |
|
|
|
actSolutionConcentration: volResult.actNd, |
|
|
|
},"blur"); |
|
|
|
}, "blur"); |
|
|
|
} |
|
|
|
} else if (type === "paralle") { |
|
|
|
const targetAcSolution = item.targetAcSolution || 0;//获取实际起始溶液浓度 |
|
|
|
if (targetAcSolution) { |
|
|
|
const volResult = this.updateSjmbrynd(item, targetAcSolution); |
|
|
|
if(!volResult){ |
|
|
|
if (!volResult) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.$refs[`paralleStepTableRef_${configIndex}`][0]?.updateDataSourceByRowIndex(rowIndex, { |
|
|
|
actSolutionVolume: volResult.actVol, |
|
|
|
actSolutionConcentration: volResult.actNd, |
|
|
|
},"blur"); |
|
|
|
}, "blur"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -468,7 +471,7 @@ export default { |
|
|
|
const tableRef = this.$refs[`paralleStepTableRef_${currentRowIndex}`][0]; |
|
|
|
if (tableRef) { |
|
|
|
const volResult = this.updateSjmbrynd(this.currentRowData, row.nd); |
|
|
|
if(!volResult){ |
|
|
|
if (!volResult) { |
|
|
|
return |
|
|
|
} |
|
|
|
tableRef.updateDataSourceByRowIndex(currentTableIndex, { |
|
|
|
@ -476,7 +479,7 @@ export default { |
|
|
|
targetAcSolution: row.nd, |
|
|
|
actSolutionVolume: volResult.actVol, |
|
|
|
actSolutionConcentration: volResult.actNd, |
|
|
|
},"clickable") |
|
|
|
}, "clickable") |
|
|
|
} |
|
|
|
} |
|
|
|
this.$refs.selectReagentDialogRef.onCancel(); |
|
|
|
@ -497,7 +500,7 @@ export default { |
|
|
|
// 遍历数据,按要求更新起始溶液编号 |
|
|
|
newData.forEach((item, index) => { |
|
|
|
const volResult = this.updateSjmbrynd(item, row.nd); |
|
|
|
if(!volResult){ |
|
|
|
if (!volResult) { |
|
|
|
return |
|
|
|
} |
|
|
|
console.log(volResult.actNd, "actNd") |
|
|
|
@ -601,15 +604,15 @@ export default { |
|
|
|
mc: null, |
|
|
|
bh: stepTableFormData[j].targetSolutionCode + stepTableFormData[j].subTargetSolutionCode, |
|
|
|
ph: null, |
|
|
|
ndz:stepTableFormData[j].actSolutionConcentration + ladderConfigs.headerSelectFields.actSolutionConcentrationUnit, |
|
|
|
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, |
|
|
|
type: null, |
|
|
|
elnType: this.product, |
|
|
|
syl: null, |
|
|
|
syldw: unit, |
|
|
|
yxzq: ladderConfigs.effectivePeriod, |
|
|
|
@ -629,8 +632,8 @@ export default { |
|
|
|
sxrq: ladderConfigs.expireDate, |
|
|
|
kc: fzsj.fzList[k].num, |
|
|
|
kcdw: fzsj.dw, |
|
|
|
type: null, |
|
|
|
elnType: this.product, |
|
|
|
type: null, |
|
|
|
elnType: this.product, |
|
|
|
syl: null, |
|
|
|
syldw: ladderConfigs.headerSelectFields.actSolutionVolumeUnit, |
|
|
|
yxzq: ladderConfigs.effectivePeriod, |
|
|
|
@ -659,8 +662,8 @@ export default { |
|
|
|
sxrq: stepTableFormData[j].targetSolutionExpirationDate, |
|
|
|
kc: total, |
|
|
|
kcdw: unit, |
|
|
|
type: null, |
|
|
|
elnType: this.product, |
|
|
|
type: null, |
|
|
|
elnType: this.product, |
|
|
|
syl: null, |
|
|
|
syldw: unit, |
|
|
|
yxzq: stepTableFormData[j].targetSolutionCycle, |
|
|
|
@ -680,8 +683,8 @@ export default { |
|
|
|
sxrq: paralleConfigs.expireDate, |
|
|
|
kc: fzsj.fzList[k].num, |
|
|
|
kcdw: fzsj.dw, |
|
|
|
type: null, |
|
|
|
elnType: this.product, |
|
|
|
type: null, |
|
|
|
elnType: this.product, |
|
|
|
syl: null, |
|
|
|
syldw: paralleConfigs.headerSelectFields.actSolutionVolumeUnit, |
|
|
|
yxzq: paralleConfigs.effectivePeriod, |
|
|
|
@ -693,16 +696,16 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//使用的试剂、仪器 |
|
|
|
//使用的试剂、仪器 |
|
|
|
// const stepResource = this.$refs.stepRef.getStepResource() |
|
|
|
// this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[]) |
|
|
|
// this.yqResourceTmp = stepResource.yqResource||[] |
|
|
|
|
|
|
|
this.resourceTmp=tmpResource |
|
|
|
this.resourceTmp = tmpResource |
|
|
|
return content; |
|
|
|
}, |
|
|
|
getStepResource(){ |
|
|
|
const sjResource=[],yqResource= []; |
|
|
|
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[`paralleStepRef_${i}`][0].getStepResource(); |
|
|
|
@ -718,8 +721,8 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
//去重 |
|
|
|
const {sj,yq} = duplicateResource(sjResource,yqResource) |
|
|
|
return {sjResource:sj,yqResource:yq}; |
|
|
|
const { sj, yq } = duplicateResource(sjResource, yqResource) |
|
|
|
return { sjResource: sj, yqResource: yq }; |
|
|
|
}, |
|
|
|
async onSave() { |
|
|
|
const formData = this.getStepResource(); |
|
|
|
|