ソースを参照

病例录入新需求

zhangxc 5 年 前
コミット
9a5a38f0d4

+ 3 - 1
src/api/config.js

@@ -285,7 +285,9 @@ export default {
       'getRecordInpList':'/api/mrman/qcInputcases/getInputcasesAll',//获取全部病历录入
       'removeRecordInpById':'/api/mrman/qcInputcases/cancelById',//删除病历录入
       'addRecordInp':'/api/mrman/qcInputcases/getInputcasesAlls', //保存和修改全部病历录入 
-      'getRecordInpModule':'/api/mrman/qcCases/getAll' //获取全部模块及条目
+      'getRecordInpModule':'/api/mrman/qcCases/getAll', //获取全部模块及条目
+      'getRecordHopitalList':'/api/mrman/qcHospitalInfo/getHospitalInfoAll',//获取医院信息 
+      'getRecordCases':'/api/mrman/qcCases/getCases', //获取全部模块
   },
 	menuIconList: { //菜单对应图标
 		'YH-KZT': 'el-icon-menu',

+ 7 - 0
src/api/records.js

@@ -27,4 +27,11 @@ export default {
   getRecordInpModule: (param) =>{ //获取全部模块及条目
     return axios.post(urls.getRecordInpModule,param);
   },
+  getRecordHopitalList: (param) =>{ //获取医院信息
+    return axios.post(urls.getRecordHopitalList,param);
+  },
+  getRecordCases: (param) =>{ //获取全部模块
+    return axios.post(urls.getRecordCases,param);
+  },
+ 
 }

+ 209 - 99
src/components/recordInput/AddRecord.vue

@@ -6,14 +6,32 @@
                 <el-form ref="form" :label-position="labelPosition" label-width="90px" class="add-record-form clearfix" :model="form">
                     <div class="contentBox clearfix">
                         <div class="left fl clearfix">
-                            <el-form-item label="病例信息:" prop="recordInfo">
-                                <el-input
-                                      v-model="form.recordInfo"
-                                      type="textarea"
-                                      :rows="20"
-                                      placeholder="请输入内容">
-                                </el-input>
-                            </el-form-item>
+                            <div class="selectHospital">
+                               <el-select v-model="form.hospitalCode" placeholder="请选择医院">
+                                  <el-option
+                                    v-for="item in hospitalList"
+                                    :key="item.id"
+                                    :label="item.name"
+                                    :value="item.id">
+                                  </el-option>
+                              </el-select>
+                            </div>
+                            <div class="checkBox">
+                              <el-checkbox-group v-model="checkList"  @change="changeCheck">
+                                <el-checkbox v-for="item in casesEntryListSelect" :label="item.id" :disabled="item.disabled" :key="item.id">{{item.name}}</el-checkbox>
+                              </el-checkbox-group>
+                            </div>
+                            <div class="contentBox">
+                              <el-form-item v-for="item in textList" :label="item.label+':'" :key="item.id" prop="recordInfo">
+                                  <el-input
+                                        v-model.trim="item.recordInfo"
+                                        type="textarea"
+                                        :rows="12"
+                                        placeholder="请输入内容">
+                                  </el-input>
+                              </el-form-item>
+                            </div>
+                            
                         </div>
                         <div class="right fr clearfix">
                             <el-select v-model="form.casesId" placeholder="请选择" @change="changeSelectCase">
@@ -36,7 +54,7 @@
                     
                    
                     <p class="oper">
-                        <el-button style="margin-right: 30px" size="small" type="primary" @click="confirm('form')">确定</el-button>
+                        <el-button style="margin-right: 30px" size="small" type="primary" :disabled="!canSumbit" @click="confirm('form')">确定</el-button>
                         <el-button size="small" @click="cancel">取消</el-button>
                     </p>
                 </el-form>
@@ -58,40 +76,88 @@
           {name:'vvv',content:'333sa'}
         ],*/
         caseLIst:[],
+        caseRemarkList:[],
+        hospitalList:[],
         casesEntryList:[],
+        textList:[],
+        casesEntryListSelect:[],
+        checkList:[],
         title:'病例录入-添加病例',
         form:{
-          recordInfo:'',
           casesId:'',
-          checkedcasesEntrys:[]
+          checkedcasesEntrys:[],
+          hospitalCode:'',
         },
         id:null,
