luojie 2 months ago
parent
commit
8cf2f66eba
2 changed files with 156 additions and 49 deletions
  1. +63
    -29
      src/views/business/comps/template/comps/sp/SP003.vue
  2. +93
    -20
      src/views/business/comps/template/comps/sp/SP00456.vue

+ 63
- 29
src/views/business/comps/template/comps/sp/SP003.vue View File

@ -15,14 +15,12 @@
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage @clickable="handleClickable" ref="stepFormPackageRef"
fieldItemLabel="template.common.operationSteps"
@resetRecord="resetRecord"
@onSureModifyRecord="onSureModifyRecord"
:formConfig="stepFormConfig" @blur="onHandleBlur"
fieldItemLabel="template.common.operationSteps" @resetRecord="resetRecord"
@onSureModifyRecord="onSureModifyRecord" :formConfig="stepFormConfig" @blur="onHandleBlur"
:formData="formData" />
<CustomTable fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur"
:showAddRow="true" :showOperation="fillType === 'actFill'" ref="stepTableRef"
:columns="stepColumns" :formData="formData">
:showAddRow="fillType === 'preFill' ? true : false" :showOperation="fillType === 'actFill'"
ref="stepTableRef" :columns="stepColumns" :formData="formData">
<template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @startConfig="startConfig" @configComplete="configComplete"
@printTag="printTag" @subPackageSubmit="subPackageSubmit" :fillType="fillType"
@ -54,7 +52,7 @@ import CustomTable from '@/components/Template/CustomTable.vue';
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
import { EventBus } from "@/utils/eventBus";
import { addTj ,uniqeResource,uniqeResourceOne,addDecimals} from "@/utils/calUnitTools";
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
export default {
name: "SP003",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion },
@ -277,7 +275,7 @@ export default {
bodySubType: "span",
bodySubKey: "subTargetSolutionCode",
bodyFillType: "preFill",
width: 130,
width: 140,
myCodeFields: ["targetSolutionCode", "subTargetSolutionCode"],//
maxVolumeField: "actSolutionVolume",//
maxVolumeFieldUnit: "actSolutionVolumeUnit",//
@ -429,7 +427,7 @@ export default {
methods: {
//
onSureModifyRecord(key) {
if(key === "subStartSolution"){//table
if (key === "subStartSolution") {//table
this.$refs.stepTableRef.updateRecords();
}
@ -483,7 +481,7 @@ export default {
bh: mybh,
nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studySubjectId: this.formData.studySubjectId,
list: list
}
this.subPackageRequest(postData);
@ -500,7 +498,7 @@ export default {
if (hasAnyWithValue) {
return;
}
const codes = stepTableFormData.map((item) => ({prex:item.targetSolutionCode,type:1}));
const codes = stepTableFormData.map((item) => ({ prex: item.targetSolutionCode, type: 1 }));
const snList = await this.getLatestSnArr(codes);
stepTableFormData.forEach((item, index) => {
this.$refs.stepTableRef.updateDataSourceByRowIndex(index, { subTargetSolutionCode: snList[index] });
@ -515,7 +513,7 @@ export default {
EventBus.$emit('onModifyRecord', params,)
})
},
getStepResource(){
getStepResource() {
return this.$refs.stepRef.getStepResource()
},
//
@ -560,7 +558,7 @@ export default {
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode;
}
const volResult = this.updateSjmbrynd(item, row.nd);
if(!volResult){
if (!volResult) {
continue
}
item.actSolutionVolume = volResult.actVol;
@ -572,15 +570,14 @@ export default {
},
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
//resource
let tmpResource = []
if (this.fillType === "actFill") {
//
let tableList = content.stepTableFormData
if (tableList && tableList.length > 0) {
for (let i = 0; i < tableList.length; i++) {
let item = tableList[i]
let fzTotal = 0//
//
let fzTotal = 0 //
if (item.fzsj && item.fzsj.fzList && item.fzsj.fzList) {
for (let j = 0; j < item.fzsj.fzList.length; j++) {
let fzItem = item.fzsj.fzList[j]
@ -595,19 +592,19 @@ export default {
sxrq: content.expireDate,
kc: fzItem.num,
kcdw: item.fzsj.dw,
type: null,
elnType: this.product,
type: null,
elnType: this.product,
syl: null,
syldw: item.fzsj.dw,
yxzq: content.effectivePeriod,
yxzqdw: content.effectivePeriodUnit,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
fzTotal = addDecimals(fzTotal, fzItem.num)
}
}
//
//(+)
const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolumeUnit], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit])
const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolume], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({
mc: null,
bh: item.targetSolutionCode + item.subTargetSolutionCode,
@ -619,23 +616,60 @@ export default {
sxrq: content.expireDate,
kc: total,
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal>0?fzTotal:null,
syldw: fzTotal>0?item.fzsj.dw:unit,
type: null,
elnType: this.product,
syl: fzTotal > 0 ? fzTotal : null,
syldw: fzTotal > 0 ? item.fzsj.dw : unit,
yxzq: content.effectivePeriod,
yxzqdw: content.effectivePeriodUnit,
})
//
tmpResource.push({
mc: null,
bh: content.subStartSolution,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: item.actStartSolutionVolume,
syldw: content.headerSelectFields.actStartSolutionVolumeUnit,
yxzq: null,
yxzqdw: null,
})
//
tmpResource.push({
mc: null,
bh: content.subSolution,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: item.actDiluentVolume,
syldw: content.headerSelectFields.actDiluentVolumeUnit,
yxzq: null,
yxzqdw: null,
})
}
}
}
if(tmpResource.length>0){
if (tmpResource.length > 0) {
tmpResource = uniqeResourceOne(tmpResource)
}
//使
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || []
return content;
},
async onSave() {

+ 93
- 20
src/views/business/comps/template/comps/sp/SP00456.vue View File

@ -110,7 +110,7 @@ import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
import { getExpireDate, duplicateResource } from "@/utils/index.js";
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 } from "../../formConfig/paralleAndLadderConfig.js";
export default {
name: "SP00456",
@ -210,7 +210,7 @@ export default {
bh: mybh,
nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studySubjectId: this.formData.studySubjectId,
list: list
}
this.subPackageRequest(postData);
@ -306,7 +306,7 @@ export default {
this.$refs[ref][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate });
});
resolve()
}else{
} else {
reject()
}
@ -594,6 +594,7 @@ export default {
}
let content = this.getFilledFormData();
//resource
debugger
let tmpResource = []
if (this.fillType === "actFill") {
//
@ -603,11 +604,12 @@ export default {
let stepTableFormData = ladderConfigs.stepTableFormData
for (let j = 0; j < stepTableFormData.length; j++) {
let fzTotal = 0//
//
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]
let fzItem = fzsj.fzList[k]
tmpResource.push({
mc: null,
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode,
@ -626,10 +628,10 @@ export default {
yxzq: ladderConfigs.effectivePeriod,
yxzqdw: ladderConfigs.effectivePeriodUnit,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
fzTotal = addDecimals(fzTotal, fzItem.num)
}
}
//
//(+)
const { total, unit } = addTj([stepTableFormData[j].actStartSolutionVolume, stepTableFormData[j].actDiluentVolume], [ladderConfigs.headerSelectFields.actStartSolutionVolumeUnit, ladderConfigs.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({
@ -645,12 +647,47 @@ export default {
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal>0?fzTotal:null,
syldw: fzTotal>0?fzsj.dw:unit,
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,
})
}
}
}
@ -660,11 +697,12 @@ export default {
let paralleConfigs = content.paralleConfigs[i]
let stepTableFormData = paralleConfigs.stepTableFormData
for (let j = 0; j < stepTableFormData.length; j++) {
let fzTotal = 0//
//
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]
let fzItem = fzsj.fzList[k]
tmpResource.push({
mc: null,
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode,
@ -683,10 +721,10 @@ export default {
yxzq: paralleConfigs.effectivePeriod,
yxzqdw: paralleConfigs.effectivePeriodUnit,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
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,
@ -701,23 +739,58 @@ export default {
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal>0?fzTotal:null,
syldw: fzTotal>0?fzsj.dw:unit,
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.subStartSolution,
ph: null,
nd: null,
nddw: null,
ndz: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
type: 1,
syl: stepTableFormData[j].actSolutionVolume,
syldw: paralleConfigs.headerSelectFields.actSolutionVolumeUnit,
yxzq: null,
yxzqdw: null,
})
//
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){
if (tmpResource.length > 0) {
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || []
this.resourceTmp = tmpResource
return content;

Loading…
Cancel
Save