From c791cc3916c00a48c7af190973e47fdbea491490 Mon Sep 17 00:00:00 2001 From: luojie <125330818@qq.com> Date: Mon, 5 Jan 2026 23:13:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86][?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=8A=BD=E7=A6=BBing]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Template/BaseInfoFormPcakge.vue | 46 +++- src/components/Template/CustomTable.vue | 34 ++- src/components/Template/HandleFormItem.vue | 58 +++-- src/components/Template/Step.vue | 11 +- src/lang/en/template/commonTemplate.js | 7 +- src/lang/zh/template/commonTemplate.js | 7 +- .../business/comps/template/TemplateTable.vue | 4 +- .../business/comps/template/comps/dl/SYWZPZJHB.vue | 240 +++++++++++++++++++++ .../comps/template/comps/sp/SWYPBQGZYZBB.vue | 16 +- .../comps/template/comps/sp/SWYPFXCBYPZB.vue | 12 +- .../comps/template/comps/sp/SWYPFXRYPZB.vue | 13 +- .../comps/template/mixins/templateMixin.js | 7 +- 12 files changed, 397 insertions(+), 58 deletions(-) create mode 100644 src/views/business/comps/template/comps/dl/SYWZPZJHB.vue diff --git a/src/components/Template/BaseInfoFormPcakge.vue b/src/components/Template/BaseInfoFormPcakge.vue index c67a8fa..3190013 100644 --- a/src/components/Template/BaseInfoFormPcakge.vue +++ b/src/components/Template/BaseInfoFormPcakge.vue @@ -52,7 +52,7 @@
{{ sItem.label }}
-
+
@@ -78,7 +78,7 @@
{{ sItem.label }}
-
+
@@ -99,10 +99,12 @@
{{ formFields[sItem.subKey] }}
-
+ +
{{ formFields[sItem.subKey] }}
-
+ +
@@ -193,6 +197,9 @@ export default { }) }, handleClickable(sItem,event){ + if(this.fillType !== 'actFill'){ + return + } this.$emit("clickable",sItem) }, //根据span判断一行显示几列 @@ -211,6 +218,13 @@ export default { maxlength: sItem.otherMaxlength || 50, } }, + getClickableItem(sItem){ + return { + label: "", + type: "clickable", + fillType: sItem.subFillType || sItem.fillType, + } + }, getSubItem(sItem){ return { label: "", @@ -278,6 +292,23 @@ export default { this.allFieldsConfig = config; console.log(config,"config") }, + //判断是否禁用 + getDisabled() { + const { item } = this; + const { fillType } = item; + if (item.hasOwnProperty("disabled")) { + return item.disabled + } else { + const { templateStatus } = this.$store.state.template; + if (fillType === "actFill") {//当模板状态是实际填写时,只有当fillType是actFill时才能填写 + return templateStatus !== "actFill" + } else if (fillType === "preFill") {//当模板状态是预填写时,只有当fillType是preFill才能填写 + return templateStatus !== "preFill" + } else { + return true + } + } + }, getFormData() { const { formFields, allFieldsConfig } = this; const { templateStatus } = this.$store.state.template; @@ -443,6 +474,9 @@ export default { display: flex; align-items: center; justify-content: center; + font-size: 14px; + font-weight: normal; + color: #606266; } .orange-border { diff --git a/src/components/Template/CustomTable.vue b/src/components/Template/CustomTable.vue index bcf6762..8f51c80 100644 --- a/src/components/Template/CustomTable.vue +++ b/src/components/Template/CustomTable.vue @@ -6,10 +6,12 @@ :style="{ width: col.width ? col.width + 'px' : 'auto' }">
{{ col.label }}
-
-
- @@ -72,6 +78,11 @@ export default { HandleFormItem }, props: { + // 是否显示表头选择器 + showHeaderSelect: { + type: Boolean, + default: true, + }, // 是否显示操作栏 showOperation: { type: Boolean, @@ -218,9 +229,8 @@ export default { return false; }, // 表头选择器变化 - onHeaderSelectChange(colIndex, value) { - this.headerSelectValues[colIndex] = value; - this.$emit('header-select-change', colIndex, value); + onHeaderSelectChange(col, value) { + this.headerSelectFields[col.headerSelectKey] = value; }, // 表体值变化 onBodyValueChange(rowIndex, colIndex, value) { @@ -280,6 +290,10 @@ export default { // 深拷贝数据以避免直接修改原始数据 this.localDataSource = JSON.parse(JSON.stringify(dataSource || [])); }, + // 添加行 + addRow(row) { + this.localDataSource.push(row); + }, getDataSource(){ return this.localDataSource; }, @@ -422,5 +436,9 @@ export default { width: 100px; margin-left: 5px; } - +.no-data{ + text-align: center; + padding: 20px 0; + color: rgb(144, 147, 153) +} \ No newline at end of file diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index 305b36b..ea61579 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -2,30 +2,34 @@
- +
+ {{ value }} + 请选择 +
@@ -79,17 +83,19 @@ export default { } }, filters: { - getFillType(type) { + + + }, + methods: { + getFillTypeStyle(type) { + const {fillType} = this.item; const typeObj = { actFill: "orange-border",//实际填写的边框颜色 green: "green-border", preFill: "blue-border",//预填写的边框颜色 } - return typeObj[type] || "" + return typeObj[fillType] || "" }, - - }, - methods: { //获取question图标颜色 getQuestionColor() { //gray 灰色 green 绿色 orange 橙色 @@ -101,6 +107,12 @@ export default { this.$emit('input', value); this.$emit('change', value); }, + handleClickable(item,event){ + if(item.fillType !== 'actFill'){ + return + } + this.$emit("clickable",item) + }, //判断是否显示复制按钮 getIsShowCopyIcon() { const { copyFrom } = this.item; @@ -186,7 +198,7 @@ export default { .orange-border { - input, + .el-input-group__prepend,input, textarea { border-color: #f9c588; @@ -207,7 +219,7 @@ export default { .green-border { - input, + .el-input-group__prepend,input, textarea { border-color: green; @@ -228,7 +240,7 @@ export default { .blue-border { - input, + .el-input-group__prepend,input, textarea { border-color: #4ea2ff; @@ -246,4 +258,24 @@ export default { } } +.clickable{ + cursor: pointer; + width: auto; + margin-left: 10px; + min-width: 100px; + height: 28px; + border-radius: 4px; + border:1px solid #4ea2ff; + display: flex; + align-items: center; + justify-content: center; + font-size: 14px; + font-weight: normal; + color: #606266; + &.disabled{ + cursor: not-allowed; + color: #c0c4cc; + background-color: #f5f7fa; + } +} \ No newline at end of file diff --git a/src/components/Template/Step.vue b/src/components/Template/Step.vue index cd60912..0af4db2 100644 --- a/src/components/Template/Step.vue +++ b/src/components/Template/Step.vue @@ -81,8 +81,8 @@ export default { name: 'Step', props: { formData: { - type: Object, - default: () => ({stepData:[]}) + type: Array, + default: () => [] } }, data() { @@ -164,7 +164,7 @@ export default { }, deep: true }, - 'formData.stepData': { + 'formData': { handler(newVal) { console.log('newVal', newVal) if(!newVal || newVal.length === 0) return @@ -174,7 +174,8 @@ export default { formData: step.formData || {} })) }, - deep: true + deep: true, + immediate: true } }, methods: { @@ -233,7 +234,7 @@ export default { type: step.type, ...step.formData })) - resolve({stepData}) + resolve(stepData) }) }, diff --git a/src/lang/en/template/commonTemplate.js b/src/lang/en/template/commonTemplate.js index 0d522f3..02a80de 100644 --- a/src/lang/en/template/commonTemplate.js +++ b/src/lang/en/template/commonTemplate.js @@ -52,5 +52,10 @@ export default { instrumentName: 'Instrument Name', instrumentModel: 'Instrument Model', instrumentCode: 'Instrument Number', - nextTestDate: 'Next Test/Calibration/Verification Date' + nextTestDate: 'Next Test/Calibration/Verification Date', + + // 试验物质配制计划列 + administrationDoseOrGroup: 'Administration Dose or Group', + preparationConcentration: 'Preparation Concentration', + preparationVolume: 'Preparation Volume' } diff --git a/src/lang/zh/template/commonTemplate.js b/src/lang/zh/template/commonTemplate.js index ec056bd..483d48d 100644 --- a/src/lang/zh/template/commonTemplate.js +++ b/src/lang/zh/template/commonTemplate.js @@ -52,5 +52,10 @@ export default { instrumentName: '仪器名称', instrumentModel: '仪器型号', instrumentCode: '仪器编号', - nextTestDate: '下次测试/校准/检定日期' + nextTestDate: '下次测试/校准/检定日期', + + // 试验物质配制计划列 + administrationDoseOrGroup: '给药剂量或组别', + preparationConcentration: '配制浓度', + preparationVolume: '配制体积' } diff --git a/src/views/business/comps/template/TemplateTable.vue b/src/views/business/comps/template/TemplateTable.vue index 7bce4a8..a5ad308 100644 --- a/src/views/business/comps/template/TemplateTable.vue +++ b/src/views/business/comps/template/TemplateTable.vue @@ -13,11 +13,12 @@ import SP001 from './comps/sp/SP001'; import SWYPFXRYPZB from "./comps/sp/SWYPFXRYPZB.vue"; import SWYPFXCBYPZB from "./comps/sp/SWYPFXCBYPZB.vue"; import SWYPBQGZYZBB from "./comps/sp/SWYPBQGZYZBB.vue"; +import SYWZPZJHB from "./comps/dl/SYWZPZJHB.vue"; import Demo from "./comps/sp/Demo.vue"; export default { name: "TemplateTable", components: { - SP001,SWYPFXRYPZB ,Demo,SWYPFXCBYPZB,SWYPBQGZYZBB, + SP001,SWYPFXRYPZB ,Demo,SWYPFXCBYPZB,SWYPBQGZYZBB,SYWZPZJHB, }, props: { sn: { @@ -41,6 +42,7 @@ export default { 'SP001': 'SWYPFXRYPZB', 'SP002': 'SWYPFXCBYPZB', 'SP003': 'SWYPBQGZYZBB', + 'DL001': 'SYWZPZJHB', // 'SP001': 'Demo', } } diff --git a/src/views/business/comps/template/comps/dl/SYWZPZJHB.vue b/src/views/business/comps/template/comps/dl/SYWZPZJHB.vue new file mode 100644 index 0000000..bf2b407 --- /dev/null +++ b/src/views/business/comps/template/comps/dl/SYWZPZJHB.vue @@ -0,0 +1,240 @@ + + + + + \ No newline at end of file diff --git a/src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue b/src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue index 3084b42..636359a 100644 --- a/src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue +++ b/src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue @@ -23,7 +23,7 @@
- +
@@ -120,12 +120,12 @@ export default { { type: "cardItem", config: { - bdmc: { + studyMc: { label: "试验名称", type: "input", disabled: true, }, - bdbh: { + studySn: { label: "试验编号", type: "input", disabled: true, @@ -477,9 +477,9 @@ export default { const baseData = await this.$refs.baseInfoRef.getFormData(); const conditionData = await this.$refs.storageConditionRef.getFormData(); const stepFormData = await this.$refs.stepFormPackageRef.getFormData(); - const stepDataFormData = await this.$refs.stepTableRef.getFormData(); + const stepTableFormData = await this.$refs.stepTableRef.getFormData(); const stepData = await this.$refs.stepRef.getFormData(); - if (!stepData.stepData.length) { + if (!stepData.length) { this.$message.error("请添加步骤"); return; } @@ -487,10 +487,10 @@ export default { return { ...baseData, ...conditionData, - ...stepData, - stepData: stepFormData, + stepData, + ...stepFormData, ...remarkData, - ...stepDataFormData + ...stepTableFormData } }, async onSave() { diff --git a/src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue b/src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue index d4480d6..5488650 100644 --- a/src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue +++ b/src/views/business/comps/template/comps/sp/SWYPFXCBYPZB.vue @@ -17,7 +17,7 @@
- +
@@ -99,12 +99,12 @@ export default { { type: "cardItem", config: { - bdmc: { + studyMc: { label: "试验名称", type: "input", disabled: true, }, - bdbh: { + studySn: { label: "试验编号", type: "input", disabled: true, @@ -261,7 +261,7 @@ export default { const conditionData = await this.$refs.storageConditionRef.getFormData(); const stepFormData = await this.$refs.stepFormPackageRef.getFormData(); const stepData = await this.$refs.stepRef.getFormData(); - if (!stepData.stepData.length) { + if (!stepData.length) { this.$message.error("请添加步骤"); return; } @@ -269,8 +269,8 @@ export default { return { ...baseData, ...conditionData, - ...stepData, - stepData: stepFormData, + stepData, + ...stepFormData, ...remarkData } }, diff --git a/src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue b/src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue index dfee8c1..b927781 100644 --- a/src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue +++ b/src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue @@ -18,7 +18,7 @@ @blur = "onHandleBlur" :formData="formData" />
- +
@@ -35,7 +35,6 @@ import TableList from "@/components/Template/Table"; import Step from "@/components/Template/Step"; import templateMixin from "../../mixins/templateMixin"; import CustomTable from '@/components/Template/CustomTable.vue'; -import moment from 'moment'; export default { name: "SWYPFXRYPZB", @@ -100,12 +99,12 @@ export default { { type: "cardItem", config: { - bdmc: { + studyMc: { label: this.$t('template.common.testName'), type: "input", disabled: true, }, - bdbh: { + studySn: { label: this.$t('template.common.testNumber'), type: "input", disabled: true, @@ -275,7 +274,7 @@ export default { const conditionData = await this.$refs.storageConditionRef.getFormData(); const stepFormData = await this.$refs.stepFormPackageRef.getFormData(); const stepData = await this.$refs.stepRef.getFormData(); - if (!stepData.stepData.length) { + if (!stepData.length) { this.$message.error(this.$t('template.common.addStepError')); return; } @@ -283,8 +282,8 @@ export default { return { ...baseData, ...conditionData, - ...stepData, - stepData: stepFormData, + stepData, + ...stepFormData, ...remarkData } }, diff --git a/src/views/business/comps/template/mixins/templateMixin.js b/src/views/business/comps/template/mixins/templateMixin.js index eefdae6..8904b67 100644 --- a/src/views/business/comps/template/mixins/templateMixin.js +++ b/src/views/business/comps/template/mixins/templateMixin.js @@ -39,8 +39,8 @@ export default { ] ) }, 1000); - this.setTemplateStatus("preFill"); - // this.setTemplateStatus(this.fillType) + // this.setTemplateStatus("actFill"); + this.setTemplateStatus(this.fillType) }, unmounted() { @@ -54,6 +54,9 @@ export default { setConditionOptions(options) { this.$store.commit('template/SET_CONDITION_OPTIONS', options) }, + setTemplateData(data) { + this.$store.commit('template/SET_TEMPLATE_DATA', data) + }, //统一处理删除行 deleteRow(index) { this.$refs.stepTableRef.deleteRow(index);