Selaa lähdekoodia

Merge remote-tracking branch 'origin/test'

zhouna 6 vuotta sitten
vanhempi
commit
f93422ef32

+ 2 - 2
src/api/config.js

@@ -223,11 +223,11 @@ export default {
     'fileDel':'/api/precman/file_prec/deleteRemoteFile',          //图片删除
     'questionDetail':'/api/precman/questionInfo_prec/getById',                //填写单详情
     'moduleList':'/api/precman/moduleInfo_prec/getModuleInfoList',        //模板列表
-    'addModule':'/api/precman/moduleInfo_prec/saveModuleInfo',        //模板添加
+    'addModule':'/api/precman/moduleInfo_prec/saveOrUpdateModuleInfo',        //模板添加
     'delModule':'/api/precman/moduleInfo_prec/delete',        //模板删除
     'moduleDetail':'/api/precman/moduleInfo_prec/getModuleInfoOne',    //模板详情
     'deptList':'/api/precman/moduleInfo_prec/getAllDeptAndDisInfo',    //模板-科室列表
-
+    'getPrecModuleType':'/api/precman/moduleInfo_prec/getModuleType',     //获取未创建的模板类型
   },
 	menuIconList: { //菜单对应图标
 		'YH-KZT': 'el-icon-menu',

+ 4 - 1
src/api/preTreat.js

@@ -40,6 +40,9 @@ export default {
     return axios.post(urls.delModule, param);
   },
   getDeptList(param){
-    return axios.post(urls.deptList, param)
+    return axios.post(urls.deptList, param);
+  },
+  getModuleType(param){
+    return axios.post(urls.getPrecModuleType, param);
   }
 }

+ 4 - 4
src/components/admin/Console.vue

@@ -1,7 +1,7 @@
 <template>
     <div>
         <crumbs title="控制台"></crumbs>
-        <div class="console" v-if="hasConcole">
+        <div class="console">
             <h2>平台数据</h2>
             <el-row :gutter="20">
                 <el-col :span="6">
