From cb1a56e958737cc89c0890f2adab276ce8f786bd Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Fri, 13 Mar 2026 09:18:03 +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 --- .../business/comps/template/comps/dl/DL018.vue | 203 ++++++++++----------- 1 file changed, 101 insertions(+), 102 deletions(-) diff --git a/src/views/business/comps/template/comps/dl/DL018.vue b/src/views/business/comps/template/comps/dl/DL018.vue index 0353d8f..e1442fe 100644 --- a/src/views/business/comps/template/comps/dl/DL018.vue +++ b/src/views/business/comps/template/comps/dl/DL018.vue @@ -11,24 +11,22 @@ - + - - - - + @@ -56,10 +54,10 @@ import TableOpertaionDelete from "@/components/Template/operation/TableOpertaion export default { name: "DL018", - dicts: [ - 'business_dl_qsxjbltj','business_tjdw' - ], - components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable,TableOpertaionDelete }, + dicts: [ + 'business_dl_qsxjbltj', 'business_tjdw' + ], + components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete }, mixins: [templateMixin], props: { fillType: { @@ -68,13 +66,13 @@ export default { }, }, computed: { - // 表格数据 - tableFormData() { - return { - stepTableFormData: this.formData.stepTableFormData || [], - headerSelectFields: {} - } - }, + // 表格数据 + tableFormData() { + return { + stepTableFormData: this.formData.stepTableFormData || [], + headerSelectFields: {} + } + }, // 备注表单配置 remarkConig() { return [ @@ -139,7 +137,7 @@ export default { } ] }, - // 细胞信息 + // 细胞信息 swypyjInfoFormConfig() { return [ { @@ -150,16 +148,16 @@ export default { label: 'template.dl.dl018.qxbd', type: 'qxbd', fillType: 'actFill', - qxbdType:'DL014', - filledCodes:['bdmc','bdbh'], + qxbdType: 'DL014', + filledCodes: ['bdmc', 'bdbh'], }, - bltj: { + bltj: { label: 'template.dl.dl018.bltj', type: 'select', fillType: 'preFill', options: this.getDictOptions('business_dl_qsxjbltj'), otherCode: 'bltjOther', - showOtherLabel:false + showOtherLabel: false }, } } @@ -174,7 +172,7 @@ export default { width: 180, bodyType: "input", bodyFillType: "actFill", - disabled: true, + disabled: true, bodyDisabled: true, }, { @@ -183,7 +181,7 @@ export default { width: 180, bodyType: "input", bodyFillType: "actFill", - disabled: true, + disabled: true, bodyDisabled: true, }, { @@ -192,13 +190,14 @@ export default { width: 180, bodyType: "input", bodyFillType: "actFill", - // disabled: true, - // showOtherLabel: false, + // disabled: true, + // showOtherLabel: false, - bodySubType: 'button', - subodySubKeybKey: 'rsks', - bodySubButtonName: 'template.dl.dl018.ksButton', - showBodySub:this.fillType === "actFill", + bodySubType: 'button', + bodySubFillType: 'actFill', + subodySubKeybKey: 'rsks', + bodySubButtonName: 'template.dl.dl018.ksButton', + showBodySub: this.fillType === "actFill", }, { label: "template.dl.dl018.rsjs", @@ -206,13 +205,14 @@ export default { width: 180, bodyType: "input", bodyFillType: "actFill", - // disabled: true, - // showOtherLabel: false, + // disabled: true, + // showOtherLabel: false, - bodySubType: 'button', - subodySubKeybKey: 'rsjs', - bodySubButtonName: 'template.dl.dl018.jsButton', - showBodySub:this.fillType === "actFill", + bodySubType: 'button', + bodySubFillType: 'actFill', + subodySubKeybKey: 'rsjs', + bodySubButtonName: 'template.dl.dl018.jsButton', + showBodySub: this.fillType === "actFill", }, { label: "template.dl.dl018.zs", @@ -260,69 +260,69 @@ export default { mounted() { }, methods: { - onRegentSubmit(e) { - const { selectInfo, key, rowIndex } = e - const { row } = selectInfo - if (key === 'qxbd') { - try { - // 解析前序表单的内容 - const bdnr = JSON.parse(row.bdnr) - // 获取剂量组列表数据 - const stepTableFormData = bdnr.jlzTableData || [] + onRegentSubmit(e) { + const { selectInfo, key, rowIndex } = e + const { row } = selectInfo + if (key === 'qxbd') { + try { + // 解析前序表单的内容 + const bdnr = JSON.parse(row.bdnr) + // 获取剂量组列表数据 + const stepTableFormData = bdnr.jlzTableData || [] - if (stepTableFormData.length === 0) { - // 清空当前的换液情况列表数据 - this.$set(this.formData, 'stepTableFormData', []) - this.$message.warning('前序表单中没有剂量组数据') - return - } + if (stepTableFormData.length === 0) { + // 清空当前的换液情况列表数据 + this.$set(this.formData, 'stepTableFormData', []) + this.$message.warning('前序表单中没有剂量组数据') + return + } - // 从剂量组数据中提取剂量组别和悬液编号 - const itemData = stepTableFormData.map(item => ({ - jlzb: item.jlzb || '', // 剂量组别 - xybh: item.xybh || '', // 悬液编号 - rsks: '', // - rsjs: '', // - zs: '', // - ys: '', // - zy: '', // - yx: '', // - tj: '', // - })) - // 使用 $set 更新 formData,触发 CustomTable 的响应式更新 - this.$set(this.formData, 'stepTableFormData', itemData) + // 从剂量组数据中提取剂量组别和悬液编号 + const itemData = stepTableFormData.map(item => ({ + jlzb: item.jlzb || '', // 剂量组别 + xybh: item.xybh || '', // 悬液编号 + rsks: '', // + rsjs: '', // + zs: '', // + ys: '', // + zy: '', // + yx: '', // + tj: '', // + })) + // 使用 $set 更新 formData,触发 CustomTable 的响应式更新 + this.$set(this.formData, 'stepTableFormData', itemData) - this.$message.success(`已从前序表单加载 ${itemData.length} 条剂量组数据`) - } catch (error) { - this.$set(this.formData, 'stepTableFormData', []) - console.error('解析前序表单数据失败:', error) - this.$message.error('解析前序表单数据失败') - } - } - }, - //选择table header下拉框也要更新体积 - onHeaderSelectChange(data){ - const {key, headerSelectFields,dataSource=[]} = data; + this.$message.success(`已从前序表单加载 ${itemData.length} 条剂量组数据`) + } catch (error) { + this.$set(this.formData, 'stepTableFormData', []) + console.error('解析前序表单数据失败:', error) + this.$message.error('解析前序表单数据失败') + } + } + }, + //选择table header下拉框也要更新体积 + onHeaderSelectChange(data) { + const { key, headerSelectFields, dataSource = [] } = data; const keys = [ 'targetStartSolutionVolumeUnit', 'targetDiluentVolumeUnit', 'targetSolutionConcentrationUnit', 'targetSolutionVolumeUnit', ] - if(keys.includes(key)){ - const {targetStartSolution,subTargetStartSolution} = this.$refs.swypyjInfoRef?.getFilledFormData(); + if (keys.includes(key)) { + const { targetStartSolution, subTargetStartSolution } = this.$refs.swypyjInfoRef?.getFilledFormData(); const params = { subTargetStartSolution, headerSelectFields } - this.batchUpdateTargetStartSolutionVolume(dataSource,targetStartSolution,params) + this.batchUpdateTargetStartSolutionVolume(dataSource, targetStartSolution, params) } }, - beforeSaveRecord(data){ + beforeSaveRecord(data) { const formFields = this.$refs.swypyjInfoRef?.getFilledFormData(); - this.onCommonVerifyNdException(formFields,data); + this.onCommonVerifyNdException(formFields, data); }, - configComplete(val) { + configComplete(val) { const { rowData, headerSelectFields } = val; //计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积) const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit]) @@ -332,8 +332,8 @@ export default { nd: rowData.actSolutionConcentration,//实际目标溶液浓度 nddw: headerSelectFields.actSolutionConcentrationUnit, studySubjectId: this.formData.studySubjectId, - studyFormId:this.formData.id, - studyId:this.formData.studyId, + studyFormId: this.formData.id, + studyId: this.formData.studyId, kc: total, kcdw: unit, } @@ -342,30 +342,30 @@ export default { //获取已填写的表单数据 getFilledFormData() { - return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef", "stepTableRef", "stepRef","remarkRef"]) + return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef", "stepTableRef", "stepRef", "remarkRef"]) }, //获取填写完成的表单数据 async getFormData() { - let content = await this.validFormFields(["baseInfoRef", "swypyjInfoRef", "stepTableRef", "stepRef","remarkRef"]); + let content = await this.validFormFields(["baseInfoRef", "swypyjInfoRef", "stepTableRef", "stepRef", "remarkRef"]); return content; }, getResource() { //使用的试剂、仪器 const stepResource = this.$refs.stepRef.getStepResource() - const tableList = this.$refs.qcxjjyqkTableRef?.getFilledFormData()?.stepTableFormData || [] + const tableList = this.$refs.qcxjjyqkTableRef?.getFilledFormData()?.stepTableFormData || [] // 从操作步骤中提取试剂和仪器资源 this.resourceTmp = stepResource.sjResource || [] this.yqResourceTmp = stepResource.yqResource || [] - const tableFromHyqk = tableList - .filter(item => item.xybh) - .map(item => ({ - bh: item.xybh, - type: 'cell' - })) + const tableFromHyqk = tableList + .filter(item => item.xybh) + .map(item => ({ + bh: item.xybh, + type: 'cell' + })) - this.resourceTmp = [...this.resourceTmp, ...tableFromHyqk] + this.resourceTmp = [...this.resourceTmp, ...tableFromHyqk] return this.resourceTmp; }, //保存 @@ -383,5 +383,4 @@ export default { } }; - +