From 843c99ca06c38ec0eea664bb1522a1ddf6952c2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E6=96=8C=E6=9D=B0?= <> Date: Mon, 23 Oct 2023 10:10:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E8=80=83=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/itemSet/ReferenceRange.vue | 143 +++++++++++++++++----- src/views/fee-settings/Item.vue | 54 ++++---- 2 files changed, 143 insertions(+), 54 deletions(-) diff --git a/src/components/itemSet/ReferenceRange.vue b/src/components/itemSet/ReferenceRange.vue index 18e4487..e85b4fe 100644 --- a/src/components/itemSet/ReferenceRange.vue +++ b/src/components/itemSet/ReferenceRange.vue @@ -5,9 +5,8 @@ :data="tableData" border style="width: 100%" - row-key="id" class="el-table__body-wrapper tbody" - height="200" + :height="window.pageHeight < 600 ? 260 : window.pageHeight - 340" @row-click="rowick" highlight-current-row > @@ -50,7 +49,7 @@ - + -
-
+
+
新增
-
+
编辑
-
+
删除
@@ -120,7 +119,7 @@ > - + - + - + + 取 消 确 定 - 关 闭
@@ -180,7 +179,7 @@ export default { { required: true, message: "请输入年龄上限", trigger: "blur" }, ], referenceRangeValue: [ - { required: true, message: "请输入引用范围", trigger: "blur" }, + { required: true, message: "请输入参考范围", trigger: "blur"}, ], criticalRangeValue: [ { required: true, message: "请输入临界范围", trigger: "blur" }, @@ -212,7 +211,10 @@ export default { id: "", //新增/编辑 或删除的记录 id forSexId: [], //性别 diagnosis: [], //偏低诊断 + diagnosies:[],//偏高诊断 tableData: [], + curRowes:{}, + diagnosisId:"" }; }, @@ -225,7 +227,7 @@ export default { this.getlist(this.itemId, this.ReferenceRangeTypeFlag); }, computed: { - ...mapState(["itemSet"]), + ...mapState(["itemSet","window"]), }, methods: { getlist(itemId, ReferenceRangeTypeFlag) { @@ -236,11 +238,52 @@ export default { }); }, + remoteMethods(keyWords){ + if (keyWords) { + this.diagnosis = []; + this.diagnosisId.forEach(item => { + if (item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 + || item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 + // || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 + ) { + this.diagnosis.push(item); + } + }); + } else { + this.quckeDitd = deepCopy(this.diagnosis); + } + }, + remoteMethodes(keyWords){ + if (keyWords) { + this.diagnosies = []; + this.diagnosisId.forEach(item => { + if (item.displayName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 + || item.simpleCode.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 + // || item.shortName.toLowerCase().indexOf(keyWords.toLowerCase()) > - 1 + ) { + this.diagnosies.push(item); + } + }); + } else { + this.quckeDitd = deepCopy(this.diagnosies); + } + }, rowick(row) { - this.id = row.id; - this.form = row; + getapi(`/api/app/reference-range/${row.id}`).then((res) => { + this.curRowes = res.data; + this.id = res.data.id; + }); + }, + quckEditdigoisce(e){ + if(!e){ + this.remoteMethods() + } + }, + quckEditdigoisces(e){ + if(!e){ + this.remoteMethodes() + } }, - //ldddw(forSexId, 'id', scope.row.forSexId, 'displayName') ldddw(arrayData, key, value, display) { return dddw(arrayData, key, value, display); @@ -255,31 +298,43 @@ export default { //诊断 postapi("/api/app/diagnosis/getlistinsuggestion").then((res) => { this.diagnosis = res.data; + this.diagnosies=res.data + this.diagnosisId=res.data }); }, add() { + this.addtoedit() this.id = ""; + this.dialogVisible = true; + if (this.$refs.form !== undefined){ + this.$refs.form.resetFields() + } + Object.assign(this.$data.form, this.$options.data().form) this.form = { itemId: this.itemId, referenceRangeTypeFlag: this.ReferenceRangeTypeFlag, }; - this.dialogVisible = true; }, //编辑弹框 edit() { if (!this.id) { - alert("请先选中要编辑的记录"); + this.$message.warning("请先选中要编辑的记录"); return; } this.dialogVisible = true; + if (this.$refs.form !== undefined){ + this.$refs.form.resetFields() + } + this.form={...this.curRowes} + this.addtoedit() }, del() { //this.$message.success("删除操作"); if (!this.id) { - alert("请先选中要删除的记录"); + this.$message.warning("请先选中要删除的记录"); return; } this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", { @@ -304,17 +359,13 @@ export default { }); }); }, - - //确定新增或者编辑 - onsbmint() { - this.$refs["form"].validate((v) => { - if (v) { - if (!this.id) { + confirmationRequest(){ + if (!this.id) { postapi("/api/app/reference-range", this.form).then((res) => { if(res.code!=-1){ this.$message.success("新增成功"); this.getlist(this.itemId, this.ReferenceRangeTypeFlag); - this.id = res.data.id; + this.id = this.curRowes.id; this.dialogVisible=false } }); @@ -329,6 +380,38 @@ export default { } ); } + }, + //确定新增或者编辑 + onsbmint() { + this.$refs["form"].validate((v) => { + let that=this + if (v) { + if(that.form.referenceRangeValue.includes('-')){ + let before=/^\d+\.?\d?$/.test(that.form.referenceRangeValue.match(/(\S*)-/)[1]) + let after=/^\d+\.?\d?$/.test(that.form.referenceRangeValue.match(/-(\S*)/)[1]) + if(before && after){ + console.log(that.form) + if(that.form.criticalRangeValue!="" && that.form.criticalRangeValue!=undefined){ + if(that.form.criticalRangeValue.includes('-')){ + let criticalBefore=/^\d+\.?\d?$/.test(that.form.criticalRangeValue.match(/(\S*)-/)[1]) + let criticalAfter=/^\d+\.?\d?$/.test(that.form.criticalRangeValue.match(/-(\S*)/)[1]) + if(criticalBefore && criticalAfter){ + that.confirmationRequest() + }else{ + return that.$message.warning("警告范围值-符号前后必须是数字"); + } + }else{ + return that.$message.warning("警告范围值必须以-符号隔开"); + } + }else{ + that.confirmationRequest() + } + }else{ + return that.$message.warning("参考范围值-符号前后必须是数字"); + } + }else{ + return that.$message.warning("参考范围值必须以-符号隔开"); + } } }); }, @@ -353,5 +436,9 @@ export default { diff --git a/src/views/fee-settings/Item.vue b/src/views/fee-settings/Item.vue index a8be22a..e2080a8 100644 --- a/src/views/fee-settings/Item.vue +++ b/src/views/fee-settings/Item.vue @@ -428,7 +428,7 @@
-
+
-
-
- 诊断设置 -
- -
+
+ 新增 +
@@ -667,9 +655,8 @@ - 取 消 确 定 @@ -1282,22 +1269,37 @@ export default { this.disableddiagnosisFunction = false; } }, - //参考范围确定类型 - determinetype() { - if (this.referencerangevalue == 2) { - console.log(this.form.id); + addfssubdex(){ + if(this.fssubdex){ let obj = { itemId: this.form.id, referenceRangeValue: this.fssubdex, referenceRangeTypeFlag: this.referencerangevalue, }; postapi("/api/app/reference-range/text", obj).then((res) => { - this.$message.success("新增成功"); - this.fssubdex = res.data.referenceRangeValue; - this.diagnosdialogVisible = false; + if(res.code!=-1){ + this.$message.success("新增成功"); + this.fssubdex = ""; + } }); + }else{ + this.$message.warning("内容不能为空"); } }, + //参考范围确定类型 + determinetype() { + this.referencerangedialogVisible = false; + // if(this.referencerangevalue == 0){ + // this.referencerangedialogVisible = false; + // }else if(this.referencerangevalue == 1){ + // this.referencerangedialogVisible = false; + // }else if (this.referencerangevalue == 2) { + + // }else if(this.referencerangevalue == 3){ + // this.referencerangedialogVisible = false; + // } + this.referencerangevalue="0" + }, async blurInput(id, name, value) { var isdate = false; //是否存在 for (var i = 0; i < this.newssdate.length; i++) {