From 932e2109905b86ca3679b2368e5b35d7967f3631 Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Fri, 6 Mar 2026 18:14:56 +0800 Subject: [PATCH 01/27] =?UTF-8?q?fix:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86?= =?UTF-8?q?]GSP005?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/comps/template/comps/gsp/GSP002.vue | 1 - .../business/comps/template/comps/gsp/GSP005.vue | 159 +++++++++++++++++++-- 2 files changed, 146 insertions(+), 14 deletions(-) diff --git a/src/views/business/comps/template/comps/gsp/GSP002.vue b/src/views/business/comps/template/comps/gsp/GSP002.vue index a0f8c10..fb621ea 100644 --- a/src/views/business/comps/template/comps/gsp/GSP002.vue +++ b/src/views/business/comps/template/comps/gsp/GSP002.vue @@ -519,7 +519,6 @@ export default { const { rowData, headerSelectFields } = val; //计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积) const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit]) - debugger let postData = { mc: null, bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode, diff --git a/src/views/business/comps/template/comps/gsp/GSP005.vue b/src/views/business/comps/template/comps/gsp/GSP005.vue index ec1997a..9c9c894 100644 --- a/src/views/business/comps/template/comps/gsp/GSP005.vue +++ b/src/views/business/comps/template/comps/gsp/GSP005.vue @@ -34,7 +34,7 @@ $t('template.common.deleteBtn') }} {{ $t('template.gsp.GSP005.kspz') }} + @click="zlKspz(zlIndex)">{{ $t('template.gsp.GSP005.kspz') }} {{ $t('template.common.bqdy') }} @@ -47,7 +47,7 @@ :formData="formzlConfig.stepData" :fieldItemLabel="$t('template.common.jtpz')" :prefixKey="'form_' + zlIndex"> {{ $t('template.gsp.GSP005.jspz') }} + @click="zlJspz(zlIndex)">{{ $t('template.gsp.GSP005.jspz') }} @@ -62,7 +62,7 @@ $t('template.common.deleteBtn') }} {{ $t('template.gsp.GSP005.kspz') }} + @click="ryKspz(ryIndex)">{{ $t('template.gsp.GSP005.kspz') }} {{ $t('template.common.bqdy') }} @@ -75,7 +75,7 @@ :formData="formryConfig.stepData" :fieldItemLabel="$t('template.common.jtpz')" :prefixKey="'form_' + ryIndex"> {{ $t('template.gsp.GSP005.jspz') }} + @click="ryJspz(ryIndex)">{{ $t('template.gsp.GSP005.jspz') }} @@ -96,10 +96,11 @@ import templateMixin from "../../mixins/templateMixin"; import CustomTable from '@/components/Template/CustomTable.vue'; import { getLatestSn } from '@/api/template'; import { EventBus } from "@/utils/eventBus"; -import { uniqeResource } from "@/utils/calUnitTools"; +import { uniqeResource, subTj } from "@/utils/calUnitTools"; import { debounce } from 'lodash-es' import { duplicateResource, getExpireDate } from "@/utils/index.js"; import { isCommonUnit } from "@/utils/conTools"; +import moment from "moment"; export default { name: "GSP005", @@ -313,6 +314,7 @@ export default { label: 'template.gsp.GSP005.sywzmc', type: "input", subType: "input", + subDisabled: true, subKey: "sywzmcSub", fillType: "preFill", subFillType: "actFill", @@ -356,6 +358,7 @@ export default { rjmc: { label: 'template.gsp.GSP005.rjmc', type: "input", + disabled: true, fillType: "actFill", maxlength: 50, }, @@ -495,6 +498,7 @@ export default { label: 'template.gsp.GSP005.yrymc', type: "input", subType: "input", + subDisabled: true, subKey: "yrymcSub", fillType: "preFill", subFillType: "actFill", @@ -560,6 +564,7 @@ export default { rjmc: { label: 'template.gsp.GSP005.rjmc', type: "input", + disabled: true, fillType: "actFill", maxlength: 50, }, @@ -614,6 +619,64 @@ export default { } }, methods: { + //溶液开始配置 + ryKspz(zlIndex) { + this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].updateFormData('pzkssj', moment().format("YYYY-MM-DD HH:mm:ss")) + const rowData = this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].getFilledFormData() + let postData = { + bh: rowData.targetCode + rowData.targetCodeSn, + studySubjectId: this.formData.studySubjectId, + studyId: this.formData.studyId, + studyFormId: this.formData.id, + } + this.startConfigRequest(postData); + }, + //溶液结束配置 + ryJspz(zlIndex) { + this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].updateFormData('pzjssj', moment().format("YYYY-MM-DD HH:mm:ss")) + const rowData = this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].getFilledFormData() + let postData = { + mc: rowData.targetName, + bh: rowData.targetCode + rowData.targetCodeSn, + nd: rowData.targetActConcentration, + nddw: rowData.targetActConcentrationUnit, + kc: rowData.targetActVolume, + kcdw: rowData.targetActVolumeUnit, + studySubjectId: this.formData.studySubjectId, + studyId: this.formData.studyId, + studyFormId: this.formData.id, + } + this.configCompleteRequest(postData); + }, + //质量开始配置 + zlKspz(zlIndex) { + this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].updateFormData('pzkssj', moment().format("YYYY-MM-DD HH:mm:ss")) + const rowData = this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].getFilledFormData() + let postData = { + bh: rowData.targetCode + rowData.targetCodeSn, + studySubjectId: this.formData.studySubjectId, + studyId: this.formData.studyId, + studyFormId: this.formData.id, + } + this.startConfigRequest(postData); + }, + //质量结束配置 + zlJspz(zlIndex) { + this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].updateFormData('pzjssj', moment().format("YYYY-MM-DD HH:mm:ss")) + const rowData = this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].getFilledFormData() + let postData = { + mc: rowData.targetName, + bh: rowData.targetCode + rowData.targetCodeSn, + nd: rowData.targetActConcentration, + nddw: rowData.targetActConcentrationUnit, + kc: rowData.targetActVolume, + kcdw: rowData.targetActVolumeUnit, + studySubjectId: this.formData.studySubjectId, + studyId: this.formData.studyId, + studyFormId: this.formData.id, + } + this.configCompleteRequest(postData); + }, // 溶液 onTableBeforeReagentRySubmit(data, zlIndex, formZlConfig) { const { selectData, callback, key, formFields } = data; @@ -632,13 +695,13 @@ export default { this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].updateFormData('yrybhphSubType', data.selectInfo.selectType) this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].updateFormData('yrybhphSubKcdw', data.selectInfo.row.kcdw) this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].updateFormData('yrybhphSubNddw', data.selectInfo.row.nddw) - this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].updateFormData('yrymc', data.selectInfo.row.mc||'NA') + this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].updateFormData('yrymcSub', data.selectInfo.row.mc || 'NA') } if (data.key === 'rjbhphSub') { this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].updateFormData('rjbhphSubType', data.selectInfo.selectType) this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].updateFormData('rjbhphSubKcdw', data.selectInfo.row.kcdw) this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].updateFormData('rjbhphSubNddw', data.selectInfo.row.nddw) - this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].updateFormData('rjmc', data.selectInfo.row.mc||'NA') + this.$refs[`formRyConfigFormPackageRef_${zlIndex}`][0].updateFormData('rjmc', data.selectInfo.row.mc || 'NA') } }, // 质量 @@ -659,13 +722,13 @@ export default { this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].updateFormData('sywzbhphSubType', data.selectInfo.selectType) this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].updateFormData('sywzbhphSubKcdw', data.selectInfo.row.kcdw) this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].updateFormData('sywzbhphSubNddw', data.selectInfo.row.nddw) - this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].updateFormData('sywzmcSub', data.selectInfo.row.mc||'NA') + this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].updateFormData('sywzmcSub', data.selectInfo.row.mc || 'NA') } if (data.key === 'rjbhphSub') { this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].updateFormData('rjbhphSubType', data.selectInfo.selectType) this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].updateFormData('rjbhphSubKcdw', data.selectInfo.row.kcdw) this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].updateFormData('rjbhphSubNddw', data.selectInfo.row.nddw) - this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].updateFormData('rjmc', data.selectInfo.row.mc||'NA') + this.$refs[`formZlConfigFormPackageRef_${zlIndex}`][0].updateFormData('rjmc', data.selectInfo.row.mc || 'NA') } }, //新增质量 @@ -832,10 +895,45 @@ export default { yxzq: item.effectivePeriod, yxzqdw: item.effectivePeriodUnit, }) + //试验物质编号/批号 + tmpResource.push({ + mc: null, + bh: item.sywzbhphSub, + ph: null, + nd: null, + nddw: null, + ndz: null, + ly: null, + sxrq: null, + kc: null, + kcdw: null, + type: item.sywzbhphSubType, + syl: item.sywzyjclz, + syldw: item.sywzyjclzUnit, + yxzq: null, + yxzqdw: null, + }) + //溶剂编号/批号 + tmpResource.push({ + mc: null, + bh: item.rjbhphSub, + ph: null, + nd: null, + nddw: null, + ndz: null, + ly: null, + sxrq: null, + kc: null, + kcdw: null, + type: item.rjbhphSubType, + syl: item.rjsjtj, + syldw: item.rjsjtjUnit, + yxzq: null, + yxzqdw: null, + }) } } - //使用 - + let tableListRy = content.formRyConfigs if (tableListRy && tableListRy.length > 0) { for (let i = 0; i < tableListRy.length; i++) { @@ -858,10 +956,45 @@ export default { yxzq: item.effectivePeriod, yxzqdw: item.effectivePeriodUnit, }) + //源溶液编号/批号 + tmpResource.push({ + mc: null, + bh: item.yrybhphSub, + ph: null, + nd: null, + nddw: null, + ndz: null, + ly: null, + sxrq: null, + kc: null, + kcdw: null, + type: item.yrybhphSubType, + syl: item.yrysjtj, + syldw: item.yrysjtjUnit, + yxzq: null, + yxzqdw: null, + }) + //溶剂编号/批号 + tmpResource.push({ + mc: null, + bh: item.rjbhphSub, + ph: null, + nd: null, + nddw: null, + ndz: null, + ly: null, + sxrq: null, + kc: null, + kcdw: null, + type: item.rjbhphSubType, + syl: item.rjsjtj, + syldw: item.rjsjtjUnit, + yxzq: null, + yxzqdw: null, + }) } } - //使用 - + } //使用的试剂、仪器 const stepResource = this.getStepResource() From 91579824909cdd7bf75ca33288844ae013bd432a Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Fri, 6 Mar 2026 19:06:33 +0800 Subject: [PATCH 02/27] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86][=E6=9A=82=E5=AD=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Template/DecimalInput.vue | 44 +------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/src/components/Template/DecimalInput.vue b/src/components/Template/DecimalInput.vue index 90b5275..cc8e23a 100644 --- a/src/components/Template/DecimalInput.vue +++ b/src/components/Template/DecimalInput.vue @@ -44,16 +44,7 @@ export default { if (newVal === '' || newVal == null) { this.internalValue = ''; } else { - // 如果当前值是 "NA" 或 "20/30/40" 格式,保持不变 - if ((this.internalValue && this.internalValue.toUpperCase() === 'NA') || (this.internalValue && /^\d+(\/\d+)*$/.test(this.internalValue))) { - return; - } - // 检查是否为 "NA" 或其输入过程,或类似 "20/30/40" 的格式 - if (String(newVal).toUpperCase() === 'NA' || /^[Nn]?[Aa]?$/.test(String(newVal)) || /^\d+(\/\d*)*$/.test(String(newVal))) { - this.internalValue = String(newVal); - } else { - this.internalValue = this.handleDecimalDigits(String(newVal)); - } + this.internalValue = this.handleDecimalDigits(String(newVal)); } } }, @@ -65,27 +56,6 @@ export default { return; } - // 检查是否为 "NA" 或其输入过程 - if (val.toUpperCase() === 'NA' || /^[Nn]?[Aa]?$/.test(val)) { - this.internalValue = val; - this.$emit('input', val); - return; - } - - // 检查是否为 "20/30/40" 或其输入过程 - if (/^\d+(\/\d*)*$/.test(val)) { - this.internalValue = val; - this.$emit('input', val); - return; - } - - // 如果当前值是 "NA" 或 "20/30/40" 格式,不允许输入其他字符 - if ((this.internalValue && this.internalValue.toUpperCase() === 'NA') || (this.internalValue && /^\d+(\/\d+)*$/.test(this.internalValue))) { - // 保持当前值不变 - this.$emit('input', this.internalValue); - return; - } - // 1. 只保留数字、小数点、开头的负号 let cleaned = val .replace(/[^\d.-]/g, '') @@ -150,11 +120,6 @@ export default { const actVal = val || this.internalValue; let finalValue = actVal.trim(); - // 检查是否为 "NA" 或类似 "20/30/40" 的格式 - if (finalValue.toUpperCase() === 'NA' || /^\d+(\/\d+)+$/.test(finalValue)) { - return finalValue; - } - if (finalValue === '' || finalValue === '-') { this.internalValue = ''; this.$emit('input', ''); @@ -185,13 +150,6 @@ export default { }, handleBlur() { - // 检查是否为 "NA" 或类似 "20/30/40" 的格式 - if ((this.internalValue && this.internalValue.toUpperCase() === 'NA') || (this.internalValue && /^\d+(\/\d+)*$/.test(this.internalValue))) { - this.$emit('input', this.internalValue); - this.$emit('blur', this.internalValue); - return; - } - let formatted = this.handleDecimalDigits(this.internalValue); this.internalValue = formatted; // emit 数字类型(也可 emit 字符串,根据需求) From beb9e6e8c6c5720894642e4286e3cf6d34ff7ebb Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Fri, 6 Mar 2026 20:39:17 +0800 Subject: [PATCH 03/27] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86][=E6=9A=82=E5=AD=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Template/DecimalInput.vue | 285 ++++++++++++++++----- .../Template/mixins/formPackageMixins.js | 2 - 2 files changed, 218 insertions(+), 69 deletions(-) diff --git a/src/components/Template/DecimalInput.vue b/src/components/Template/DecimalInput.vue index cc8e23a..e5adbd9 100644 --- a/src/components/Template/DecimalInput.vue +++ b/src/components/Template/DecimalInput.vue @@ -35,20 +35,52 @@ export default { }, data() { return { - internalValue: this.value !== null && this.value !== undefined ? String(this.value) : '' + internalValue: this.value !== null && this.value !== undefined ? String(this.value) : '', + oldValue: null, + oldPattern: null, + patternRules: [ + { name: 'NA', pattern: /^NA$/i, inputPattern: /^N?A?$/i }, + { name: 'FRACTION', pattern: /^\d+(\/\d+)*$/, inputPattern: /^(\d+\/?)*$/ } + ] }; }, watch: { - value(newVal) { - // 外部值变化时同步到内部(但不做格式化,避免干扰用户输入) - if (newVal === '' || newVal == null) { - this.internalValue = ''; - } else { - this.internalValue = this.handleDecimalDigits(String(newVal)); - } + value: { + handler(newVal) { + if (newVal === '' || newVal == null) { + this.internalValue = ''; + this.oldValue = null; + this.oldPattern = null; + } else { + const strVal = String(newVal); + this.internalValue = strVal; + this.updateOldValue(strVal); + } + }, + immediate: true } }, methods: { + updateOldValue(val) { + for (const rule of this.patternRules) { + if (rule.pattern.test(val)) { + this.oldValue = val; + this.oldPattern = rule; + return true; + } + } + return false; + }, + + getMatchingRule(val) { + for (const rule of this.patternRules) { + if (rule.inputPattern.test(val)) { + return rule; + } + } + return null; + }, + handleInput(val) { if (val === '') { this.internalValue = ''; @@ -56,91 +88,142 @@ export default { return; } - // 1. 只保留数字、小数点、开头的负号 - let cleaned = val - .replace(/[^\d.-]/g, '') - .replace(/^(-)\1+/, '$1'); // 合并多个负号 - - // 2. 只保留第一个小数点 - const firstDotIndex = cleaned.indexOf('.'); - if (firstDotIndex !== -1) { - const before = cleaned.slice(0, firstDotIndex); - const after = cleaned.slice(firstDotIndex + 1).replace(/\./g, ''); - cleaned = before + '.' + after; - } - - // 3. 限制小数位数(仅当允许小数时) - if (this.decimalDigits > 0 && cleaned.includes('.')) { - const [intPart, decPart = ''] = cleaned.split('.'); - cleaned = intPart + '.' + decPart.slice(0, this.decimalDigits); - } else if (this.decimalDigits === 0) { - cleaned = cleaned.split('.')[0]; // 移除小数部分 - } - - // 4. 处理以 . 或 -. 开头 - if (cleaned === '.') cleaned = '0.'; - else if (cleaned === '-.') cleaned = '-0.'; - else if (cleaned.startsWith('.')) cleaned = '0' + cleaned; - else if (cleaned.startsWith('-.')) cleaned = '-0.' + cleaned.slice(2); - - // 5. 【关键】安全去除前导零,但保留单个 0 - if (cleaned.includes('.')) { - // 有小数点:处理整数部分 - const [int, dec] = cleaned.split('.'); - // 整数部分:-0012 → -12,00 → 0,0 → 0,-0 → 0(或保留 -0) - let newInt = int; - if (/^-?0+\d/.test(int)) { - newInt = int.replace(/^-?0+(\d)/, '$1'); - } else if (int === '' || int === '-') { - newInt = int + '0'; - } else if (int === '00' || /^-00+$/.test(int)) { - newInt = int.startsWith('-') ? '-0' : '0'; + const upperVal = val.toUpperCase(); + let cleaned = val; + let matchedRule = null; + if (this.oldPattern) { + // 检查是否是旧模式的延续(以oldValue开头) + if (val.startsWith(this.oldValue)) { + // 是旧模式的延续,检查是否符合inputPattern + if (this.oldPattern.inputPattern.test(val)) { + matchedRule = this.oldPattern; + cleaned = val; + } else { + // 不符合,但如果是FRACTION类型,尝试特殊处理 + if (this.oldPattern.name === 'FRACTION') { + cleaned = val.replace(/[^\d/]/g, ''); + const parts = cleaned.split('/'); + const validParts = []; + for (let i = 0; i < parts.length; i++) { + if (parts[i] !== '') { + validParts.push(parts[i]); + } + } + cleaned = validParts.join('/'); + matchedRule = this.oldPattern; + } else { + cleaned = this.oldValue || ''; + this.internalValue = cleaned; + return; + } + } + } else if (this.oldPattern.inputPattern.test(val)) { + // 不是延续,但符合inputPattern(可能是清空后重新输入) + matchedRule = this.oldPattern; + cleaned = val; + } else { + // 尝试匹配新规则 + matchedRule = this.getMatchingRule(val); + if (!matchedRule) { + cleaned = this.oldValue || ''; + this.internalValue = cleaned; + return; + } } - cleaned = newInt + '.' + dec; } else { - // 无小数点 - if (/^-?0+\d/.test(cleaned)) { - cleaned = cleaned.replace(/^-?0+(\d)/, '$1'); - } else if (cleaned === '00' || /^-00+$/.test(cleaned)) { - cleaned = cleaned.startsWith('-') ? '-0' : '0'; + matchedRule = this.getMatchingRule(val); + + if (matchedRule) { + if (matchedRule.name === 'FRACTION') { + cleaned = val.replace(/[^\d/]/g, ''); + const parts = cleaned.split('/'); + const validParts = []; + for (let i = 0; i < parts.length; i++) { + if (parts[i] !== '') { + validParts.push(parts[i]); + } + } + cleaned = validParts.join('/'); + } else { + cleaned = upperVal; + } + } else { + cleaned = val + .replace(/[^\d.-]/g, '') + .replace(/^(-)\1+/, '$1'); + + const firstDotIndex = cleaned.indexOf('.'); + if (firstDotIndex !== -1) { + const before = cleaned.slice(0, firstDotIndex); + const after = cleaned.slice(firstDotIndex + 1).replace(/\./g, ''); + cleaned = before + '.' + after; + } + + if (this.decimalDigits > 0 && cleaned.includes('.')) { + const [intPart, decPart = ''] = cleaned.split('.'); + cleaned = intPart + '.' + decPart.slice(0, this.decimalDigits); + } else if (this.decimalDigits === 0) { + cleaned = cleaned.split('.')[0]; + } + + if (cleaned === '.') cleaned = '0.'; + else if (cleaned === '-.') cleaned = '-0.'; + else if (cleaned.startsWith('.')) cleaned = '0' + cleaned; + else if (cleaned.startsWith('-.')) cleaned = '-0.' + cleaned.slice(2); + + if (cleaned.includes('.')) { + const [int, dec] = cleaned.split('.'); + let newInt = int; + if (/^-?0+\d/.test(int)) { + newInt = int.replace(/^-?0+(\d)/, '$1'); + } else if (int === '' || int === '-') { + newInt = int + '0'; + } else if (int === '00' || /^-00+$/.test(int)) { + newInt = int.startsWith('-') ? '-0' : '0'; + } + cleaned = newInt + '.' + dec; + } else { + if (/^-?0+\d/.test(cleaned)) { + cleaned = cleaned.replace(/^-?0+(\d)/, '$1'); + } else if (cleaned === '00' || /^-00+$/.test(cleaned)) { + cleaned = cleaned.startsWith('-') ? '-0' : '0'; + } + } } - // 注意:不要把单独的 '0' 变成 '' } + this.internalValue = cleaned; - // emit if (cleaned === '' || cleaned === '-') { this.$emit('input', cleaned === '-' ? '-' : ''); + } else if (matchedRule && matchedRule.name !== 'FRACTION') { + this.$emit('input', cleaned); + } else if (cleaned.includes('/')) { + this.$emit('input', cleaned); } else { const num = parseFloat(cleaned); this.$emit('input', isNaN(num) ? '' : num); } }, + handleDecimalDigits(val) { const actVal = val || this.internalValue; let finalValue = actVal.trim(); if (finalValue === '' || finalValue === '-') { - this.internalValue = ''; - this.$emit('input', ''); - return; + return ''; } const num = parseFloat(finalValue); if (isNaN(num)) { - this.internalValue = ''; - this.$emit('input', ''); - return; + return ''; } - // 只保留用户输入的有效小数位数,不强制补零 let formatted = String(num); - // 如果用户输入的是整数,直接显示整数 if (!finalValue.includes('.')) { formatted = String(Math.floor(num)); } else { - // 保留用户输入的小数位数,但不超过设定的最大值 const decPart = finalValue.split('.')[1]; const actualDecimalDigits = decPart.length; const displayDecimalDigits = Math.min(actualDecimalDigits, this.decimalDigits); @@ -150,12 +233,80 @@ export default { }, handleBlur() { - let formatted = this.handleDecimalDigits(this.internalValue); + const val = this.internalValue.trim(); + + if (val === '') { + this.oldValue = null; + this.oldPattern = null; + this.$emit('input', ''); + this.$emit('blur', ''); + return; + } + + const upperVal = val.toUpperCase(); + + for (const rule of this.patternRules) { + if (rule.pattern.test(upperVal)) { + this.oldValue = upperVal; + this.oldPattern = rule; + this.internalValue = upperVal; + this.$emit('input', upperVal); + this.$emit('blur', upperVal); + return; + } + } + + if (val.includes('/')) { + const parts = val.split('/'); + const validParts = parts.filter(part => part !== ''); + + if (validParts.length === 0) { + if (this.oldValue) { + this.internalValue = this.oldValue; + this.$emit('input', this.oldValue); + this.$emit('blur', this.oldValue); + } else { + this.internalValue = ''; + this.$emit('input', ''); + this.$emit('blur', ''); + } + return; + } + + if (validParts.length === 1) { + const result = validParts[0]; + this.oldValue = result; + this.oldPattern = this.patternRules.find(r => r.name === 'FRACTION'); + this.internalValue = result; + this.$emit('input', result); + this.$emit('blur', result); + return; + } + + const formattedValue = validParts.join('/'); + this.oldValue = formattedValue; + this.oldPattern = this.patternRules.find(r => r.name === 'FRACTION'); + this.internalValue = formattedValue; + this.$emit('input', formattedValue); + this.$emit('blur', formattedValue); + return; + } + + if (this.oldValue && this.oldPattern) { + const partialMatch = this.oldPattern.inputPattern && this.oldPattern.inputPattern.test(val); + if (!partialMatch) { + this.internalValue = this.oldValue; + this.$emit('input', this.oldValue); + this.$emit('blur', this.oldValue); + return; + } + } + + let formatted = this.handleDecimalDigits(val); this.internalValue = formatted; - // emit 数字类型(也可 emit 字符串,根据需求) this.$emit('input', parseFloat(formatted)); this.$emit('blur', parseFloat(formatted)); } } }; - \ No newline at end of file + diff --git a/src/components/Template/mixins/formPackageMixins.js b/src/components/Template/mixins/formPackageMixins.js index 2ed467e..77f44da 100644 --- a/src/components/Template/mixins/formPackageMixins.js +++ b/src/components/Template/mixins/formPackageMixins.js @@ -67,7 +67,6 @@ export default { }, getRegentItem(item, fieldCode = "type") { const type = item[fieldCode]; - console.log(item, "type") return { label: "", type, @@ -391,7 +390,6 @@ export default { const {otherCode} = o; const otherValue = formFields[otherCode] || ""; const isShow = this.isShowOtherByRadioAndOther(radioValue,o) - console.log(o,radioValue,isShow,otherValue,"radioValue") if(isShow&&!otherValue){ errors.push({ field: key, From dabb8fcdce7b8704e3040546a507eaf718275d0f Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Fri, 6 Mar 2026 21:00:36 +0800 Subject: [PATCH 04/27] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86][=E6=9A=82=E5=AD=98]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Template/CustomTable.vue | 19 +++------ src/components/Template/Step.vue | 74 +++++++++++++++++++++------------ src/utils/index.js | 13 +++++- 3 files changed, 64 insertions(+), 42 deletions(-) diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index 76281a3..c5567c8 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -203,7 +203,7 @@ import HandleFormItem from "./HandleFormItem.vue"; import { isEqual } from "@/utils/index.js"; import { isShowOther } from "@/utils/formPackageCommon.js"; import { EventBus } from "@/utils/eventBus"; -import { getuuid } from "@/utils/index.js"; +import { getuuid,justUpdateFilledFormData } from "@/utils/index.js"; import { isRegent } from "@/utils/index.js"; import { isValueEmpty } from '@/utils/index.js'; @@ -322,7 +322,7 @@ export default { onDeleteCheckboxTag(rowIndex, col, tagIndex) { this.localDataSource[rowIndex][col.prop].splice(tagIndex, 1); this.$emit("onDeleteTag", rowIndex, col, tagIndex); - this.justUpdateFilledFormData(); + justUpdateFilledFormData(); }, onCheckboxTagChange(rowIndex, colIndex, col, value) { // value 现在是整个数组 @@ -349,7 +349,7 @@ export default { error.field === col.prop) ); this.$emit("onCheckboxChange", rowIndex, col, value); - this.justUpdateFilledFormData(); + justUpdateFilledFormData(); }, handleClickButton(e, data, key, rowIndex, colIndex) { this.$emit("clickButton", key, rowIndex, colIndex, e, data,) @@ -836,7 +836,7 @@ export default { this.localDataSource[rowIndex] = { ...this.localDataSource[rowIndex], ...data }; this.localDataSource = [...this.localDataSource]; this.checkCompareToOnDataLoad(); - this.justUpdateFilledFormData(); + justUpdateFilledFormData(); }, // 比较newData和oldData的值是否相等,只要有一对不相等就返回false compareOldAndCurrentFormFields(newData, oldData) { @@ -852,15 +852,6 @@ export default { return true; }, - // 只是更新已填写的表单数据,不触发校验 - justUpdateFilledFormData() { - const params = { - type: "fieldChanged", - newRecord: null, - resourceList: null, - } - EventBus.$emit('onModifyRecord', params,) - }, // 处理全选 handleCheckAllChange(val) { this.localDataSource.forEach(row => { @@ -898,7 +889,7 @@ export default { targetDiluentVolumePrecision: 3,//小数点精度默认为3 targetStartSolutionVolumePrecision: 3,//小数点精度默认为3 }); - this.justUpdateFilledFormData() + justUpdateFilledFormData() }, // 添加行 diff --git a/src/components/Template/Step.vue b/src/components/Template/Step.vue index 34b75cf..5bcf70a 100644 --- a/src/components/Template/Step.vue +++ b/src/components/Template/Step.vue @@ -2,36 +2,36 @@
添加步骤
-
- - -
- {{ index + 1 }} - - - - - - -
- - - + +
+
+ + {{ index + 1 }} + + + + +
+ + + +
-
+
+ \ No newline at end of file diff --git a/src/views/business/comps/template/formConfig/PCRTableConfig.js b/src/views/business/comps/template/formConfig/PCRTableConfig.js index 8dacff8..51e3074 100644 --- a/src/views/business/comps/template/formConfig/PCRTableConfig.js +++ b/src/views/business/comps/template/formConfig/PCRTableConfig.js @@ -758,6 +758,107 @@ export const getPCR007Config = ($this) => { ] } + +// PCR008 +export const getPCR008Config = ($this) => { + return [ + { + label: 'template.pcr.pcr008.ypmc', + prop: 'ypmc', + width: 280, + bodyType: 'input', + fillType: 'preFill', + otherCode: 'bhOther', + bodyFillType: 'preFill', + }, + { + label: 'template.pcr.pcr008.cjgz', + prop: 'cjgz', + width: 280, + showWidth: 180, + fillType: 'preFill', + headerSelectKey: 'cjgzUnit', + headerOptions: $this.getDictOptions('business_tjdw'), + bodyType: 'inputNumber', + bodyFillType: 'preFill', + bodyMaxlength: 10, + }, + { + label: 'template.pcr.pcr008.lzzcz', + prop: 'lzzcz', + width: 280, + showWidth: 180, + fillType: 'preFill', + headerSelectKey: 'lzzczUnit', + headerOptions: $this.getDictOptions('business_tjdw'), + bodyType: 'inputNumber', + bodyFillType: 'actFill', + bodyMaxlength: 10, + bodySubType: 'inputNumber', + bodyFillType: 'actFill', + bodySubType: 'button', + bodySubButtonName: 'form.hqz', + }, + { + label: 'template.pcr.pcr008.zzzl', + prop: 'zzzl', + width: 280, + showWidth: 180, + fillType: 'preFill', + headerSelectKey: 'zzzlUnit', + headerOptions: $this.getDictOptions('business_tjdw'), + bodyType: 'inputNumber', + bodyFillType: 'actFill', + bodyMaxlength: 10, + bodySubType: 'inputNumber', + bodySubKey: 'targetStartSolutionVolumePrecision', + bodySubFillType: 'preFill', + showBodySub: $this.fillType === 'preFill', + bodyPrecisionKey: 'targetStartSolutionVolumePrecision', + bodyMaxlength: 10, + bodyDisabled: $this.fillType === 'preFill', + bodySubPlaceholder: 'template.common.xswsPlaceholder', + headerSelectTo:"actStartSolutionVolumeUnit", + }, + { + label: 'template.pcr.pcr008.ysyjrybjrl', + prop: 'ysyjrybjrl', + width: 280, + showWidth: 180, + fillType: 'preFill', + headerSelectKey: 'ysyjrybjrlUnit', + headerOptions: $this.getDictOptions('business_tjdw'), + bodyType: 'inputNumber', + bodyFillType: 'actFill', + bodyMaxlength: 10, + bodySubType: 'inputNumber', + bodySubKey: 'targetDiluentVolumePrecision', + bodySubFillType: 'preFill', + showBodySub: $this.fillType === 'preFill', + bodyPrecisionKey: 'targetDiluentVolumePrecision', + bodyMaxlength: 10, + bodyDisabled: $this.fillType === 'preFill', + bodySubPlaceholder: 'template.common.xswsPlaceholder', + headerSelectTo:"actStartSolutionVolumeUnit", + }, + { + label: 'template.pcr.pcr008.sjyjrybjrl', + prop: 'sjyjrybjrl', + width: 280, + showWidth: 180, + fillType: 'preFill', + headerSelectKey: 'sjyjrybjrlUnit', + headerOptions: $this.getDictOptions('business_tjdw'), + bodyType: 'inputNumber', + bodyFillType: 'actFill', + copyFrom: 'ysyjrybjrl', //复制哪个字段 + bodyMaxlength: 10, + } + ] +} + + + // PCR009 export const getPCR009Config = ($this) => { return [ From 4954f52071331ce2b4fae6145a87968b3de70c63 Mon Sep 17 00:00:00 2001 From: ouqian <13568766802@163.com> Date: Sun, 8 Mar 2026 17:20:31 +0800 Subject: [PATCH 17/27] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86][DL014~DL015=E5=AE=8C=E5=96=84]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lang/en/template/dl.js | 10 +- src/lang/zh/template/dl.js | 10 +- .../business/comps/template/comps/dl/DL014.vue | 246 ++++++++++------- .../business/comps/template/comps/dl/DL015.vue | 296 ++++++++++++--------- 4 files changed, 339 insertions(+), 223 deletions(-) diff --git a/src/lang/en/template/dl.js b/src/lang/en/template/dl.js index 892c025..5d7650a 100644 --- a/src/lang/en/template/dl.js +++ b/src/lang/en/template/dl.js @@ -213,7 +213,15 @@ export default { }, dl015: { ...common, - hyqk: 'Medium Change Status' + hyqk: 'Medium Change Status', + jlzb: 'Dose Group', + xybh: 'Suspension Number', + hyqszqk: 'Growth Before Medium Change', + hyqcdjqk: 'Precipitation Before Medium Change', + hyqqtqk: 'Other Conditions Before Medium Change', + qqpyy: 'Discard Culture Medium', + pbsxd: 'PBS Wash', + pyybrl: 'Culture Medium Volume Added (ul)' }, dl016: { xbxx:'细胞信息', diff --git a/src/lang/zh/template/dl.js b/src/lang/zh/template/dl.js index 2819a16..8a56b24 100644 --- a/src/lang/zh/template/dl.js +++ b/src/lang/zh/template/dl.js @@ -214,7 +214,15 @@ export default { }, dl015: { ...common, - hyqk: '换液情况' + hyqk: '换液情况', + jlzb: '剂量组别', + xybh: '悬液编号', + hyqszqk: '换液前生长情况', + hyqcdjqk: '换液前沉淀情况', + hyqqtqk: '换液前其他情况', + qqpyy: '倾去培养液', + pbsxd: 'PBS洗涤', + pyybrl: '培养液补入量(ul)' }, dl016: { xbxx:'细胞信息', diff --git a/src/views/business/comps/template/comps/dl/DL014.vue b/src/views/business/comps/template/comps/dl/DL014.vue index 77731e6..5abe068 100644 --- a/src/views/business/comps/template/comps/dl/DL014.vue +++ b/src/views/business/comps/template/comps/dl/DL014.vue @@ -16,43 +16,8 @@ :formData="formData" /> - - - - - - - - - + + item.yqbh) + .map(item => ({ + bh: item.yqbh, + mc: item.yqmc, + xh: item.yqxh + })) + + // 从剂量组表格中提取试剂资源(如果有 S9混合液编号或细胞编号) + const jlzData = this.$refs.jlzTableRef?.getFilledFormData() + const jlzList = jlzData?.stepTableFormData || [] + + const sjResourceFromJlz = [] + jlzList.forEach(item => { + // 如果有细胞编号,添加到试剂资源 + if (item.xybh) { + sjResourceFromJlz.push({ + bh: item.xybh, + type: 'cell' + }) + } + }) + + this.resourceTmp = sjResourceFromJlz + return this.resourceTmp }, onRegentSubmit(e) { @@ -524,7 +590,7 @@ export default { const params = { yqmc: row.mc, yqxh: row.xh, - xccsjzjdrq: row.jzrq + jzrq: row.jzrq } this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) } @@ -544,12 +610,12 @@ export default { // 获取剂量组总数 const jlzInfoData = this.$refs[refConf.jlzInfo]?.getFilledFormData() const jlzzs = jlzInfoData?.jlzzs - + if (!jlzzs || jlzzs <= 0) { this.$message.warning('请先输入剂量组总数') return } - + // 生成剂量组名称表格数据 const newJlzmcRows = [] for (let i = 0; i < jlzzs; i++) { @@ -557,10 +623,10 @@ export default { jlzzmc: '' }) } - + // 直接修改 formData,CustomTable 会自动响应 this.$set(this.formData, 'jlzmcTableData', newJlzmcRows) - + this.$message.success(`已生成 ${jlzzs} 个剂量组名称`) } }, @@ -569,35 +635,37 @@ export default { // 获取平行瓶数 const jlzInfoData = this.$refs[refConf.jlzInfo]?.getFilledFormData() const pxpb = jlzInfoData?.pxpb - + if (!pxpb || pxpb <= 0) { this.$message.warning('请先输入平行瓶数') return } - + // 从 CustomTable ref 获取最新的剂量组名称列表数据 const jlzmcTableData = this.$refs[refConf.jlzmcTable]?.getFilledFormData() const jlzmcList = jlzmcTableData?.stepTableFormData || [] - + if (jlzmcList.length === 0) { this.$message.warning('请先设置剂量组名称') return } - + // 检查是否所有剂量组名称都已填写 - const emptyNames = jlzmcList.filter(item => !item.jlzzmc || item.jlzzmc.trim() === '') + const emptyNames = jlzmcList.filter( + (item) => !item.jlzzmc || item.jlzzmc.trim() === '' + ) if (emptyNames.length > 0) { this.$message.warning('请填写所有剂量组名称') return } - + // 生成剂量组列表数据 const newRows = [] - + // 遍历每个剂量组名称 jlzmcList.forEach((jlzmcItem) => { const jlzzmc = jlzmcItem.jlzzmc - + // 为每个剂量组名称生成 pxpb 行数据 for (let i = 0; i < pxpb; i++) { newRows.push({ @@ -615,10 +683,10 @@ export default { }) } }) - + // 直接修改 formData,CustomTable 会自动响应 this.$set(this.formData, 'jlzTableData', newRows) - + this.$message.success(`已生成 ${newRows.length} 行剂量组数据`) }, // 保存 diff --git a/src/views/business/comps/template/comps/dl/DL015.vue b/src/views/business/comps/template/comps/dl/DL015.vue index 8199dda..a4b6f1e 100644 --- a/src/views/business/comps/template/comps/dl/DL015.vue +++ b/src/views/business/comps/template/comps/dl/DL015.vue @@ -16,55 +16,38 @@ :formData="formData" /> - - + + + + - - + @onRegentSubmit="onRegentSubmit" + /> - + + - - - - - - @@ -89,13 +72,11 @@ import LineLabel from '@/components/Template/LineLabel' import TableList from '@/components/Template/Table' import Step from '@/components/Template/Step' import templateMixin from '../../mixins/templateMixin' -import moment from 'moment' const refConf = { base: 'baseInfoRef', - sysj: 'sysjTableRef', - yqsy: 'yqsyTableRef', xbInfo: 'xbInfoRef', + hyqk: 'hyqkTableRef', step: 'stepRef', remark: 'remarkRef' } @@ -119,6 +100,13 @@ export default { } }, computed: { + // 换液情况表格数据 + hyqkFormData() { + return { + stepTableFormData: this.formData.hyqkTableData || [], + headerSelectFields: {} + } + }, // 备注表单配置 remarkConfig() { return [ @@ -174,12 +162,12 @@ export default { type: 'cellItem', label: 'template.dl.dl015.czsj', config: { - kssj: { + startDate: { label: 'template.dl.dl015.kssj', type: 'input', disabled: true }, - jssj: { + endDate: { label: 'template.dl.dl015.jssj', type: 'input', disabled: true @@ -188,98 +176,102 @@ export default { } ] }, - // 试验试剂信息 - sysjColumns() { + // 细胞信息表单配置 + xbInfoFormConfig() { return [ { - label: 'template.dl.dl015.sjmc', - prop: 'sjmc', - bodyType: 'input', - bodyFillType: 'actFill' - }, + type: 'cellItem', + config: { + qxbd: { + label: 'template.dl.dl015.qxbd', + type: 'qxbd', + qxbdType:'DL014', + fillType: 'actFill', + filledCodes: ['bdmc', 'bdbh'] + }, + bltj: { + label: 'template.dl.dl015.bltj', + type: 'select', + options: this.getDictOptions('business_dl_qsxjbltj'), + fillType: 'preFill', + otherCode: 'bltjOther' + } + } + } + ] + }, + // 换液情况表格列配置 + hyqkColumns() { + return [ { - label: 'template.dl.dl015.bh', - prop: 'bh', + label: 'template.dl.dl015.jlzb', + prop: 'jlzb', bodyType: 'input', - bodyFillType: 'actFill' + bodyFillType: 'actFill', + bodyDisabled: true, + disabled: true }, { - label: 'template.dl.dl015.ph', - prop: 'ph', + label: 'template.dl.dl015.xybh', + prop: 'xybh', bodyType: 'input', - bodyFillType: 'actFill' + bodyFillType: 'actFill', + bodyDisabled: true, + disabled: true }, { - label: 'template.dl.dl015.ndhlcd', - prop: 'ndhlcd', - bodyType: 'input', - bodyFillType: 'actFill' + label: 'template.dl.dl015.hyqszqk', + prop: 'hyqszqk', + bodyType: 'select', + bodyFillType: 'actFill', + bodyOptions: [ + { label: '良好', value: '良好' }, + { label: '中', value: '中' }, + { label: '差', value: '差' } + ] }, { - label: 'template.dl.dl015.ly', - prop: 'ly', - bodyType: 'input', - bodyFillType: 'actFill' + label: 'template.dl.dl015.hyqcdjqk', + prop: 'hyqcdjqk', + bodyType: 'select', + bodyFillType: 'actFill', + bodyOptions: [ + { label: '严重', value: '严重' }, + { label: '中等', value: '中等' }, + { label: '较少', value: '较少' }, + { label: '无', value: '无' } + ] }, { - label: 'template.dl.dl015.sxr', - prop: 'sxr', - bodyType: 'input', - bodyFillType: 'actFill' - } - ] - }, - // 仪器使用信息 - yqsyColumns() { - return [ - { - label: 'template.dl.dl015.yqmc', - prop: 'yqmc', - bodyType: 'input', - bodyFillType: 'actFill' + label: 'template.dl.dl015.hyqqtqk', + prop: 'hyqqtqk', + bodyType: 'select', + bodyFillType: 'actFill', + bodyOptions: [ + { label: '大量贴壁细胞变圆', value: '大量贴壁细胞变圆' }, + { label: '无', value: '无' } + ] }, { - label: 'template.dl.dl015.yqxh', - prop: 'yqxh', - bodyType: 'input', - bodyFillType: 'actFill' + label: 'template.dl.dl015.qqpyy', + prop: 'qqpyy', + bodyType: 'checkbox', + bodyFillType: 'actFill', + checkboxLabel: '' }, { - label: 'template.dl.dl015.yqbh', - prop: 'yqbh', - bodyType: 'yq', - bodyFillType: 'actFill' + label: 'template.dl.dl015.pbsxd', + prop: 'pbsxd', + bodyType: 'checkbox', + bodyFillType: 'actFill', + checkboxLabel: '' }, { - label: 'template.dl.dl015.xccsjzjdrq', - prop: 'xccsjzjdrq', - bodyType: 'input', - bodyDisabled: true, + label: 'template.dl.dl015.pyybrl', + prop: 'pyybrl', + bodyType: 'inputNumber', bodyFillType: 'actFill', - disabled: true - } - ] - }, - // 细胞信息表单配置 - xbInfoFormConfig() { - return [ - { - type: 'cellItem', - config: { - qxbd: { - label: 'template.dl.dl015.qxbd', - type: 'qxbd', - fillType: 'actFill', - filledCodes: ['bdmc', 'bdbh'] - }, - bltj: { - label: 'template.dl.dl015.bltj', - type: 'select', - options: this.getDictOptions('business_bltj'), - fillType: 'preFill', - otherCode: 'bltjOther' - } - } + bodyMaxlength: 10 } ] } @@ -297,7 +289,15 @@ export default { }, // 获取已填写的表单数据 getFilledFormData() { - return this.getFilledFormDataByRefs(refNames) + const baseData = this.getFilledFormDataByRefs(refNames) + + // 确保换液情况数据被正确保存 + const hyqkData = this.$refs[refConf.hyqk]?.getFilledFormData() + if (hyqkData) { + baseData.hyqkTableData = hyqkData.stepTableFormData || [] + } + + return baseData }, // 获取填写完成的表单数据 async getFormData() { @@ -308,32 +308,64 @@ export default { return await this.validFormFields(refNames) }, getResource() { - const sysjStepResource = this.$refs.sysjTableRef.getStepResource() - const yqsyStepResource = this.$refs.yqsyTableRef.getStepResource() const stepResource = this.$refs.stepRef.getStepResource() - // 使用的试剂、仪器 - this.resourceTmp = [ - ...(sysjStepResource.sjResource || []), - ...(yqsyStepResource.sjResource || []), - ...(stepResource.sjResource || []) - ] - this.yqResourceTmp = [ - ...(yqsyStepResource.yqResource || []), - ...(stepResource.yqResource || []) - ] + const hyqkData = this.$refs.hyqkTableRef?.getFilledFormData() + const hyqkList = hyqkData?.stepTableFormData || [] + + // 从操作步骤中提取试剂和仪器资源 + this.resourceTmp = stepResource.sjResource || [] + this.yqResourceTmp = stepResource.yqResource || [] + + // 从换液情况表格中提取悬液编号作为试剂资源 + const sjResourceFromHyqk = hyqkList + .filter(item => item.xybh) + .map(item => ({ + bh: item.xybh, + type: 'cell' + })) + + this.resourceTmp = [...this.resourceTmp, ...sjResourceFromHyqk] + return this.resourceTmp }, onRegentSubmit(e) { - const { selectInfo, key, rowIndex } = e + const { selectInfo, key } = e const { row } = selectInfo - if (key === 'yqbh') { - const params = { - yqmc: row.mc, - yqxh: row.xh, - xccsjzjdrq: row.jzrq + if (key === 'qxbd') { + try { + // 解析前序表单的内容 + const bdnr = JSON.parse(row.bdnr) + console.log('前序表单数据:', bdnr) + + // 获取剂量组列表数据 + const jlzTableData = bdnr.jlzTableData || [] + + if (jlzTableData.length === 0) { + this.$message.warning('前序表单中没有剂量组数据') + return + } + + // 从剂量组数据中提取剂量组别和悬液编号 + const hyqkData = jlzTableData.map(item => ({ + jlzb: item.jlzb || '', // 剂量组别 + xybh: item.xybh || '', // 悬液编号 + hyqszqk: '', // 换液前生长情况 + hyqcdjqk: '', // 换液前沉淀情况 + hyqqtqk: '', // 换液前其他情况 + qqpyy: '', // 倾去培养液 + pbsxd: '', // PBS洗涤 + pyybrl: '' // 培养液补入量 + })) + + // 使用 $set 更新 formData,触发 CustomTable 的响应式更新 + this.$set(this.formData, 'hyqkTableData', hyqkData) + + this.$message.success(`已从前序表单加载 ${hyqkData.length} 条剂量组数据`) + } catch (error) { + console.error('解析前序表单数据失败:', error) + this.$message.error('解析前序表单数据失败') } - this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) } }, // 保存 From 814072f0d256368cf150940c9ba7cf41b67b576c Mon Sep 17 00:00:00 2001 From: lslaiwy <1209768238@qq.com> Date: Sun, 8 Mar 2026 17:54:27 +0800 Subject: [PATCH 18/27] =?UTF-8?q?fix[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86]?= =?UTF-8?q?DL016.vue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/business/comps/template/comps/dl/DL016.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/business/comps/template/comps/dl/DL016.vue b/src/views/business/comps/template/comps/dl/DL016.vue index 8953cae..06abc10 100644 --- a/src/views/business/comps/template/comps/dl/DL016.vue +++ b/src/views/business/comps/template/comps/dl/DL016.vue @@ -12,14 +12,14 @@ From 44a5c1003c41786d7cbbdcac373790370aee7c18 Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Sun, 8 Mar 2026 18:15:08 +0800 Subject: [PATCH 19/27] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86][=E6=89=B9=E9=87=8F=E4=BF=AE=E6=94=B9step=E7=9A=84?= =?UTF-8?q?=E9=85=8D=E7=BD=AE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Template/HandleFormItem.vue | 6 ++++-- src/components/Template/mixins/formPackageMixins.js | 1 + src/views/business/comps/template/comps/pcr/PCR008.vue | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index 03b3a59..ebaffc4 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -631,9 +631,11 @@ export default { }; if (type === "mix") { params.mixType = true; - } else if (item.qxbdType) { + } + if (item.qxbdType) { params.qxbdType = item.qxbdType; - } else if (item.checkType) { + } + if (item.checkType) { params.checkType = item.checkType; } } diff --git a/src/components/Template/mixins/formPackageMixins.js b/src/components/Template/mixins/formPackageMixins.js index 77f44da..1abcb5f 100644 --- a/src/components/Template/mixins/formPackageMixins.js +++ b/src/components/Template/mixins/formPackageMixins.js @@ -67,6 +67,7 @@ export default { }, getRegentItem(item, fieldCode = "type") { const type = item[fieldCode]; + console.log(item, "type") return { label: "", type, diff --git a/src/views/business/comps/template/comps/pcr/PCR008.vue b/src/views/business/comps/template/comps/pcr/PCR008.vue index 495ca17..6a2dc86 100644 --- a/src/views/business/comps/template/comps/pcr/PCR008.vue +++ b/src/views/business/comps/template/comps/pcr/PCR008.vue @@ -177,7 +177,7 @@ export default { type: 'qxbd', fillType: 'preFill', qxbdType: 'PCR007', - checkType: 'checkBox', + checkType: 'checkbox', filledCodes: ['bdmc', 'bdbh'], }, yjry: { From 8ca6bea4f67e7fcbc64395ae33bef70f048b3030 Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Sun, 8 Mar 2026 18:51:57 +0800 Subject: [PATCH 20/27] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86][=E6=89=B9=E9=87=8F=E4=BF=AE=E6=94=B9step=E7=9A=84?= =?UTF-8?q?=E9=85=8D=E7=BD=AE]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Template/HandleFormItem.vue | 4 ++-- .../business/comps/template/comps/pcr/PCR008.vue | 5 ++++- .../template/dialog/SelectMixReagentDialog.vue | 21 +++++++++++++++++---- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index ebaffc4..4e4a368 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -591,8 +591,8 @@ export default { this.inputValue = data.selectedId; const { filledCodes = [] } = this.item; console.log(filledCodes, "filledCodes") - const { selectInfo, row } = data; - if (filledCodes.length > 0) { + const { selectInfo, row,checkType } = data; + if (filledCodes.length > 0 && checkType !=="checkbox") { this.inputValue = row[filledCodes[0]] + "(" + row[filledCodes[1]] + ")"; } this.selectRegentInfo = data; diff --git a/src/views/business/comps/template/comps/pcr/PCR008.vue b/src/views/business/comps/template/comps/pcr/PCR008.vue index 6a2dc86..e017cc0 100644 --- a/src/views/business/comps/template/comps/pcr/PCR008.vue +++ b/src/views/business/comps/template/comps/pcr/PCR008.vue @@ -15,7 +15,7 @@
+ :formConfig="stepFormConfig" @blur="onHandleBlur" :formData="formData" @onRegentSubmit="onRegentSubmit" />
{{ $t('form.delete') }} @@ -230,6 +230,9 @@ export default { this.onHandleTableBlur() }, methods: { + onRegentSubmit(data){ + console.log(data,"回调") + }, onClickDelete() { this.$modal.confirm(this.$t('form.confirmDelete')).then(() => { diff --git a/src/views/business/comps/template/dialog/SelectMixReagentDialog.vue b/src/views/business/comps/template/dialog/SelectMixReagentDialog.vue index 0e075c4..12aebcd 100644 --- a/src/views/business/comps/template/dialog/SelectMixReagentDialog.vue +++ b/src/views/business/comps/template/dialog/SelectMixReagentDialog.vue @@ -188,16 +188,29 @@ export default { ndz: (row.nd||"")+(row.nddw||""), type: Number(this.selectType), } - if(this.qxbdType && row.templateSn !== this.qxbdType){ - this.$message.error(`请选择正确前序表单`); - return + const {qxbdType,checkType} = this; + if(qxbdType){ + if(checkType === "radio"&& row.templateSn !== qxbdType){ + this.$message.error(`请选择正确前序表单`); + return + } + if(checkType === "checkbox" ){ + const isAllType = row.every((item)=>item.templateSn === qxbdType) + if(!isAllType){ + this.$message.error(`请选择正确前序表单`); + return + } + } + } this.$emit('submit', selectedValue, row); - let callbackData = { selectInfo, uuid: this.uuid, selectedId: selectedValue, row,selectType:this.selectType }; + let callbackData = { selectInfo, uuid: this.uuid, selectedId: selectedValue, row,selectType:this.selectType,checkType }; if(this.checkType === "checkbox"){ callbackData = { uuid: this.uuid, selectedRows: row, + selectedId:row.map((item)=>item.bdbh).join(","), + checkType } } // 触发eventBus事件 From 7f0c3e43653bd660acc66bd6960cde5362d8deaf Mon Sep 17 00:00:00 2001 From: ouqian <13568766802@163.com> Date: Sun, 8 Mar 2026 21:07:19 +0800 Subject: [PATCH 21/27] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86][DL014=E5=A2=9E=E5=8A=A0=E6=B5=81=E7=A8=8B=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/comps/template/comps/dl/DL007.vue | 29 +++- .../business/comps/template/comps/dl/DL008.vue | 1 + .../business/comps/template/comps/dl/DL009.vue | 7 +- .../business/comps/template/comps/dl/DL014.vue | 148 ++++++++++++++++++--- .../business/comps/template/comps/dl/DL015.vue | 4 + 5 files changed, 160 insertions(+), 29 deletions(-) diff --git a/src/views/business/comps/template/comps/dl/DL007.vue b/src/views/business/comps/template/comps/dl/DL007.vue index 39f6dfd..2e12a9b 100644 --- a/src/views/business/comps/template/comps/dl/DL007.vue +++ b/src/views/business/comps/template/comps/dl/DL007.vue @@ -209,6 +209,7 @@ export default { qxbd: { label: 'template.dl.dl007.qxbd', type: 'qxbd', + qxbdType: 'DL006', fillType: 'actFill', filledCodes: ['bdmc', 'bdbh'] }, @@ -264,10 +265,18 @@ export default { return await this.validFormFields(refNames) }, getResource() { - const stepResource = this.$refs.yqsyTableRef.getStepResource() - // 使用的试剂、仪器 - this.resourceTmp = stepResource.sjResource || [] - this.yqResourceTmp = stepResource.yqResource || [] + const yqsyData = this.$refs.yqsyTableRef?.getFilledFormData() + const yqsyList = yqsyData?.stepTableFormData || [] + + // 从仪器使用信息表格中提取仪器资源 + this.yqResourceTmp = yqsyList + .filter((item) => item.yqbh) + .map((item) => ({ + bh: item.yqbh, + type: 'yq' + })) + + this.resourceTmp = [] return this.resourceTmp }, onRegentSubmit(e) { @@ -283,7 +292,17 @@ export default { this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) } if (key === 'qxbd') { - this.$refs.czInfoRef.updateFormData('pykssj', row.startDate) + try { + const bdnr = JSON.parse(row.bdnr) + if (bdnr.startDate) { + const formattedDate = moment(bdnr.startDate).format( + 'YYYY/MM/DD HH:mm' + ) + this.$refs.czInfoRef.updateFormData('pykssj', formattedDate) + } + } catch (error) { + console.error('解析前序表单数据失败:', error) + } } }, // 保存 diff --git a/src/views/business/comps/template/comps/dl/DL008.vue b/src/views/business/comps/template/comps/dl/DL008.vue index c8a8972..a75927c 100644 --- a/src/views/business/comps/template/comps/dl/DL008.vue +++ b/src/views/business/comps/template/comps/dl/DL008.vue @@ -220,6 +220,7 @@ export default { prop: 'jlzb', bodyType: 'input', bodyFillType: 'actFill', + disabled: true, width: 100 }, { diff --git a/src/views/business/comps/template/comps/dl/DL009.vue b/src/views/business/comps/template/comps/dl/DL009.vue index da5400b..6cea609 100644 --- a/src/views/business/comps/template/comps/dl/DL009.vue +++ b/src/views/business/comps/template/comps/dl/DL009.vue @@ -198,16 +198,15 @@ export default { { type: 'cellItem', config: { - kssj: { + startDate: { label: 'template.dl.dl009.kssj', type: 'input', disabled: true }, - jssj: { + endDate: { label: 'template.dl.dl009.jssj', type: 'input', - fillType: 'actFill', - maxlength: 200 + disabled: true } } } diff --git a/src/views/business/comps/template/comps/dl/DL014.vue b/src/views/business/comps/template/comps/dl/DL014.vue index 5abe068..85152c2 100644 --- a/src/views/business/comps/template/comps/dl/DL014.vue +++ b/src/views/business/comps/template/comps/dl/DL014.vue @@ -57,6 +57,7 @@ :formData="formData" @select="onSftjs9Change" @clickButton="handleJlzzsButton" + @blur="onJlzInfoBlur" /> @@ -67,6 +68,7 @@ :showAddRow="false" :formData="jlzmcTableFormData" :prefixKey="`jlzmcTable`" + @blur="onJlzmcTableBlur" > @@ -321,14 +323,20 @@ export default { } // 添加剂量组总数字段 - firstStepConfig.jlzzs = { + const jlzzsConfig = { label: 'template.dl.dl014.jlzzs', type: 'inputNumber', - fillType: 'preFill', - subType: 'button', - subKey: 'jlzzsButton', - buttonName: 'template.dl.dl014.qrButton' + fillType: 'preFill' } + + // 只在 preFill 模式下显示确认按钮 + if (this.fillType === 'preFill') { + jlzzsConfig.subType = 'button' + jlzzsConfig.subKey = 'jlzzsButton' + jlzzsConfig.buttonName = 'template.dl.dl014.qrButton' + } + + firstStepConfig.jlzzs = jlzzsConfig return [ { @@ -477,7 +485,9 @@ export default { return { formData: {}, refConf, - isSftjs9Yes: false // 是否添加S9 + isSftjs9Yes: false, // 是否添加S9 + oldJlzzs: null, // 存储旧的剂量组总数 + oldPxpb: null // 存储旧的平行瓶数 } }, mounted() { @@ -486,6 +496,16 @@ export default { this.isSftjs9Yes = this.formData.sftjs9 === '是' || this.formData.sftjs9 === 'Yes' } + + // 初始化剂量组总数的旧值 + if (this.formData.jlzzs) { + this.oldJlzzs = this.formData.jlzzs + } + + // 初始化平行瓶数的旧值 + if (this.formData.pxpb) { + this.oldPxpb = this.formData.pxpb + } }, methods: { // 删除表格行 @@ -533,6 +553,23 @@ export default { return false } + // 额外校验:检查剂量组名称表格和剂量组列表是否为空 + const jlzmcTableData = this.$refs[refConf.jlzmcTable]?.getFilledFormData() + const jlzmcList = jlzmcTableData?.stepTableFormData || [] + + if (jlzmcList.length === 0) { + this.$message.warning('请先生成剂量组名称') + return false + } + + const jlzTableData = this.$refs[refConf.jlzTable]?.getFilledFormData() + const jlzList = jlzTableData?.stepTableFormData || [] + + if (jlzList.length === 0) { + this.$message.warning('请先生成剂量组列表数据') + return false + } + return this.getFilledFormData() }, // 只做校验 @@ -547,7 +584,29 @@ export default { refConf.remark ] - return await this.validFormFields(refsToValidate) + const validFlag = await this.validFormFields(refsToValidate) + if (!validFlag) { + return false + } + + // 额外校验:检查剂量组名称表格和剂量组列表是否为空 + const jlzmcTableData = this.$refs[refConf.jlzmcTable]?.getFilledFormData() + const jlzmcList = jlzmcTableData?.stepTableFormData || [] + + if (jlzmcList.length === 0) { + this.$message.warning('请先生成剂量组名称') + return false + } + + const jlzTableData = this.$refs[refConf.jlzTable]?.getFilledFormData() + const jlzList = jlzTableData?.stepTableFormData || [] + + if (jlzList.length === 0) { + this.$message.warning('请先生成剂量组列表数据') + return false + } + + return true }, getResource() { // 从仪器使用信息表格中提取仪器资源 @@ -603,6 +662,55 @@ export default { this.isSftjs9Yes = value === '是' || value === 'Yes' } }, + // 处理剂量组配制信息的 blur 事件 + onJlzInfoBlur(e) { + const { key, value } = e + + // 当剂量组总数改变时,清空剂量组名称表格数据和剂量组列表数据 + if (key === 'jlzzs') { + // 检查值是否真的改变了 + if (this.oldJlzzs !== null && this.oldJlzzs !== value) { + // 清空剂量组名称表格数据 + this.$set(this.formData, 'jlzmcTableData', []) + // 同时清空剂量组列表数据 + this.$set(this.formData, 'jlzTableData', []) + + this.$message.info('剂量组总数已改变,已清空剂量组名称和剂量组列表数据') + } + + // 更新旧值 + this.oldJlzzs = value + } + + // 当平行瓶数改变时,清空剂量组列表数据 + if (key === 'pxpb') { + // 检查值是否真的改变了 + if (this.oldPxpb !== null && this.oldPxpb !== value) { + // 清空剂量组列表数据 + this.$set(this.formData, 'jlzTableData', []) + + this.$message.info('平行瓶数已改变,已清空剂量组列表数据') + } + + // 更新旧值 + this.oldPxpb = value + } + }, + // 处理剂量组名称表格的 blur 事件 + onJlzmcTableBlur(e) { + const { colKey } = e + + // 当剂量组名称字段改变时,清空剂量组列表数据 + if (colKey === 'jlzzmc') { + // 检查剂量组列表是否有数据 + const jlzTableData = this.formData.jlzTableData || [] + if (jlzTableData.length > 0) { + // 清空剂量组列表数据 + this.$set(this.formData, 'jlzTableData', []) + this.$message.info('剂量组名称已改变,已清空剂量组列表数据') + } + } + }, // 处理剂量组总数确认按钮 handleJlzzsButton(item) { const { subKey } = item || {} @@ -611,8 +719,9 @@ export default { const jlzInfoData = this.$refs[refConf.jlzInfo]?.getFilledFormData() const jlzzs = jlzInfoData?.jlzzs + // 校验剂量组总数是否有值且大于0 if (!jlzzs || jlzzs <= 0) { - this.$message.warning('请先输入剂量组总数') + this.$message.warning('请输入大于0的剂量组总数') return } @@ -631,8 +740,8 @@ export default { } }, // 处理剂量组名称完成按钮 - handleJlzmcComplete() { - // 获取平行瓶数 + async handleJlzmcComplete() { + // 1. 校验平行瓶数 const jlzInfoData = this.$refs[refConf.jlzInfo]?.getFilledFormData() const pxpb = jlzInfoData?.pxpb @@ -641,7 +750,15 @@ export default { return } - // 从 CustomTable ref 获取最新的剂量组名称列表数据 + // 2. 校验剂量组名称表格是否填写完成 + try { + await this.$refs[refConf.jlzmcTable]?.getFormData() + } catch (error) { + this.$message.warning('请完善剂量组名称信息') + return + } + + // 3. 获取剂量组名称列表数据 const jlzmcTableData = this.$refs[refConf.jlzmcTable]?.getFilledFormData() const jlzmcList = jlzmcTableData?.stepTableFormData || [] @@ -650,15 +767,6 @@ export default { return } - // 检查是否所有剂量组名称都已填写 - const emptyNames = jlzmcList.filter( - (item) => !item.jlzzmc || item.jlzzmc.trim() === '' - ) - if (emptyNames.length > 0) { - this.$message.warning('请填写所有剂量组名称') - return - } - // 生成剂量组列表数据 const newRows = [] diff --git a/src/views/business/comps/template/comps/dl/DL015.vue b/src/views/business/comps/template/comps/dl/DL015.vue index a4b6f1e..49623f4 100644 --- a/src/views/business/comps/template/comps/dl/DL015.vue +++ b/src/views/business/comps/template/comps/dl/DL015.vue @@ -342,6 +342,8 @@ export default { const jlzTableData = bdnr.jlzTableData || [] if (jlzTableData.length === 0) { + // 清空当前的换液情况列表数据 + this.$set(this.formData, 'hyqkTableData', []) this.$message.warning('前序表单中没有剂量组数据') return } @@ -364,6 +366,8 @@ export default { this.$message.success(`已从前序表单加载 ${hyqkData.length} 条剂量组数据`) } catch (error) { console.error('解析前序表单数据失败:', error) + // 解析失败时也清空当前的换液情况列表数据 + this.$set(this.formData, 'hyqkTableData', []) this.$message.error('解析前序表单数据失败') } } From 7ccfe003f3f1b06e406bb60b481db54effc6c467 Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Sun, 8 Mar 2026 21:45:49 +0800 Subject: [PATCH 22/27] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86][update]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Template/CustomTable.vue | 6 ++++++ src/views/business/comps/template/comps/pcr/PCR008.vue | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index 312cb37..e9013dd 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -927,6 +927,12 @@ export default { }); }, + deleteSelectedRows(rowsIndex){ + this.deleteRows(rowsIndex); + this.selectedRows = []; + this.isIndeterminate = false; + this.$emit('selectionChange', this.selectedRows); + }, // 更新数据方法,可在formData变更时调用,也可由父组件调用 updateDataSource(dataSource = []) { this.oldLocalDataSource = JSON.parse(JSON.stringify(this.localDataSource)); diff --git a/src/views/business/comps/template/comps/pcr/PCR008.vue b/src/views/business/comps/template/comps/pcr/PCR008.vue index e017cc0..df299c2 100644 --- a/src/views/business/comps/template/comps/pcr/PCR008.vue +++ b/src/views/business/comps/template/comps/pcr/PCR008.vue @@ -17,7 +17,7 @@
- {{ + {{ $t('form.delete') }}
@@ -236,7 +236,7 @@ export default { onClickDelete() { this.$modal.confirm(this.$t('form.confirmDelete')).then(() => { - this.$refs.stepTableRef.deleteRows(this.deleteRows) + this.$refs.stepTableRef.deleteSelectedRows(this.deleteRows) this.$refs.stepTableRef.justUpdateFilledFormData(); }).catch(() => { }); From 145e2cb5a831d841b84373a866c4613c8c1f8a55 Mon Sep 17 00:00:00 2001 From: lslaiwy <1209768238@qq.com> Date: Sun, 8 Mar 2026 22:16:59 +0800 Subject: [PATCH 23/27] =?UTF-8?q?fix[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86]?= =?UTF-8?q?DL016.vue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/comps/template/comps/dl/DL016.vue | 50 ++++++++++++++++++---- .../business/comps/template/comps/dl/DL024.vue | 4 +- 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/src/views/business/comps/template/comps/dl/DL016.vue b/src/views/business/comps/template/comps/dl/DL016.vue index 06abc10..a3151fc 100644 --- a/src/views/business/comps/template/comps/dl/DL016.vue +++ b/src/views/business/comps/template/comps/dl/DL016.vue @@ -21,7 +21,7 @@ fieldItemLabel="template.common.operationSteps" @blur="onHandleTableBlur" @beforeSaveRecord = "beforeSaveRecord" :showAddRow="false" :showOperation="false" - ref="qcxjjyqkTableRef" :columns="stepColumns" :formData="formData"> + ref="qcxjjyqkTableRef" :columns="stepColumns" :formData="qcxjjyqkFormData"> @@ -62,6 +62,13 @@ export default { }, }, computed: { + // 换液情况表格数据 + qcxjjyqkFormData() { + return { + stepTableFormData: this.formData.qcxjjyqkData || [], + headerSelectFields: {} + } + }, // 备注表单配置 remarkConig() { return [ @@ -136,7 +143,7 @@ export default { label: 'template.dl.dl016.qxbd', type: 'qxbd', fillType: 'actFill', - qxbdType:'DL017', + qxbdType:'DL014', filledCodes:['bdmc','bdbh'], }, bltj: { @@ -194,14 +201,41 @@ export default { onRegentSubmit(e) { const { selectInfo, key, rowIndex } = e const { row } = selectInfo - console.log('selectInfo==============',selectInfo) + console.log('selectInfo==============',selectInfo,key,rowIndex) if (key === 'qxbd') { - const params = { - jlzb: row.mc, - xybh: row.xh, - xccsjzjdrq: '' + try { + // 解析前序表单的内容 + const bdnr = JSON.parse(row.bdnr) + console.log('前序表单数据:', bdnr) + + // 获取剂量组列表数据 + const qcxjjyqkData = bdnr.qcxjjyqkData || [] + + // if (qcxjjyqkData.length === 0) { + // this.$message.warning('前序表单中没有剂量组数据') + // return + // } + + // 从剂量组数据中提取剂量组别和悬液编号 + const itemData = qcxjjyqkData.map(item => ({ + jlzb: item.jlzb || '', // 剂量组别 + xybh: item.xybh || '', // 悬液编号 + hyqszqk: '', // 换液前生长情况 + hyqcdjqk: '', // 换液前沉淀情况 + hyqqtqk: '', // 换液前其他情况 + qqpyy: '', // 倾去培养液 + pbsxd: '', // PBS洗涤 + pyybrl: '' // 培养液补入量 + })) + + // 使用 $set 更新 formData,触发 CustomTable 的响应式更新 + this.$set(this.formData, 'qcxjjyqkData', itemData) + + this.$message.success(`已从前序表单加载 ${itemData.length} 条剂量组数据`) + } catch (error) { + console.error('解析前序表单数据失败:', error) + this.$message.error('解析前序表单数据失败') } - this.$refs.qcxjjyqkTableRef.updateDataSourceByRowIndex(rowIndex, params) } }, //选择table header下拉框也要更新体积 diff --git a/src/views/business/comps/template/comps/dl/DL024.vue b/src/views/business/comps/template/comps/dl/DL024.vue index 4cb1b94..228d265 100644 --- a/src/views/business/comps/template/comps/dl/DL024.vue +++ b/src/views/business/comps/template/comps/dl/DL024.vue @@ -111,8 +111,8 @@ export default { label: 'template.dl.dl024.sydd', type: 'select', fillType: 'actFill', - options: this.getDictOptions('business_dl_xbmc'), - otherCode: 'xbmcOther', + options: this.getDictOptions('business_sydd'), + otherCode: 'syddOther', showOtherLabel:false }, } From f1c977e1348007b05cf70a05e8e26ba0c9c16fb9 Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Mon, 9 Mar 2026 09:36:41 +0800 Subject: [PATCH 24/27] =?UTF-8?q?feat:=20[=E6=A8=A1=E6=9D=BF=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20DL016=E5=8A=A0=E8=BD=BD=E5=89=8D=E5=BA=8F=E8=A1=A8?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/business/comps/template/comps/dl/DL016.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/views/business/comps/template/comps/dl/DL016.vue b/src/views/business/comps/template/comps/dl/DL016.vue index a3151fc..b25f678 100644 --- a/src/views/business/comps/template/comps/dl/DL016.vue +++ b/src/views/business/comps/template/comps/dl/DL016.vue @@ -167,7 +167,7 @@ export default { bodyType: "input", bodyFillType: "actFill", width: 180, - disabled:true + bodyDisabled: true, }, { label: "template.dl.dl016.xybh", @@ -176,7 +176,7 @@ export default { bodyType: "input", bodyFillType: "actFill", bodyMaxlength: 10, - disabled:true + bodyDisabled: true, }, { label: "template.dl.dl016.qsxjjrl", @@ -199,6 +199,7 @@ export default { }, methods: { onRegentSubmit(e) { + debugger const { selectInfo, key, rowIndex } = e const { row } = selectInfo console.log('selectInfo==============',selectInfo,key,rowIndex) @@ -209,7 +210,7 @@ export default { console.log('前序表单数据:', bdnr) // 获取剂量组列表数据 - const qcxjjyqkData = bdnr.qcxjjyqkData || [] + const qcxjjyqkData = bdnr.jlzTableData || [] // if (qcxjjyqkData.length === 0) { // this.$message.warning('前序表单中没有剂量组数据') @@ -227,6 +228,7 @@ export default { pbsxd: '', // PBS洗涤 pyybrl: '' // 培养液补入量 })) + debugger // 使用 $set 更新 formData,触发 CustomTable 的响应式更新 this.$set(this.formData, 'qcxjjyqkData', itemData) From 7e9be487710df1a9d8a1b4b4e43fbbc69f0fa264 Mon Sep 17 00:00:00 2001 From: memorylkf <312904636@qq.com> Date: Mon, 9 Mar 2026 09:56:46 +0800 Subject: [PATCH 25/27] =?UTF-8?q?feat:=20[=E8=AF=95=E9=AA=8C=E7=AE=A1?= =?UTF-8?q?=E7=90=86]=20SD=E4=B8=8D=E8=83=BD=E7=BB=99=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E4=BA=BA=E5=88=9B=E5=BB=BA=EF=BC=8C=E4=BB=85TFM=E5=8F=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=95=E9=AA=8C=E8=B4=9F=E8=B4=A3=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/business/study/comp/edit.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/views/business/study/comp/edit.vue b/src/views/business/study/comp/edit.vue index 39969d8..6af6032 100644 --- a/src/views/business/study/comp/edit.vue +++ b/src/views/business/study/comp/edit.vue @@ -26,7 +26,7 @@ - + @@ -42,6 +42,7 @@