Просмотр исходного кода

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

zhouna 6 лет назад
Родитель
Сommit
1080ab5d62

+ 1 - 1
src/api/config.js

@@ -223,7 +223,7 @@ 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',    //模板-科室列表

+ 5 - 6
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">
                 填写单明细:
             </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"
@@ -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;

+ 3 - 3
src/components/preTreat/AddQuestionModules.vue

@@ -60,7 +60,7 @@
                     <el-option
                             v-for="item in deptList"
                             :label="item.name"
-                            :value="item.conceptId"
+                            :value="item.conceptId+''"
                             :key="item.conceptId"
                     ></el-option>
                 </el-select>
@@ -76,7 +76,7 @@
                 ></el-input>
             </el-form-item>
             <el-form-item label="备注:">
-                <el-input type="textarea" v-model="form.remark"></el-input>
+                <el-input type="textarea" v-model="form.remark" maxLength="120"></el-input>
             </el-form-item>
         </el-form>
     </div>
@@ -84,7 +84,7 @@
             <p class="title">
                 填写单明细:
             </p>
-            <QuestionTagGroup v-if="form.type!=1" :ascription="form.type" @changeActionData="pushValues" :options="editData.moduleDetail"></QuestionTagGroup>
+            <QuestionTagGroup v-if="form.type!=1" qaType="3" :ascription="form.type" @changeActionData="pushValues" :options="editData.moduleDetail"></QuestionTagGroup>
             <div class="static" v-if="form.type==1">
                 <p>请问您有哪些不适?</p>
                 <div class="inner">科室常见症状</div>

+ 4 - 14
src/components/preTreat/AddSimpleQuestion.vue

@@ -60,6 +60,10 @@
         this.editData = data;
       }
     },
+    beforeDestroy(){
+      console.log(33333)
+      this.options = [];
+    },
     methods: {
       back() { this.$router.go(-1) },
       changeVal(val) {   //子组件数据改变传递到父组件
@@ -95,20 +99,6 @@
           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;

+ 11 - 6
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
@@ -97,7 +97,7 @@
                 <el-input
                         :disabled="!form.region1"
                         v-model="form.region4"
-                        maxLength="30"
+                        :maxLength="form.region1==1?7:30"
                         :placeholder="qaType==2?'请输入填写单医生界面展示标准内容':'请输入填写单界面描述名称'"
                         @change="sendData"
                 ></el-input>
@@ -110,7 +110,7 @@
                 <el-input
                         :disabled="!form.region1"
                         v-model="form.region5"
-                        maxLength="30"
+                        :maxLength="form.region1==1?7:30"
                         placeholder="请输入填写单患者界面展示通俗内容"
                         @change="sendData"
                 ></el-input>
@@ -229,6 +229,13 @@
       var validatePass12 = (rule, value, callback) => {
         this.validateSystomName(value,callback,1)
       };
+      var validateLength = (rule, value, callback) => {
+        if(value.length>29){
+          callback(new Error('不能超过30字'));
+        }else{
+          callback();
+        }
+      };
       return {
         form: {
           region1: '',    //归属
@@ -317,13 +324,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) {

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

+ 43 - 8
src/components/preTreat/QuestionTagGroup.vue

@@ -1,5 +1,10 @@
 <template>
     <div class="symptomTagGroupWrapper commomSymptom clearfix">
+        <div class="operation-row">
+            <el-checkbox-group size="small">
+                <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'],
     data() {
         return {
             leftTagsList: [],
@@ -95,6 +99,26 @@ export default {
         }
     },
     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 +126,10 @@ export default {
         },
         ifReflashTagList(newVal='', preVal=''){
           if(newVal.trim() == ''){
-            this.rightTagsList=[];console.log(1)
+            this.rightTagsList=[];
             this.searchTagList();
           }else if(newVal.trim() != preVal.trim()){
-            this.rightTagsList=[];console.log(2)
+            this.rightTagsList=[];
             this.searchTagList();
           }
         },
@@ -225,7 +249,7 @@ export default {
                 "type": this.ascription,
                 "notIds": notIds,
                 "sexType": this.sexType,
-                "tagType":maps[this.type]
+                "tagType":+this.qaType===2?maps[this.type]:['1','4']       //qaType=2:组合填写单,qaType=3模板
             };
             api.questionSearch(param).then((res) => {
                 if (res.data.code === '0') {
@@ -242,6 +266,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%;