diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue index 83c8450..d33f339 100644 --- a/src/components/Template/HandleFormItem.vue +++ b/src/components/Template/HandleFormItem.vue @@ -3,11 +3,10 @@
- + + :remote="item.selectRemote || false" :remote-method="remoteMethod" @visible-change="onSelectBlur" + @change="onInputChange" filterable> @@ -79,16 +77,10 @@ :format="type === 'dateTime' ? 'yyyy/MM/dd HH:mm:ss' : 'yyyy/MM/dd'" :placeholder="getPlaceholder()" @change="(val) => onDateChange(val, type === 'dateTime' ? 'yyyy/MM/DD HH:mm:ss' : 'yyyy/MM/DD')"> - + :disabled="getDisabled()" :on-success="handleSuccess" :on-change="handleChange" + :on-exceed="handleExceed" :file-list="fileList" :auto-upload="false"> 点击上传 请上传附件 @@ -215,7 +206,8 @@
- @@ -232,12 +224,12 @@ import Question from "./icons/Question.vue"; import DecimalInput from "./DecimalInput.vue"; import { EventBus } from "@/utils/eventBus"; import moment from "moment"; -import { getuuid, isEqual, deepClone, getDefaultValueByOptions, isValueEmpty,isRegent } from "@/utils/index.js"; +import { getuuid, isEqual, deepClone, getDefaultValueByOptions, isValueEmpty, isRegent } from "@/utils/index.js"; import { getToken } from "@/utils/auth"; import { isShowOtherByCheckboxTree } from "@/utils/formPackageCommon"; export default { - inject: ['templateData', 'templateFillType',"getSubmittedCodes","updateSubmittedCodes", "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"], + inject: ['templateData', 'templateFillType', "getSubmittedCodes", "updateSubmittedCodes", "getZdxgjl", "getFhyjjl", "updateZdxgjl", "replaceFhyjjl", "updateFhyjjl", "getFieldCheckObj", "updateFieldCheckObj"], components: { Question, DecimalInput, @@ -307,7 +299,7 @@ export default { const defaultCheckedValue = getDefaultValueByOptions(this.item.options || []); initialValue = { checkedValues: defaultCheckedValue, otherValues: {} }; } - const {type} = this; + const { type } = this; return { inputValue: initialValue, oldValue: typeof initialValue === 'object' ? JSON.parse(JSON.stringify(initialValue)) : initialValue, // 记录上一次的值 @@ -343,7 +335,7 @@ export default { // disabledDate(time) { // return time.getTime() > Date.now(); // }, - shortcuts: type === 'dateTimeRange' ? undefined:[{ + shortcuts: type === 'dateTimeRange' ? undefined : [{ text: '今天', onClick(picker) { picker.$emit('pick', new Date()); @@ -354,7 +346,7 @@ export default { } }, watch: { - + value(newVal) { if (this.type === 'checkboxTag' && Array.isArray(newVal)) { // checkboxTag类型,value是数组格式 @@ -412,7 +404,7 @@ export default { return false; }, getFlexClass() { - const noFlexArr = ["radio", "checkboxTag", "fqyq"] + const noFlexArr = ["radio", "checkboxTag", "fqyq","button"] return noFlexArr.includes(this.type) ? '' : 'flex1' }, getDecimalDigits() { @@ -524,7 +516,7 @@ export default { // 所有删除操作都需要验证电子签名 // 保存待删除的文件信息 this.pendingRemoveFile = { file, fileList: this.fileList }; -console.log("fillll") + console.log("fillll") // 触发电子签名弹窗 EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); @@ -611,8 +603,8 @@ console.log("fillll") this.inputValue = data.selectedId; const { filledCodes = [] } = this.item; console.log(filledCodes, "filledCodes") - const { selectInfo, row,checkType } = data; - if (filledCodes.length > 0 && checkType !=="checkbox") { + const { selectInfo, row, checkType } = data; + if (filledCodes.length > 0 && checkType !== "checkbox") { this.inputValue = row[filledCodes[0]] + "(" + row[filledCodes[1]] + ")"; } this.selectRegentInfo = data; @@ -621,7 +613,7 @@ console.log("fillll") }, //统一处理试剂/供试品等弹窗 onCommonHandleRegent(item, type) { - const {fillType = "actFill"} = item; + const { fillType = "actFill" } = item; if (this.templateFillType !== fillType) { return } @@ -651,10 +643,10 @@ console.log("fillll") }; if (type === "mix") { params.mixType = true; - } + } if (item.qxbdType) { params.qxbdType = item.qxbdType; - } + } if (item.checkType) { params.checkType = item.checkType; } @@ -670,7 +662,7 @@ console.log("fillll") onDateChange(val, format) { if (this.type === 'dateTimeRange') { this.inputValue = [moment(val[0]).format(format), moment(val[1]).format(format)]; - }else{ + } else { this.inputValue = moment(val).format(format); } this.onCommonHandleSaveRecord(this.inputValue); @@ -742,7 +734,7 @@ console.log("fillll") }, getFillTypeStyle(type) { const { fillType } = this.item; - const filterType = ["attachment", "checkboxTag", "fqyq", "checkboxTree","radio"] + const filterType = ["attachment", "checkboxTag", "fqyq", "checkboxTree", "radio"] const typeObj = { actFill: "orange-border",//实际填写的边框颜色 blxjsh: "orange-border",//实际填写的边框颜色 @@ -1098,10 +1090,10 @@ console.log("fillll") const { mainRadio: oldMainRadio, inputValue: oldInputValue, subRadio: oldSubRadio } = this.oldFqyqValue; const o = { "mainRadio": { oldValue: oldMainRadio, newValue: mainRadio, des: "" }, - "inputValue": { oldValue: oldInputValue, newValue: inputValue, des: "",key: this.fieldKey+"_inputValue" }, + "inputValue": { oldValue: oldInputValue, newValue: inputValue, des: "", key: this.fieldKey + "_inputValue" }, "subRadio": { oldValue: oldSubRadio, newValue: subRadio, des: "是否在规定时间完成:" } } - console.log(o, this.currentHandleType, this.fqyqValue,"fqyqValue") + console.log(o, this.currentHandleType, this.fqyqValue, "fqyqValue") return o[this.currentHandleType]; }, getCheckboxTreeInfo() { @@ -1112,7 +1104,7 @@ console.log("fillll") const oldItem = oldCheckedValues.find(item => item.label === currentCheckboxTreeValue); const o = { "checkboxTreeCheckbox": { oldValue: oldItem, newValue: newItem, des: "" }, - "checkboxTreeOther": { oldValue: oldOtherValues[currentCheckboxTreeValue], newValue: otherValues[currentCheckboxTreeValue], des: `${currentCheckboxTreeValue}:`,key: this.fieldKey+"_"+currentCheckboxTreeValue }, + "checkboxTreeOther": { oldValue: oldOtherValues[currentCheckboxTreeValue], newValue: otherValues[currentCheckboxTreeValue], des: `${currentCheckboxTreeValue}:`, key: this.fieldKey + "_" + currentCheckboxTreeValue }, } return o[currentHandleType]; }, @@ -1171,9 +1163,9 @@ console.log("fillll") } else if (this.type === "fqyq") { const current = this.getFqyqInfo(); isSame = isEqual(current.oldValue, current.newValue); - if(this.currentHandleType === "inputValue"){ - isOldValueEmpty =this.isUnSubmitted(current.key); - }else{ + if (this.currentHandleType === "inputValue") { + isOldValueEmpty = this.isUnSubmitted(current.key); + } else { isOldValueEmpty = isValueEmpty(current.oldValue); } } else if (this.type === "checkboxTree") { @@ -1188,10 +1180,10 @@ console.log("fillll") } - } else if(this.type === "checkbox"){ + } else if (this.type === "checkbox") { isSame = isEqual(this.oldValue, this.inputValue) - isOldValueEmpty =this.isUnSubmitted(); - }else { + isOldValueEmpty = this.isUnSubmitted(); + } else { isSame = isEqual(this.oldValue, this.inputValue) isOldValueEmpty = this.isUnSubmitted(); } @@ -1199,7 +1191,7 @@ console.log("fillll") if (isSame) { return; } - if (!isOldValueEmpty && !(isSame) && (this.templateFillType === "actFill" || this.templateFillType === "blxjsh")&&this.type !== "attachment") { + if (!isOldValueEmpty && !(isSame) && (this.templateFillType === "actFill" || this.templateFillType === "blxjsh") && this.type !== "attachment") { console.log("需要电子签名") // 通过EventBus触发电子签名弹窗 EventBus.$emit('showEditSignDialog', { uuid: this.uuid }); @@ -1209,9 +1201,9 @@ console.log("fillll") }, //是否提交过 - isUnSubmitted(key){ + isUnSubmitted(key) { const finallyKey = key || this.fieldKey; - const has = this.getSubmittedCodes().includes(finallyKey) + const has = this.getSubmittedCodes().includes(finallyKey) return !has; }, @@ -1265,7 +1257,7 @@ console.log("fillll") const current = this.getFqyqInfo(); recordOldVlaue = `${current.des + current.oldValue}`; recordValue = `${current.des + current.newValue}`; - if(this.currentHandleType === "inputValue"){ + if (this.currentHandleType === "inputValue") { finallyKey = current.key; } isModify = !!this.oldFqyqValue.mainRadio @@ -1283,11 +1275,11 @@ console.log("fillll") recordValue = `${current.des + (current.newValue || '')}`; isModify = !!current.oldValue; } - }else if(this.type === "checkbox"){ - recordOldVlaue = `${this.item.checkboxLabel || ""}:${this.oldValue?'勾选':'未勾选'}`; - recordValue = `${this.item.checkboxLabel||""}:${this.inputValue?'勾选':'未勾选'}`; + } else if (this.type === "checkbox") { + recordOldVlaue = `${this.item.checkboxLabel || ""}:${this.oldValue ? '勾选' : '未勾选'}`; + recordValue = `${this.item.checkboxLabel || ""}:${this.inputValue ? '勾选' : '未勾选'}`; isModify = this.oldValue !== ''; - }else if(this.type === "attachment"){ + } else if (this.type === "attachment") { const attList = JSON.parse(recordValue); const oldAttList = JSON.parse(recordOldVlaue || "[]"); recordValue = attList.map(item => item.name).join(";"); @@ -1423,7 +1415,7 @@ console.log("fillll") return this.templateFillType !== "preFill" } else if (fillType === "blxjsh") {//当模板状态是预填写时,只有当fillType是blxjsh才能填写 return this.templateFillType !== "blxjsh" - }else { + } else { return true } } @@ -1631,6 +1623,7 @@ console.log("fillll") .el-checkbox__inner { border-color: #f9c588 !important; } + &.is-checked { .el-checkbox__label { color: #606266; @@ -1859,6 +1852,7 @@ console.log("fillll") color: #606266; flex: 1; background-color: #fff; + &.disabled { cursor: not-allowed; color: #c0c4cc; @@ -2069,6 +2063,7 @@ console.log("fillll") border-radius: 4px; border: 1px solid #ff5d5d; } + .no-border { border: none; } diff --git a/src/components/Template/StepComponents/ZLSubPackage.vue b/src/components/Template/StepComponents/ZLSubPackage.vue index bdd69ef..a553d27 100644 --- a/src/components/Template/StepComponents/ZLSubPackage.vue +++ b/src/components/Template/StepComponents/ZLSubPackage.vue @@ -2,10 +2,10 @@
@@ -97,6 +99,10 @@ export default { prefixKey: { type: String, default: "" + }, + stepIndex: { + type: Number, + default: 0 } }, mounted() { @@ -115,6 +121,10 @@ export default { } }, methods: { + // 子组件提交处理方法 + onSubPackageSubmit(key){ + this.$emit("onSubPackageSubmit", {key,formData:this.formFields}); + }, // //试剂/仪器等弹窗提交 onRegentSubmit(data,key,item){ this.updateFormData(key,data.selectedId); @@ -123,7 +133,7 @@ export default { this.allFieldsConfig[key].sjSelectType = data.selectType; } this.formFields[`selectInfo_${key}`] = data.selectInfo; - // this.$emit("onRegentSubmit", {selectInfo:data,key,config:item}); + this.$emit("onRegentSubmit", {selectInfo:data,key,config:item}); }, getRegentItem(item,fieldCode="type"){ const type = item[fieldCode] ; diff --git a/src/utils/formPackageCommon.js b/src/utils/formPackageCommon.js index 9fb003e..cfb6814 100644 --- a/src/utils/formPackageCommon.js +++ b/src/utils/formPackageCommon.js @@ -5,7 +5,7 @@ export const isShowOther = (v = [], col) => { } // 确保v是数组类型,以避免类型错误 const arr = Array.isArray(v) ? v : [v] - const otherArr = ['其他', '遮光', 'CA-QC Dilution-', '拒绝', '部分接受',"污染"] + const otherArr = ['其他', '遮光', 'CA-QC Dilution-', '拒绝', '部分接受', "污染"] return arr.some((item) => otherArr.includes(item)) } @@ -19,7 +19,25 @@ export const isShowOtherByRadioAndOther = (v = '', col) => { } //checkboxTree判断是否显示其他输入框 -export const isShowOtherByCheckboxTree = (v = "")=>{ - const otherArr = ['其他', '样品信息', '样品','部分接受'] - return otherArr.includes(v) +export const isShowOtherByCheckboxTree = (v = "") => { + + const otherArr = ['其他', '样品信息', '样品', '部分接受', '给药 ', + '样本采集', + '日常观察 ', + '皮肤评分', + '眼刺激评分', + '麻醉 ', + '交配确认', + 'PND检测', + '神经行为功能评测', + '血糖测定', + '遥测数据采集', + '呼吸检测', + '血压测定', + '心电检测', + '体温测定', + '毒代 TK', + '药代 PK' + , '细胞因子'] + return otherArr.includes(v) }