diff --git a/src/components/Template/BaseInfoFormPackage.vue b/src/components/Template/BaseInfoFormPackage.vue index 83a752b..5853f1e 100644 --- a/src/components/Template/BaseInfoFormPackage.vue +++ b/src/components/Template/BaseInfoFormPackage.vue @@ -102,6 +102,12 @@ @resetRecord="resetRecord(key)" :item="sItem" :value="formFields[key]" /> +
+ +
@@ -148,6 +154,11 @@ :error="errors[sItem.subKey]" @update:error="errors[sItem.subKey] = false" @resetRecord="resetRecord(sItem.subKey)" :value="formFields[sItem.subKey]" /> +
{{sItem.otherLabel ? $t(sItem.otherLabel) : $t("template.common.other") }}
@@ -178,6 +189,10 @@ @update:error="errors[sItem.subKey] = false" @resetRecord="resetRecord(sItem.subKey)" :item="getClickableItem(sItem)" :value="formFields[sItem.subKey]" /> +
+
+ +
diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index e821e61..239c308 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -22,24 +22,20 @@ + :disabled="getDisabled()" :placeholder="getPlaceholder()" @change="onItemCheckboxChange"> + :disabled="getDisabled()" format="yyyy/MM/dd HH:mm:ss" :placeholder="getPlaceholder()" + @change="(val) => onDateChange(val, 'yyyy/MM/DD HH:mm:ss')"> - + :disabled="getDisabled()" format="yyyy/MM/dd" :placeholder="getPlaceholder()" + @change="(val) => onDateChange(val, 'yyyy/MM/DD')"> - + {{ item.buttonName }} @@ -49,10 +45,17 @@ {{ inputValue }} {{ getPlaceholder() }} +
+ {{ inputValue }} + {{ getPlaceholder() }} +
- +
@@ -76,9 +79,9 @@ {{ index + 1 }}. {{ getUserName(record) }} {{ record.time }} - {{ modificationRecords.length-1==index?"提交":"修改" }} + {{ modificationRecords.length - 1 == index ? "提交" : "修改" }}
-
+
原值:{{ record.oldValue }}
修改值:{{ record.value }}
备注:{{ record.reason }}
@@ -100,8 +103,8 @@
- + @@ -120,7 +123,7 @@ import moment from "moment"; import { deepClone } from "@/utils/index"; import { getuuid } from "@/utils/index.js"; export default { - inject: ['templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"], + inject: ['templateData', 'templateFillType', "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"], components: { Question, DecimalInput, @@ -143,7 +146,7 @@ export default { }, // v-model 值 value: { - type: [String, Number, Array,Boolean], + type: [String, Number, Array, Boolean], default: '' }, // 错误状态 @@ -168,7 +171,11 @@ export default { isFieldsRecord: { type: Boolean, default: true, - } + }, + sourceFrom: { + type: String, + default: "" + }, }, data() { return { @@ -184,6 +191,8 @@ export default { visible: false,//是否显示弹窗 checkboxValue: this.getChecked(),//是否选中 uuid: getuuid(), // 唯一标识符,用于EventBus事件匹配 + regentType:['sj','gsp','mix','xj','xb','gyzj','mjy','yq'], //试剂/仪器/供试品等类型 + selectRegentInfo:{},//选择的试剂/仪器/供试品等信息 } }, watch: { @@ -205,25 +214,67 @@ export default { EventBus.$on('onExternalFieldUpdate', this.handleExternalFieldUpdate); EventBus.$on('onEditSignCancel', this.handleEditSignCancel); EventBus.$on('onEditSignCallback', this.handleEditSignCallback); + //试剂 + EventBus.$on("onReagentSubmit", this.onReagentSubmit) + //仪器 + EventBus.$on("onInstrumentSubmit", this.onInstrumentSubmit) + //供试品/试剂/给药制剂等 + EventBus.$on("onMixReagentSubmit", this.onMixReagentSubmit) }, unmounted() { EventBus.$off('onExternalFieldUpdate', this.handleExternalFieldUpdate); EventBus.$off('onEditSignCancel', this.handleEditSignCancel); EventBus.$off('onEditSignCallback', this.handleEditSignCallback); + EventBus.$off("onReagentSubmit", this.onReagentSubmit) + EventBus.$off("onInstrumentSubmit", this.onInstrumentSubmit) + EventBus.$off("onMixReagentSubmit", this.onMixReagentSubmit) }, methods: { + //试剂弹窗提交 + onMixReagentSubmit(data){ + if(data.uuid !== this.uuid) return; + this.inputValue = data.selectedId; + this.selectRegentInfo = data; + this.onCommonHandleSaveRecord(); + // this.inputValue = this.item.label; + }, + //统一处理试剂/供试品等弹窗 + onCommonHandleRegent(item, type) { + let params = { + studyFormId:this.templateData.id, + uuid:this.uuid, + sourceFrom:this.sourceFrom, + } + if (type !== "yq") { + const sjType = { + sj: "1",//试剂 + gsp: "7",//供试品 + mix: "1",//试剂/供试品/试剂 + gyzj: "3",//给药制剂 + mjy: "5",//麻精药 + xj: "9",//细菌 + xb: "11",//细胞 + } + params = { + ...params, + type: sjType[type] + } + } + EventBus.$emit("showSelectMixReagentDialog", params) + // this.$emit('regent', item,type); + }, // 点击按钮 - handleClickButton(item){ + handleClickButton(item) { this.$emit('clickButton', item); }, - onDateChange(val,format){ + onDateChange(val, format) { this.inputValue = moment(val).format(format); - console.log(this.inputValue,"inputValue") + console.log(this.inputValue, "inputValue") this.onCommonHandleSaveRecord(this.inputValue); }, - getUserName(record){ + getUserName(record) { const locale = this.$i18n.locale; - if(locale === 'zh_CN'){ + if (locale === 'zh_CN') { return record.userNameCn; } return record.userNameEn; @@ -336,13 +387,13 @@ export default { // 复选框变化处理 onCheckboxChange(val) { //有提出意见就不能勾选 - if (this.templateFillType == 'qc' && this.getQuestionColor()=== "orange") { + if (this.templateFillType == 'qc' && this.getQuestionColor() === "orange") { this.checkboxValue = false; this.$message({ message: '该表单还有质疑项未处理,无法勾选', type: 'error' }); - return ; + return; } this.checkboxValue = val; // 触发修改记录事件 @@ -357,8 +408,8 @@ export default { onRemoveTag(e) { this.onCommonHandleSaveRecord(this.inputValue); }, - onItemCheckboxChange(){ - this.onCommonHandleSaveRecord(this.inputValue); + onItemCheckboxChange() { + this.onCommonHandleSaveRecord(this.inputValue); }, // 下拉框失去焦点处理 onSelectBlur(visible) { @@ -419,7 +470,7 @@ export default { } else if (!this.error && isEmpty) { this.$emit('update:error', true); } - if(!this.isFieldsRecord){//是否需要记录修改记录 + if (!this.isFieldsRecord) {//是否需要记录修改记录 this.$emit("blur", this.inputValue); this.$emit('input', this.inputValue); this.$emit("change", this.inputValue); @@ -427,13 +478,13 @@ export default { } // 值发生了变化,需要弹出密码输入框 const isSame = this.isEqual(this.oldValue, this.inputValue); - if(isSame){ + if (isSame) { return; } if (!this.isValueEmpty(this.oldValue) && !isSame && this.templateFillType === "actFill") { // 通过EventBus触发电子签名弹窗 EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); - }else{//如果是第一次填写,不需要密码验证 + } else {//如果是第一次填写,不需要密码验证 this.handleUpdateRecord() } }, @@ -444,8 +495,8 @@ export default { this.inputValue = this.oldValue; this.$emit('input', this.inputValue); // 触发 v-model 更新 // this.$emit("blur", this.oldValue); - this.$emit("change", this.oldValue,"cancel"); - if(this.item.type === "clickable"){ + this.$emit("change", this.oldValue, "cancel"); + if (this.item.type === "clickable") { this.$emit("resetRecord"); } }, @@ -453,7 +504,7 @@ export default { //处理更新记录 handleUpdateRecord(data) { const baseInfo = this.getCommonRecordInfo(); - if(!this.oldValue && !this.inputValue) return; + if (!this.oldValue && !this.inputValue) return; const record = { ...baseInfo, oldValue: this.oldValue, @@ -464,7 +515,7 @@ export default { if (data) { record.reason = data.remark } - + const params = { type: "fieldChanged", newRecord: [record], @@ -474,15 +525,19 @@ export default { this.oldValue = this.inputValue; // 更新旧值 this.$emit("blur", this.inputValue); this.$emit('input', this.inputValue); - this.$emit("change", this.inputValue,data?"save":""); - if(this.item.type === "clickable"){//clickable的丢给父级去处理 + this.$emit("change", this.inputValue, data ? "save" : ""); + if (this.item.type === "clickable") {//clickable的丢给父级去处理 return; } - if(this.templateFillType === "actFill"){//只有实际填报的时候才记录修改记录 + + if (this.templateFillType === "actFill") {//只有实际填报的时候才记录修改记录 this.updateZdxgjl(record); } setTimeout(() => { EventBus.$emit('onModifyRecord', params,) + if(this.regentType.includes(this.item.type)){ + this.$emit("onRegentSubmit", this.selectRegentInfo); + } }, 10); }, @@ -502,20 +557,20 @@ export default { const { nickName, name } = this.$store.getters; //locale:zh-CN 中文 en-US 英文 const { label, parentLabel } = this.item; - let fieldLabelCn = this.$i18n.t(label,"zh_CN"),fieldLabelEn = this.$i18n.t(label,"en_US"); + let fieldLabelCn = this.$i18n.t(label, "zh_CN"), fieldLabelEn = this.$i18n.t(label, "en_US"); if (label === "template.common.other") { - fieldLabelCn = this.$i18n.t(parentLabel,"zh_CN")+this.$i18n.t("template.common.otherInfo","zh_CN"); - fieldLabelEn = this.$i18n.t(parentLabel,"en_US")+this.$i18n.t("template.common.otherInfo","en_US"); + fieldLabelCn = this.$i18n.t(parentLabel, "zh_CN") + this.$i18n.t("template.common.otherInfo", "zh_CN"); + fieldLabelEn = this.$i18n.t(parentLabel, "en_US") + this.$i18n.t("template.common.otherInfo", "en_US"); } else if (!label && parentLabel == "template.common.remark") { - fieldLabelCn = this.$i18n.t(parentLabel,"zh_CN")+this.$i18n.t("template.common.unit","zh_CN"); - fieldLabelEn = this.$i18n.t(parentLabel,"en_US")+this.$i18n.t("template.common.unit","en_US"); + fieldLabelCn = this.$i18n.t(parentLabel, "zh_CN") + this.$i18n.t("template.common.unit", "zh_CN"); + fieldLabelEn = this.$i18n.t(parentLabel, "en_US") + this.$i18n.t("template.common.unit", "en_US"); } const commonInfo = { userNameCn: nickName, userNameEn: name, key: this.fieldKey, - fieldCn: `${this.$i18n.t(this.fieldItemLabel,"zh_CN")}`+(fieldLabelCn?("-"+fieldLabelCn):""), - fieldEn: `${this.$i18n.t(this.fieldItemLabel,"en_US")}`+(fieldLabelEn?("-"+fieldLabelEn):""), + fieldCn: `${this.$i18n.t(this.fieldItemLabel, "zh_CN")}` + (fieldLabelCn ? ("-" + fieldLabelCn) : ""), + fieldEn: `${this.$i18n.t(this.fieldItemLabel, "en_US")}` + (fieldLabelEn ? ("-" + fieldLabelEn) : ""), } return commonInfo; }, @@ -540,13 +595,13 @@ export default { this.$emit("clickable", item) }, //判断是否禁用复选框 - getCheckboxDisabled(){ + getCheckboxDisabled() { //只有qc能操作checkbox,其他都只能看。 return this.templateFillType !== 'qc' }, //判断是否显示复选框图标 getIsShowCheckboxIcon() { - if(this.templateFillType === 'qc'){ + if (this.templateFillType === 'qc') { return true; } return this.getChecked(); @@ -584,7 +639,7 @@ export default { if (this.getDisabled()) { return "" } - if (type === "clickable") { + if (this.regentType.includes(type) || type === "clickable") { return this.$t("template.common.pleaseSelect") } let prex = "template.common.pleaseFillIn" @@ -777,44 +832,53 @@ export default { border-color: #f9c588 !important; } } - .el-checkbox__inner{ + + .el-checkbox__inner { border-color: #f9c588 !important; } - + } -.el-button--primary{ - &.orange-border{ + +.el-button--primary { + &.orange-border { background-color: #f79b31 !important; border-color: #f79b31 !important; + &:hover { background-color: #f79b31 !important; } + &:disabled { - background-color: rgba(#f79b31,.8) !important; - border-color: rgba(#f79b31,.8) !important; + background-color: rgba(#f79b31, .8) !important; + border-color: rgba(#f79b31, .8) !important; } + &:active { - background-color: rgba(#f79b31,.8) !important; - border-color: rgba(#f79b31,.8) !important; + background-color: rgba(#f79b31, .8) !important; + border-color: rgba(#f79b31, .8) !important; } } + &.blue-border { background-color: #4ea2ff !important; border-color: #4ea2ff !important; + &:hover { background-color: #4ea2ff !important; } + &:disabled { - background-color: rgba(#4ea2ff,.8) !important; - border-color: rgba(#4ea2ff,.8) !important; + background-color: rgba(#4ea2ff, .8) !important; + border-color: rgba(#4ea2ff, .8) !important; } + &:active { - background-color: rgba(#4ea2ff,.8) !important; - border-color: rgba(#4ea2ff,.8) !important; + background-color: rgba(#4ea2ff, .8) !important; + border-color: rgba(#4ea2ff, .8) !important; } } - + } .green-border { @@ -871,16 +935,16 @@ export default { .clickable, .el-date-editor { border-color: #ff5d5d; - box-shadow: 0 0 6px #ffc3c3!important; + box-shadow: 0 0 6px #ffc3c3 !important; &:focus { border-color: #ff5d5d; - box-shadow: 0 0 6px #ffc3c3!important; + box-shadow: 0 0 6px #ffc3c3 !important; } &:hover { border-color: #ff5d5d; - box-shadow: 0 0 6px #ffc3c3!important; + box-shadow: 0 0 6px #ffc3c3 !important; } } @@ -888,21 +952,21 @@ export default { .el-select .el-input__inner, .el-date-editor .el-input__inner .el-checkbox__inner { border-color: #ff5d5d; - box-shadow: 0 0 6px #ffc3c3!important; + box-shadow: 0 0 6px #ffc3c3 !important; } // 处理 DecimalInput 组件的错误边框样式 :deep(.el-input-number) { .el-input__inner { border-color: #ff5d5d; - box-shadow: 0 0 6px #ffc3c3!important; + box-shadow: 0 0 6px #ffc3c3 !important; } } // 为点击式表单项添加错误边框样式 .clickable { border-color: #ff5d5d; - box-shadow: 0 0 6px #ffc3c3!important; + box-shadow: 0 0 6px #ffc3c3 !important; } } @@ -976,7 +1040,7 @@ export default { cursor: pointer; width: auto; // margin-left: 10px; - min-height: 28px; + min-height: 28px; line-height: 28px; word-break: break-all; border-radius: 4px; @@ -997,7 +1061,7 @@ export default { &.error-border { border-color: #ff5d5d !important; - box-shadow: 0 0 6px #ffc3c3!important; + box-shadow: 0 0 6px #ffc3c3 !important; } } diff --git a/src/components/Template/mixins/formPackageMixins.js b/src/components/Template/mixins/formPackageMixins.js index 51c0f6d..ba78f89 100644 --- a/src/components/Template/mixins/formPackageMixins.js +++ b/src/components/Template/mixins/formPackageMixins.js @@ -50,6 +50,25 @@ export default { }, methods: { + //试剂/仪器等弹窗提交 + onRegentSubmit(data,key,item){ + this.$emit("onRegentSubmit", {selectInfo:data,key,config:item}); + }, + //是不是试剂/仪器等弹窗类型 + isRegent(item,fieldCode="type"){ + const type = item[fieldCode] ; + const typeList = ['sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq'] + return typeList.includes(type); + }, + getRegentItem(item,fieldCode="type"){ + const type = item[fieldCode] ; + return { + label: "", + type, + fillType: item.subFillType || item.fillType, + parentLabel: item.label, + } + }, getRecords(data) { const records = []; const { nickName, name } = this.$store.getters; @@ -130,7 +149,7 @@ export default { const cloneFormFields = JSON.parse(JSON.stringify(this.formFields)); this.oldFormFields[key] = cloneFormFields[key]; - this.showEditSignDialog(); + // this.showEditSignDialog(); this.formFields[key] = value; // 清除该表单项的错误状态 if (this.errors[key]) { diff --git a/src/views/business/comps/template/comps/sp/SP003.vue b/src/views/business/comps/template/comps/sp/SP003.vue index 87af7e7..3c5557b 100644 --- a/src/views/business/comps/template/comps/sp/SP003.vue +++ b/src/views/business/comps/template/comps/sp/SP003.vue @@ -15,9 +15,9 @@ :formData="formData" /> -->
-
- - @@ -196,7 +194,7 @@ export default { label: "template.sp.sp003.qsyry", type: "input", fillType: "preFill", - subType: "clickable", + subType: "sj", subKey: "subStartSolution", subFillType: "actFill", maxlength: 20, @@ -222,7 +220,7 @@ export default { label: "template.sp.sp003.xsy", type: "input", fillType: "preFill", - subType: "clickable", + subType: "sj", subKey: "subSolution", subFillType: "actFill", maxlength: 20, @@ -431,14 +429,13 @@ export default { }, methods: { //更新记录 - onSureModifyRecord(key) { + onRegentSubmit(data) { + const { selectInfo,key} = data; + const {row} = selectInfo; if (key === "subStartSolution") {//选择起始源溶液需要同步更新table的变更记录。 - this.$refs.stepTableRef.updateRecords(); + this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd); + this.updateStepTableData(row); } - - }, - resetRecord() { - this.$refs.stepTableRef.resetRecord(); }, startConfig(val) { const { rowData } = val; @@ -525,25 +522,6 @@ export default { getFilledFormData() { return this.getFilledFormDataByRefs(["baseInfoRef", "stepFormPackageRef", "stepRef", "remarkRef", "stepTableRef"]) }, - handleClickable(item) { - if (this.fillType === "preFill") { - return; - } - const { subKey = "" } = item; - if (subKey === "subStartSolution" || subKey === "subSolution") {//起始源溶液点击事件 - this.$refs.selectReagentDialogRef.show(this.formData.id) - this.currentSubKey = subKey; - } - }, - //选择试剂提交事件 - onSelectReagentSubmit(code, row) { - if (this.currentSubKey === "subStartSolution") {//起始源溶液点击事件 - this.$refs.stepFormPackageRef.updateFormData("targetAcSolution", row.nd); - this.updateStepTableData(row); - } - this.$refs.selectReagentDialogRef.onCancel() - this.$refs.stepFormPackageRef.updateFormData(this.currentSubKey, code); - }, //更新table数据 updateStepTableData(row) { const { stepTableFormData = [] } = this.$refs.stepTableRef.getFilledFormData();