-        modifier:''
+        modifier:'',
+        canSumbit: true
+
       }
     },
     created(){
       
-      const userLoginDTO = JSON.parse(localStorage.getItem('userLoginDTO'))
-      this.modifier = userLoginDTO && userLoginDTO.linkman
+      const userLoginDTO = JSON.parse(localStorage.getItem('userLoginDTO'));
+      this.modifier = userLoginDTO && userLoginDTO.linkman;
       const { isEdit, data } = this.$route.params;
+      console.log('data',data)
+      this.getRecordHopitalList();
       if(isEdit) {
           this.title = '病例录入-修改病例';
           this.id= data.id
           this.form.casesId = data.qcInputcasesMapping[0].casesId
-          this.form.recordInfo = data.text
-          let noCheckedcasesEntrys = []
-           this.getRecordInpModule().then(()=>{
-            this.changeSelectCase(this.form.casesId)
-            let casesEntryIdList = this.getIdList(this.casesEntryList)
-             for(let i = 0; i <  data.qcInputcasesMapping.length; i++) {
-                noCheckedcasesEntrys.push(data.qcInputcasesMapping[i].casesEntryId)
+          this.form.hospitalCode = data.hospitalId
+          // this.form.recordInfo = data.text
+          let checkedcasesEntrys = []
+           Promise.all([this.getRecordInpModule(), this.getRecordCases()])
+          //  this.getRecordInpModule()
+           .then(()=>{
+             console.log(' this.caseRemarkList', this.caseRemarkList)
+            // this.changeSelectCase(this.form.casesId)
+            this.casesEntryList = this.caseLIst.filter(item => item.id === this.form.casesId)[0].qcCasesEntry
+            const caseListCopy =JSON.parse(JSON.stringify(this.caseLIst)) 
+             const casesEntryListSelect = []
+            for(let i = 0; i < caseListCopy.length; i++){
+              if(caseListCopy[i].id != this.form.casesId) {
+                casesEntryListSelect.push({
+                  id: caseListCopy[i].id,
+                  name: caseListCopy[i].name, 
+                  disabled: false
+                })
+              }else{
+                casesEntryListSelect.push({
+                  id: caseListCopy[i].id,
+                  name: caseListCopy[i].name, 
+                  disabled: true
+                })
               }
-              let  checkedcasesEntrys = this.getArrDifference(casesEntryIdList,noCheckedcasesEntrys)
+            }
+            this.casesEntryListSelect = casesEntryListSelect
 
-              this.form.checkedcasesEntrys = checkedcasesEntrys
-              })
+           
+            let casesEntryIdList = this.getIdList(this.casesEntryList)
+            for(let i = 0; i <  data.qcInputcasesMapping.length; i++) {
+              if( data.qcInputcasesMapping[i].pass == '-1'){
+              checkedcasesEntrys.push(data.qcInputcasesMapping[i].casesEntryId)
+              } 
+            }
+            this.form.checkedcasesEntrys = checkedcasesEntrys
+            const keys = Object.keys(data)
+            for(let i = 0; i < keys.length; i++){
+              const hasItem = this.caseRemarkList.find(item => item.remark == keys[i])
+              if(hasItem&&data[hasItem.remark]){
+                this.checkList.push(hasItem.id)
+                this.textList.push({
+                  id: hasItem.id,
+                  label: hasItem.name,
+                  remark: hasItem.remark,
+                  recordInfo: data[hasItem.remark]
+                })
+              }
+            }
+          })
       }else {
-         this.getRecordInpModule()
+        this.getRecordCases();
+        this.getRecordInpModule()
       }
 
     },
@@ -109,10 +175,83 @@
           }
         })
       },
