Browse Source

fix:[模板管理]SP009

lkf
HanLong 2 months ago
parent
commit
a1408e6d21
2 changed files with 166 additions and 7 deletions
  1. +162
    -5
      src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP009.vue
  2. +4
    -2
      src/views/business/comps/template/formConfig/SWYPFXFFXYPZBBTableConfig.js

+ 162
- 5
src/views/business/comps/template/comps/sp/SWYPFXFFXYPZBB/SP009.vue View File

@ -78,7 +78,8 @@ import TableOpertaion from "@/components/Template/operation/TableOpertaion.vue"
import SelectReagentDialog from '../../../dialog/SelectReagentDialog.vue'; import SelectReagentDialog from '../../../dialog/SelectReagentDialog.vue';
import { EventBus } from "@/utils/eventBus"; import { EventBus } from "@/utils/eventBus";
import { sj_subpackage,sj_startConfiguration,sj_configurationCompleted } from '@/api/business/sj/sj'; import { sj_subpackage,sj_startConfiguration,sj_configurationCompleted } from '@/api/business/sj/sj';
import { addTj,uniqeResource } from "@/utils/calUnitTools";
import { addTj,uniqeResource,uniqeResourceOne,addDecimals } from "@/utils/calUnitTools";
export default { export default {
name: "SWYPFXRYPZB", name: "SWYPFXRYPZB",
components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog }, components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaion, SelectReagentDialog },
@ -379,6 +380,7 @@ export default {
type:1 type:1
}) })
} }
const result = await getLatestSnArr(postSn)
if(result.code == 200){ if(result.code == 200){
for(let i=0;i<stepTableFormData_1.length;i++){ for(let i=0;i<stepTableFormData_1.length;i++){
this.$refs.rongyeTableRef.updateDataSourceByRowIndex(i,{ this.$refs.rongyeTableRef.updateDataSourceByRowIndex(i,{
@ -416,7 +418,73 @@ export default {
for(let i=0;i<tableList.length;i++){ for(let i=0;i<tableList.length;i++){
// //
let item = tableList[i] let item = tableList[i]
console.log('表格item:'+JSON.stringify(item))
//使
tmpResource.push({
mc: null,
bh: item.sjry,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjryxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjryxqlUnit,
yxzq:null,
yxzqdw:null,
})
//
tmpResource.push({
mc: null,
bh: content.subJz,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjjzxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjjzxqlUnit,
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,
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.sjjzxql, item.sjryxql], [content.headerSelectFields.sjjzxqlUnit, content.headerSelectFields.sjryxqlUnit])
tmpResource.push({ tmpResource.push({
@ -430,10 +498,10 @@ export default {
sxrq: null, sxrq: null,
kc: total, kc: total,
kcdw: unit, kcdw: unit,
syl: null,
syl: fzTotal>0?fzTotal:null,
type: null, type: null,
elnType: this.product, elnType: this.product,
syldw:unit,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:null, yxzq:null,
yxzqdw:null, yxzqdw:null,
}) })
@ -445,6 +513,92 @@ export default {
for(let i=0;i<tableList.length;i++){ for(let i=0;i<tableList.length;i++){
// //
let item = tableList[i] let item = tableList[i]
console.log('表格item:'+JSON.stringify(item))
//使
tmpResource.push({
mc: null,
bh: item.sjry,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjryxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjryxqlUnit,
yxzq:null,
yxzqdw:null,
})
//
tmpResource.push({
mc: null,
bh: content.subGzy,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjgzyxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjgzyxqlUnit,
yxzq:null,
yxzqdw:null,
})
//
tmpResource.push({
mc: null,
bh: content.subXsy,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: 'ELN配制',
sxrq: null,
kc: null,
kcdw: null,
syl: item.sjxsyxql,
type: 1,
elnType: this.product,
syldw:content.headerSelectFields.sjxsyxqlUnit,
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,
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.sjryxql, item.sjgzyxql,item.sjxsyxql], [content.headerSelectFields_1.sjryxqlUnit, content.headerSelectFields_1.sjgzyxqlUnit,content.headerSelectFields_1.sjxsyxqlUnit]) const { total, unit } = addTj([item.sjryxql, item.sjgzyxql,item.sjxsyxql], [content.headerSelectFields_1.sjryxqlUnit, content.headerSelectFields_1.sjgzyxqlUnit,content.headerSelectFields_1.sjxsyxqlUnit])
tmpResource.push({ tmpResource.push({
mc: null, mc: null,
@ -457,16 +611,19 @@ export default {
sxrq: null, sxrq: null,
kc: total, kc: total,
kcdw: unit, kcdw: unit,
syl: null,
syl: fzTotal>0?fzTotal:null,
type: null, type: null,
elnType: this.product, elnType: this.product,
syldw:unit,
syldw:fzTotal>0?item.fzsj.dw:unit,
yxzq:null, yxzq:null,
yxzqdw:null, yxzqdw:null,
}) })
} }
} }
} }
if(tmpResource.length>0){
tmpResource = uniqeResourceOne(tmpResource)
}
//使 //使
const stepResource = this.$refs.stepRef.getStepResource() const stepResource = this.$refs.stepRef.getStepResource()
this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[]) this.resourceTmp =uniqeResource(tmpResource,stepResource.sjResource||[])

+ 4
- 2
src/views/business/comps/template/formConfig/SWYPFXFFXYPZBBTableConfig.js View File

@ -118,13 +118,15 @@ export const getSWYPFXFFXYPZBBTQHSLTableConfig = ($this, selectKey) => {
{ {
label: 'template.sp.sp008.bh', label: 'template.sp.sp008.bh',
prop: 'bh', prop: 'bh',
bodyType: 'select',
bodyType: selectKey === '' ? 'input' : 'select',
bodyOptions: $this.getDictOptions(selectKey), bodyOptions: $this.getDictOptions(selectKey),
otherCode: 'bhOther',
otherLabel: 'template.sp.sp016.bs',
bodySubType: 'span', bodySubType: 'span',
bodySubKey: 'bhCode', bodySubKey: 'bhCode',
bodyFillType: 'preFill', bodyFillType: 'preFill',
width: 280, width: 280,
myCodeFields: ['bh', 'bhCode'],
myCodeFields: ['bh', 'bhOther', 'bhCode'],
maxVolumeField: 'sjryxql,sjgzyxql,sjxsyxql', //分装的最大量字段 maxVolumeField: 'sjryxql,sjgzyxql,sjxsyxql', //分装的最大量字段
maxVolumeFieldUnit: 'sjryxqlUnit,sjgzyxqlUnit,sjxsyxqlUnit' //分装的最大量单位字段 maxVolumeFieldUnit: 'sjryxqlUnit,sjgzyxqlUnit,sjxsyxqlUnit' //分装的最大量单位字段
}, },

Loading…
Cancel
Save