diff --git a/src/assets/styles/ruoyi.scss b/src/assets/styles/ruoyi.scss index c12876d..78bf408 100644 --- a/src/assets/styles/ruoyi.scss +++ b/src/assets/styles/ruoyi.scss @@ -174,7 +174,7 @@ .list-group-item { border-bottom: 1px solid #e7eaec; - border-top: 1px solid #e7eaec; + // border-top: 1px solid #e7eaec; margin-bottom: -1px; padding: 11px 0px; font-size: 13px; diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index 09cfc06..7ddf799 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -106,6 +106,14 @@ +
+ +
+ :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '') + (error ? ' form-error-border' : '') + (item.noBorder ? ' no-border' : '') + (item.layout === 'horizontal' ? ' flex' : '')">
\ No newline at end of file diff --git a/src/views/business/comps/template/comps/bl/BL001.vue b/src/views/business/comps/template/comps/bl/BL001.vue index 77bdb90..418b1bf 100644 --- a/src/views/business/comps/template/comps/bl/BL001.vue +++ b/src/views/business/comps/template/comps/bl/BL001.vue @@ -235,23 +235,26 @@ export default { label: 'template.dj.dj003.cyd', prop: "cyd", bodyType: 'input', - bodyFillType: 'actFill' + bodyFillType: 'actFill', + width: 180, }, { label: 'template.dj.dj003.dwbh', prop: "dwbh", bodyType: 'input', - bodyFillType: 'actFill' + bodyFillType: 'actFill', + width: 180, }, { label: 'template.dj.dj003.ypmc', prop: "ypmcTa", bodyType: 'checkboxTree', bodyFillType: 'actFill', - bodyOptions: [ - {value:1,label:'正常'}, - {value:0,label:'偏离'}, - ], + width: 280, + bodyLayout: 'horizontal',//水平 + optionCode:"ypmcTaOptions", + noBorder: true, + bodyOptions: this.ypmcTaOptions, }, { label: 'template.dj.dj003.cysj', @@ -268,13 +271,15 @@ export default { {value:1,label:'正常'}, {value:0,label:'偏离'}, ], - bodyFillType: 'actFill' + bodyFillType: 'actFill', + width: 180, }, { label: 'template.dj.dj003.yps', prop: "yps", bodyType: 'inputNumber', - bodyFillType: 'actFill' + bodyFillType: 'actFill', + width: 180, }, ] @@ -308,7 +313,14 @@ export default { data() { return { formData: {}, - refConf + refConf, + ypmcTaOptions: [], + } + }, + mounted() { + if(this.fillType === "actFill"){ + console.log(this.formData, "this.formData") + this.ypmcTaOptions = this.formData.ypmcTaOptions || [] } }, methods: { @@ -319,11 +331,25 @@ export default { // 获取已填写的表单数据 getFilledFormData() { - return this.getFilledFormDataByRefs(refNames) + const filledData = this.getFilledFormDataByRefs(refNames); + if(this.formData.ypmcTaOptions){ + filledData.ypmcTaOptions = this.formData.ypmcTaOptions + } + return filledData }, // 获取填写完成的表单数据 async getFormData() { - return await this.validFormFields(refNames) + const formData = await this.validFields(); + if(this.fillType === "preFill" && !!formData){ + const filledData = this.getFilledFormData(); + const {stepTableFormData_1 = []} = filledData; + const options = stepTableFormData_1.map(item => ({ + value: item.ypmc, + label: item.ypmc, + })) + formData.ypmcTaOptions = options + } + return formData }, // 只做校验 async validFields() { diff --git a/src/views/business/comps/template/comps/dj/DJ001.vue b/src/views/business/comps/template/comps/dj/DJ001.vue index 93c6f09..14e7fde 100644 --- a/src/views/business/comps/template/comps/dj/DJ001.vue +++ b/src/views/business/comps/template/comps/dj/DJ001.vue @@ -13,7 +13,7 @@
-
{{ $t('template.dj.dj001.fhfw') }} @@ -159,13 +159,14 @@ export default { label: 'template.dj.dj001.fhfw', type: "checkboxTree", fillType: 'actFill', - options: this.fhfwCheckOptions + options: Array.isArray(this.fhfwCheckOptions) ? this.fhfwCheckOptions : [] }, fhlrCheck: { label: 'template.dj.dj001.fhlr', type: "checkboxTree", fillType: 'actFill', - options: this.fhlrCheckOptions + options: Array.isArray(this.fhlrCheckOptions) ? this.fhlrCheckOptions : [] + }, } }, @@ -199,16 +200,17 @@ export default { }, data() { return { - formData: {}, + formData: { + fhfwCheck: { checkedValues: [], otherValues: {} }, + fhlrCheck: { checkedValues: [], otherValues: {} }, + }, fhfwCheckOptions:[], fhlrCheckOptions:[], isFirstTableDataRecorded: false, }; }, mounted() { - setTimeout(()=>{ - this.getTableData() - },200) + this.getTableData() }, methods: { //获取已填写的表单数据 @@ -251,23 +253,47 @@ export default { }, // 获取范围和内容表格数据(核心优化) getTableData() { - const formData = this.getFilledFormData() || {}; - const stepTableFormData = formData.stepTableFormData || []; - const stepTableFormData_1 = formData.stepTableFormData_1 || []; - // 处理数据为复选框options格式(去重+空值过滤) - const firstList = stepTableFormData - .filter(item => item.fhfw) // 过滤空值 - .map(item => ({ label: item.fhfw, value: item.fhfw })) - .filter((item, index, arr) => arr.findIndex(i => i.value === item.value) === index); // 去重 + try { + const formData = this.getFilledFormData() || {}; + // 修复:增加空值保护 + const stepTableFormData = formData.stepTableFormData || this.formData.stepTableFormData || []; + const stepTableFormData_1 = formData.stepTableFormData_1 || this.formData.stepTableFormData_1 || []; + + // 处理数据为checkboxTree期望的格式(包含children结构) + const firstList = stepTableFormData + .filter(item => item && item.fhfw && item.fhfw.trim()) // 严格过滤空值 + .map(item => ({ + label: item.fhfw, + value: item.fhfw, + children: [] // 必须包含children字段,否则checkboxTree会报错 + })) + // 去重优化 + .filter((item, index, arr) => { + return arr.findIndex(i => i.value === item.value) === index; + }); - const secondList = stepTableFormData_1 - .filter(item => item.fhlr) // 过滤空值 - .map(item => ({ label: item.fhlr, value: item.fhlr })) - .filter((item, index, arr) => arr.findIndex(i => i.value === item.value) === index); // 去重 + const secondList = stepTableFormData_1 + .filter(item => item && item.fhlr && item.fhlr.trim()) // 严格过滤空值 + .map(item => ({ + label: item.fhlr, + value: item.fhlr, + children: [] // 必须包含children字段 + })) + .filter((item, index, arr) => { + return arr.findIndex(i => i.value === item.value) === index; + }); - // 更新响应式变量(触发computed更新) - this.fhfwCheckOptions = firstList; - this.fhlrCheckOptions = secondList; + // 响应式更新 + this.$nextTick(()=>{ + this.fhfwCheckOptions = firstList; + this.fhlrCheckOptions = secondList; + }) + + } catch (error) { + // 异常时重置为空数组,避免页面崩溃 + this.fhfwCheckOptions = []; + this.fhlrCheckOptions = []; + } }, } }; diff --git a/src/views/business/comps/template/comps/dl/DL006.vue b/src/views/business/comps/template/comps/dl/DL006.vue index f96eb7b..c785fde 100644 --- a/src/views/business/comps/template/comps/dl/DL006.vue +++ b/src/views/business/comps/template/comps/dl/DL006.vue @@ -659,9 +659,7 @@ export default { // 关键修复2:先构建完整的数据源数组,再一次性更新 const newDataSource = []; let rowIndexNew = 0; - console.log(doseGroupCount, parallelDishCount,"doseGroupCount, parallelDishCount") for (let doseIndex = 0; doseIndex < doseGroupCount; doseIndex++) { - for (let dishIndex = 0; dishIndex < parallelDishCount; dishIndex++) { const rowData = { jlzb: stepTableFormData[doseIndex]?.jlzmc || '', @@ -671,19 +669,28 @@ export default { newDataSource.push(rowData); rowIndexNew++; } - newDataSource.map((item,index)=>{ - for (let i = 0; i < doseGroupCount; i++) { - item[`czrxm_${i}Label`] = formatNumberByDigits((i*newDataSource.length)+index+1) - } - }) } // 在构建 newDataSource 之后,补充编号生成逻辑 - console.log(this.getFilledFormData()) + if (qsbh && /^\d+$/.test(qsbh)) { + let currentNum = parseInt(qsbh, 10); + const totalRows = newDataSource.length; + // 遍历每一列(菌种编号列) + for (let colIndex = 0; colIndex < Number(jzs); colIndex++) { + // 遍历每一行,为当前列赋值递增编号 + for (let rowIndex = 0; rowIndex < totalRows; rowIndex++) { + const row = newDataSource[rowIndex]; + // 格式化为3位数字(如 001、002) + row[`czrxm_${colIndex}Label`] = currentNum.toString().padStart(3, '0'); + currentNum++; + } + } + } // 关键修复3:一次性更新数据源,覆盖原空数据 this.$refs.czxxTableRef.updateDataSource(newDataSource); justUpdateFilledFormData() }); }, + } } diff --git a/src/views/business/comps/template/comps/dl/DL018.vue b/src/views/business/comps/template/comps/dl/DL018.vue index fd828e8..39704e3 100644 --- a/src/views/business/comps/template/comps/dl/DL018.vue +++ b/src/views/business/comps/template/comps/dl/DL018.vue @@ -11,24 +11,23 @@ - + - - - - + @@ -56,10 +55,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 +67,13 @@ export default { }, }, computed: { - // 表格数据 - tableFormData() { - return { - stepTableFormData: this.formData.stepTableFormData || [], - headerSelectFields: {} - } - }, + // 表格数据 + tableFormData() { + return { + stepTableFormData: [{}], + headerSelectFields: {} + } + }, // 备注表单配置 remarkConig() { return [ @@ -139,7 +138,7 @@ export default { } ] }, - // 细胞信息 + // 细胞信息 swypyjInfoFormConfig() { return [ { @@ -150,16 +149,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 +173,7 @@ export default { width: 180, bodyType: "input", bodyFillType: "actFill", - disabled: true, + disabled: true, bodyDisabled: true, }, { @@ -183,7 +182,7 @@ export default { width: 180, bodyType: "input", bodyFillType: "actFill", - disabled: true, + disabled: true, bodyDisabled: true, }, { @@ -192,10 +191,14 @@ export default { width: 180, bodyType: "input", bodyFillType: "actFill", - disabled: true, - subType: 'button', - subKey: 'rsks', - buttonName: 'template.dl.dl018.ksButton', + // disabled: true, + // showOtherLabel: false, + + bodySubType: 'button', + bodySubFillType: 'actFill', + bodySubKey: 'rsks', + bodySubButtonName: 'template.dl.dl018.ksButton', + showBodySub: this.fillType === "actFill", }, { label: "template.dl.dl018.rsjs", @@ -203,10 +206,14 @@ export default { width: 180, bodyType: "input", bodyFillType: "actFill", - disabled: true, - subType: 'button', - subKey: 'rsjs', - buttonName: 'template.dl.dl018.jsButton', + // disabled: true, + // showOtherLabel: false, + + bodySubType: 'button', + bodySubFillType: 'actFill', + bodySubKey: 'rsjs', + bodySubButtonName: 'template.dl.dl018.jsButton', + showBodySub: this.fillType === "actFill", }, { label: "template.dl.dl018.zs", @@ -254,69 +261,72 @@ 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 || [] + clickButton(e,rowIndex) { + console.log(e,rowIndex) + }, + 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]) @@ -326,8 +336,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, } @@ -336,30 +346,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; }, //保存 @@ -377,5 +387,4 @@ export default { } }; - + diff --git a/src/views/business/comps/template/comps/dl/DL022.vue b/src/views/business/comps/template/comps/dl/DL022.vue index 8a9b0d0..6af3933 100644 --- a/src/views/business/comps/template/comps/dl/DL022.vue +++ b/src/views/business/comps/template/comps/dl/DL022.vue @@ -14,7 +14,7 @@
畸变类型以代号填写:断片(b)、裂隙(g)、互换及射体(t)、环状染色体(r)、多倍体(p)、双着丝点染色体(d)、内复制(e)、染色体碎化(z)、缺失(l)、粘着(s)、微小体(m)。 @@ -26,9 +26,9 @@
@@ -154,42 +154,42 @@ export default { prop: 'bpbh', bodyType: 'input', bodyFillType: 'actFill', - width: 100, + width: 200, bodyMaxlength: 50, }, { label: 'template.dl.dl022.gcxps', prop: 'gcxps', bodyType: 'inputNumber', bodyFillType: 'actFill', - width: 100, + width: 200, bodyMaxlength: 10, }, { label: 'template.dl.dl022.jgjxjbs', prop: 'jgjxjbs', bodyType: 'inputNumber', bodyFillType: 'actFill', - width: 80, + width: 200, disabled: true }, { label: 'template.dl.dl022.lxjbs', prop: 'lxjbs', bodyType: 'inputNumber', bodyFillType: 'actFill', - width: 100, + width: 200, disabled: true }, { label: 'template.dl.dl022.dbtjbs', prop: 'dbtjbs', bodyType: 'inputNumber', bodyFillType: 'actFill', - width: 100, + width: 200, disabled: true }, { label: 'template.dl.dl022.nfzjbs', prop: 'nfzjbs', bodyType: 'inputNumber', bodyFillType: 'actFill', - width: 80, + width: 200, disabled: true }, { label: 'template.dl.dl022.jblx', @@ -223,8 +223,6 @@ export default { }, handleEdit(){ const {currentItem, currentRowIndex} = this; - - currentItem.isComplete = !currentItem.isComplete; this.$refs.tableRef.updateDataSourceByRowIndex(currentRowIndex, currentItem) }, @@ -240,7 +238,7 @@ export default { EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); this.currentItem = item; this.currentRowIndex = rowIndex; - + }, // 新增行 onAddRow() { @@ -248,20 +246,6 @@ export default { jblx: [{value: undefined}], }) }, - // 选择显微镜预留 - onRegentSubmit(e) { - const { selectInfo, key, rowIndex } = e - const { row } = selectInfo - console.log('选择显微镜预留===', row) - // if (key === 'yqbh' && this.$refs.yqsyTableRef) { - // const params = { - // yqmc: row.mc, - // yqxh: row.xh, - // xccsjzjdrq: row.jzrq - // } - // this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) - // } - }, onFormSelect(fields) { this.onHandleBlur(fields) }, @@ -363,7 +347,12 @@ export default { diff --git a/src/views/business/comps/template/comps/dl/DL023.vue b/src/views/business/comps/template/comps/dl/DL023.vue index 431893c..d92c87f 100644 --- a/src/views/business/comps/template/comps/dl/DL023.vue +++ b/src/views/business/comps/template/comps/dl/DL023.vue @@ -47,7 +47,7 @@ import TableOpertaionDelete from "@/components/Template/operation/TableOpertaion export default { name: "dl023", dicts: [ - 'business_dl_xbmc' + 'business_dl_xbmc',"business_sydd" ], components: { BaseInfoFormPackage, LineLabel, TableList, Step, CustomTable, TableOpertaionDelete }, mixins: [templateMixin], @@ -100,13 +100,11 @@ export default { //yqsyxxColumns仪器使用信息 yqsyxxColumns() { return [{ - label: 'template.dl.dl023.yqbh', - prop: 'yqbh', - bodyType: 'input', - bodyFillType: 'actFill', - bodyDisabled: true, - disabled: true - }, { + label: 'template.dl.dl023.yqbh', + prop: 'yqbh', + bodyType: 'yq', + bodyFillType: 'actFill' + }, { label: 'template.dl.dl023.yqmc', prop: 'yqmc', bodyType: 'input', @@ -153,7 +151,7 @@ export default { label: 'template.dl.dl023.sydd', type: 'select', fillType: 'actFill', - options: this.getDictOptions('business_dl_sydd'), + options: this.getDictOptions('business_sydd'), otherCode: 'syddOther', showOtherLabel: false }, @@ -226,15 +224,14 @@ export default { onRegentSubmit(e) { const { selectInfo, key, rowIndex } = e const { row } = selectInfo - console.log('选择仪器编号预留===', row) - // if (key === 'yqbh' && this.$refs.yqsyTableRef) { - // const params = { - // yqmc: row.mc, - // yqxh: row.xh, - // xccsjzjdrq: row.jzrq - // } - // this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) - // } + if (key === 'yqbh' && this.$refs.tableRef) { + const params = { + yqmc: row.mc, + yqxh: row.xh, + xcrq: row.jzrq, + } + this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, params) + } }, onFormSelect(fields) { this.onHandleBlur(fields) diff --git a/src/views/business/comps/template/comps/dl/DL024.vue b/src/views/business/comps/template/comps/dl/DL024.vue index 228d265..06f4d26 100644 --- a/src/views/business/comps/template/comps/dl/DL024.vue +++ b/src/views/business/comps/template/comps/dl/DL024.vue @@ -15,7 +15,7 @@
({ + xbbh: item.jlzb || '', // 细胞编号 + })) + // 使用 $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('解析前序表单数据失败') + } + // if (key === 'qxbd' && this.$refs.tableRef) { // const params = { - // yqmc: row.mc, + // yqmc: row.xbbh, // yqxh: row.xh, // xccsjzjdrq: row.jzrq // } - // this.$refs.yqsyTableRef.updateDataSourceByRowIndex(rowIndex, params) + // this.$refs.tableRef.updateDataSourceByRowIndex(rowIndex, params) // } }, onFormSelect(fields){ this.onHandleBlur(fields) }, - //选择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(); - const params = { - subTargetStartSolution, - headerSelectFields - } - this.batchUpdateTargetStartSolutionVolume(dataSource,targetStartSolution,params) - } - }, - beforeSaveRecord(data){ - const formFields = this.$refs.swypyjInfoRef?.getFilledFormData(); - this.onCommonVerifyNdException(formFields,data); - }, - configComplete(val) { - const { rowData, headerSelectFields } = val; - //计算实际目标溶液体积(实际起始溶液体积+实际稀释液体积) - const { total, unit } = addTj([rowData.actStartSolutionVolume, rowData.actDiluentVolume], [headerSelectFields.actStartSolutionVolumeUnit, headerSelectFields.actDiluentVolumeUnit]) - let postData = { - mc: null, - bh: rowData.targetSolutionCode + rowData.subTargetSolutionCode, - nd: rowData.actSolutionConcentration,//实际目标溶液浓度 - nddw: headerSelectFields.actSolutionConcentrationUnit, - studySubjectId: this.formData.studySubjectId, - studyFormId:this.formData.id, - studyId:this.formData.studyId, - kc: total, - kcdw: unit, - } - this.configCompleteRequest(postData); - }, - //分装回调 - subPackageSubmit(data) { - const { fzsj, rowData, headerSelectFields } = data; - const { fzList = [], dw = "", mybh } = fzsj; - if (fzList && fzList.length > 0) { - const list = fzList.map((item) => { - return { - bh: mybh + item.preCode + item.subCode, - kc: item.num, - kcdw: dw, - } - }) - let postData = { - studyId: this.formData.studyId, - studyFormId: this.formData.id, - bh: mybh, - nd: rowData.actSolutionConcentration || 0, - nddw: headerSelectFields.actSolutionConcentrationUnit, - studySubjectId: this.formData.studySubjectId, - studyFormId:this.formData.id, - list: list - } - this.subPackageRequest(postData); - } - }, //获取已填写的表单数据 getFilledFormData() { return this.getFilledFormDataByRefs(["baseInfoRef", "swypyjInfoRef","remarkRef","tableRef"]) @@ -280,9 +250,18 @@ export default { }, getResource() { //使用的试剂、仪器 - // stepRef不存在,直接返回空数组 - this.resourceTmp = [] - this.yqResourceTmp = [] + const stepResource = this.$refs.stepRef.getStepResource() + const tableList = this.$refs.qcxjjyqkTableRef?.getFilledFormData()?.stepTableFormData || [] + // 从操作步骤中提取试剂和仪器资源 + this.resourceTmp = stepResource.sjResource || [] + const tableFromHyqk = tableList + .filter(item => item.xybh) + .map(item => ({ + bh: item.xybh, + type: 'cell' + })) + + this.resourceTmp = [...this.resourceTmp, ...tableFromHyqk] return this.resourceTmp; }, //保存 diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 8bbab70..f9d72d4 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -359,7 +359,7 @@ export default { getDept(row.deptId).then(response => { this.form = response.data this.open = true - this.title = this.$t('page.system.dept.modifyDept') + this.title = readonly? this.$t('form.detail'): this.$t('page.system.dept.modifyDept') listDeptExcludeChild(row.deptId).then(response => { this.deptOptions = this.handleTree(response.data, "deptId") if (this.deptOptions.length == 0) { diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 275b5ac..9e8ecf8 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -229,7 +229,7 @@ - +
  • 用户名称 @@ -45,9 +45,9 @@ 基本资料
- + @@ -72,7 +72,7 @@ export default { user: {}, roleGroup: {}, postGroup: {}, - selectedTab: "userinfo" + selectedTab: "resetPwd" } }, created() { diff --git a/src/views/system/user/profile/resetPwd.vue b/src/views/system/user/profile/resetPwd.vue index 2614e31..399783c 100644 --- a/src/views/system/user/profile/resetPwd.vue +++ b/src/views/system/user/profile/resetPwd.vue @@ -57,6 +57,9 @@ export default { if (valid) { updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => { this.$modal.msgSuccess("修改成功") + this.$store.dispatch('LogOut').then(() => { + location.href = '/' + }) }) } })