Browse Source

feat:[模板管理]PCR002

lkf
HanLong 2 months ago
parent
commit
8efbbbf001
2 changed files with 120 additions and 31 deletions
  1. +111
    -26
      src/views/business/comps/template/comps/pcr/PCR002.vue
  2. +9
    -5
      src/views/business/comps/template/formConfig/PCRTableConfig.js

+ 111
- 26
src/views/business/comps/template/comps/pcr/PCR002.vue View File

@ -63,10 +63,11 @@ import templateMixin from "../../mixins/templateMixin";
import CustomTable from '@/components/Template/CustomTable.vue';
import { getLatestSnArr } from '@/api/template';
import { EventBus } from "@/utils/eventBus";
import { uniqeResource } from "@/utils/calUnitTools";
import SelectReagentDialog from '../../dialog/SelectReagentDialog.vue';
import { getLadderColumnsConfig } from "../../formConfig/PCRTableConfig.js";
import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default {
name: "PCR002",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog },
@ -373,37 +374,121 @@ export default {
getFilledFormData() {
return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef","stepTableRef", "stepRef", "remarkRef"])
},
//
async getFormData() {
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef", "stepRef", "remarkRef"]);
let content = await this.validFormFields(["baseInfoRef", "stepFormPackageRef", "stepTableRef","stepRef", "remarkRef"]);
return content;
},
getResource() {
let content = this.getFilledFormData();
console.log(content)
//resource
let tmpResource = []
if (this.fillType === "actFill") {
//
tmpResource.push({
mc: content.targetName,
bh: content.targetCode + content.targetCodeSn,
ph: '',
ndz: content.targetActConcentration + content.targetActConcentrationUnit,
nd: content.targetActConcentration,
nddw: content.targetActConcentrationUnit,
ly: 'ELN配制',
sxrq: content.expireDate,
kc: content.targetActVolume,
kcdw: content.targetActVolumeUnit,
syl: null,
type: null,
elnType: this.product,
syldw: content.targetActVolumeUnit,
yxzq: content.effectivePeriod,
yxzqdw: content.effectivePeriodUnit,
})
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]
console.log('表格item:'+JSON.stringify(item))
//使
//
tmpResource.push({
mc: null,
bh: item.startSolutionCode,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.actStartSolutionVolume,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.actStartSolutionVolumeUnit,
yxzq:null,
yxzqdw:null,
})
//
tmpResource.push({
mc: null,
bh: content.subSolution,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.actDiluentVolume,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.actDiluentVolumeUnit,
yxzq:null,
yxzqdw:null,
})
//
let fzTotal = 0//
if(item.fzsj && item.fzsj.fzList && item.fzsj.fzList.length>0){
for(let j=0;j<item.fzsj.fzList.length;j++){
let fzItem = item.fzsj.fzList[j]
tmpResource.push({
mc: null,
bh: item.fzsj.mybh+fzItem.preCode+ fzItem.subCode,
ph: null,
ndz: item.hhwznd + content.headerSelectFields.hhwzndUnit,
nd: item.hhwznd,
nddw: content.headerSelectFields.hhwzndUnit,
ly: 'ELN配制',
sxrq: null,
kc: fzItem.num,
kcdw: item.fzsj.dw,
syl: null,
type: null,
elnType: this.product,
syldw:item.fzsj.dw,
yxzq:null,
yxzqdw:null,
})
fzTotal=addDecimals(fzTotal,fzItem.num)
}
}
//
// const { total, unit } = addTj([item.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
const { total, unit } = addTj([item.actStartSolutionVolume, item.actDiluentVolume], [content.headerSelectFields.actStartSolutionVolumeUnit, content.headerSelectFields.actDiluentVolumeUnit])
tmpResource.push({
mc: null,
bh: item.targetSolutionCode+item.subTargetSolutionCode,
ph: null,
ndz: item.actSolutionConcentration + content.headerSelectFields.actSolutionConcentrationUnit,
nd: item.actSolutionConcentration,
nddw: content.headerSelectFields.actSolutionConcentrationUnit,
ly: 'ELN配制',
sxrq: null,
kc: total,
kcdw: unit,
type: null,
elnType: this.product,
syl: fzTotal>0?fzTotal:null,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:content.effectivePeriod,
yxzqdw:content.effectivePeriodUnit,
})
}
}
}
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使
const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp = uniqeResource(tmpResource, stepResource.sjResource || [])
this.yqResourceTmp = stepResource.yqResource || []
return content;
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])
this.yqResourceTmp = stepResource.yqResource||[]
return this.resourceTmp;
},
//
async onSave() {

+ 9
- 5
src/views/business/comps/template/formConfig/PCRTableConfig.js View File

@ -28,6 +28,7 @@ export const getLadderColumnsConfig = ($this, selectKey) => {
label: 'template.pcr.pcr002.ysqsrytj',
prop: 'targetStartSolutionVolume',
width: 280,
showWidth: 180,
headerSelectKey: 'targetStartSolutionVolumeUnit',
fillType: 'preFill',
headerOptions: $this.getDictOptions('business_tjdw'),
@ -40,7 +41,8 @@ export const getLadderColumnsConfig = ($this, selectKey) => {
bodyPrecisionKey: 'targetStartSolutionVolumePrecision',
bodyMaxlength: 10,
bodyDisabled: true,
bodySubPlaceholder: 'template.common.xswsPlaceholder'
bodySubPlaceholder: 'template.common.xswsPlaceholder',
headerSelectTo:"actStartSolutionVolumeUnit",
},
{
label: 'template.pcr.pcr002.sjqsrytj',
@ -69,10 +71,10 @@ export const getLadderColumnsConfig = ($this, selectKey) => {
bodyFillType: 'preFill',
bodySubFillType: 'preFill',
showBodySub: $this.fillType === 'preFill',
bodyPrecisionKey: 'targetDiluentVolumePrecision',
bodyMaxlength: 10,
bodySubPlaceholder: 'template.common.xswsPlaceholder'
bodySubPlaceholder: 'template.common.xswsPlaceholder',
headerSelectTo:"actDiluentVolumeUnit",
},
{
label: 'template.pcr.pcr002.sjxsytj',
@ -96,7 +98,8 @@ export const getLadderColumnsConfig = ($this, selectKey) => {
headerOptions: $this.getDictOptions('business_nddw'),
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10
bodyMaxlength: 10,
headerSelectTo:"actSolutionConcentrationUnit",
},
{
label: 'template.pcr.pcr002.sjmbrynd',
@ -213,7 +216,8 @@ export const getParallelColumnsConfig = ($this) => {
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'preFill',
bodyMaxlength: 10
bodyMaxlength: 10,
headerSelectTo:"actSolutionVolumeUnit",
},
{
label: 'template.sp.sp00456.sjmbrytj',

Loading…
Cancel
Save