Browse Source

Merge remote-tracking branch 'origin/perTreat' into test

zhouna 6 years ago
parent
commit
e89ceada57

+ 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 - 9
src/components/icss/AddMedicinePrompt.vue

@@ -15,7 +15,9 @@
                                filterable
                                remote
                                clearable
-                               no-data-text=" "
+                               :loading="showDrop"
+                               loading-text="加载中..."
+                               @change="changeWord"
                                value-key="conceptId"
                                ref="termName"
                                placeholder="搜索"
@@ -63,6 +65,7 @@
     data() {
       return {
         isEdit:false,
+        isCopy:false,
         termTypes:[],
         terms:[],              //术语列表
         editData:{
@@ -89,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;
@@ -125,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){
@@ -177,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{

+ 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 - 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)

+ 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个字',

+ 5 - 2
src/components/preTreat/QuestionTagGroup.vue

@@ -91,7 +91,8 @@ export default {
     },
     watch: {
         searchVal(newVal, preVal){
-          this.ifReflashTagList(newVal, preVal);
+          //this.ifReflashTagList(newVal, preVal);
+          this.searchTagList();
         },
         ascription(newVal, preVal){
           this.ifReflashTagList(newVal, preVal);
@@ -134,9 +135,11 @@ export default {
         },
         ifReflashTagList(newVal='', preVal=''){
           if(newVal.trim() == ''){
+            this.searchVal = '';
             this.rightTagsList=[];
             this.searchTagList();
           }else if(newVal.trim() != preVal.trim()){
+            this.searchVal = '';
             this.rightTagsList=[];
             this.searchTagList();
           }
@@ -263,7 +266,7 @@ export default {
                 if (res.data.code === '0') {
                     this.leftTagsList = res.data.data;
                     this.selectLeftTagsList = [];
-                    this.selectRightTagsList = [];
+                    this.selectRightTagsList = [];console.log(this.rightTagsList)
                 }
             })