Browse Source

feat:[模板管理][PCR008]

ouqian
HanLong 1 month ago
parent
commit
fc1b46418c
4 changed files with 107 additions and 48 deletions
  1. +1
    -1
      src/lang/en/template/pcr.js
  2. +2
    -2
      src/lang/zh/template/pcr.js
  3. +99
    -41
      src/views/business/comps/template/comps/pcr/PCR008.vue
  4. +5
    -4
      src/views/business/comps/template/formConfig/PCRTableConfig.js

+ 1
- 1
src/lang/en/template/pcr.js View File

@ -52,7 +52,7 @@ export default {
ypmc: '样品名称',
cyqypgsjyjtjtj: '采样前样品管试剂预计添加体积',
cyqypgsjsjtjtj: '采样前样品管试剂实际添加体积',
cygzl: '采集管重量',
cjgzl: '采集管重量',
czsj: '称重时间',
clpbh: 'Analysis Batch Number',
ypmc: '样品名称',

+ 2
- 2
src/lang/zh/template/pcr.js View File

@ -51,7 +51,7 @@ export default {
ypmc: '样品名称',
cyqypgsjyjtjtj: '采样前样品管试剂预计添加体积',
cyqypgsjsjtjtj: '采样前样品管试剂实际添加体积',
cygzl: '采集管重量',
cjgzl: '采集管重量',
czsj: '称重时间',
clpbh: 'Analysis Batch Number',
ypmc: '样品名称',
@ -66,7 +66,7 @@ export default {
},
pcr008: {
czb: '称重表',
clsj: 'Work Time',
clsj: '处理时间',
yjry: '匀浆溶液',
bs: '倍数',
yjyjry: '已加匀浆溶液',

+ 99
- 41
src/views/business/comps/template/comps/pcr/PCR008.vue View File

@ -15,7 +15,8 @@
<LineLabel label="template.common.operationSteps" />
<div class="template-form-item">
<BaseInfoFormPackage fieldItemLabel="template.common.operationSteps" ref="stepFormPackageRef"
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" @onRegentSubmit="onRegentSubmit" />
:formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData"
@beforeReagentSubmit="onBeforeReagentSubmit" @onRegentSubmit="onRegentSubmit" />
<div v-if="fillType == 'preFill'">
<el-button :disabled="deleteRows.length === 0" type="danger" @click="onClickDelete">{{
$t('form.delete') }}</el-button>
@ -230,16 +231,66 @@ export default {
this.onHandleTableBlur()
},
methods: {
onRegentSubmit(data){
console.log(data,"回调")
onBeforeReagentSubmit(data) {
const { selectData, callback } = data;
let selectedRows = selectData.selectedRows
let cjgzlUnit;
let error = false;
if (selectedRows) {
selectedRows.forEach(item => {
let bdnr = JSON.parse(item.bdnr)
if (!cjgzlUnit) {
cjgzlUnit = bdnr.headerSelectFields.cjgzlUnit
}
if (cjgzlUnit != bdnr.headerSelectFields.cjgzlUnit) {
error = true
}
})
}
if (error) {
callback.prevent("所选表单单位不一致,请重新选择")
}
},
onRegentSubmit(data) {
let addRows = []
let selectedRows = data.selectInfo.selectedRows
let cjgzlUnit;
if (selectedRows) {
selectedRows.forEach(item => {
let bdnr = JSON.parse(item.bdnr)
if (!cjgzlUnit) {
cjgzlUnit = bdnr.headerSelectFields.cjgzlUnit
}
if (bdnr.stepTableFormData) {
bdnr.stepTableFormData.forEach(row => {
addRows.push({
ypmc: row.ypmc,
cjgz: row.cjgzl,
targetStartSolutionVolumePrecision: 3,
targetDiluentVolumePrecision: 3
})
})
}
})
if (addRows) {
this.$refs.stepTableRef.addRows(addRows)
let content = this.getFilledFormData();
setTimeout(() => {
this.justUpdateFilledFormData();
}, 100);
}
}
},
onClickDelete() {
this.$modal.confirm(this.$t('form.confirmDelete')).then(() => {
this.$refs.stepTableRef.deleteSelectedRows(this.deleteRows)
this.$refs.stepTableRef.justUpdateFilledFormData();
setTimeout(() => {
this.justUpdateFilledFormData();
}, 100);
}).catch(() => { });
},
handleSelectionChange(row) {
this.deleteRows = []
@ -259,17 +310,35 @@ export default {
let content = this.getFilledFormData();
let bs = content.bs
content
let yjyjry = content.yjyjry
let yjyjryUnit = content.yjyjryUnit
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 cqzl = item.cqzl * bs
//
console.log(item)
let lzzcz = item.lzzcz
let cjgz = item.cjgz
let tabZzzl;
// =
if(lzzcz && cjgz) {
let temp = subTj([lzzcz, cjgz], [content.headerSelectFields.lzzczUnit, content.headerSelectFields.cjgzUnit])
let zzzl = temp.total
let zzzlUnit = temp.unit
tabZzzl = volumeConverter.convert(zzzl + zzzlUnit, content.headerSelectFields.zzzlUnit)
tableList[i].zzzl = tabZzzl
}
// =
let ysyjrybjrl = volumeConverter.convert(cqzl + content.headerSelectFields.cqzlUnit, content.headerSelectFields.ysyjrybjrlUnit)
tableList[i].ysyjrybjrl = ysyjrybjrl
if(tabZzzl && bs && yjyjry) {
let temp = subTj([tabZzzl * bs, yjyjry], [content.headerSelectFields.zzzlUnit, yjyjryUnit])
let ysyjrybjrl = temp.total
let ysyjrybjrlUnit = temp.unit
ysyjrybjrl = volumeConverter.convert(ysyjrybjrl + ysyjrybjrlUnit, content.headerSelectFields.ysyjrybjrlUnit)
tableList[i].ysyjrybjrl = ysyjrybjrl
}
}
}
this.$refs.stepTableRef.updateDataSource(tableList);
@ -289,36 +358,25 @@ export default {
//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]
console.log('表格item:' + JSON.stringify(item))
//使
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.ysxsyxytj,
type: 1,
elnType: this.product,
syldw: content.headerSelectFields.sjxsyxytjUnit,
yxzq: null,
yxzqdw: null,
})
}
}
//使
tmpResource.push({
mc: null,
bh: content.yjrybh,
ph: null,
ndz: null,
nd: null,
nddw: null,
ly: null,
sxrq: null,
kc: null,
kcdw: null,
syl: content.yjyjry,
type: 1,
elnType: this.product,
syldw: content.yjyjryUnit,
yxzq: null,
yxzqdw: null,
})
}
if (tmpResource.length > 0) {
tmpResource = uniqeResourceOne(tmpResource)

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

@ -735,12 +735,12 @@ export const getPCR007Config = ($this) => {
bodyMaxlength: 10,
},
{
label: 'template.pcr.pcr007.cygzl',
prop: 'cygzl',
label: 'template.pcr.pcr007.cjgzl',
prop: 'cjgzl',
width: 280,
showWidth: 180,
fillType: 'preFill',
headerSelectKey: 'cygzlUnit',
headerSelectKey: 'cjgzlUnit',
headerOptions: $this.getDictOptions('business_tjdw'),
bodyType: 'inputNumber',
bodyFillType: 'actFill',
@ -794,10 +794,11 @@ export const getPCR008Config = ($this) => {
bodyType: 'inputNumber',
bodyFillType: 'actFill',
bodyMaxlength: 10,
bodySubType: 'inputNumber',
bodyFillType: 'actFill',
bodySubType: 'button',
bodySubButtonName: 'form.hqz',
bodySubFillType: 'actFill',
showBodySub: $this.fillType === 'actFill',
},
{
label: 'template.pcr.pcr008.zzzl',

Loading…
Cancel
Save