浏览代码

诊断依据文本框修改(未完成)

zhangxc 5 年之前
父节点
当前提交
0dd76ebf44
共有 2 个文件被更改,包括 47 次插入43 次删除
  1. 46 42
      src/components/diagBase/AddDiagBase.vue
  2. 1 1
      src/components/diagBase/Textarea.vue

+ 46 - 42
src/components/diagBase/AddDiagBase.vue

@@ -109,7 +109,7 @@
                     </td>
                     <td class="FeatureResult">
                         <el-tooltip :disabled="!item.verifyResult"  class="item" effect="dark" :content="item.verifyResult" placement="top">
-                            <!-- <el-input class="groupTextarea"
+                            <el-input class="groupTextarea"
                                 type="textarea"  
                                 :autosize="{ minRows: 1}"
                                 :readonly="item.type!=3"  
@@ -118,13 +118,13 @@
                                 v-model.trim="item.midResult" 
                                 @input="handleInp(index,$event,'FeatureResult')"
                                 @focus="clickItem(index,'FeatureResult')">
-                            </el-input> -->
-                            <Textarea 
-                                :value = "item.uniqueName"
-                                :readonly = "item.type!=3"
+                            </el-input>
+                            <!-- <Textarea 
+                                :value = "item.midResult"
+                                :readonly = "item.type==3"
                                 :borderRed = 'item.verifyResult'
-                                @handleInp="handleInp"
-                            ></Textarea>
+                                @handleInp="handleInp(index,$event,'FeatureResult')"
+                            ></Textarea> -->
                         </el-tooltip> 
                     </td>
                     <td class="FeatureOpera">
@@ -476,14 +476,16 @@
         exportDiagnosticAll(){
             this.submitForm('export').then(() => {
                 if(this.hasQuestion == 0) {
-                        const param = {
+                    const param = {
                         diagnoseId: this.id
                     }
                     api.exportDiagnosticAll(param).then((res) => {
                         utils.downloadExportedData(res.data,'诊断依据.xls');
                     })
                 }else {
-                    this.warning('导出失败');
+                    if(!this.hasNoUniqueName) {
+                        this.warning('导出失败');
+                    }
                 }
                 
             })
@@ -549,7 +551,8 @@
                 return this.labVerifyData(labArr, loading,type).then(() =>{
                     if(this.hasNoUniqueName) {
                         loading.close()
-                        return
+                        return      
+                       
                     }else {
                         this.verifyDiagBase(loading,type)
                     }
@@ -719,6 +722,7 @@
                 this.disFeatureList = JSON.parse(JSON.stringify(disFeatureList))
                 this.errorTips(errorStr)
                 loading.close()
+                this.isReady=false
                 return  false
             }
             return true
@@ -757,7 +761,8 @@
                         }
                     }
                     if(errorStr) {
-                        this.errorTips(errorStr)
+                       return this.errorTips(errorStr);
+                        
                     }
                     this.disFeatureList = JSON.parse(JSON.stringify(this.disFeatureListResult))
                     this.disFeatureListResult = JSON.parse(JSON.stringify(this.disFeatureListResult))
@@ -834,41 +839,40 @@
         },
        
         // handleInp(index,e,type,itemType){ //分组不能输入负数
