Browse Source

独立填写单选项超过30个字bug修改1847

zhouna 6 years ago
parent
commit
16803309ab

+ 13 - 1
src/components/preTreat/AddSimpleQuestion.vue

@@ -83,9 +83,21 @@
         let isNull = false;
         let options2 = [];
         const opts = this.options;
+        let pureName='',pureDesc = '';
         for (let i = 0; i < this.options.length; i++) {
+          pureName=this.options[i].name.replace(/(\$\{number_\S*?\})|(\$\{input_\S*?\})/g,'');
+          pureDesc = this.options[i].description.replace(/(\$\{number_\S*?\})|(\$\{input_\S*?\})/g,'');
+          if(pureName.length>30){
+            this.warning('医生界面展示内容不能超过30个字');
+            return ;
+          }
+          if(pureDesc.length>30){
+            this.warning('患者界面展示内容不能超过30个字');
+            return ;
+          }
+
           if(this.options[i].name.trim() != '') {
-            options2.push(this.options[i])
+              options2.push(this.options[i]);
           }else if(this.options[i].description.trim() != ''){           //患者填了,医生没填,提示医生必填
             isNull = true;
           }

+ 2 - 2
src/components/preTreat/PubSelect.vue

@@ -244,13 +244,13 @@
         const pureName=name.replace(/(\$\{number_\S*?\})|(\$\{input_\S*?\})/g,'');
         //console.log(pureName);
         if(pureName.length > 30) {
-          if(isName){
+          /*if(isName){
             Vue.set(this.rows[i], 'name', this.rows[i].name.slice(0, 30));
             this.$refs.inputName[i].currentValue = this.rows[i].name;
           }else{
             Vue.set(this.rows[i], 'description', this.rows[i].description.slice(0, 30));
             this.$refs.inputDesc[i].currentValue = this.rows[i].description;
-          }
+          }*/
 
           this.$message({
             message: '最多输入30个字',