zhangxc пре 5 година
родитељ
комит
4685895220
1 измењених фајлова са 118 додато и 62 уклоњено
  1. 118 62
      src/components/recordInput/ManageItemBatch.vue

+ 118 - 62
src/components/recordInput/ManageItemBatch.vue

@@ -54,7 +54,7 @@
                                  </template>
                             </el-table-column>
                           </el-table> -->
-                          <el-collapse v-model="activeLeftNames" @change="handleChange">
+                          <el-collapse v-model="activeLeftNames" @change="handleChange" v-if="caseLIst.length > 0">
                                 <el-collapse-item v-for="(item, index) in caseLIst" :title="item.name" :name="item.id" :key="item.id">
                                     <!-- <el-checkbox-group v-model="checkAllMap[item.remark]" >
                                       <el-checkbox v-for=" casesEntry in item.qcCasesEntry" :label="casesEntry.id" :key="casesEntry.id">{{casesEntry.name}}
@@ -136,21 +136,26 @@
         multipleSelection: [],
         id:null,
         activeLeftNames: ['1'],
+        modifier:''
       }
     },
     created(){
-      let info = this.$route.params;
+      const userLoginDTO = JSON.parse(localStorage.getItem('userLoginDTO'))
+      this.modifier = userLoginDTO && userLoginDTO.linkman
+     
       this.getRecordHopitalList()
-      this.getRecordInpModule()
+      // this.getRecordInpModule()
     },
     methods:{
       toggleSelection(values) {
-        console.log('ccccccccc',values) ///remark有空值,数据错误明天提醒下改下
         setTimeout(()=>{
+          //  this.$refs.multipleTable[6].toggleRowSelection(this.caseLIst[6].qcCasesEntry[0]);
+          //  this.$refs.multipleTable[6].toggleRowSelection(this.caseLIst[6].qcCasesEntry[1]);
           for(let i = 0; i < values.length; i++){
-            if(values[i]){
+            if(values[i].length > 0){
               values[i].forEach(value=>{
-                this.$refs.multipleTable[i].toggleRowSelection(value);
+                const index = this.caseLIst[i].qcCasesEntry.findIndex(item =>item.id === value.id)
+                this.$refs.multipleTable[i].toggleRowSelection(this.caseLIst[i].qcCasesEntry[index]);
               })
             }
           }
@@ -179,14 +184,16 @@
         
       },
       handleSelectionChange(val,remark) {
-        console.log('val',remark)
         this.checkAllMap[remark] = val;
       },
        handleChange(val) {
-        // console.log(val);
       },
       changeHospital(val){
-        this.getRecordByHospital(val).then
+        this.getRecordInpModule().then(()=>{
+          this.getRecordByHospital(val)
+         }
+        )
+        
       },
       getRecordInpModule(){
         return api.getRecordInpModule({}).then((res)=>{
@@ -194,7 +201,6 @@
           if(result.code==0){
             let  caseLIst = result.data
           
-            console.log('caseLIst', caseLIst)
             this.caseLIst = caseLIst  //提醒每项加分值和备注
 
              const checkAllMap = {}
@@ -205,7 +211,8 @@
           }else{
             this.$message({
               message:result.msg,
-              type:'warning'
+              type:'warning',
+              showClose: true
             });
           }
         })
@@ -215,7 +222,6 @@
           const result = res.data;
           if(result.code==0){
             this.hospitalList = result.data
-            console.log('hospitalList',this.hospitalList)
             const tableData = []
             for(let i = 0; i < this.hospitalList.length; i++){
               tableData.push({
@@ -229,7 +235,8 @@
           }else{
             this.$message({
               message:result.msg,
-              type:'warning'
+              type:'warning',
+              showClose: true
             });
           }
         })
@@ -241,7 +248,6 @@
         return api.getRecordByHospital(param).then((res)=>{
           const result = res.data;
           if(result.code==0){
-            console.log('hospitalRecord', result.data)
             this.hospitalItemList =  result.data
             for (let i = 0; i< this.hospitalItemList.length; i++){
               const hospitalItem = this.hospitalItemList[i]
@@ -260,7 +266,8 @@
           }else{
             this.$message({
               message:result.msg,
-              type:'warning'
+              type:'warning',
+              showClose: true
             });
           }
         })
@@ -272,68 +279,117 @@
         });
       },
       comfirn(form){
-        console.log('multipleSelection',this.checkAllMap)
-        return
-        /*if(!this.form.name.trim() || !this.form.refreshTime.trim()){
+        if(!this.hospitalId){
           this.$message({
-            message:'请填写相关内容',
-            type:'warning'
-          });
-          return
-        }*/
-        /*this.$refs[form].validate((valid) => {
-          if (valid) {*/
-            if(this.basyid){//修改
-              const param = Object.assign({},this.form,{basyid:this.basyid,brzyid:this.brzyid});
-              api.saveRecord(param).then((res)=>{
+                    message:"请选择医院",
+                    type:'warning',
+                    showClose: true
+                  });
+        }
+        const values = Object.values(this.checkAllMap)
+        let casesEntryHospitals = []
+        for(let i = 0; i < values.length; i++){
+          for(let j = 0; j < values[i].length;j++){
+            const value = values[i][j]
+            let item = {
+              "casesEntryId": value.id,
+              "creator": "0",
+              "hospitalId": this.hospitalId,
+              "modifier": this.modifier,
+              "msg": value.msg,
+              "remark": value.remark,
+              "score": value.score
+            }
+            casesEntryHospitals.push(item)
+          }
+        }
+        let param = {
+          "casesEntryHospitals": casesEntryHospitals,
+          "hospitalIds": [
+           this.hospitalId
+          ]
+        }
+        api.updateRecordByHospital(param).then((res)=>{
                 if(res.data.code==0){
                   this.$message({
                     message:"修改成功",
-                    type:'success'
+                    type:'success',
+                    showClose: true
                   });
                   //返回带搜索条件的首页
                   this.$router.push({
-                    name: 'RecordManager',
+                    name: 'RecordItemList',
                     params: Object.assign({}, this.$route.params)
                   });
                 }else{
                   this.$message({
                     message:res.data.msg,
-                    type:'warning'
+                    type:'warning',
+                    showClose: true
                   });
                 }
               })
-            }else{//添加
-              // 复制时把list多余字段过滤掉,如id等
-              const detail = this.list;
-              let copyDetail=[];
-              let item={};
-              if(detail && detail.length>0){
-                for(let i=0; i<detail.length; i++){
-                  item.title = detail[i].title;
-                  item.description = detail[i].description;
-                  copyDetail.push(item);
-                  item={};
-                }
-              }
-              const params = Object.assign({},this.form);
-              // api.addVersInfo(this.form).then((res)=>{
-              api.saveRecord(params).then((res)=>{
-                if(res.data.code==0){
-                  this.$message({
-                    message:"添加成功",
-                    type:'success'
-                  })
-                  // this.$router.push({path: 'LT-GBBXXWH-BBXXWH'});
-                  this.$router.push({name: 'RecordManager'});
-                }else{
-                  this.$message({
-                    message:res.data.msg,
-                    type:'warning'
-                  });
-                }
-              })
-            }
+        return
+        /*if(!this.form.name.trim() || !this.form.refreshTime.trim()){
+          this.$message({
+            message:'请填写相关内容',
+            type:'warning'
+          });
+          return
+        }*/
+        /*this.$refs[form].validate((valid) => {
+          if (valid) {*/
+            // if(this.basyid){//修改
+            //   const param = Object.assign({},this.form,{basyid:this.basyid,brzyid:this.brzyid});
+            //   api.saveRecord(param).then((res)=>{
+            //     if(res.data.code==0){
+            //       this.$message({
+            //         message:"修改成功",
+            //         type:'success'
+            //       });
+            //       //返回带搜索条件的首页
+            //       this.$router.push({
+            //         name: 'RecordManager',
+            //         params: Object.assign({}, this.$route.params)
+            //       });
+            //     }else{
+            //       this.$message({
+            //         message:res.data.msg,
+            //         type:'warning'
+            //       });
+            //     }
+            //   })
+            // }else{//添加
+            //   // 复制时把list多余字段过滤掉,如id等
+            //   const detail = this.list;
+            //   let copyDetail=[];
+            //   let item={};
+            //   if(detail && detail.length>0){
+            //     for(let i=0; i<detail.length; i++){
+            //       item.title = detail[i].title;
+            //       item.description = detail[i].description;
+            //       copyDetail.push(item);
+            //       item={};
+            //     }
+            //   }
+            //   const params = Object.assign({},this.form);
+            //   // api.addVersInfo(this.form).then((res)=>{
+            //   api.saveRecord(params).then((res)=>{
+            //     if(res.data.code==0){
+            //       this.$message({
+            //         message:"添加成功",
+            //         type:'success'
+            //       })
+            //       // this.$router.push({path: 'LT-GBBXXWH-BBXXWH'});
+            //       this.$router.push({name: 'RecordManager'});
+            //     }else{
+            //       this.$message({
+            //         message:res.data.msg,
+            //         type:'warning'
+            //       });
+            //     }
+            //   })
+            // }
           /*} else {
             return false;
           }