Luolei hace 6 años
padre
commit
fba069d39e

+ 3 - 3
src/components/icss/CommonTemplate.vue

@@ -148,7 +148,7 @@ export default {
       default: '',
       type: String
     },
-    sign: {
+    signe: {
       default: '',
       type: String
     },
@@ -239,7 +239,7 @@ export default {
       }
       this.searchTagList()       //重新获取标签池数据
     },
-    sign(newVal, preVal) {
+    signe(newVal, preVal) {
       if(newVal != preVal){
         this.form = {region: ''}  
         this.subTmpList = []     //子模板的id用于去重
@@ -491,7 +491,7 @@ export default {
       let param = {
         noIds:this.subTmpList,
         type:this.type,
-        moduleType: this.sign,
+        moduleType: this.signe,
         relationId: this.rela
       }
       api.getModuleInfoSub(param).then((res) => {

+ 1 - 1
src/components/icss/LabelGroup.vue

@@ -134,7 +134,7 @@ export default {
                     let tmpLis = res.data.data[1]
                     this.Adscriptions = tmpLis.filter(item => item.val != 7);
 
-                    this.tagTypes =  res.data.data[3];
+                    this.tagTypes =  res.data.data[2];
                     for (var i = 0; i < this.tagTypes.length; i++) {
                         this.tagTypesList.push(this.tagTypes[i].val)
                     }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 2 - 2
src/components/icss/NoiseTemplate.vue


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

@@ -246,7 +246,8 @@ export default {
         '8':['9'],
         '9':['9'],
         '21':['9'],
-        '22':['9']
+        '22':['9'],
+        '10':['9']
       },
       rules: {
         region1: [

+ 63 - 24
src/components/icss/PubTemplateGroup.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="PubTagGroupWrapper">
+    <el-button class="copyTmpt" type="primary" @click="copyTmpt" v-if="editData.id && this.form.region3 != 0">复制该内容</el-button>
     <el-form
       class="groups"
       :rules="rules"
@@ -13,7 +14,6 @@
       >
         <el-input
           v-model="form.region2"
-          :disabled="!!editData.id"
           maxLength="120"
           placeholder="请输入模板名称"
         ></el-input>
@@ -24,7 +24,7 @@
       >
         <span class="changeTips">改变模板类型后,模板内容将会恢复到默认状态</span>
         <el-select
-          :disabled="!!editData.id"
+          :disabled="form.isCopy || !!editData.id"
           v-model="form.region3"
           placeholder="模板类型"
           @change="sendData"
@@ -64,7 +64,7 @@
       >
         <span class="changeTips">改变模板归属后,模板内容将会恢复到默认状态</span>
         <el-select
-          :disabled="!!editData.id || (form.region3 == '') || (form.region3 != '0' && form.region4 == '') || (form.region3 != '0' && form.region5 == '') "
+          :disabled="form.isCopy || !!editData.id || (form.region3 == '') || (form.region3 != '0' && form.region4 == '')"
           v-model="form.region1"
           placeholder="模板归属"
           @change="sendData"
@@ -97,14 +97,12 @@ export default {
       numWord:0,
       Adscriptions:[],
       sonLis:[],
-      disabled1:'false',
-      disabled2:'false',
-      disabled3:'false',
       form: {
         region1: '',    //归属
         region2: '',     //模板名称
         region3: '',     //类型
         region4: '',     //所属科室慢病
+        isCopy:false
       },
       rules: {
         region1: [
@@ -126,8 +124,12 @@ export default {
   },
   beforeMount:function(){
     let templateType = localStorage.getItem('icssEnumsData') ? JSON.parse(localStorage.getItem('icssEnumsData')).moduleInfoTypeEnum : []
+    let templateOwn = localStorage.getItem('typeLis') ? JSON.parse(localStorage.getItem('typeLis')) : []
     this.deptDis = localStorage.getItem('deptDis') ? JSON.parse(localStorage.getItem('deptDis')) : {}
-
+    for(let i = 0;i < templateOwn.length;i++){
+      templateOwn[i].type = templateOwn[i].val
+    }
+    this.Adscriptions = templateOwn
     this.AdscriptionsType = templateType
   },
   computed:{
@@ -148,8 +150,10 @@ export default {
             tmpDeptDTOS.unshift(obj)
           }
           this.sonLis = tmpDeptDTOS
-          this.form.region4 = ''
-          this.form.region1 = ''
+          if(!this.form.id){
+            this.form.region4 = ''
+            this.form.region1 = ''
+          }
         }else if(newVal == 2){
           let tmpDisDTOS = this.deptDis.disDTOS
           let obj = {id:0,name:'通用'}
@@ -157,39 +161,51 @@ export default {
             tmpDisDTOS.unshift(obj)
           }
           this.sonLis = tmpDisDTOS
-          this.form.region1 = ''
-          this.form.region4 = ''
+          if(!this.form.id){
+            this.form.region4 = ''
+            this.form.region1 = ''
+          }
         }else{
-          this.getTypes()
           this.sonLis = []
-          this.form.region1 = ''
-          this.form.region4 = ''
+          if(!this.form.id){
+            this.getTypes()
+            this.form.region4 = ''
+            this.form.region1 = ''
+          }
         }
       }
     },
     tmpOwnTo(newVal, preVal){
       if(newVal != preVal){
-          this.getTypes()   
-          this.form.region1 = ''
+          if(!this.form.id){
+            this.getTypes()
+            this.form.region1 = ''
+          }
+          if(this.form.isCopy){
+            this.getTypes('copy')
+          }
       }
     }
   },
   mounted() {
     const editData = this.$props.editData;
-    console.log(editData)
-    let templateOwn = localStorage.getItem('typeLis') ? JSON.parse(localStorage.getItem('typeLis')) : []
     if(editData.id){      //修改
       this.form = Object.assign({},this.form,editData);
-      this.Adscriptions = templateOwn
-      this.form.region1 = (editData.type+'')
+      this.form.region1 = editData.type
       this.form.region2 = editData.name
-      this.form.region3 = editData.moduleType
-      this.form.region4 = editData.relationId
+      this.form.region3 = editData.moduleType+''
+      this.form.region4 = editData.relationId+''
     }
     this.$emit('changeVal', this.form, false)
   },
   methods:{
-    getTypes(){
+    copyTmpt(){
+      this.editData.id = ''
+      this.form.isCopy = true
+      this.$emit('staticOwn', this.form.region4, false)
+      this.$emit('changeVal', this.form, false)
+    },
+    getTypes(type){
       let param = {
           "moduleType": this.form.region3,
           "relationId": this.form.region4
@@ -197,7 +213,24 @@ export default {
       api.getModuleType(param).then((res) => {
         if (res.data.code === '0') {//获取模板归属
           let result = res.data.data
-          this.Adscriptions = result
+          if(type){
+            let num = 0;
+            for(let i = 0;i < result.length;i++){
+              if(result[i].type == this.form.region1){
+                ++num
+              }
+            }
+            if(num == 0){
+              this.$message({
+                message:'该归属下的模板已添加',
+                type:'warning'
+              })
+              this.$emit('staticOwn', this.form.region4, false)
+              return
+            }
+          }else{
+            this.Adscriptions = result
+          }
         }
       })
     },
@@ -219,6 +252,12 @@ export default {
 </script>
 <style lang="less">
 .PubTagGroupWrapper {
+  position: relative;
+  .copyTmpt {
+    position: absolute;
+    right: 40px;
+    top: 20px;
+  }
   .groups {
   background-color: #fff;
   padding: 20px;

+ 13 - 11
src/components/icss/TemplateMaintenance.vue

@@ -172,21 +172,23 @@
       getDataList() {
         const param = this.getFilterItems();
         api.getModuleInfoList(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].tagType === this.tagTypes[j].val) {
-                list[i].tagTypeCn = this.tagTypes[j].name;
+          if(res.data.code == 0){
+            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].tagType === this.tagTypes[j].val) {
+                  list[i].tagTypeCn = this.tagTypes[j].name;
+                }
               }
-            }
-            for (var z =  0; z < this.Adscriptions.length; z++) {
-              if(list[i].type === this.Adscriptions[z].val) {
-                list[i].typeCn = this.Adscriptions[z].name
+              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;
           }
-          this.list = list;
-          this.total = res.data.data.total;
         })
       },
       filterDatas() {

+ 10 - 2
src/components/icss/TemplateMaintenanceWrap.vue

@@ -9,6 +9,7 @@
       :editData="editData"
       @changeVal="changeVal"
       @validatePass="validatePass"
+      @staticOwn="staticOwn"
       ref="submitForm"
     ></PubTemplateGroup>
     <div class="main">
@@ -16,7 +17,7 @@
         v-if="dataPub.region1"
         :pool="dataPub.tagPool"
         :type="dataPub.region1"
-        :sign="dataPub.region3"
+        :signe="dataPub.region3"
         :rela="dataPub.region4"
         :options="editData"
          @changeActionData="changeActionData"
@@ -25,6 +26,8 @@
       <div class="btn">
         <el-button
           type="primary"
+          :disabled="dataPub.isCopy && staticOwnTo == dataPub.region4"
+          :plain="dataPub.isCopy && staticOwnTo == dataPub.region4"
           @click="submitForm"
         >确 定</el-button>
       </div>
@@ -48,6 +51,7 @@ export default {
       dataPub: {},                    //公用组件传的值都在这
       editData:{},                    //编辑数据
       sendIds: [],           //标签明细右侧操作数据
+      staticOwnTo:''
     }
   },
   beforeMount:function(){
@@ -60,6 +64,10 @@ export default {
   },
   methods: {
     back() { this.$router.go(-1) },
+    staticOwn(val){
+      console.log(val,'change555')
+      this.staticOwnTo = val
+    },
     changeVal(val) {    //子组件数据改变传递到父组件
       this.dataPub = val    // console.log('公用组件传的值都在这', val)
     },
@@ -80,7 +88,7 @@ export default {
           type: 'warning'
         });
         return;
-      }else if(detailLis[0].questionId == ''){
+      }else if(detailLis[0].questionId == '' && detailLis.length == 1){
         this.$message({
           message: '保存模版时,无法保存单独的输入栏',
           type: 'warning'