From 4177ca07ea278a44cfa149af69551e5408ac422e Mon Sep 17 00:00:00 2001 From: ouqian <13568766802@163.com> Date: Fri, 13 Mar 2026 22:14:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86][DL01?= =?UTF-8?q?1~DL012=E6=A0=B8=E5=AF=B9]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/comps/template/comps/dl/DL011.vue | 67 +++++++++++++------ .../business/comps/template/comps/dl/DL012.vue | 77 ++++++++++++++-------- 2 files changed, 97 insertions(+), 47 deletions(-) diff --git a/src/views/business/comps/template/comps/dl/DL011.vue b/src/views/business/comps/template/comps/dl/DL011.vue index f0c354b..688b5d8 100644 --- a/src/views/business/comps/template/comps/dl/DL011.vue +++ b/src/views/business/comps/template/comps/dl/DL011.vue @@ -198,6 +198,8 @@ export default { fillType: 'actFill', subType: 'button', subKey: 'pykssjButton', + subDisable: this.fillType !== 'actFill', + disabled: true, buttonName: 'template.dl.dl011.pykssjButton' } } @@ -214,7 +216,8 @@ export default { type: 'select', options: this.getDictOptions('business_dl_xbmc'), fillType: 'preFill', - otherCode: 'xbmcOther' + otherCode: 'xbmcOther', + otherMaxlength: 50 }, xbdcbh: { label: 'template.dl.dl011.xbdcbh', @@ -248,8 +251,7 @@ export default { copyFrom: 'fshxbyjtj', compareTo: 'fshxbyjtj', subOptions: this.getDictOptions('business_nddw'), - maxlength: 10, - copyFrom: 'fshxbyjtj' //复制哪个字段 + maxlength: 10 } } } @@ -257,12 +259,35 @@ export default { } }, mounted() { + // 获取数据检查 pytjText 是否已有值 + const pyxxData = this.getFilledFormDataByRefs([refConf.pyxx]) + const { pytjText } = pyxxData || {} + + // 只有在 pytjText 无值时才设置,避免重复设置 + if (!pytjText) { + this.$nextTick(() => { + this.$refs[refConf.pyxx]?.updateFormData( + 'pytjText', + '培养条件:温度为温度为37℃±2℃,CO2浓度为5%±0.5%', + { isUpdateRecord: false, signData: null } + ) + }) + } + + // 只在实际填报模式下生成编号 + if (this.fillType !== 'actFill') return + + const data = this.getFilledFormDataByRefs([refConf.xbxx]) + const { fshxbbhCodeSn } = data || {} + + // 如果已经有 fshxbbhCodeSn 值,说明是回显数据,不需要重新生成 + if (fshxbbhCodeSn) return + this.$nextTick(() => { - this.$refs[refConf.pyxx]?.updateFormData( - 'pytjText', - '培养条件:温度为温度为37℃±2℃,CO2浓度为5%±0.5%', - { isUpdateRecord: false, signData: null } - ) + const updateData = {} + const formattedDate = moment().format('YYMMDD') + updateData['fshxbbhCodeSn'] = formattedDate + '-' + '0001' + this.$refs[refConf.xbxx].batchUpdateFormData(updateData) }) }, data() { @@ -301,28 +326,30 @@ export default { // 使用的试剂、仪器(来自复苏步骤) this.resourceTmp = stepResource.sjResource || [] this.yqResourceTmp = [...(stepResource.yqResource || [])] - + // 获取细胞信息 const xbxxData = this.$refs.xbxxRef?.getFilledFormData() || {} - + // 如果选择了细胞冻存编号,添加到细胞细菌信息中 if (xbxxData.xbdcbh) { const xbInfo = xbxxData.selectInfo_xbdcbh || {} // 细胞信息格式:不包含 type 字段(参考 StepFormPackage 中 xb 类型的处理) - this.xbxjTmp = [{ - value: xbxxData.xbdcbh, - bh: xbInfo.bh || xbxxData.xbdcbh, - mc: xbInfo.mc || '', - xh: xbInfo.xh || '', - jzrq: xbInfo.jzrq || '' - }] + this.xbxjTmp = [ + { + value: xbxxData.xbdcbh, + bh: xbInfo.bh || xbxxData.xbdcbh, + mc: xbInfo.mc || '', + xh: xbInfo.xh || '', + jzrq: xbInfo.jzrq || '' + } + ] } else { this.xbxjTmp = [] } - + // 获取培养信息 const pyxxData = this.$refs.pyxxRef?.getFilledFormData() || {} - + // 如果选择了培养箱编号,添加到仪器信息中 if (pyxxData.pyxbh) { const pyxInfo = pyxxData.selectInfo_pyxbh || {} @@ -336,7 +363,7 @@ export default { jzrq: pyxInfo.jzrq || '' }) } - + return this.resourceTmp }, onRegentSubmit(e) { diff --git a/src/views/business/comps/template/comps/dl/DL012.vue b/src/views/business/comps/template/comps/dl/DL012.vue index ea9538f..474c117 100644 --- a/src/views/business/comps/template/comps/dl/DL012.vue +++ b/src/views/business/comps/template/comps/dl/DL012.vue @@ -194,6 +194,8 @@ export default { fillType: 'actFill', subType: 'button', subKey: 'pykssjButton', + disabled: true, + subDisable: this.fillType !== 'actFill', buttonName: 'template.dl.dl012.pykssjButton' } } @@ -271,30 +273,49 @@ export default { } }, mounted() { - this.$nextTick(() => { - this.$refs[refConf.pyxx]?.updateFormData( - 'pytjText', - '培养条件:温度为温度为37℃±2℃,CO2浓度为5%±0.5%', - { isUpdateRecord: false, signData: null } - ) - }) - const data = this.getFilledFormDataByRefs([refConf.xbxx, refConf.base]) - console.log(data) - const { zbxbs, zbhxbbh_1, startDate } = data || {} + console.log(this.fillType, '===>fillType') + + // 获取数据检查 pytjText 是否已有值 + const pyxxData = this.getFilledFormDataByRefs([refConf.pyxx]) + const { pytjText } = pyxxData || {} + + // 只有在 pytjText 无值时才设置,避免重复设置 + if (!pytjText) { + this.$nextTick(() => { + this.$refs[refConf.pyxx]?.updateFormData( + 'pytjText', + '培养条件:温度为温度为37℃±2℃,CO2浓度为5%±0.5%', + { isUpdateRecord: false, signData: null } + ) + }) + } + + // 只在实际填报模式下生成编号 + const data = this.getFilledFormDataByRefs([refConf.xbxx]) + const { zbxbs, zbhxbbh_1 } = data || {} if (!zbxbs) return try { this.zbxbs = Number(zbxbs) } catch (error) { this.zbxbs = 1 } + if (this.fillType !== 'actFill') return this.$nextTick(() => { const updateData = {} - // Convert startDate from "2026-03-07 14:02:15" to "260307" (YYMMDD) - const formattedDate = startDate ? moment(startDate).format('YYMMDD') : '' + // 使用当前时间生成编号 + const formattedDate = moment().format('YYMMDD') for (let index = 1; index <= this.zbxbs; index++) { - updateData['zbhxbbh_' + index] = zbhxbbh_1 - updateData['zbhxbbhCodeSn_' + index] = - formattedDate + '-' + `${index}`.padStart(2, '0') + const zbhxbbhKey = 'zbhxbbh_' + index + const codeSnKey = 'zbhxbbhCodeSn_' + index + + // 分别判断每个字段,只有无值时才设置 + if (!data[zbhxbbhKey]) { + updateData[zbhxbbhKey] = zbhxbbh_1 + } + if (!data[codeSnKey]) { + updateData[codeSnKey] = + formattedDate + '-' + `${index}`.padStart(4, '0') + } } this.$refs[refConf.xbxx].batchUpdateFormData(updateData) }) @@ -339,28 +360,30 @@ export default { // 使用的试剂、仪器(来自制备步骤) this.resourceTmp = stepResource.sjResource || [] this.yqResourceTmp = [...(stepResource.yqResource || [])] - + // 获取细胞信息 const xbxxData = this.$refs.xbxxRef?.getFilledFormData() || {} - + // 如果选择了细胞制备前编号,添加到细胞细菌信息中 if (xbxxData.xbzbqbh) { const xbInfo = xbxxData.selectInfo_xbzbqbh || {} // 细胞信息格式:不包含 type 字段 - this.xbxjTmp = [{ - value: xbxxData.xbzbqbh, - bh: xbInfo.bh || xbxxData.xbzbqbh, - mc: xbInfo.mc || '', - xh: xbInfo.xh || '', - jzrq: xbInfo.jzrq || '' - }] + this.xbxjTmp = [ + { + value: xbxxData.xbzbqbh, + bh: xbInfo.bh || xbxxData.xbzbqbh, + mc: xbInfo.mc || '', + xh: xbInfo.xh || '', + jzrq: xbInfo.jzrq || '' + } + ] } else { this.xbxjTmp = [] } - + // 获取培养信息 const pyxxData = this.$refs.pyxxRef?.getFilledFormData() || {} - + // 如果选择了培养箱编号,添加到仪器信息中 if (pyxxData.pyxbh) { const pyxInfo = pyxxData.selectInfo_pyxbh || {} @@ -374,7 +397,7 @@ export default { jzrq: pyxInfo.jzrq || '' }) } - + return this.resourceTmp }, onRegentSubmit(e) {