From 7edc9128b4141500c32645263d7db5ffeb744c25 Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Mon, 30 Mar 2026 14:40:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86][upd?= =?UTF-8?q?ate]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Template/BaseInfoFormPackage.vue | 7 +- src/components/Template/HandleFormItem.vue | 4 + .../Template/StepComponents/ZLSubPackage.vue | 1 + .../Template/StepComponents/pcr/hsypfz.vue | 1 + .../Template/StepComponents/pcrfxyp/cdnsypfz.vue | 1 + src/components/Template/StepComponents/ry/fz.vue | 13 +- src/components/Template/mixins/stepMixins.js | 332 +++++++++++---------- .../business/comps/template/comps/dl/DL011.vue | 10 +- .../business/comps/template/comps/dl/DL012.vue | 13 +- .../comps/template/dialog/SubPackageDialog.vue | 4 +- 10 files changed, 216 insertions(+), 170 deletions(-) diff --git a/src/components/Template/BaseInfoFormPackage.vue b/src/components/Template/BaseInfoFormPackage.vue index 7350c5b..2d788eb 100644 --- a/src/components/Template/BaseInfoFormPackage.vue +++ b/src/components/Template/BaseInfoFormPackage.vue @@ -183,7 +183,7 @@ :style="{ 'width': sItem.labelWidth ? sItem.labelWidth + 'px' : '150px' }" v-if="sItem.label"> {{ $t(sItem.label) }} -
+
{{ formFields[key] }}
@@ -691,4 +691,9 @@ export default { width: 120px; text-align: center; } +.span-text { + font-size: 14px; + font-weight: normal; + color: #606266; +} \ No newline at end of file diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index d33f339..fcccc06 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -657,6 +657,10 @@ export default { // 点击按钮 handleClickButton(item) { this.inputValue = `button-${new Date().getTime()}`; + if(item.noSign){//不需要签名的直接emit + this.$emit("clickButton", item); + return; + } this.onCommonHandleSaveRecord(this.inputValue); }, onDateChange(val, format) { diff --git a/src/components/Template/StepComponents/ZLSubPackage.vue b/src/components/Template/StepComponents/ZLSubPackage.vue index 78c6d8a..fcfcb40 100644 --- a/src/components/Template/StepComponents/ZLSubPackage.vue +++ b/src/components/Template/StepComponents/ZLSubPackage.vue @@ -210,6 +210,7 @@ export default { // 根据输入的数量生成新列表 for (let i = 0; i < fzList.length; i++) { fzList[i].subCode = codes[i]; + fzList[i].preCode = `${mybh}-set${codes[i]}` } justUpdateFilledFormData() } diff --git a/src/components/Template/StepComponents/pcr/hsypfz.vue b/src/components/Template/StepComponents/pcr/hsypfz.vue index 5c2afca..20be290 100644 --- a/src/components/Template/StepComponents/pcr/hsypfz.vue +++ b/src/components/Template/StepComponents/pcr/hsypfz.vue @@ -102,6 +102,7 @@ export default { fillType: "actFill", fzType: "step", buttonName: "分装", + noSign: true, maxVolumeField: "sjtj", maxVolumeUnitField: "sjtjdw", myCodeFields: ["lbbh", "lbbhCode"], diff --git a/src/components/Template/StepComponents/pcrfxyp/cdnsypfz.vue b/src/components/Template/StepComponents/pcrfxyp/cdnsypfz.vue index ebc2d90..3e2e849 100644 --- a/src/components/Template/StepComponents/pcrfxyp/cdnsypfz.vue +++ b/src/components/Template/StepComponents/pcrfxyp/cdnsypfz.vue @@ -97,6 +97,7 @@ export default { type:"button", buttonName:"分装", fzType: "step", + noSign: true, maxVolumeField: "sjtj", maxVolumeUnitField: "sjtjdw", myCodeFields: ["lbbh", "lbbhCode"], diff --git a/src/components/Template/StepComponents/ry/fz.vue b/src/components/Template/StepComponents/ry/fz.vue index aadbfd4..e14fc79 100644 --- a/src/components/Template/StepComponents/ry/fz.vue +++ b/src/components/Template/StepComponents/ry/fz.vue @@ -1,6 +1,6 @@ diff --git a/src/components/Template/mixins/stepMixins.js b/src/components/Template/mixins/stepMixins.js index 1b6fc21..6610cef 100644 --- a/src/components/Template/mixins/stepMixins.js +++ b/src/components/Template/mixins/stepMixins.js @@ -1,167 +1,179 @@ -import { getuuid ,justUpdateFilledFormData} from '@/utils/index.js' +import { getuuid, justUpdateFilledFormData } from '@/utils/index.js' import { EventBus } from '@/utils/eventBus' import { getLatestSn, getLatestSnArr } from '@/api/template' export default { - inject: ['templateFillType'], - dicts: [ - 'business_tjdw', - 'business_czhj', - 'business_rqcz', - 'business_zldw', - 'business_yqscdw', - 'business_zsdw', - 'business_wddw', - 'business_ccwz', - 'business_ggdw', - 'business_hjxx', - 'business_zzzc', - 'business_step_pcr', - 'business_fycx', - 'business_step_pcrfxyp', - 'business_cctj' - ], - props: { - formData: { - type: Object, - default: () => ({}) - }, - stepIndex: { - type: String, - default: '' - } - }, - data() { - return { - uuid: getuuid(), - fzInfo:{}, - } - }, - mounted() { - EventBus.$on('dialogSubPackageSubmit', (data) => { - this.onSubPackageSubmit(data) - }) - EventBus.$on('subPackageDialogPrintTag', (data) => { - this.onPrintTag(data) - }) - }, - destroyed() { - EventBus.$off('dialogSubPackageSubmit') - EventBus.$off('subPackageDialogPrintTag') - }, + inject: ['templateFillType', 'getMybh'], + dicts: [ + 'business_tjdw', + 'business_czhj', + 'business_rqcz', + 'business_zldw', + 'business_yqscdw', + 'business_zsdw', + 'business_wddw', + 'business_ccwz', + 'business_ggdw', + 'business_hjxx', + 'business_zzzc', + 'business_step_pcr', + 'business_fycx', + 'business_step_pcrfxyp', + 'business_cctj' + ], + props: { + formData: { + type: Object, + default: () => ({}) + }, + stepIndex: { + type: String, + default: '' + } + }, + data() { + return { + uuid: getuuid(), + fzInfo: {}, + } + }, + mounted() { + EventBus.$on('dialogSubPackageSubmit', (data) => { + this.onSubPackageSubmit(data) + }) + EventBus.$on('subPackageDialogPrintTag', (data) => { + this.onPrintTag(data) + }) + }, + destroyed() { + EventBus.$off('dialogSubPackageSubmit') + EventBus.$off('subPackageDialogPrintTag') + }, - methods: { - //回填编号 preField 前缀 updateField 需要更新的字段 - async handleBackfillCode(preField,updateField){ - const updateValue = this.formData[updateField]; - if (this.templateFillType === 'actFill' && !updateValue) { - const stepFormData = this.getFilledFormData(); - const preValue = stepFormData[preField]; - const result = await this.getLatestSn({ - pre: preValue, - }) - this.$refs.stepFormPackageRef.updateFormData(updateField,result[0]) - this.justUpdateFilledFormData(); - } - }, - justUpdateFilledFormData(){ - justUpdateFilledFormData(); - }, - //获取最新的多个编号 - async getLatestSnArr(params) { - const res = await getLatestSnArr(params) - if (res.code === 200) { - return res.data - } - return [] - }, - async getLatestSn(params) { - const defaultParams = { - count: 1, - type: 1, - pre: '' - } - const finalParams = { ...defaultParams, ...params } - const res = await getLatestSn(finalParams) - if (res.code === 200) { - return res.data - } - return [] - }, - // 打印标签 - onPrintTag(data) { - this.$emit('printTag') - }, - onSubPackageSubmit(data) { - if (data.uuid === this.uuid) { - delete data.uuid //删除uuid字段,不然会导致下次匹配的时候匹配到错误的uuid - this.$refs.stepFormPackageRef.updateFormData('fzInfo',data) - this.justUpdateFilledFormData(); - } - }, - // 点击按钮 - onHandleClickButton(e, item, key) { - const { - buttonName = '', - myCodeFields = [], - maxVolumeField = '', - maxVolumeUnitField = '' - } = e + methods: { + //回填编号 preField 前缀 updateField 需要更新的字段 + async handleBackfillCode(preField, updateField) { + const updateValue = this.formData[updateField]; + if (this.templateFillType === 'actFill' && !updateValue) { + const stepFormData = this.getFilledFormData(); + const preValue = stepFormData[preField]; + const result = await this.getLatestSn({ + pre: preValue, + }) + this.$refs.stepFormPackageRef.updateFormData(updateField, result[0]) + this.justUpdateFilledFormData(); + } + }, + justUpdateFilledFormData() { + justUpdateFilledFormData(); + }, + //获取最新的多个编号 + async getLatestSnArr(params) { + const res = await getLatestSnArr(params) + if (res.code === 200) { + return res.data + } + return [] + }, + async getLatestSn(params) { + const defaultParams = { + count: 1, + type: 1, + pre: '' + } + const finalParams = { ...defaultParams, ...params } + const res = await getLatestSn(finalParams) + if (res.code === 200) { + return res.data + } + return [] + }, + // 打印标签 + onPrintTag(data) { + this.$emit('printTag') + }, + onSubPackageSubmit(data) { + if (data.uuid === this.uuid) { + delete data.uuid //删除uuid字段,不然会导致下次匹配的时候匹配到错误的uuid + this.$refs.stepFormPackageRef.updateFormData('fzInfo', data) + this.justUpdateFilledFormData(); + } + }, + // 点击按钮 + onHandleClickButton(e, item, key) { + const { + buttonName = '', + myCodeFields = [], + maxVolumeField = '', + maxVolumeUnitField = '' + } = e - if (buttonName === '分装') { - const fields = [] - const stepFormData = this.getFilledFormData() - if (!myCodeFields.length || !maxVolumeField || !maxVolumeUnitField) { - console.warn('请配制分装参数') - return - } - const fzInfo = stepFormData.fzInfo || this.formData.fzInfo; - const maxVolume = stepFormData[maxVolumeField] - const maxVolumeUnit = stepFormData[maxVolumeUnitField] - myCodeFields.forEach((key) => { - fields.push(stepFormData[key]) - }) - EventBus.$emit('showSubPackageDialog', { - mybh: fields.join(''), - fzType: 'step', - ...fzInfo, - maxVolume, - maxVolumeUnit, - uuid: this.uuid, - }) - } - }, + if (buttonName === '分装') { + const stepFormData = this.getFilledFormData() + const fzInfo = stepFormData.fzInfo || this.formData.fzInfo; + let fields = [] + let maxVolume, maxVolumeUnit; + if (this.getMybh) { + const { mybh, maxVolume:max, maxVolumeUnit:unit } = this.getMybh() + if(!mybh || !max || !unit){ + this.$message.warning('请先填写分装数据') + return + } + fields.push(mybh) + maxVolume = max || '' + maxVolumeUnit = unit || '' + } else { + if (!myCodeFields.length || !maxVolumeField || !maxVolumeUnitField) { + this.$message.warning('请配制分装参数') + return + } + maxVolume = stepFormData[maxVolumeField] + maxVolumeUnit = stepFormData[maxVolumeUnitField] + myCodeFields.forEach((key) => { + fields.push(stepFormData[key]) + }) + } + EventBus.$emit('showSubPackageDialog', { + mybh: fields.join(''), + fzType: 'step', + ...fzInfo, + maxVolume, + maxVolumeUnit, + uuid: this.uuid, + }) + } + }, - async getFormData() { - const data = await this.$refs.stepFormPackageRef.getFormData(); - data.fzInfo = data.fzInfo || this.formData.fzInfo; - return data - }, - getFilledFormData() { - const data = this.$refs.stepFormPackageRef?.getFilledFormData(); - data.fzInfo = data.fzInfo || this.formData.fzInfo; - return data - }, - getSjResource() { - const data = this.$refs.stepFormPackageRef?.getSjResource(); - data.fzInfo = data.fzInfo || this.formData.fzInfo; - return data - }, - //试验配制条件options - getDictOptions(dictType) { - return this.dict.type[dictType] || [] - }, - resetRecord() { - this.$refs.stepFormPackageRef.resetRecord() - }, - //更新温层数据 - updateWcData(key, value) { - const options = this.getDictOptions('business_ccwz') - const selectedOption = options.find((item) => item.value === value) - if (selectedOption) { - this.$refs.stepFormPackageRef.updateFormData(key, [ - selectedOption.raw.remark - ]) - } - } - } + async getFormData() { + const data = await this.$refs.stepFormPackageRef.getFormData(); + data.fzInfo = data.fzInfo || this.formData.fzInfo; + return data + }, + getFilledFormData() { + const data = this.$refs.stepFormPackageRef?.getFilledFormData(); + data.fzInfo = data.fzInfo || this.formData.fzInfo; + return data + }, + getSjResource() { + const data = this.$refs.stepFormPackageRef?.getSjResource(); + data.fzInfo = data.fzInfo || this.formData.fzInfo; + return data + }, + //试验配制条件options + getDictOptions(dictType) { + return this.dict.type[dictType] || [] + }, + resetRecord() { + this.$refs.stepFormPackageRef.resetRecord() + }, + //更新温层数据 + updateWcData(key, value) { + const options = this.getDictOptions('business_ccwz') + const selectedOption = options.find((item) => item.value === value) + if (selectedOption) { + this.$refs.stepFormPackageRef.updateFormData(key, [ + selectedOption.raw.remark + ]) + } + } + } } diff --git a/src/views/business/comps/template/comps/dl/DL011.vue b/src/views/business/comps/template/comps/dl/DL011.vue index 15463f8..aa423b5 100644 --- a/src/views/business/comps/template/comps/dl/DL011.vue +++ b/src/views/business/comps/template/comps/dl/DL011.vue @@ -107,6 +107,14 @@ export default { TableOpertaionDelete }, mixins: [templateMixin], + provide() { + return { + getMybh: ()=>{ + const data = this.$refs[refConf.xbxx].getFilledFormData() + return {mybh:data.fshxbbh+data.fshxbbhCodeSn,maxVolume:data.fshxbsjtj,maxVolumeUnit:data.fshxbsjtjUnit} + } + } + }, props: { fillType: { type: String, @@ -261,7 +269,7 @@ export default { fillType: 'actFill', copyFrom: 'fshxbyjtj', compareTo: 'fshxbyjtj', - subOptions: this.getDictOptions('business_nddw'), + subOptions: this.getDictOptions('business_tjdw'), maxlength: 10 } } diff --git a/src/views/business/comps/template/comps/dl/DL012.vue b/src/views/business/comps/template/comps/dl/DL012.vue index 0abc403..00b6ba4 100644 --- a/src/views/business/comps/template/comps/dl/DL012.vue +++ b/src/views/business/comps/template/comps/dl/DL012.vue @@ -72,6 +72,15 @@ export default { TableOpertaionDelete }, mixins: [templateMixin], + provide() { + return { + getMybh: ()=>{ + const data = this.$refs[refConf.xbxx].getFilledFormData() + console.log(data,"ddd") + return {mybh:data.fshxbbh+data.fshxbbhCodeSn,maxVolume:data.fshxbsjtj,maxVolumeUnit:data.fshxbsjtjUnit} + } + } + }, props: { fillType: { type: String, @@ -229,7 +238,7 @@ export default { subType: 'select', subKey: 'fshxbyjtjUnit', fillType: 'preFill', - subOptions: this.getDictOptions('business_nddw'), + subOptions: this.getDictOptions('business_tjdw'), maxlength: 10, // selectTo: 'zbhxbsjtjUnit' }, @@ -239,7 +248,7 @@ export default { subType: 'select', subKey: 'zbhxbsjtjUnit', fillType: 'actFill', - subOptions: this.getDictOptions('business_nddw'), + subOptions: this.getDictOptions('business_tjdw'), maxlength: 10, compareTo: 'zbhxbyjtj', copyFrom: 'zbhxbyjtj' diff --git a/src/views/business/comps/template/dialog/SubPackageDialog.vue b/src/views/business/comps/template/dialog/SubPackageDialog.vue index b2cdd0a..bee56e8 100644 --- a/src/views/business/comps/template/dialog/SubPackageDialog.vue +++ b/src/views/business/comps/template/dialog/SubPackageDialog.vue @@ -109,7 +109,7 @@ export default { unitItem() { return { type: "select", - fillType: "preFill", + fillType: "actFill", options: this.dict.type.business_tjdw } } @@ -378,7 +378,7 @@ export default { this.fzList.push({ num: "", subCode: codes[i], - preCode: `-set${codes[i]}` + preCode: `${this.formData.mybh}-set${codes[i]}` }); // 同步初始化错误状态数组 this.fzListErrors.push(false);