-        handleInp(e){ //分组不能输入负数
-            console.log(e)
+        handleInp(index,e,type,itemType){ //分组不能输入负数
 
-            // const value = e
-            // if(type === 'FeatureNumber') { //序号只能输入数字和.
-            //     this.$nextTick(() => {
-            //         this.disFeatureList[index].code = value.replace(/[^\d.]/g,'')
-            //     })
-            // } else if(type==='FeatureStand') {  //标准词不能输入顿号
-            //      this.$nextTick(() => {
-            //         this.disFeatureList[index].standard = value.replace(/、/g,'')
-            //     })
-            //     // this.disFeatureList[index].standard = value.replace(/、/g,'')
-            // } else if ( type === 'FormulaNumber') {
-            //     //计算公式确诊只能输入以下内容: 任、一、二、三、四、五、六、七、八、九、十、拟、诊、0-9、/、.、(、)、(、)
-            //     if(itemType == 91) {
-            //         this.$nextTick(() => {
+            const value = e
+            if(type === 'FeatureNumber') { //序号只能输入数字和.
+                this.$nextTick(() => {
+                    this.disFeatureList[index].code = value.replace(/[^\d.]/g,'')
+                })
+            } else if(type==='FeatureStand') {  //标准词不能输入顿号
+                 this.$nextTick(() => {
+                    this.disFeatureList[index].standard = value.replace(/、/g,'')
+                })
+                // this.disFeatureList[index].standard = value.replace(/、/g,'')
+            } else if ( type === 'FormulaNumber') {
+                //计算公式确诊只能输入以下内容: 任、一、二、三、四、五、六、七、八、九、十、拟、诊、0-9、/、.、(、)、(、)
+                if(itemType == 91) {
+                    this.$nextTick(() => {
                        
-            //             this.disFormulaList[index].formula =  value.replace(/[^\u4EFB\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D\u5341\u62df\u8bca0-9\/\.+\(\)\(\)]/g,'').replace(/[\(]/g, '(').replace(/[\)]/g, ')').replace(/' '/g, '')
-            //         })
-            //     } else {    //计算公式其他只能输入以下内容: 任、一、二、三、四、五、六、七、八、九、十、0-9、/、.、(、)、(、)
-            //     //计算公式只能输入以下内容: 任、一、二、三、四、五、六、七、八、九、十、0-9、/、.、(、)、(、)
-            //         this.$nextTick(() => {
-            //             this.disFormulaList[index].formula =  value.replace(/[^\u4EFB\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D\u53410-9\/\.+\(\)\(\)]/g,'').replace(/[\(]/g, '(').replace(/[\)]/g, ')').replace(/' '/g, '')
-            //         })
-            //     }
+                        this.disFormulaList[index].formula =  value.replace(/[^\u4EFB\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D\u5341\u62df\u8bca0-9\/\.+\(\)\(\)]/g,'').replace(/[\(]/g, '(').replace(/[\)]/g, ')').replace(/' '/g, '')
+                    })
+                } else {    //计算公式其他只能输入以下内容: 任、一、二、三、四、五、六、七、八、九、十、0-9、/、.、(、)、(、)
+                //计算公式只能输入以下内容: 任、一、二、三、四、五、六、七、八、九、十、0-9、/、.、(、)、(、)
+                    this.$nextTick(() => {
+                        this.disFormulaList[index].formula =  value.replace(/[^\u4EFB\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D\u53410-9\/\.+\(\)\(\)]/g,'').replace(/[\(]/g, '(').replace(/[\)]/g, ')').replace(/' '/g, '')
+                    })
+                }
                 
             
-            // } else if ( type === 'FeatureRelate') {
-            //     if(itemType == 3) {
-            //          this.$nextTick(() => {
-            //             this.disFeatureList[index].relation = value.replace(/、/g,'')
-            //         })
-            //     }
-            // }
+            } else if ( type === 'FeatureRelate') {
+                if(itemType == 3) {
+                     this.$nextTick(() => {
+                        this.disFeatureList[index].relation = value.replace(/、/g,'')
+                    })
+                }
+            }
             // const item = this.selectedIndexList[index].indexDesc;
             // e.target.value = value.replace(/[^\d]/g,'');
             // this.selectedIndexList[index].indexDesc = item.replace(/[^\d]/g,'');

+ 1 - 1
src/components/diagBase/Textarea.vue

@@ -21,7 +21,7 @@ export default {
     },
     methods: {
         handInput(e) {
-           this.$emit("handleInp",e)
+           this.$emit("handleInp",e.target.innerText.replace(/\s+/g,""))
         },
         handleFocus() {