@@ -36,7 +36,7 @@
 
   export default {
     name: 'admin-console',
-    props:['hasConcole'],
+   /* props:['hasConcole'],*/
     data: function () {
       return {
         orderCount: '...',
@@ -45,10 +45,10 @@
     },
     beforeRouteEnter(to,form,next){
       next(vm=>{
-        if(!vm.hasConcole){
+        /*if(!vm.hasConcole){
           vm.$emit('redirect-page');
           return;
-        }
+        }*/
         //获取控制台默认显示数字
         api.getOrderNum().then((res) => {
           const result = res.data;

+ 35 - 19
src/components/common/HomePage.vue

@@ -23,7 +23,7 @@
                 </div>
             </el-header>
             <el-main>
-              <router-view v-if="ok" v-on:status-change="changeStatus" v-on:redirect-page="redirectPage" :hasConcole="hasConcole"></router-view>
+              <router-view v-if="ok" v-on:status-change="changeStatus"></router-view>
             </el-main>
         </el-container>
     </el-container>
@@ -51,7 +51,6 @@
         authStatus: null,
         authStatusName:'',
         ok:false,           //是否已获取到菜单
-        hasConcole:true         //是否有控制台权限,登录后跳转用
       }
     },
     computed: {
@@ -61,28 +60,45 @@
     },
     created () {
       //获取菜单
-      api.getAccessdMenu().then((res) => {
-        if (res.data.code == '0') {
-          const data = res.data.data;
-            this.ok = true;
-            const hasConcole=data.menuWrappers.findIndex((it)=>{
-              return it.code == 'LT-KZT'
-            });
-          this.hasConcole = hasConcole!=-1;
-          this.menuWrappers = data.menuWrappers;
-          this.organization = data.organization;
-          this.userLoginDTO = data.userLoginDTO;
-          data.userLoginDTO && data.userLoginDTO.type == '0' && this.getAuthStatus();
+      this.getMenuList();
+    },
+    watch:{
+      '$route': function(to,from){
+            if(from.name=='login'){
+              this.getMenuList();
+            }
+            if(to.path=='/'){       // 退出时清空菜单
+              this.menuWrappers=[];
+            }
         }
-      }).catch((error) => {
-        console.log(error);
-      });
     },
     methods: {
-      redirectPage(){
+      getMenuList(){
+        api.getAccessdMenu().then((res) => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.ok = true;
+            const hasConcole=data.menuWrappers.find((it)=>{
+              return it.code.indexOf('-KZT')>-1;
+            });
+            //this.hasConcole = hasConcole!=-1;
+            this.menuWrappers = data.menuWrappers;
+            this.organization = data.organization;
+            this.userLoginDTO = data.userLoginDTO;
+            this.getRole=='user' && this.getAuthStatus();
+            if(hasConcole){
+              const url = this.getRole=='user'?'/user/YH-KZT':'/admin/LT-KZT';
+              this.$router.push({path:url});
+            }
+          }
+        }).catch((error) => {
+          console.log(error);
+        });
+      },
+      /*redirectPage(){
         const url = this.getRole=='user'?'/user':'/admin';
         this.$router.push({path:url});
-      },
+      },*/
       changeStatus(text){       //账号信息中提交认证后修改状态
         this.authStatus = 2;
         this.authStatusName = text;

+ 24 - 8
src/components/icss/AddMedicinePrompt.vue

@@ -15,6 +15,9 @@
                                filterable
                                remote
                                clearable
+                               :loading="showDrop"
+                               loading-text="加载中..."
+                               @change="changeWord"
                                value-key="conceptId"
                                ref="termName"
                                placeholder="搜索"
@@ -62,6 +65,7 @@
     data() {
       return {
         isEdit:false,
+        isCopy:false,
         termTypes:[],
         terms:[],              //术语列表
         editData:{
@@ -88,22 +92,26 @@
             { required: true, message: '请选择术语标签', trigger: 'change' }
           ]
         },
-        saveDisable: false  //保存按钮禁止点击
+        saveDisable: false,  //保存按钮禁止点击
+        showDrop:false,        //下拉框显示文字bug1774
       }
     },
-    watch:{
+    /*watch:{
       'form.selectedTerm':function(newVal){
-        const name = newVal.nameType;
+        const name = newVal.nameType;console.log(newVal)
         this.form.selectedTermName = name;
         this.form.conceptId = newVal.conceptId;
       }
-    },
+    },*/
     created:function(){
-      const {isEdit,data} = this.$route.params;
-      if(isEdit){
+      const {isEdit,data,isCopy} = this.$route.params;
+      if(isEdit||isCopy){
         this.isEdit = isEdit;
-        this.form.selectedTermName = data.libName;
-        this.form.conceptId = data.conceptId;
+        this.isCopy = isCopy;
+        this.changeWord(data);
+        //this.form.selectedTerm = data;
+        //this.form.selectedTermName = data.libName;
+        //this.form.conceptId = data.conceptId;
         api.getTremList({conceptId:data.conceptId}).then((res) => {
           if (res.data.code == '0') {
             const data = res.data.data;
@@ -124,6 +132,12 @@
       }
     },
     methods: {
+      changeWord(newVal){
+        const name = newVal.nameType;
+        this.form.selectedTermName = name;
+        this.form.selectedTerm=name;
+        this.form.conceptId = newVal.conceptId;
+      },
       reOrder(isUp,i){
         let temp = {},it={};
         if(isUp===1){
@@ -176,7 +190,9 @@
       back() { this.$router.go(-1) },
       searchTerms(query){
         //搜索术语列表
+        this.showDrop = true;
         api.getAllConcept({name:query}).then((res) =>{
+          this.showDrop = false;
           if(res.data.code === '0') {
             this.terms = res.data.data;
           }else{

+ 0 - 1
src/components/icss/AddVersion.vue

@@ -13,7 +13,6 @@
               v-model="form.refreshTime"
               type="date"
               placeholder="选择日期"
-              :picker-options="pickerOptions1"
               value-format="yyyy-MM-dd"
               :clearable='false'>
             </el-date-picker>

+ 11 - 1
src/components/icss/MedicalName.vue

@@ -256,10 +256,20 @@
             });
             this.getDataList();
           }else{
-            this.$message({
+            /*this.$message({
               dangerouslyUseHTMLString: true,
               message:res.data.msg,
               type:'warning'
+            });*/
+            this.$alert(res.data.msg,'错误信息',{
+              dangerouslyUseHTMLString: true,
+              confirmButtonText: '确定',
+              callback: action => {
+                /*this.$message({
+                  type: 'info',
+                  message: `action: ${ action }`
+                });*/
+              }
             });
           }
         })

+ 12 - 1
src/components/icss/MedicalRelation.vue

@@ -284,10 +284,21 @@
             });
             this.getDataList()
           }else{
-            this.$message({
+            /*this.$message({
               dangerouslyUseHTMLString: true,
               message:res.data.msg,
               type:'warning'
+            });*/
+            // 7-22 改成确定按钮
+            this.$alert(res.data.msg,'错误信息',{
+              dangerouslyUseHTMLString: true,
+              confirmButtonText: '确定',
+              callback: action => {
+                /*this.$message({
+                  type: 'info',
+                  message: `action: ${ action }`
+                });*/
+              }
             });
           }
         })

+ 9 - 1
src/components/icss/MedicineInfoPg.vue

@@ -63,7 +63,15 @@
               },
               action: config.urls.promptServer,
               response: (res) => {
-                return config.imgHost+res.url;
+                if(res.code=='0'){
+                  return config.imgHost+res.data.url;
+                }else{
+                  this.$message({
+                    showClose: true,
+                    message: res.msg,
+                    type: 'warning'
+                  })
+                }
               }
             },
             toolbar: {

+ 9 - 1
src/components/icss/MedicinePrompt.vue

@@ -51,11 +51,13 @@
                         width="80">
                 </el-table-column>
                 <el-table-column
-                        label="操作" width="120">
+                        label="操作" width="140">
                     <template slot-scope="scope">
                         <el-button v-if="scope.row.isDeleted=='Y'" type="text" size="small" class="is-disabled">修改</el-button>
                         <el-button v-if="scope.row.isDeleted=='N'" type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
                         <span style="margin:0 3px;">|</span>
+                        <el-button type="text" size="small" @click="toCopyProduct(scope.row)">复制</el-button>
+                        <span style="margin:0 3px;">|</span>
                         <el-button v-if="scope.row.isDeleted=='Y'" type="text" size="small" @click="showReuseDialog(scope.row)">恢复</el-button>
                         <el-button v-if="scope.row.isDeleted=='N'" type="text" size="small" class="delete" @click="showDelDialog(scope.row)">删除</el-button>
                     </template>
@@ -104,6 +106,12 @@
           params: {data:row,isEdit:true}
         })
       },
+      toCopyProduct(row){
+        this.$router.push({
+          name:'AddMedicinePrompt',
+          params: {data:row,isCopy:true}
+        })
+      },
       filterDatas(){
         this.currentPage = 1;
         this.getDataList();

+ 2 - 1
src/components/icss/PubTagPartDetail.vue

@@ -90,7 +90,7 @@
                 </template>
               </p>        
               <p class="partDetail tipsWrap" :title="item.join" :key="item.join+'--'" v-if="!!item.join">标签之间链接{{item.join}}</p>
-              <p class="partDetail tipsWrap" :title="item.name" :key="item.type+'--'" v-if="!!item.name">{{item.name}}</p> 
+              <p class="partDetail tipsWrap" :title="item.tagName" :key="item.type+'--'" v-if="!!item.tagName">{{item.tagName}}</p> 
             </template>
           </li>
         </ul> 
@@ -352,6 +352,7 @@ export default {
             if(!utils.filterArr(poolDetailListTips[i],tmpLi.controlType,2)){
               objTmp.type = tmpLi.controlType
               objTmp.name = tmpLi.name
+              objTmp.tagName = tmpLi.tagName
               objTmp.join = tmpLi.joint
               if(tmpLi.controlType){
                 poolDetailListTips[i].push(objTmp)

+ 2 - 2
src/components/login/Login.vue

@@ -175,11 +175,11 @@
                       const type = res.data.data.type;
                       if (type == 0) {
                         this.$router.push({
-                          path: '/user/YH-KZT'
+                          path: '/user'
                         });
                       } else if (type == 1) {
                         this.$router.push({
-                          path: '/admin/LT-KZT'
+                          path: '/admin'
                         });
                       }
                     }.bind(this)

+ 7 - 8
src/components/preTreat/AddCombinQuestion.vue

@@ -7,7 +7,6 @@
         ></crumbs>
         <PubIndeptQa
                 @changeVal="changeVal"
-                @changeSex="changeSex"
                 @changeType="changeType"
                 @validatePass="validatePass"
                 qaType="2"
@@ -15,10 +14,10 @@
                 ref="submitForm"
         ></PubIndeptQa>
         <div class="main">
-            <p class="title">
-                填写单明细:
+            <p class="title" v-if="dataPub.region2">
+                填写单明细:<span>(互斥项与其他明细内容互斥,互斥项同时只可选择一个)</span>
             </p>
-            <QuestionTagGroup :ascription="dataPub.region1" :sexType="dataPub.region7" :type="dataPub.region2" @changeActionData="pushValues" :options="editData.questionMapping"></QuestionTagGroup>
+            <QuestionTagGroup v-if="dataPub.region2" qaType="2" :ascription="dataPub.region1" :sexType="dataPub.region7" :type="dataPub.region2" @changeActionData="pushValues" :options="editData.questionMapping"></QuestionTagGroup>
             <div class="btn">
                 <el-button
                         type="primary"
@@ -53,7 +52,7 @@
       const {isEdit,data} = this.$route.params;
       if(isEdit){
         this.txt = '组合填写单维护-修改组合填写单';
-        this.editData = data;
+        this.editData = data;console.log(data)
       }
     },
     methods: {
@@ -62,9 +61,9 @@
         this.dataPub = val;
         console.log('公用组件传的值都在这', val);
       },
-      changeSex(sex) {       //性别改变,清空填写单明细
+      /*changeSex(sex) {       //性别改变,清空填写单明细
                              //console.log(sex)
-      },
+      },*/
       changeType(type) {        //填写单类型改变,标签明细左侧更新,右侧清空
         // console.log('type',type)
         this.options = [];
@@ -74,7 +73,7 @@
           return {
             sonQuestion:it.id,
             orderNo:+i+1,
-            exclusionType:0
+            exclusionType:it.exclusionType
           }
         });
         this.options = arr;

+ 81 - 26
src/components/preTreat/AddQuestionModules.vue

@@ -25,43 +25,45 @@
                             v-for="item in moduleTypes"
                             :label="item.name"
                             :value="item.val"
-                            :key="item.id"
+                            :key="item.val"
                     ></el-option>
                 </el-select>
             </el-form-item>
             <el-form-item
-                    label="模板归属:"
-                    prop="type"
-            >
-                <span class="changeTips">改变归属后,填写单明细将会恢复到默认状态</span>
+                    v-if="form.moduleType==1"
+                    label="选择科室:"
+                    prop="relationId">
+                <span class="changeTips">改变类型后,填写单明细将会恢复到默认状态</span>
                 <el-select
-                        v-model="form.type"
+                        v-model="form.relationId"
                         :disabled="!!editData.id"
-                        placeholder="请选择模板归属"
-                        @change="changeType(0)"
+                        placeholder="请选择科室"
                 >
                     <el-option
-                            v-for="item in typeList"
+                            v-for="item in deptList"
                             :label="item.name"
-                            :value="item.val"
-                            :key="item.id"
+                            :value="item.conceptId+''"
+                            :key="item.conceptId+''"
                     ></el-option>
                 </el-select>
             </el-form-item>
             <el-form-item
-                    v-if="form.moduleType==1"
-                    label="选择科室:"
-                    prop="relationId">
-                <span class="changeTips">改变类型后,填写单明细将会恢复到默认状态</span>
+                    label="模板归属:"
+                    prop="type"
+            >
+                <span class="changeTips">改变归属后,填写单明细将会恢复到默认状态</span>
                 <el-select
-                        v-model="form.relationId"
-                        placeholder="请选择科室"
+                        v-model="form.type"
+                        :clearable="false"
+                        :disabled="!!editData.id||!form.moduleType||(form.moduleType==1&&!form.relationId)"
+                        placeholder="请选择模板归属"
+                        @change="changeType(0)"
                 >
                     <el-option
-                            v-for="item in deptList"
+                            v-for="item in typeList"
                             :label="item.name"
-                            :value="item.conceptId"
-                            :key="item.conceptId"
+                            :value="item.val"
+                            :key="item.val"
                     ></el-option>
                 </el-select>
             </el-form-item>
@@ -75,16 +77,16 @@
                         placeholder="请输入模板名称"
                 ></el-input>
             </el-form-item>
-            <el-form-item label="备注:">
-                <el-input type="textarea" v-model="form.remark"></el-input>
+            <el-form-item label="备注:" prop="remark">
+                <el-input type="textarea" v-model="form.remark" style="width: 500px;"></el-input>
             </el-form-item>
         </el-form>
     </div>
         <div class="main">
-            <p class="title">
-                填写单明细:
+            <p class="title" v-if="form.type&&form.moduleType">
+                <i v-if="form.type!=1">*</i>填写单明细:
             </p>
-            <QuestionTagGroup v-if="form.type!=1" :ascription="form.type" @changeActionData="pushValues" :options="editData.moduleDetail"></QuestionTagGroup>
+            <QuestionTagGroup v-if="form.type&&form.moduleType&&form.type!=1" qaType="3" :ascription="form.type" :relationId="form.relationId" @changeActionData="pushValues" :options="editData.moduleDetail"></QuestionTagGroup>
             <div class="static" v-if="form.type==1">
                 <p>请问您有哪些不适?</p>
                 <div class="inner">科室常见症状</div>
@@ -132,7 +134,23 @@
             { required: true, message: '请选择类型', trigger: 'change' }
           ],
           name: [
-            { required: true, message: '请输入模板名称', trigger: 'change' }
+            { required: true, message: '请输入模板名称', trigger: 'change' },
+            { validator: (rule, value, callback)=>{
+              if(value.length>7){
+                callback(new Error('模板名称不能超过7个字'));
+              }else{
+                callback();
+              }
+              }, trigger: 'blur' },
+          ],
+          remark:[
+            { validator: (rule, value, callback)=>{
+                if((value&&value.trim().length>0)&&value.length>120){
+                  callback(new Error('备注不能超过120个字'));
+                }else{
+                  callback();
+                }
+              }, trigger: 'blur' },
           ],
           relationId: [
             { required: true, message: '请选择模板归属科室', trigger: 'change' },
@@ -144,13 +162,34 @@
       const {isEdit,data} = this.$route.params;
       this.getDropDatas();
       if(isEdit){
+        //this.getAvailibleType();
         this.txt = '模板维护-修改模板';
         this.form = Object.assign({},this.form,this.transFormData(data));
         this.editData = data;
       }
     },
+    watch:{
+      'form.moduleType':function(newVal,oldVal){
+        if(+newVal!==1){
+          this.form.relationId = '';
+        }
+        this.getAvailibleType();
+      },
+      'form.relationId':function(newVal,oldVal){
+        this.getAvailibleType();
+      },
+    },
     methods: {
       back() { this.$router.go(-1) },
+      getAvailibleType(){
+        api.getModuleType({moduleType:this.form.moduleType,relationId:this.form.relationId}).then((res) =>{
+          if(res.data.code === '0') {
+            this.typeList = res.data.data;
+          }else{
+            this.warning(res.data.msg);
+          }
+        });
+      },
       transFormData(org){
         const maps = {
           'moduleType':'moduleType',
@@ -212,6 +251,10 @@
           if (valid) {
             let param = this.form;
             param.moduleDetail = this.options;
+            if(this.form.type!=1&&(!this.options||this.options.length==0)){
+              this.warning('模版至少包含一个填写单');
+              return;
+            }
             this.showSaveDialog(param);
           }else{
             return false;
@@ -255,6 +298,18 @@
 </script>
 <style lang="less">
     @import "../../less/common.less";
+    .NoiseTemplateWrapper .el-select .el-input__validateIcon.el-icon-circle-close{
+        display: none!important;
+    }
+    .PubTagGroupWrapper .groups {
+        padding: 20px 20px 30px;
+        .el-form-item__error{
+            top:unset;
+        }
+    }
+    .NoiseTemplateWrapper .PubTagGroupWrapper{
+        padding-bottom: 18px;
+    }
     .static{
         width:360px;
         height:137px;

+ 18 - 20
src/components/preTreat/AddSimpleQuestion.vue

@@ -14,7 +14,7 @@
         ></PubIndeptQa>
         <div class="main">
             <p class="title" v-if="dataPub.region2==1||dataPub.region2==2|| dataPub.region2==3|| dataPub.region2==11">
-                填写单明细:
+                填写单明细:<span v-if="dataPub.region2==2">(互斥项与其他明细内容互斥,互斥项同时只可选择一个)</span>
             </p>
             <PubSelect
                     v-if="dataPub.region2==1 || dataPub.region2==2 || dataPub.region2==3 || dataPub.region2==11"
@@ -83,32 +83,29 @@
         let isNull = false;
         let options2 = [];
         const opts = this.options;
-        for (let i = 0; i < this.options.length; i++) {
-          if(this.options[i].name.trim() != '') {
-            options2.push(this.options[i])
-          }else if(this.options[i].description.trim() != ''){           //患者填了,医生没填,提示医生必填
+        let pureName='',pureDesc = '';
+        for (let i = 0; i < opts.length; i++) {
+          pureName=opts[i].name.replace(/(\$\{number_\S*?\})|(\$\{input_\S*?\})/g,'');
+          pureDesc = opts[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(opts[i].name.trim() != '') {
+              options2.push(this.options[i]);
+          }else if(opts[i].description.trim() != ''){           //患者填了,医生没填,提示医生必填
             isNull = true;
           }
         }
-        this.options = options2;
         if(this.itemsTypes.includes(+this.dataPub.region2)&&isNull) {
           this.warning('医生界面展示标准内容必填');
           return;
         }
-        let flag=true;
-        if(opts[0] && opts[0].code){
-          flag=opts.findIndex((it)=>{
-            return !it.code;
-          })==-1;
-        }else{
-          flag=opts.findIndex((it)=>{
-            return it.code;
-          })==-1;
-        }
-        if(!flag){
-          this.warning('所有选项必须都有或者都没有同“伴”/“无”标记');
-          return;
-        }
         if(parseFloat(this.dataPub.region8) >= parseFloat(this.dataPub.region9)) {
           this.warning('最小年龄不能大于或等于最大年龄');
           return;
@@ -117,6 +114,7 @@
           this.warning('最小正常值不能大于或等于最大正常值');
           return;
         }
+        this.options = options2;
         const {isEdit,data} = this.$route.params;
         let param = {
           "questionWrapper": {

+ 2 - 1
src/components/preTreat/CombinQuestion.vue

@@ -157,7 +157,8 @@
         api.questionDetail({id:row.id}).then((res)=>{
           const {code,data,msg} = res.data;
           if(code=='0'){
-            this.$router.push({name:'AddCombinQuestion',params:{isEdit:true,data:data}});
+            const infos = Object.assign({},row,data);
+            this.$router.push({name:'AddCombinQuestion',params:{isEdit:true,data:infos}});
           }else{
             this.$message({
               message: msg,

+ 49 - 13
src/components/preTreat/PubIndeptQa.vue

@@ -53,7 +53,7 @@
             >
                 <el-select
                         v-model="form.region12"
-                        :disabled="!form.region1"
+                        :disabled="!form.region1||!!editData.id"
                         @change="sendData"
                 >
                     <el-option
@@ -74,7 +74,6 @@
                     <el-input
                             v-model="form.region3"
                             :disabled="!form.region1"
-                            maxLength="30"
                             placeholder="请输入填写单系统名称"
                             @change="sendData"
                             @input="focusSystemName"></el-input>
@@ -97,7 +96,6 @@
                 <el-input
                         :disabled="!form.region1"
                         v-model="form.region4"
-                        maxLength="30"
                         :placeholder="qaType==2?'请输入填写单医生界面展示标准内容':'请输入填写单界面描述名称'"
                         @change="sendData"
                 ></el-input>
@@ -110,7 +108,6 @@
                 <el-input
                         :disabled="!form.region1"
                         v-model="form.region5"
-                        maxLength="30"
                         placeholder="请输入填写单患者界面展示通俗内容"
                         @change="sendData"
                 ></el-input>
@@ -215,20 +212,57 @@
       var validatePass1 = (rule, value, callback) => {
         this.validateSystomName(value,callback,1)
       };
+      var validateNameLength = (value,callback,type)=>{
+        const limit = (type===2||type===3)&&(this.qaType==2&&this.form.region1==1)?7:30;
+        let name = '';
+        switch (type){
+          case 1:
+            name='系统名称';
+            break;
+          case 2:
+            name=this.qaType==1?'界面描述名称':'医生界面标准内容';
+            break;
+          case 3:
+            name='患者界面通俗内容';
+            break;
+        }
+        if(value.length>limit){
+          callback(new Error(name+'不能超过'+limit+'个字'));
+        }
+      };
+
       var validatePass2 = (rule, value, callback) => {
         const editData = this.$props.editData;
         if(editData.id && value == editData.tagName){ //修改系统名称没变就不再校验
           callback();
         }else{
-          this.validateSystomName(value,callback,2)
+          validateNameLength(value,callback,1);
+          this.validateSystomName(value,callback,2);
         }
       };
       var validatePass11 = (rule, value, callback) => {
+        validateNameLength(value,callback,2);
         this.validateSystomName(value,callback,11)
       };
       var validatePass12 = (rule, value, callback) => {
+        validateNameLength(value,callback,3);
         this.validateSystomName(value,callback,1)
       };
+      var validateLength = (rule, value, callback) => {
+        if(value.length>29){
+          callback(new Error('不能超过30字'));
+        }else{
+          callback();
+        }
+      };
+      var validateNum = (rule, value, callback)=>{
+        if(value<0||(''+value).indexOf('.')>-1){
+          callback(new Error('请输入正整数'));
+        }else{
+          callback();
+        }
+      };
+
       return {
         form: {
           region1: '',    //归属
@@ -286,10 +320,12 @@
             { required: true, message: '请选择性别', trigger: 'change' }
           ],
           region8: [
-            { required: true, message: '请输入最小年龄', trigger: 'change' }
+            { required: true, message: '请输入最小年龄', trigger: 'change' },
+            { validator: validateNum, trigger: 'blur' },
           ],
           region9: [
-            { required: true, message: '请输入最大年龄', trigger: 'change' }
+            { required: true, message: '请输入最大年龄', trigger: 'change' },
+            { validator: validateNum, trigger: 'blur' },
           ],
           region12: [
             { required: true, message: '请选择是否为主要内容', trigger: 'change' }
@@ -317,13 +353,11 @@
         const imgUrl = trans.region13;
         if(imgUrl){
           this.imgList = [{name:'',url:imgUrl.replace('{imageUrlPrefix}',config.imgHost)}];
+          this.showFileList = true;
         }
       };
 
-      //this.$emit('submitForm', 'groups', false);
-
       this.$emit('changeVal', this.form, false);
-
     },
     /*watch: {
       newName(nextVal, prevVal) {
@@ -339,15 +373,17 @@
         this.imgList=[];
       },
       handleSuccess(response){
-        if(response.state==='SUCCESS'){
+        if(response.code==='0'){
           this.showFileList = true;
-          this.form.region13 = '{imageUrlPrefix}'+response.url;
+          this.form.region13 = '{imageUrlPrefix}'+response.data.url;
+          this.sendData();
         }else{
+          this.imgList = [];
           this.showFileList=false;
           this.warning(response.msg);
         }
       },
-      handleError(){
+      handleError(err, file, fileList){
         this.showFileList=false;
       },
       getDropList() {

+ 42 - 41
src/components/preTreat/PubSelect.vue

@@ -3,10 +3,10 @@
         <el-form>
             <div class="operation-row">
                 <el-checkbox-group size="small">
-                    <el-checkbox-button :label="0" @change="handlePlaceholder(0)">文字输入框占位符</el-checkbox-button>
+                    <el-checkbox-button :label="0" :disabled="disableBtn" @change="handlePlaceholder(0)">文字输入框占位符</el-checkbox-button>
                 </el-checkbox-group>
                 <el-checkbox-group size="small">
-                    <el-checkbox-button :label="0" @change="handlePlaceholder(1)">数字输入框占位符</el-checkbox-button>
+                    <el-checkbox-button :label="0" :disabled="disableBtn" @change="handlePlaceholder(1)">数字输入框占位符</el-checkbox-button>
                 </el-checkbox-group>
                 <el-checkbox-group size="small" v-if="type==2">
                     <el-checkbox-button :label="0" @change="handleExclu">互斥项</el-checkbox-button>
@@ -23,13 +23,13 @@
                     <div class="inps">
                         <el-input v-model="rows[i].name"
                                   v-bind:class="{select:focusOn==i}"
-                                  @focus="selectRow(i)"
+                                  @focus="selectRow(i,'name')"
                                   ref = "inputName"
                                   @input="HandleInputName(i, rows[i].name,true)"
                                   @blur="emitValues"></el-input>
                         <el-input v-model="rows[i].description"
                                   v-bind:class="{select:focusOn==i}"
-                                  @focus="selectRow(i)"
+                                  @focus="selectRow(i,'description')"
                                   ref = "inputDesc"
                                   @input="HandleInputName(i, rows[i].description)"
                                   @blur="emitValues"></el-input>
@@ -43,7 +43,7 @@
                     <div class="inps">
                         <el-input v-model="rows[i].name"
                                   v-bind:class="{select:focusOn==i}"
-                                  @focus="selectRow(i)"
+                                  @focus="selectRow(i,'name')"
                                   ref = "inputName"
                                   @input="HandleInputName(i, rows[i].name,true)"
                                   @blur="emitValues"></el-input>
@@ -147,6 +147,8 @@
       return {
         rows:[...initRows],
         focusOn:-1,         //聚焦的行index
+        focusName:'name',        //是否聚焦医生界面输入框
+        disableBtn:false,       //占位符是否禁用
       }
     },
     mounted(){
@@ -155,15 +157,10 @@
         const arr = options.filter((it)=>{
           return it.name;
         });
-        const arrLen = arr.length;
-        if(arrLen < 4) {
-          for (let i = 0; i < 4 - arrLen; i++) {
-            arr.push(...utils.getInitRow(initRow,1))
-          }
-        }
-        this.rows = arr;
-        const items = utils.simpleOptionData(this.rows);
-        this.$emit('pushValues',items);
+        this.rows = arr.length==0?utils.getInitRow(initRow,4):arr;
+        this.$emit('pushValues',arr);
+      }else{
+        this.initData();
       }
     },
     computed:{
@@ -177,29 +174,32 @@
       },
     },
     watch: {
-      ascription(newVal, preVal) {
-        if (newVal != preVal) {
-            this.rows = [...utils.getInitRow(initRow,4)];
-        }
+      /*ascription(newVal, preVal) {        //永远检测不到,因为归属修改时类型被清空,本组件被销毁
+        this.rows = [...utils.getInitRow(initRow,4)];
+      },*/
+      type() {
+        this.initData();
       },
-      type(newVal, preVal) {
-        if (newVal != preVal) {
-            this.rows = [...utils.getInitRow(initRow,4)];
-        }
-      },
-      sexType(newVal, preVal) {
-        if (newVal != preVal) {
-            this.rows = [...utils.getInitRow(initRow,4)];
-        }
+      sexType() {
+        this.initData();
       },
     },
     methods:{
+      initData(){
+        this.rows = [...utils.getInitRow(initRow,4)];
+      },
       addRow(){
-        this.rows.push(utils.getInitRow(initRow,1));
+        this.rows.push(Object.assign({},initRow,{orderNo:this.rows.length}));
       },
-      selectRow(index){
+      selectRow(index,name){
         this.focusOn = index;
-
+        this.focusName = name;
+        const placeReg = /(\$\{number_\S*?\})|(\$\{input_\S*?\})/g;
+        if(placeReg.test(this.rows[index][name])){
+          this.disableBtn = true;
+          return;
+        }
+        this.disableBtn = false;
       },
       handlePlaceholder(type){          //占位符类型,type=0文本输入框,type=1数字输入框
         const i = this.focusOn;
@@ -212,8 +212,10 @@
           return ;
         }
         const maps = {0:'${input_输入}',1:'${number_输入}'};
-        this.rows[i].name = this.rows[i].name+maps[type];
-        this.rows[i].description = this.rows[i].description+maps[type];
+        const key = this.focusName;
+        this.rows[i][key] = this.rows[i][key]+maps[type];
+        this.disableBtn = true;
+        //this.rows[i].description = this.rows[i].description+maps[type];
       },
       handleExclu(){
         const i = this.focusOn;
@@ -246,15 +248,14 @@
         this.$emit('pushValues',items);
       },
       HandleInputName(i, name, isName) {
-        if(name.length > 30) {
-          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;
-          }
-
+        const pureName=name.replace(/(\$\{number_\S*?\})|(\$\{input_\S*?\})/g,'');
+        const hasPlace = /(\$\{number_\S*?\})|(\$\{input_\S*?\})/g.test(name);
+        if(hasPlace&&this.disableBtn==false){
+          this.disableBtn = true;
+        }else if(!hasPlace&&this.disableBtn==true){
+          this.disableBtn = false;
+        }
+        if(pureName.length > 30) {
           this.$message({
             message: '最多输入30个字',
             type: 'warning',

+ 21 - 13
src/components/preTreat/QuestionModules.vue

@@ -67,7 +67,7 @@
                 </el-table-column>
                 <el-table-column
                         :resizable = "false"
-                        prop="modifier"
+                        prop="userName"
                         label="操作人"
                         width="120">
                 </el-table-column>
@@ -151,22 +151,30 @@
       getDataList() {
         const param = this.getFilterItems();
         api.getModuleList(param).then((res) => {
-          const list = [...res.data.data.records];
-          for (var i = 0; i < list.length; i++) {
-            for (var j =  0; j < this.tagTypes.length; j++) {
-              if(list[i].moduleType == this.tagTypes[j].val) {
-                list[i].tagTypeCn = this.tagTypes[j].name;
+          if (res.data.code === '0') {
+            const list = res.data.data&&res.data.data.records?[...res.data.data.records]:[];
+            for (var i = 0; i < list.length; i++) {
+              for (var j =  0; j < this.tagTypes.length; j++) {
+                if(list[i].moduleType == this.tagTypes[j].val) {
+                  list[i].tagTypeCn = this.tagTypes[j].name;
+                }
               }
-            }
-            //后台数据typeCn转换为筛选中对应的字段名称
-            for (var z =  0; z < this.Adscriptions.length; z++) {
-              if(list[i].type == this.Adscriptions[z].val) {
-                list[i].typeCn = this.Adscriptions[z].name;
+              //后台数据typeCn转换为筛选中对应的字段名称
+              for (var z =  0; z < this.Adscriptions.length; z++) {
+                if(list[i].type == this.Adscriptions[z].val) {
+                  list[i].typeCn = this.Adscriptions[z].name;
+                }
               }
             }
+            this.list = list;
+            this.total = res.data.data.total;
+          }else{
+            this.$message({
+              message: res.data.msg,
+              type: 'warning'
+            });
           }
-          this.list = list;
-          this.total = res.data.data.total;
+
         })
       },
       filterDatas() {

+ 74 - 10
src/components/preTreat/QuestionTagGroup.vue

@@ -1,5 +1,10 @@
 <template>
     <div class="symptomTagGroupWrapper commomSymptom clearfix">
+        <div class="operation-row">
+            <el-checkbox-group size="small" v-if="qaType==2">
+                <el-checkbox-button :label="0" @change="handleExclu">互斥项</el-checkbox-button>
+            </el-checkbox-group>
+        </div>
     <div class="bottomPartLeft">
       <p class="poolTitle">标签池</p>
       <div class="pool">
@@ -39,11 +44,12 @@
                 @click='selectRightTag(item)'
             >
                 <p class="tagName  ellipsis" :title="'[ '+item.tagName+' ]'">{{item.tagName}} </p>
+                <el-tag class="exclu" v-if="item.exclusionType==1" type="info" size="mini">互斥项</el-tag>
             </li>
         </ul>
     </div>
-    <div class="buttonBox">
-        <div class="bottomPartMid bottomPartMidss fl" :class="(ascription == 1)?'':'bottomPartMids'">
+    <div class="buttonBox" :class="(qaType==2)?'rightMore':''">
+        <div class="bottomPartMid bottomPartMidss fl bottomPartMids" >
             <p><span class="el-icon-arrow-up" @click="toggleTopDownList(1)"></span></p>
             <p><span class="el-icon-arrow-down" @click="toggleTopDownList(2)"></span></p>
         </div>
@@ -52,12 +58,10 @@
 </template>
 <script>
 import api from '@api/preTreat.js';
-import utils from '@api/utils.js';
-import { constants } from 'fs';
 
 export default {
     name: "QuestionTagGroup",
-    props: ['ascription','sexType','options','type'],
+    props: ['ascription','sexType','options','type','qaType','relationId'],
     data() {
         return {
             leftTagsList: [],
@@ -71,18 +75,24 @@ export default {
         }
     },
     mounted() {
+      //编辑
         let tagList = this.transOptions(this.options);
         if(tagList&&tagList.length > 0){
           const that = this;
           setTimeout(function(){            //等watch执行后赋值tags,否则这里先执行,会被watch里清空
             that.rightTagsList = tagList;
             that.searchTagList();
+            that.$emit('changeActionData',that.rightTagsList);
           },100);
+        }else{
+          //添加初始
+          this.searchTagList();
         }
     },
     watch: {
         searchVal(newVal, preVal){
-          this.ifReflashTagList(newVal, preVal);
+          //this.ifReflashTagList(newVal, preVal);
+          this.searchTagList();
         },
         ascription(newVal, preVal){
           this.ifReflashTagList(newVal, preVal);
@@ -92,9 +102,32 @@ export default {
         },
         type(newVal, preVal){
           this.ifReflashTagList(newVal, preVal);
-        }
+        },
+        relationId(newVal, preVal){
+          this.ifReflashTagList(newVal, preVal);
+        },
     },
     methods: {
+        handleExclu(){
+            if(!this.selectRightTagsList||this.selectRightTagsList.length==0){
+              this.$message({
+                showClose: true,
+                message: '请先选择要操作的标签',
+                type: 'warning'
+              });
+              return ;
+            }
+            const arr = this.rightTagsList.map((it)=>{
+              if(it.id==this.selectRightTagsList[0].id){
+                it.exclusionType=1;
+              }else{
+                it.exclusionType=0;
+              }
+              return it;
+            });
+            this.rightTagsList=arr;
+            this.$emit('changeActionData',this.rightTagsList);
+        },
         transOptions(opt){
           return opt&&opt.map((it)=>{
             return Object.assign({},it,{id:it.questionId||it.id});      //模板是questionId,组合是id
@@ -102,10 +135,12 @@ export default {
         },
         ifReflashTagList(newVal='', preVal=''){
           if(newVal.trim() == ''){
-            this.rightTagsList=[];console.log(1)
+            this.searchVal = '';
+            this.rightTagsList=[];
             this.searchTagList();
           }else if(newVal.trim() != preVal.trim()){
-            this.rightTagsList=[];console.log(2)
+            this.searchVal = '';
+            this.rightTagsList=[];
             this.searchTagList();
           }
         },
@@ -200,7 +235,24 @@ export default {
             this.searchTagList();
             this.$emit('changeActionData',this.rightTagsList, false);
         },
+        toMuchImgs(list){
+          const arr = list.filter((it)=>{
+            return it.tagType==1&&it.controlType ==4;
+          });
+          if(arr.length>1){
+            return true;
+          }
+          return false;
+        },
         toRightList() {
+            if(this.toMuchImgs([...this.rightTagsList,...this.selectLeftTagsList])){
+              this.$message({
+                showClose: true,
+                message: '一个模板最多只能添加一个上传图片类型填写单',
+                type: 'warning'
+              });
+              return ;
+            }
             this.rightTagsList.push(...this.selectLeftTagsList);
 
             for (let i = 0; i < this.rightTagsList.length; i++) {
@@ -224,8 +276,9 @@ export default {
                 "tagName": this.searchVal,
                 "type": this.ascription,
                 "notIds": notIds,
+                "notControlType":this.qaType==2||this.ascription!='51'?['4']:[],             //组合填写单或非诊疗情况模版不能添加图片上传
                 "sexType": this.sexType,
-                "tagType":maps[this.type]
+                "tagType":+this.qaType===2?maps[this.type]:['1','6']       //qaType=2:组合填写单,qaType=3模板
             };
             api.questionSearch(param).then((res) => {
                 if (res.data.code === '0') {
@@ -242,6 +295,17 @@ export default {
 
 <style lang="less" >
 @import '../../less/common.less';
+.operation-row{
+    text-align: right;
+}
+.exclu{
+    position: absolute;
+    right: -54px;
+    top: 5px;
+}
+.rightMore{
+    margin-left: 48px;
+}
 .commomSymptom {
   .tagList.operationPools {
     width: 100%;

+ 5 - 0
src/less/admin.less

@@ -177,4 +177,9 @@
 .el-button--primary .is-disabled[type=button]:hover {
   background: @adminBase;
   color: #fff
+}
+
+.el-message-box .el-message-box__content{
+  max-height: 100px;
+  overflow-y: auto;
 }

+ 1 - 1
vue.config.js

@@ -1,6 +1,6 @@
 const path = require('path');
 // const proxy_path = 'http://192.168.2.236:80';
-const proxy_path = 'http://192.168.2.236:88';
+const proxy_path = 'http://192.168.2.241:88';
 // const proxy_path = 'http://192.168.2.236:88';
 // const proxy_path = 'http://192.168.3.101:5050';
 // const proxy_path = 'http://192.168.3.117:5050';//周铁刚