Преглед на файлове

模板维护-模板类型修改复制

zhouna преди 5 години
родител
ревизия
de02dedbaa
променени са 3 файла, в които са добавени 37 реда и са изтрити 19 реда
  1. 1 1
      src/api/config.js
  2. 11 6
      src/components/qualityControl/AddQualityControlTemp.vue
  3. 25 12
      src/components/qualityControl/QCTypePour.vue

+ 1 - 1
src/api/config.js

@@ -299,7 +299,7 @@ export default {
       'getQCTempDetail':'/api/mrman/qc/qcModuleInfo/getById', //获取模板详情
       'getQCName':'/api/mrman/qc/qcQuestionInfo/index', //获取字段名称
       'getQcFlawList':'/api/mrman/qcCasesEntry/indexCaseEntry',   //获取缺陷列表
-      'getModuleTypeList':'/api/mrman/med/RecordModule/getAll', //获取模块类型列表
+      'getModuleTypeList':'/api/mrman/qc/qcModuleInfo/index', //获取模块类型列表
       'getRecordInpList':'/api/mrman/qcInputcases/getAllInputcases',//获取全部病历录入
       'removeRecordInpById':'/api/mrman/qcInputcases/cancelById',//删除病历录入
       'addRecordInp':'/api/mrman/qcInputcases/saveOrUpdata', //保存和修改全部病历录入 

+ 11 - 6
src/components/qualityControl/AddQualityControlTemp.vue

@@ -17,7 +17,9 @@
                     </el-form-item>
                     <el-form-item label="模块类型:" prop="moduleTypes" class="formItem widthLarge">
                     </el-form-item>
-                    <QCTypePour :hospital="form.hospital" :moduleName="form.moduleName" @changeActionData="moduleTypeChange"></QCTypePour>
+                    <QCTypePour :hospital="form.hospital"
+                                :moduleName="form.moduleName"
+                                @changeActionData="moduleTypeChange" :selectedTag="form.recordAnalyzeList"></QCTypePour>
                     <el-form-item label="模板名称:" prop="tempName" class="formItem widthLarge">
                         <el-input v-model="form.tempName"  placeholder="请输入模板名称"></el-input>
                     </el-form-item>
@@ -85,6 +87,7 @@ export default {
                 hospital:"",
                 moduleName:"",
                 moduleTypes:[],
+                recordAnalyzeList:[],
                 nameType:""
             },
             rules:{
@@ -103,7 +106,7 @@ export default {
     },
     created(){
         this.getAllTypes();
-        const {isCopy, isEdit, data } = this.$route.params
+        const {isCopy, isEdit, data } = this.$route.params;
         if(isEdit || isCopy) {
             this.form.hospital = ''+data.hospitalId
             this.form.moduleName = ''+data.modeId
@@ -111,7 +114,8 @@ export default {
                 this.isEdit = isEdit;
                 this.id = data.id
                 this.title ="模板维护-修改"
-               this.form.tempName = data.name
+                this.form.tempName = data.name;
+                this.form.recordAnalyzeList = data.recordAnalyzeList;
             }
             if(isCopy){
                 this.isEdit = isEdit;
@@ -119,7 +123,8 @@ export default {
                 this.id = ""
                 this.title ="模板维护-复制"
                 this.form.tempName = ""
-                 this.form.moduleTypes=[]
+                this.form.moduleTypes=[];
+                this.form.recordAnalyzeList = data.recordAnalyzeList;
                  //this.form.example=""
             }
             const moduleDetail = data.moduleDetail
@@ -146,7 +151,7 @@ export default {
     },
     methods:{
         moduleTypeChange(list){
-          this.form.moduleTypes=list.map((it)=>it.id);
+          this.form.moduleTypes=[...list];
         },
         closeSearch(){
             if(this.searchIndex > -1){
@@ -330,7 +335,7 @@ export default {
                         hospitalId: hospital,
                         moduleDetail: moduleDetail,
                         remark:'',
-                       recordIdList:moduleTypes
+                        recordIdList:moduleTypes
                      };
                      if(this.isEdit){
                          param = Object.assign({}, param, {id: this.id})

+ 25 - 12
src/components/qualityControl/QCTypePour.vue

@@ -12,7 +12,7 @@
                     @click='selectLeftTag(item, index, $event)'
                 >
                     <p class="ellipsis" >
-                        <span class="tagName">{{item.recTypeDetail}}</span>
+                        <span class="tagName">{{item.name}}</span>
                         <span :class="activeId==item.id?'tip-icon active':'tip-icon'" @click="showTipPop(item,$event)"></span>
                     </p>
                 </li>
@@ -33,7 +33,7 @@
                     @click='selectRightTag(item)'
                 >
                     <p class="ellipsis">
-                        <span class="tagName">{{item.recTypeDetail}}</span>
+                        <span class="tagName">{{item.name}}</span>
                         <span :class="activeId==item.id?'tip-icon active':'tip-icon'" @click="showTipPop(item,$event)"></span>
                     </p>
                 </li>
@@ -53,7 +53,7 @@ import QCTipPop from './QCTipPop.vue';
 
 export default {
     name: "QCTypePour",
-    props: ['hospital','moduleName'],
+    props: ['hospital','moduleName','selectedTag'],
     data() {
         return {
             checkedExc:false,
@@ -77,8 +77,9 @@ export default {
         if(this.hospital&&this.moduleName){
           const that = this;
           setTimeout(function(){            //等watch执行后赋值tags,否则这里先执行,会被watch里清空
+            that.rightTagsList = [...that.selectedTag];
             that.getModuleTypeList();
-            //that.$emit('changeActionData',that.rightTagsList);
+            that.$emit('changeActionData',that.getModuleTypeIds());
           },100);
         }
     },
@@ -97,9 +98,17 @@ export default {
     },
     methods: {
         showTipPop(item,e){
-          console.log(e)
+          if(this.showPop){
+            this.activeId = '';
+            this.curName = '';
+            this.curEmp = '';
+            this.popTop = 0;
+            this.popLeft=0;
+            this.showPop=false;
+            return;
+          }
           this.activeId = item.id;
-          this.curName = item.recTypeDetail;
+          this.curName = item.name;
           this.curEmp = item.behospitalCodes;
           this.popTop = e.clientX;
           this.popLeft=e.clientY;
@@ -127,7 +136,7 @@ export default {
               return it;
             });
             this.rightTagsList=arr;
-            this.$emit('changeActionData',this.rightTagsList);
+            this.$emit('changeActionData',this.getModuleTypeIds());
         },
         transOptions(opt){
           return opt&&opt.map((it)=>{
@@ -194,7 +203,7 @@ export default {
                   tmpRightLis.splice(i,1);
                   tmpRightLis.splice(i-1,0,tmp1);
                   this.rightTagsList = [...tmpRightLis];
-                  this.$emit('changeActionData',this.rightTagsList, false);
+                  this.$emit('changeActionData',this.getModuleTypeIds(), false);
                   return
                 }
               }
@@ -209,7 +218,7 @@ export default {
                   tmpRightLis.splice(i,1);
                   tmpRightLis.splice(i+1,0,tmp1);
                   this.rightTagsList = [...tmpRightLis];
-                  this.$emit('changeActionData',this.rightTagsList, false);
+                  this.$emit('changeActionData',this.getModuleTypeIds(), false);
                   return;
                 }
               }
@@ -234,7 +243,7 @@ export default {
             this.selectLeftTagsList = [];
             this.selectRightTagsList = [];
             this.getModuleTypeList();
-            this.$emit('changeActionData',this.rightTagsList, false);
+            this.$emit('changeActionData',this.getModuleTypeIds(), false);
         },
         toRightList() {
             this.rightTagsList.push(...this.selectLeftTagsList);
@@ -244,14 +253,14 @@ export default {
             this.selectLeftTagsList = [];
             this.selectRightTagsList = [];
             this.getModuleTypeList();
-            this.$emit('changeActionData',this.rightTagsList, false);
+            this.$emit('changeActionData',this.getModuleTypeIds(), false);
         },
         getModuleTypeList() {
           this.leftTagsList = []
           if(this.hospital === "" || this.moduleName===""){
             return
           }
-          return api.getModuleTypeList({hospitalId: this.hospital, modeId: this.moduleName}).then((res) =>{
+          return api.getModuleTypeList({hospitalId: this.hospital, modeId: this.moduleName,notIdList:this.getModuleTypeIds()||[]}).then((res) =>{
             if(res.data.code==="0"){
               const data = res.data.data;
               this.leftTagsList = data;
@@ -265,6 +274,10 @@ export default {
             }
           })
         },
+      getModuleTypeIds(){
+          const list=this.rightTagsList;
+          return list.map((it)=>it.id);
+      }
     },
     components:{
       QCTipPop