Luolei 6 年之前
父节点
当前提交
a0b68ed495

+ 3 - 3
src/api/icss.js

@@ -18,9 +18,9 @@ export default {
     detailsTagList(param) {
         return axios.post(urls.detailsTagList, param)
     },
-      detailsTag(param) {
-        return axios.post(urls.detailsTag, param)
-      },
+    detailsTag(param) {   //根据id返回数据
+      return axios.post(urls.detailsTag, param)
+    },
     getDeptInfo(param) {//科室维护
         return axios.post(urls.getDeptInfo, param)
     },

+ 5 - 6
src/api/utils.js

@@ -84,16 +84,16 @@ export default {
    * @param {type} 填写单类型 
    */
   dataRecombination(dataArr,type){
-    console.log(type,dataArr)
+    // console.log(dataArr,type)
     let tmpArr = [];
     for(let i = 0;i < dataArr.length;i++){
       let mapping = {
         "sonQuestion": "",
-        "position": 0,              //默认值,传0
+        "position": 0,               //默认值,传0
         "formPosition": 1,          // 填写单显示位置(0:左, 1:上)
         "exclusionType": 1,         //互斥:1
-        "text": "",                  //如果有文本内容,上面的值都置空
-        "symptomType": 0,         //0:默认值 1:主症状特有 2:伴随症状特有
+        "text": "",                 //如果有文本内容,上面的值都置空
+        "symptomType": 0,           //0:默认值 1:主症状特有 2:伴随症状特有
       }
       let sonQuestionMap = {     //目前只在既往史中用到,同层数据置空
           "id": "",
@@ -129,7 +129,7 @@ export default {
         }
         mapping.sonQuestion = tmpData[0];    //{sonQuestion:18}
         tmpArr.push(mapping)
-      }else if (type == 4 || type == 3) { //横铺展开(如咳嗽)
+      }else if (type == 4 || type == 3 || type == 7) { //横铺展开(如咳嗽)
         mapping.formPosition = 0;
         mapping.exclusionType = 0;
         mapping.symptomType = dataArr[i].symptomType
@@ -142,7 +142,6 @@ export default {
           mapping.sonQuestion = dataArr[i].id
           tmpArr.push(mapping)
         }
-       
       }
     }
     return tmpArr;

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

@@ -11,7 +11,6 @@
                 <el-form-item label="描述:" prop="remark" class="desc">
                     <el-input type="textarea" :rows="3" placeholder="请输入科室描述" v-model="form.remark" maxlength="1024"></el-input>
                 </el-form-item>
-                </el-form-item>
                 <el-button size="small" type="primary" @click="addOrga">{{text}}</el-button>
             </el-form>
         </div>

+ 327 - 0
src/components/icss/InspactTagGroup.vue

@@ -0,0 +1,327 @@
+<template>
+    <div class="symptomTagGroupWrapper clearfix">
+    <div class="bottomPartLeft">
+      <p class="poolTitle">标签池</p>
+      <div class="pool">
+        <el-input
+          placeholder="请输入搜索内容"
+          v-model="searchVal"
+        >
+            <i
+                slot="prefix"
+                class="el-input__icon el-icon-search"
+            ></i>
+        </el-input>
+        <ul class="tagList tagPool">
+            <li v-for="(item, index) in leftTagsList"
+                class = "tagItem"
+                :key='item.id'
+                :title="'[ '+item.tagName+' ]'"
+                :style="getStyle(item)?styles:null"
+                @click='selectLeftTag(item, index, $event)'
+            >
+                <p class="tagName ellipsis" >{{item.tagName}} </p>
+            </li>
+        </ul>
+      </div>
+    </div>
+    <div class="bottomPartMid fl">
+        <p><span class="el-icon-arrow-right" @click="toRightList"></span></p>
+        <p><span class="el-icon-arrow-left" @click="toLeftList"></span></p>
+    </div>
+    <div class="bottomPartRight inspectBottomPartRight">
+      <p class="poolTitle">操作界面:</p>
+      <ul class="tagList operationPool">
+            <li class = "tagItem"
+                v-for="(item) in rightTagsList2" 
+                :key='item.id'
+                :style="getStyle2(item)?styles:null"
+                @click='selectRightTag(item)'
+            >   
+                <p v-if="item.tagName" class="tagName">{{item.tagName}} </p>
+            </li>
+        </ul>
+    </div>
+  </div>
+</template>
+<script>
+import api from '@api/icss.js';
+import utils from '@api/utils.js';
+
+export default {
+    name: "InspactTagGroup",
+    props: {
+        pool: {
+            default: () => [],
+            type: Array
+        },
+        type: {
+            default: '',
+            type: String
+        },
+        sexType: {
+            default: '',
+            type: String
+        },
+        options: {
+            default: () => [],
+            type: Array
+        }
+    },
+    data() {
+        return {
+            leftTagsList: [],
+            selectLeftTagsList: [],
+            rightTagsList: [],
+            rightTagsList2: [],
+            selectRightTagsList: [],
+            searchVal: '',
+            styles:{
+                background:'#eae7e7'
+            },
+        }
+    },
+    mounted() {
+        this.rightTagsList2 = this.options
+        this.searchTagList()
+    },
+    watch: {
+        pool(newVal, preVal) {
+            if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
+                this.leftTagsList = newVal
+            }
+        },
+        searchVal(newVal, preVal){
+            if(newVal.trim() == ''){
+                this.searchTagList()
+            }else if(newVal.trim() != preVal.trim()){
+                this.searchTagList()
+            }
+        },
+        sexType(newVal, preVal) {
+            if (newVal != preVal) {
+                if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
+                    this.leftTagsList = [];
+                    this.selectLeftTagsList = [];
+                    this.rightTagsList = [];
+                    this.rightTagsList2 = [];
+                    this.selectRightTagsList = [];
+                    this.searchVal = '';
+                     this.searchTagList();
+                }
+            }
+        },
+
+        
+    },
+    methods: {
+        selectLeftTag(tag, index, e) {
+            const hasTag = this.isHasTag(tag, this.selectLeftTagsList)
+            if (hasTag) {
+                this.selectLeftTagsList = this.selectLeftTagsList.filter(item => item.id !== tag.id)
+            } else {
+                this.selectLeftTagsList.push(tag);
+            }
+        },
+        selectRightTag(tag) {
+            const hasTag = this.isHasTag(tag, this.selectRightTagsList)
+            if (hasTag) {
+                this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
+            } else {
+                this.selectRightTagsList.push(tag);
+            }
+            
+        },
+        isHasTag(item, arr) {
+            for ( let i = 0; i <arr.length; i++) {
+                if(arr[i].id === item.id) {
+                    return true;
+                }
+            }
+            return false;
+        },
+        getStyle(item){       //左侧选中状态
+            // console.log('selected',utils.filterArr(this.leftTagsList,item,2))
+            // return utils.filterArr(this.selectLeftTagsList,item,2)
+            return this.isHasTag(item, this.selectLeftTagsList)
+        },
+        getStyle2(item) {
+            // return utils.filterArr(this.selectRightTagsList,item,2)
+            return this.isHasTag(item, this.selectRightTagsList)
+        },
+        toLeftList() {
+            // if(!this.searchVal) {
+            //     this.leftTagsList = this.searchTagList()
+            // }
+            
+            for (let i = 0; i < this.selectRightTagsList.length; i++) {
+                this.rightTagsList = this.rightTagsList.filter(item => item.id !== this.selectRightTagsList[i].id)
+            }
+            for (let i = 0; i < this.selectRightTagsList.length; i++) {//每次往回移时同时删掉下面输入框
+                if (this.selectRightTagsList[i].type !== 'input') {
+                    for (let j = 0; j < this.rightTagsList2.length; j++) {
+                        if(this.selectRightTagsList[i].id === this.rightTagsList2[j].id) {
+                            this.rightTagsList2.splice(j, 1)
+                        }
+                    }
+                }
+            }
+            this.selectLeftTagsList = []
+            this.selectRightTagsList = []
+            this.searchTagList()
+            this.$emit('changeActionData',this.rightTagsList2, false);
+        },
+        toRightList() {
+            this.rightTagsList.push(...this.selectLeftTagsList);
+            // let textItem = { text: ',' ,type:'input' }
+            for (let i = 0; i < this.selectLeftTagsList.length; i++) { //选中标签每个加入输入框,默认为逗号
+                this.rightTagsList2.push(this.selectLeftTagsList[i]);
+            }
+            
+            for (let i = 0; i < this.rightTagsList.length; i++) {
+                this.leftTagsList = this.leftTagsList.filter(item => item.id !== this.rightTagsList[i].id)
+            }
+            this.selectLeftTagsList = []
+            this.selectRightTagsList = []
+            this.$emit('changeActionData',this.rightTagsList2, false);
+        },
+        searchTagList() {
+            let notIds = []
+            for (let i = 0; i < this.rightTagsList.length; i++) {
+                if(this.rightTagsList[i].id) {
+                    notIds.push(this.rightTagsList[i].id)
+                }
+                
+            }
+            let param = {
+                "tagName": this.searchVal,
+                "tagType": [1, 2],
+                "controlType": [],
+                "type": this.type || '',
+                "notIds": notIds,
+                "sexType": this.sexType,
+
+            }
+            api.searchTagList(param).then((res) => {
+                if (res.data.code === '0') {
+                    this.leftTagsList = res.data.data
+                    this.selectLeftTagsList = []
+                    this.selectRightTagsList = []
+                }
+            })
+           
+        },
+    }
+}
+</script>
+
+<style lang="less" >
+@import '../../less/common.less';
+.symptomTagGroupWrapper {
+    .bottomPartLeft {
+        width: 30%;
+        box-sizing: border-box;
+        float: left;
+    }
+    .poolTitle {
+        // border-bottom: 1px solid @icssBorder;
+        box-sizing: border-box;
+        margin-bottom: 20px;
+    }
+    .pool {
+        // border:1px solid @icssBorder;
+    
+    }
+    .search {
+        width: 100%;
+        border-bottom: 1px solid @icssBorder;
+        box-sizing: border-box;
+        height: 30px;
+    }
+    .tagList {
+        border: 1px solid @icssBorder;
+    }
+    .tagPool {
+        height: 300px;
+        overflow-y: auto;
+
+    }
+    .attributeBox {
+        position: absolute;
+        right: -100px;
+        top: 2px;
+    }
+    .tagItem {
+        position: relative;
+        line-height: 30px;
+        cursor: pointer;
+        padding: 0 10px;
+    }
+    .operationPool {
+        position: relative;
+        width: 60%;
+        min-height: 300px;
+        padding: 10px 0;
+    }
+    .tagName:before {
+        content: '['
+    }
+    .tagName::after {
+        content: ']'
+    }
+    .bottomPartMid {
+        width: 8%;
+        margin-top: 60px;
+        p {
+        width: 100%;
+        text-align: center;
+        span {
+            cursor: pointer;
+            display: inline-block;
+            width: 30px;
+            height: 40px;
+            line-height: 40px;
+            margin: 0 auto;
+            border: 1px solid @icssBorder;
+            margin-bottom: 15px;
+            font-size: 18px;
+        }
+        }
+    }
+    .bottomPartRight {
+        float: left;
+        width: 40%;
+    }
+    .buttonBox {
+        width: 10%;
+        float: left;
+    }
+    .followButton {
+        margin-top: 20px;
+    }
+    .tagAttribute {
+       border: 1px solid @icssBorder;
+       height: 17px;
+       line-height: 17px;
+       padding: 3px 5px;
+       border-radius: 10px;
+    }
+    .inputBox {
+        width: 120px;
+        .el-input {
+            .el-input__inner {
+                height: 30px;
+                background: rgb(234, 231, 231);
+            }
+        }
+    }
+    .closeTagAttribute {
+        position: absolute;
+        top: -5px;
+        right: -5px;
+    }
+    .active {
+        color: #aBcdef;
+    }
+}
+</style>

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

@@ -108,7 +108,7 @@ export default {
         },
         getDropList() {
             return api.getDropList().then((res) =>{
-                console.log('dropList', res)
+                // console.log('dropList', res)
                 if(res.data.code === '0') {
                     this.Adscriptions = res.data.data[1];
                     this.tagTypes =  res.data.data[3];

+ 19 - 7
src/components/icss/NoiseTemplate.vue

@@ -13,7 +13,7 @@
       ref="submitForm"
     ></PubTagGroup>
     <div class="main">
-      <p class="title"> <i>*</i> 标签明细:</p>
+      <p v-if="dataPub.region1 != 6 && dataPub.region1 != 7 && dataPub.region1 != 8" class="title"> <i>*</i> 标签明细:</p>
       <PubTagPartDetail
         :pool="dataPub.tagPool"
         :type="dataPub.region1"
@@ -22,6 +22,7 @@
         :sexType="dataPub.region7"
         :tipLis="dataPub.tipLis"
         :choose="dataPub.region2 == 6?'multiple':'single'"
+        :options="editData.questionMapping"
         v-show="dataPub.region2 == 2 || dataPub.region2 == 6"
         @changeActionData="changeActionData"
       ></PubTagPartDetail>
@@ -34,6 +35,15 @@
         @changeActionData="changeActionData"
         >
       </SymptomTagGroup>
+      <InspactTagGroup 
+        v-if="dataPub.region2 == 7" 
+        :pool="dataPub.tagPool" 
+        :type="dataPub.region1"
+        :sexType="dataPub.region7"
+        :options="editData.questionMapping"
+        @changeActionData="changeActionData"
+        >
+      </InspactTagGroup>
       <BloodPressTagGroup 
         v-if="dataPub.region2 == 3" 
         :pool="dataPub.tagPool" 
@@ -83,6 +93,7 @@
 import PubTagGroup from './PubTagGroup';
 import PubTagPartDetail from './PubTagPartDetail';
 import SymptomTagGroup from './SymptomTagGroup';
+import InspactTagGroup from './InspactTagGroup';
 import BloodPressTagGroup from './BloodPressTagGroup';
 import api from '@api/icss.js';
 import utils from '@api/utils.js';
@@ -108,7 +119,7 @@ export default {
     const {isEdit,data} = this.$route.params;
     if(isEdit){
       this.editData = data;
-      console.log('this.editData', this.editData)
+      // console.log('回读数据', this.editData)
     }
   },
   computed: {
@@ -127,13 +138,13 @@ export default {
     back() { this.$router.go(-1) },
     changeVal(val) {    //子组件数据改变传递到父组件
       this.dataPub = val
-      console.log('公用组件传的值都在这', val)
+      // console.log('公用组件传的值都在这', val)
     },
     changeSex(sex) {       //性别改变,清空标签明细
-      console.log(sex)
+      // console.log(sex)
     },
     changeType(type) {        //填写单类型改变,标签明细左侧更新,右侧清空
-      console.log(type)
+      // console.log(type)
     },
     changeActionData(arr) {          //标签明细右侧数据id
       this.sendIds = arr
@@ -143,7 +154,7 @@ export default {
     },
     validatePass() {      //验证成功回调,调取接口
       //仍需验证标签明细是否选择
-      if (JSON.stringify(this.sendIds) == '[[],[],[],[],[],[]]') {
+      if (JSON.stringify(this.sendIds) == '[[],[],[],[],[],[]]' && this.dataPub.region2 != 6 && this.dataPub.region2 != 7 && this.dataPub.region2 != 8) {
         this.$message({
           message: '请选择标签明细',
           type: 'warning'
@@ -155,7 +166,7 @@ export default {
       let param = {
         "questionWrapper": {
           "controlType": 0,                            //控件类型(0:默认值 1:下拉单选 2:下拉多选 6:文本框 7:数字键盘文本框 99:联合推送)
-          "id": "",                                    //新增id置
+          "id": this.editData.id || '',                //新增id
           "type": this.dataPub.region1,                //标签归属
           "tagType": this.dataPub.region2,             //标签类型
           "tagName": this.dataPub.region3,             //系统名称
@@ -215,6 +226,7 @@ export default {
     PubTagPartDetail,
     SymptomTagGroup,
     BloodPressTagGroup,
+    InspactTagGroup,
   }
 }
 </script>

+ 35 - 30
src/components/icss/PubTagGroup.vue

@@ -45,6 +45,30 @@
           ></el-option>
         </el-select>
       </el-form-item>
+      <el-form-item
+        label="性别:"
+        prop="region7"
+      >
+        <span class="changeTips">改变性别后,标签明细将会恢复到默认状态</span>
+        <el-select
+          v-model="form.region7"
+          :disabled="!!editData.id || !form.region1 || form.region2 == 11"
+          @change="(e)=>readyChangeSelect(e,3)"
+        >
+          <el-option
+            label="通用"
+            value="3"
+          ></el-option>
+          <el-option
+            label="男"
+            value="1"
+          ></el-option>
+          <el-option
+            label="女"
+            value="2"
+          ></el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item
         label="标签系统名称:"
         prop="region3"
@@ -99,30 +123,6 @@
           ></el-option>
         </el-select>
       </el-form-item>
-      <el-form-item
-        label="性别:"
-        prop="region7"
-      >
-        <span class="changeTips">改变性别后,标签明细将会恢复到默认状态</span>
-        <el-select
-          v-model="form.region7"
-          :disabled="!!editData.id || !form.region1 || form.region2 == 11"
-          @change="(e)=>readyChangeSelect(e,3)"
-        >
-          <el-option
-            label="通用"
-            value="3"
-          ></el-option>
-          <el-option
-            label="男"
-            value="1"
-          ></el-option>
-          <el-option
-            label="女"
-            value="2"
-          ></el-option>
-        </el-select>
-      </el-form-item>
       <el-form-item
         label="年龄:"
         prop="region8"
@@ -192,7 +192,12 @@ export default {
   props:['editData'],
   data() {
     var validatePass2 = (rule, value, callback) => {
-        this.validateSystomName(value,callback)
+        const editData = this.$props.editData;
+        if(editData.id && value == editData.tagName){ //修改系统名称没变就不再校验
+          callback();    
+        }else{
+          this.validateSystomName(value,callback)
+        }
     };
     return {
       form: {
@@ -279,7 +284,7 @@ export default {
     const editData = this.$props.editData;
     if(editData.id){
       const trans = utils.transformKeys(editData);
-      console.log('editData1', editData)
+      // console.log('editData1', editData)
       this.form = Object.assign({},this.form,trans);
     }
     this.$emit('submitForm', 'groups', false);
@@ -312,7 +317,7 @@ export default {
           this.form.order = res.data.data[5];
           this.form.tipLis = res.data.data[6];
           this.labelTypes = this.labelTypesList;
-          console.log('labelTypes', this.labelTypes)
+          // console.log('labelTypes', this.labelTypes)
           this.Adscriptions = this.AdscriptionsList.filter(item => Object.keys(this.labelTypesMaps).indexOf(item.val) > -1);
         }
       })
@@ -335,8 +340,9 @@ export default {
       if(this.form.region3.trim() == ''){ return }
       let param = {
         "existName": this.form.region3,
-        "tagType":this.form.region2.split(''),
-        "type": this.form.region1
+        "tagType":this.form.region2.split(''),       
+        "type": this.form.region1,
+        "notTagType":[8],        //去掉文字标签查重
       }
       api.validateSystomName(param).then((res) => {
         if (res.data.code === '0') {
@@ -366,7 +372,6 @@ export default {
         this.labelTypes = this.labelTypesList.filter(item => this.labelTypesMaps[tmpData].indexOf(item.val) > -1)
         
       }
-      console.log(tmpData)
       this.changeSex(tmpData);
       // if(type == 3){
       //   this.form.region7 = this.tmpSex;

+ 13 - 5
src/components/icss/PubTagPartDetail.vue

@@ -123,6 +123,10 @@ export default {
       default: 'single',      //multiple 多选 single 单选
       type: String
     },
+    options: {
+        default: () => [],
+        type: Array
+    }
   },
   data() {
     return {
@@ -144,6 +148,11 @@ export default {
       currentTipLis:[],         //右侧选中的标签提示
     }
   },
+  mounted(){
+    this.poolDetailList = this.options
+    console.log(this.options)
+    this.searchTagList()
+  },
   watch: {
     pool(newVal, preVal) {
       this.currentPool = newVal
@@ -154,10 +163,8 @@ export default {
       }
     },
     sexType(newVal, preVal) {
-      if (newVal != preVal) {
-        if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
-          this.clearData()
-        }
+      if (JSON.stringify(newVal) != JSON.stringify(preVal)) {
+        this.clearData()
       }
     },
     sign(newVal, preVal) {
@@ -396,7 +403,7 @@ export default {
                   return;
                 }
                 let ids = [];
-                this.poolDetailList[idx] = tmpArr;
+                this.poolDetailList[idx] = tmpArr;     //单选的数据
                 this.poolDetailListAll = Array.prototype.concat.apply([],this.poolDetailList);     //二维转一维
                 this.searchTagList();
                 this.getPoolDetailListTips();
@@ -417,6 +424,7 @@ export default {
               }
               this.currentLis = [];       //左侧选中数据清空
             })
+            console.log('单选的数据',this.poolDetailList)
           }else{           //判断是多选
             let num = 0,tmpArr = [];
             this.currentLis.map((id)=>{

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

@@ -152,7 +152,6 @@ export default {
             } else {
                 this.selectRightTagsList.push(tag);
             }
-            
         },
         isHasTag(item, arr) {
             for ( let i = 0; i <arr.length; i++) {