Browse Source

fix:[模板管理]sp003

lkf
15881625488@163.com 2 months ago
parent
commit
681d546955
1 changed files with 63 additions and 29 deletions
  1. +63
    -29
      src/views/business/comps/template/comps/sp/SP003.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 },
@ -275,7 +273,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",//
@ -427,7 +425,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();
} }
@ -481,7 +479,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);
@ -498,7 +496,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] });
@ -513,7 +511,7 @@ export default {
EventBus.$emit('onModifyRecord', params,) EventBus.$emit('onModifyRecord', params,)
}) })
}, },
getStepResource(){
getStepResource() {
return this.$refs.stepRef.getStepResource() return this.$refs.stepRef.getStepResource()
}, },
// //
@ -558,7 +556,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;
@ -570,15 +568,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]
@ -593,19 +590,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,
@ -617,23 +614,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() {

Loading…
Cancel
Save