+      getRecordHopitalList(){
+        return api.getRecordHopitalList({}).then((res)=>{
+          const result = res.data;
+          if(result.code==0){
+            this.hospitalList = result.data
+          }else{
+            this.$message({
+              message:result.msg,
+              type:'warning'
+            });
+          }
+        })
+      },
+      getRecordCases(){
+         return api.getRecordCases({}).then((res)=>{
+          const result = res.data;
+          if(result.code==0){
+            this.caseRemarkList = result.data
+          }else{
+            this.$message({
+              message:result.msg,
+              type:'warning'
+            });
+          }
+        })
+      },
       changeSelectCase(value){
-
         this.form.checkedcasesEntrys = []
         this.casesEntryList = this.caseLIst.filter(item => item.id === value)[0].qcCasesEntry
+        const casesEntryListSelect = []
+        const caseListCopy =JSON.parse(JSON.stringify(this.caseLIst)) 
+        this.checkList = []
+        this.textList= []
+        for(let i = 0; i < caseListCopy.length; i++){
+          if(caseListCopy[i].id !=value) {
+            casesEntryListSelect.push({
+              id: caseListCopy[i].id,
+              name: caseListCopy[i].name, 
+              disabled: false
+            })
+          }else{
+            casesEntryListSelect.push({
+              id: caseListCopy[i].id,
+              name: caseListCopy[i].name, 
+              disabled: true
+            })
+          }
+        }
+        this.casesEntryListSelect = casesEntryListSelect
+        this.checkList.push(value)
+        const selectCase = this.caseRemarkList.find(item => item.id == value)
+        this.textList.push({
+          id: selectCase.id,
+          label: selectCase.name,
+          remark: selectCase.remark,
+          recordInfo: ''
+        })
+        
+      },
+      changeCheck(value){
+        let textListId = []
+        for(let i = 0; i < this.textList.length; i++){
+          textListId.push(this.textList[i].id)
+        }
+        let noId = this.getArrDifference(textListId,value)[0]
+        const noIndex = this.textList.findIndex(item => item.id == noId)
+        if(noIndex > -1){
+          this.textList.splice(noIndex,1)
+        }else{
+          const selectCase = this.caseRemarkList.find(item => item.id == noId)
+            this.textList.push({
+              id: selectCase.id,
+              label: selectCase.name,
+              remark: selectCase.remark,
+              recordInfo: ''
+            })
+        }
       },
       cancel(){
         this.$router.push({
@@ -133,11 +272,11 @@
         return casesEntryIdList
       },
       confirm(form){
-        const {recordInfo, casesId, checkedcasesEntrys} = this.form
-        if(!recordInfo) {
-          this.warning('请输入病例信息')
-          return
-        }
+        const {hospitalCode, casesId, checkedcasesEntrys} = this.form
+         if(!hospitalCode){
+            this.warning('请选择医院')
+           return
+         }
          if(casesId === '') {
           this.warning('请选择模块ID')
            return
@@ -156,22 +295,33 @@
             pass: 0
           })
         }
+        for(let i = 0; i < checkedcasesEntrys.length; i++) {
+          qcInputMappingSaveVO.push({
+            casesEntryId: checkedcasesEntrys[i],
+            casesId: casesId,
+            pass: -1
+          })
+        }
         let param = {
           creator: this.modifier,
-          text: recordInfo,
+          hospitalId: this.form.hospitalCode,
           qcInputMappingSaveVO,
         }
+        for(let i = 0; i < this.textList.length; i++){
+          param[this.textList[i].remark] = this.textList[i].recordInfo
+        }
         if(this.id){
           param = Object.assign(param,{id: this.id})
         }
+        this.canSumbit = false
         api.addRecordInp(param).then((res)=>{
+            this.canSumbit = true
             if(res.data.code==0){
                 if(this.id){
                   this.warning('修改成功', 'success')
                 }else{
                   this.warning('添加成功', 'success')
                 }
-               
                 //返回带搜索条件的首页
                 this.$router.push({
                   name: 'RecordInput',
@@ -182,70 +332,6 @@
                
             }
         })
-        /*if(!this.form.name.trim() || !this.form.refreshTime.trim()){
-          this.$message({
-            message:'请填写相关内容',
-            type:'warning'
-          });
-          return
-        }*/
-        /*this.$refs[form].validate((valid) => {
-          if (valid) {*/
-            // if(id){//修改
-            //   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;
-          }
-        });*/
       },
       warning(msg,type){
         this.$message({
@@ -267,7 +353,27 @@
         position: relative;
         .left,.right{
           width: 50%;
-          height: 450px;
+          // height: 450px;
+          .el-select{
+            width: 100%;
+          }
+        }
+        .checkBox{
+          margin: 20px 0 0 0;
+          .el-checkbox{
+            position: relative;
+            margin: 0 30px  0 0px;
+            line-height: 30px;
+            .el-checkbox__input{
+              position: absolute;
+              top: 9px;
+            }
+            .el-checkbox__label{
+              padding: 0 0 0 20px;
+              white-space: normal;
+              line-height: 30px;
+            }
+          }
         }
         .right{
           width: 45%;
@@ -276,12 +382,15 @@
             width: 80%;
           }
         }
+        .contentBox{
+          margin: 20px 0 0 0;
+        }
         .casesEntryList{
           margin-top: 20px;
           padding: 10px 0;
           width: 80%;
           border: 1px solid #dcdfe6;
-          height: 350px;
+          height: 410px;
           overflow-y: auto;
           .el-checkbox{
             position: relative;
@@ -309,6 +418,7 @@
             margin-bottom: 20px;
         }
         .oper{
+          margin: 30px 0 0 0;
             padding-right: 80px;
             text-align: right;
         }

+ 5 - 3
src/components/recordInput/RecordList.vue

@@ -2,11 +2,11 @@
     <div>
         <crumbs title="病例入录" style="min-width: 980px">
             <el-form :inline="true" class="demo-form-inline">
-                <!-- <el-form-item label="病人住院ID:">
+                <el-form-item label="病人住院ID:">
                    <el-input size="mini" v-model="filter.brzyid" placeholder="病人住院ID" clearable></el-input>
-               </el-form-item> -->
+               </el-form-item>
                <el-form-item>
-                   <!-- <el-button size="mini" @click="filterDatas">查找</el-button> -->
+                   <el-button size="mini" @click="filterDatas">查找</el-button>
                    <el-button size="mini" type="warning" @click="addRecord">添加测试病例</el-button>
                </el-form-item>
             </el-form>
@@ -79,6 +79,7 @@
         list: [],
         searched: false,
         filter:{
+          brzyid:''
         },
         /*currentPage: 1,
         pageSize: config.pageSize,
@@ -179,6 +180,7 @@
         const param = {
           /*current: this.inCurrentPage||this.currentPage,
           size: this.pageSize,*/
+          textId:this.filter.brzyid.trim()
         };
         return param;
       },