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" /> <LineLabel label="template.common.operationSteps" />
<div class="template-form-item"> <div class="template-form-item">
<BaseInfoFormPackage @clickable="handleClickable" ref="stepFormPackageRef" <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" /> :formData="formData" />
<CustomTable fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur" <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 }"> <template slot="operation" slot-scope="{ row, rowIndex, columns }">
<TableOpertaion @startConfig="startConfig" @configComplete="configComplete" <TableOpertaion @startConfig="startConfig" @configComplete="configComplete"
@printTag="printTag" @subPackageSubmit="subPackageSubmit" :fillType="fillType" @printTag="printTag" @subPackageSubmit="subPackageSubmit" :fillType="fillType"
@ -54,7 +52,7 @@ import CustomTable from '@/components/Template/CustomTable.vue';
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"; import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue";
import { EventBus } from "@/utils/eventBus"; import { EventBus } from "@/utils/eventBus";
import { addTj ,uniqeResource,uniqeResourceOne,addDecimals} from "@/utils/calUnitTools";
import { addTj, uniqeResource, uniqeResourceOne, addDecimals } from "@/utils/calUnitTools";
export default { export default {
name: "SP003", name: "SP003",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion }, components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, SelectReagentDialog, TableOpertaion },
@ -277,7 +275,7 @@ export default {
bodySubType: "span", bodySubType: "span",
bodySubKey: "subTargetSolutionCode", bodySubKey: "subTargetSolutionCode",
bodyFillType: "preFill", bodyFillType: "preFill",
width: 130,
width: 140,
myCodeFields: ["targetSolutionCode", "subTargetSolutionCode"],// myCodeFields: ["targetSolutionCode", "subTargetSolutionCode"],//
maxVolumeField: "actSolutionVolume",// maxVolumeField: "actSolutionVolume",//
maxVolumeFieldUnit: "actSolutionVolumeUnit",// maxVolumeFieldUnit: "actSolutionVolumeUnit",//
@ -429,7 +427,7 @@ export default {
methods: { methods: {
// //
onSureModifyRecord(key) { onSureModifyRecord(key) {
if(key === "subStartSolution"){//table
if (key === "subStartSolution") {//table
this.$refs.stepTableRef.updateRecords(); this.$refs.stepTableRef.updateRecords();
} }
@ -483,7 +481,7 @@ export default {
bh: mybh, bh: mybh,
nd: rowData.actSolutionConcentration || 0, nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit, nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studySubjectId: this.formData.studySubjectId,
list: list list: list
} }
this.subPackageRequest(postData); this.subPackageRequest(postData);
@ -500,7 +498,7 @@ export default {
if (hasAnyWithValue) { if (hasAnyWithValue) {
return; 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); const snList = await this.getLatestSnArr(codes);
stepTableFormData.forEach((item, index) => { stepTableFormData.forEach((item, index) => {
this.$refs.stepTableRef.updateDataSourceByRowIndex(index, { subTargetSolutionCode: snList[index] }); this.$refs.stepTableRef.updateDataSourceByRowIndex(index, { subTargetSolutionCode: snList[index] });
@ -515,7 +513,7 @@ export default {
EventBus.$emit('onModifyRecord', params,) EventBus.$emit('onModifyRecord', params,)
}) })
}, },
getStepResource(){
getStepResource() {
return this.$refs.stepRef.getStepResource() return this.$refs.stepRef.getStepResource()
}, },
// //
@ -560,7 +558,7 @@ export default {
newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode; newStepTableData[i].startSolutionCode = newStepTableData[i - 1].targetSolutionCode;
} }
const volResult = this.updateSjmbrynd(item, row.nd); const volResult = this.updateSjmbrynd(item, row.nd);
if(!volResult){
if (!volResult) {
continue continue
} }
item.actSolutionVolume = volResult.actVol; item.actSolutionVolume = volResult.actVol;
@ -572,15 +570,14 @@ export default {
}, },
async getFormData() { async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]); let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
//resource
let tmpResource = [] let tmpResource = []
if (this.fillType === "actFill") { if (this.fillType === "actFill") {
//
let tableList = content.stepTableFormData let tableList = content.stepTableFormData
if (tableList && tableList.length > 0) { if (tableList && tableList.length > 0) {
for (let i = 0; i < tableList.length; i++) { for (let i = 0; i < tableList.length; i++) {
let item = tableList[i] let item = tableList[i]
let fzTotal = 0//
//
let fzTotal = 0 //
if (item.fzsj && item.fzsj.fzList && item.fzsj.fzList) { if (item.fzsj && item.fzsj.fzList && item.fzsj.fzList) {
for (let j = 0; j < item.fzsj.fzList.length; j++) { for (let j = 0; j < item.fzsj.fzList.length; j++) {
let fzItem = item.fzsj.fzList[j] let fzItem = item.fzsj.fzList[j]
@ -595,19 +592,19 @@ export default {
sxrq: content.expireDate, sxrq: content.expireDate,
kc: fzItem.num, kc: fzItem.num,
kcdw: item.fzsj.dw, kcdw: item.fzsj.dw,
type: null,
elnType: this.product,
type: null,
elnType: this.product,
syl: null, syl: null,
syldw: item.fzsj.dw, syldw: item.fzsj.dw,
yxzq: content.effectivePeriod, yxzq: content.effectivePeriod,
yxzqdw: content.effectivePeriodUnit, 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({ tmpResource.push({
mc: null, mc: null,
bh: item.targetSolutionCode + item.subTargetSolutionCode, bh: item.targetSolutionCode + item.subTargetSolutionCode,
@ -619,23 +616,60 @@ export default {
sxrq: content.expireDate, sxrq: content.expireDate,
kc: total, kc: total,
kcdw: unit, 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, yxzq: content.effectivePeriod,
yxzqdw: content.effectivePeriodUnit, 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) tmpResource = uniqeResourceOne(tmpResource)
} }
//使
//使
const stepResource = this.$refs.stepRef.getStepResource() 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; return content;
}, },
async onSave() { 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 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 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"; import { getLadderColumnsConfig, getParallelColumnsConfig, getLadderFormConfig, getBaseInfoFormConfig, getRemarkFormConfig, getStorageConditionFormConfig, getParalleStepFormConfig } from "../../formConfig/paralleAndLadderConfig.js";
export default { export default {
name: "SP00456", name: "SP00456",
@ -210,7 +210,7 @@ export default {
bh: mybh, bh: mybh,
nd: rowData.actSolutionConcentration || 0, nd: rowData.actSolutionConcentration || 0,
nddw: headerSelectFields.actSolutionConcentrationUnit, nddw: headerSelectFields.actSolutionConcentrationUnit,
studySubjectId: this.formData.studySubjectId,
studySubjectId: this.formData.studySubjectId,
list: list list: list
} }
this.subPackageRequest(postData); this.subPackageRequest(postData);
@ -306,7 +306,7 @@ export default {
this.$refs[ref][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate }); this.$refs[ref][0]?.updateDataSourceByRowIndex(idx, { subTargetSolutionCode: snList[idx], ...expDate });
}); });
resolve() resolve()
}else{
} else {
reject() reject()
} }
@ -594,6 +594,7 @@ export default {
} }
let content = this.getFilledFormData(); let content = this.getFilledFormData();
//resource //resource
debugger
let tmpResource = [] let tmpResource = []
if (this.fillType === "actFill") { if (this.fillType === "actFill") {
// //
@ -603,11 +604,12 @@ export default {
let stepTableFormData = ladderConfigs.stepTableFormData let stepTableFormData = ladderConfigs.stepTableFormData
for (let j = 0; j < stepTableFormData.length; j++) { for (let j = 0; j < stepTableFormData.length; j++) {
let fzTotal = 0//
//
let fzTotal = 0//
let fzsj = stepTableFormData[j].fzsj let fzsj = stepTableFormData[j].fzsj
if (fzsj && fzsj.fzList) { if (fzsj && fzsj.fzList) {
for (let k = 0; k < fzsj.fzList.length; k++) { for (let k = 0; k < fzsj.fzList.length; k++) {
let fzItem = fzsj.fzList[k]
let fzItem = fzsj.fzList[k]
tmpResource.push({ tmpResource.push({
mc: null, mc: null,
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode, bh: fzsj.mybh + fzItem.preCode + fzItem.subCode,
@ -626,10 +628,10 @@ export default {
yxzq: ladderConfigs.effectivePeriod, yxzq: ladderConfigs.effectivePeriod,
yxzqdw: ladderConfigs.effectivePeriodUnit, 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]) const { total, unit } = addTj([stepTableFormData[j].actStartSolutionVolume, stepTableFormData[j].actDiluentVolume], [ladderConfigs.headerSelectFields.actStartSolutionVolumeUnit, ladderConfigs.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({ tmpResource.push({
@ -645,12 +647,47 @@ export default {
kcdw: unit, kcdw: unit,
type: null, type: null,
elnType: this.product, 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, yxzq: ladderConfigs.effectivePeriod,
yxzqdw: ladderConfigs.effectivePeriodUnit, 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 paralleConfigs = content.paralleConfigs[i]
let stepTableFormData = paralleConfigs.stepTableFormData let stepTableFormData = paralleConfigs.stepTableFormData
for (let j = 0; j < stepTableFormData.length; j++) { for (let j = 0; j < stepTableFormData.length; j++) {
let fzTotal = 0//
//
let fzTotal = 0//
let fzsj = stepTableFormData[j].fzsj let fzsj = stepTableFormData[j].fzsj
if (fzsj && fzsj.fzList) { if (fzsj && fzsj.fzList) {
for (let k = 0; k < fzsj.fzList.length; k++) { for (let k = 0; k < fzsj.fzList.length; k++) {
let fzItem = fzsj.fzList[k]
let fzItem = fzsj.fzList[k]
tmpResource.push({ tmpResource.push({
mc: null, mc: null,
bh: fzsj.mybh + fzItem.preCode + fzItem.subCode, bh: fzsj.mybh + fzItem.preCode + fzItem.subCode,
@ -683,10 +721,10 @@ export default {
yxzq: paralleConfigs.effectivePeriod, yxzq: paralleConfigs.effectivePeriod,
yxzqdw: paralleConfigs.effectivePeriodUnit, 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]) const { total, unit } = addTj([stepTableFormData[j].actSolutionVolume, stepTableFormData[j].actDiluentVolume], [paralleConfigs.headerSelectFields.actSolutionVolumeUnit, paralleConfigs.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({ tmpResource.push({
mc: null, mc: null,
@ -701,23 +739,58 @@ export default {
kcdw: unit, kcdw: unit,
type: null, type: null,
elnType: this.product, 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, yxzq: stepTableFormData[j].targetSolutionCycle,
yxzqdw: stepTableFormData[j].targetSolutionCyclePrecision, 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) tmpResource = uniqeResourceOne(tmpResource)
} }
//使 //使
const stepResource = this.getStepResource() 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 this.resourceTmp = tmpResource
return content; return content;

Loading…
Cancel
Save