diff --git a/src/api/template/index.js b/src/api/template/index.js new file mode 100644 index 0000000..373745b --- /dev/null +++ b/src/api/template/index.js @@ -0,0 +1,10 @@ +import request from '@/utils/request' + +//获取试剂列表 +export const getReagentList = (params) => { + return request({ + url: '/api/business/sj/sj_list', + method: 'get', + params + }) +} \ No newline at end of file diff --git a/src/components/Template/BaseInfoFormPcakge.vue b/src/components/Template/BaseInfoFormPcakge.vue index 6010ad1..96ae6f7 100644 --- a/src/components/Template/BaseInfoFormPcakge.vue +++ b/src/components/Template/BaseInfoFormPcakge.vue @@ -94,7 +94,7 @@
{{ formFields[sItem.subKey] }}
-
+
{{ formFields[sItem.subKey] }} 请选择
@@ -105,7 +105,7 @@
{{ formFields[sItem.subKey] }}
-
+
{{ formFields[sItem.subKey] }} 请选择
@@ -191,8 +191,7 @@ export default { this.formFields[key] = data[key]; }) }, - handleClickable(sItem){ - console.log(sItem) + handleClickable(sItem,event){ this.$emit("clickable",sItem) }, //根据span判断一行显示几列 diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index 520417d..4d409fe 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -118,10 +118,8 @@ export default { const { item } = this; const { fillType } = item; if (item.hasOwnProperty("disabled")) { - console.log(item,item.disabled,"item.disabled") return item.disabled } else { - console.log(item,"else") const { templateStatus } = this.$store.state.template; if (fillType === "actFill") {//当模板状态是实际填写时,只有当fillType是actFill时才能填写 return templateStatus !== "actFill" diff --git a/src/components/Template/SelectTable.vue b/src/components/Template/SelectTable.vue new file mode 100644 index 0000000..c84b9d6 --- /dev/null +++ b/src/components/Template/SelectTable.vue @@ -0,0 +1,173 @@ + + + + + \ 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 fc3c507..887745d 100644 --- a/src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue +++ b/src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue @@ -14,18 +14,23 @@ :formData="formData" />
- + -
- + + + @@ -36,10 +41,11 @@ 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 SelectReagentDialog from '../../dialog/SelectReagentDialog.vue'; export default { name: "SWYPBQGZYZBB", - components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable }, + components: { BaseInfoFormPcakge, LineLabel, TableList, Step, CustomTable, SelectReagentDialog }, mixins: [templateMixin], props: { value: { @@ -244,54 +250,57 @@ export default { ] }, // 步骤表格列配置 - stepColumns(){ + stepColumns() { return [ { - label:"目标溶液编号", - prop:"targetSolutionCode", - bodyType:"input", - subType:"span", - subKey:"subTargetSolutionCode", - bodyFillType:"preFill", + label: "目标溶液编号", + prop: "targetSolutionCode", + bodyType: "input", + subType: "span", + subKey: "subTargetSolutionCode", + bodyFillType: "preFill", width: 280 }, { - label:"起始溶液编号",prop:"startSolutionCode", + label: "起始溶液编号", prop: "startSolutionCode", width: 280, - bodyType:"input", - bodyFillType:"actFill", - bodyMaxlength:10, + bodyType: "input", + bodyFillType: "actFill", + bodyMaxlength: 10, }, { - label:"预设起始溶液体积",prop:"targetStartSolutionVolume", + label: "预设起始溶液体积", prop: "targetStartSolutionVolume", width: 280, - headerSelectKey:"targetStartSolutionVolumeUnit", - fillType:"preFill", - headerOptions:this.$store.state.template.volumeOptions, - defaultValue:"mg", - bodyType:"inputNumber", - bodySubType:"inputNumber", - bodySubKey:"subTargetStartSolutionPrecision", - bodyFillType:"preFill", - bodySubFillType:"preFill", - showBodySub:this.fillType === "preFill", + headerSelectKey: "targetStartSolutionVolumeUnit", + fillType: "preFill", + headerOptions: this.$store.state.template.volumeOptions, + defaultValue: "mg", + bodyType: "inputNumber", + bodySubType: "inputNumber", + bodySubKey: "subTargetStartSolutionPrecision", + bodyFillType: "preFill", + bodySubFillType: "preFill", + showBodySub: this.fillType === "preFill", bodyDisabled: true, - bodyPrecisionKey:"subTargetStartSolutionPrecision", + bodyPrecisionKey: "subTargetStartSolutionPrecision", }, { - label:"实际起始溶液体积",prop:"actStartSolutionVolume", + label: "实际起始溶液体积", prop: "actStartSolutionVolume", width: 280, - headerSelectKey:"actStartSolutionVolumeUnit", - fillType:"preFill", - headerOptions:this.$store.state.template.volumeOptions, - bodyType:"inputNumber", - bodyFillType:"actFill", + headerSelectKey: "actStartSolutionVolumeUnit", + fillType: "preFill", + headerOptions: this.$store.state.template.volumeOptions, + bodyType: "inputNumber", + bodyFillType: "actFill", }, ] }, }, data() { return { + selectReagentVisible: false, + subSolutionVisible: false, + currentSubKey: "",//当前点击的子项key dataSource: [], stepTableDataSource: [], sysjColumns: [ @@ -316,9 +325,9 @@ export default { this.formData = { effectivePeriodUnit: "days",//设置默认值 createTime: "2026-01-02 18:05:36",//设置默认值 - stepTableFormData:[ - {actStartSolutionVolume:1,subActStartSolutionVolume:"ul",subTargetStartSolutionPrecision:3}, - {targetStartSolutionVolume:3,subTargetStartSolutionVolume:"mg",subTargetStartSolutionPrecision:2}, + stepTableFormData: [ + { actStartSolutionVolume: 1, subActStartSolutionVolume: "ul", subTargetStartSolutionPrecision: 3 }, + { targetStartSolutionVolume: 3, subTargetStartSolutionVolume: "mg", subTargetStartSolutionPrecision: 2 }, ], headerSelectFields: { targetStartSolutionVolumeUnit: "mg", @@ -328,6 +337,23 @@ export default { } }, methods: { + handleClickable(item) { + if(this.fillType === "preFill"){ + // return; + } + const {subKey = ""} = item; + if(subKey === "subStartSolution" || subKey === "subSolution"){//起始源溶液点击事件 + this.selectReagentVisible = true; + this.currentSubKey = subKey; + } + }, + //选择试剂提交事件 + onSelectReagentSubmit(code){ + this.formData[this.currentSubKey] = code; + this.$set(this.formData, this.currentSubKey, code); + this.formData = {...this.formData} + this.selectReagentVisible = false; + }, async getFormData() { const baseData = await this.$refs.baseInfoRef.getFormData(); const conditionData = await this.$refs.storageConditionRef.getFormData(); diff --git a/src/views/business/comps/template/dialog/SelectReagentDialog.vue b/src/views/business/comps/template/dialog/SelectReagentDialog.vue new file mode 100644 index 0000000..aeeefd2 --- /dev/null +++ b/src/views/business/comps/template/dialog/SelectReagentDialog.vue @@ -0,0 +1,86 @@ + + + + + \ No newline at end of file diff --git a/src/views/business/comps/template/mixins/templateMixin.js b/src/views/business/comps/template/mixins/templateMixin.js index db14ffa..eeb05ef 100644 --- a/src/views/business/comps/template/mixins/templateMixin.js +++ b/src/views/business/comps/template/mixins/templateMixin.js @@ -65,8 +65,9 @@ export default { }else if(key === "codeSTD"){//起始编号STD失焦时,更新stepDataSource const arr = Array.from({length:codeSTD},(item,index) => ({ subTargetStartSolutionPrecision:3,//小数点精度默认为3 + targetSolutionCode:`STD${Number(codeSTD)-index}` })); - this.stepTableDataSource = arr; + this.$refs.stepTable.updateDataSource(arr); } }