ソースを参照

慢病指标值关联维护

zhangxc 6 年 前
コミット
614dd79b40

+ 62 - 20
src/components/icss/AddChronicAndIndexRelation.vue

@@ -38,10 +38,10 @@
                         <li 
                         v-for="item in indexList" 
                         class="diagItem ellipsis"
-                        :title="item.diseaseName"
-                        @click="selectDiag(item)"
-                        :key="item.diseaseId">
-                        {{item.diseaseName}}
+                        :title="item.conceptName"
+                        @click="selectIndex(item)"
+                        :key="item.conceptName">
+                        {{item.conceptName}}
                         </li>
                     </ul>
             </div>
@@ -52,6 +52,11 @@
                     <td class="selectedContentGrop">已选内容分组(只可输入数字,相同数字归为一组展示)</td>
                     <td class="selectedContentOpera">操作</td>
                 </tr>
+                <tr v-for="(item, index) in selectedIndexList" :key="item.indexUnique"> 
+                    <td class="selectedContent">{{item.indexUnique}}</td>
+                    <td class="selectedContentGrop"><input class="groupInput" type="number" v-model="item.indexDesc"></td>
+                    <td class="selectedContentOpera"><el-button type="text" size="small" class="delete" @click="delSelectedIndex(item, index)">删除</el-button></td>
+                </tr>
             </table>
         </div>
         <div class="btn">
@@ -78,6 +83,8 @@
             titleText: '添加关联',
             diagList: [],
             indexList: [],
+            selectedIndexMap: [],   //已经选择过的指标
+            selectedIndexList: [],  //选择的指标列表
             searchDiagVal: '',
             searchIndexVal: '',
             isEdit: false,
@@ -87,10 +94,12 @@
         const { isEdit, data } = this.$route.params;
         if(isEdit) {
             if(isEdit) {
-                this.titleText = '修改关联'
+                this.isEdit = isEdit;
+                this.titleText = '修改关联';
+                this.form.diseaseId = data.diseaseId
+                this.form.diseaseName = data.diseaseName
+                this.selectedIndexList = data.data
             } 
-           
-            
         } else {
             
         }
@@ -120,7 +129,7 @@
             })
         },
         selectDiag(item) {
-            this.form.diseaseId = item.id
+            this.form.diseaseId = item.diseaseId
             this.form.diseaseName = item.diseaseName
             this.$refs['diagList'].style.display='none'
             this.searchDiagVal = ''
@@ -133,40 +142,69 @@
         },
         searchIndex() {
              const param = {
-                conceptName: this.searchIndexVal
+                conceptName: this.searchIndexVal,
+                excludedConceptNames:  this.selectedIndexMap
             }
+            
             api.getAllLisConcept(param).then((res)=>{
                if(res.data.code === '0') {
                    console.log('res.data.data', res.data.data)
-                   this.indexList = res.data.data
+                //    this.indexList = res.data.data
+                this.indexList =[
+                    {conceptName : '空腹血糖'},
+                    {conceptName : '餐后2小时血糖'},
+                    {conceptName : '随机血糖'},
+                    {conceptName : '糖化血红蛋白'},
+                    {conceptName : '血常规'},
+                ]
                    this.$refs['indexList'].style.display='block'
                 }
             })
         },
+        selectIndex(item) {
+            this.selectedIndexList.push({indexUnique: item.conceptName, indexDesc:''})
+            this.selectedIndexMap.push(item.conceptName)
+            this.indexList = []
+            this.$refs['indexList'].style.display='none'
+        },
+        delSelectedIndex(selectedItem, index) {
+            this.selectedIndexMap = this.selectedIndexMap.filter((item) => {return item != selectedItem.indexUnique})
+            this.selectedIndexList.splice(index, 1)
+        },
         submitForm(formName) {
             if(!this.form.diseaseId) {
                 this.warning('请选择诊断')
                 return
             }
-            // if(this.rightTagsList.length === 0) {
-            //     this.warning('请选择量表')
-            //     return
-            // }
+            if(this.selectedIndexList.length === 0) {
+                this.warning('请选择指标')
+                return
+            }
+            for (let i = 0; i < this.selectedIndexList.length; i++) {
+                if(!this.selectedIndexList[i].indexDesc) {
+                    this.warning('请填写内容分组')
+                    return
+                }
+            }
             this.showDelDialog()
         },
         showDelDialog() {
-            const scaleId = this.selectedTags()
+            this.selectedIndexList.map((item) => {
+                item.diseaseId = this.form.diseaseId
+                return item
+            })
             const param ={
                 "diseaseId": this.form.diseaseId,
-                "scaleId": scaleId
+                "indexConfigData": this.selectedIndexList
             }
             this.showConfirmDialog('是否建立该关联?', () => {
-                api.addDisScaleInfo(param).then((res) => {
+                const  url = this.isEdit ?api.updateIndexConfigList(param) : api.saveIndexConfigLists(param) 
+                url.then((res) => {
                 if (res.data.code  === '0') {
                     this.warning(res.data.msg || '关联成功', 'success','1000')
                     setTimeout(() => {
                     this.$router.push({
-                        path:'/admin/LT-YXSJWH-LBGLWH'
+                        path:'/admin/LT-YXSJWH-MBZBZGLWH'
                     })
                     }, 1000);
                 } else {
@@ -262,7 +300,7 @@
             background-color: #fff;
              padding: 20px;
              margin: 0px 20px 0px 20px;
-             height: 500px;
+             min-height: 400px;
         }
         .screenIndexLabel {
             float: left;
@@ -297,15 +335,19 @@
         .indexList {
             left: 128px;
         }
+        .groupInput {
+            text-align: center;
+            height: 28px;
+        }
         .btn {
             position: relative;
             background-color: #fff;
             margin: 0px 20px;
+            height: 40px;
             padding: 20px;
             .el-button {
                 position: absolute;
                 right: 20px;
-                top: -20px;
             }
         }
         .selectDepart {

+ 15 - 6
src/components/icss/ChronicAndIndexRelation.vue

@@ -46,7 +46,7 @@
                     label="操作">
                     <template slot-scope="scope">
                         <el-button  @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
-                        <el-button @click="showDelDialog(scope.row.id)" class="delete" type="text" size="small">删除</el-button>
+                        <el-button @click="showDelDialog(scope.row)" class="delete" type="text" size="small">删除</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -114,9 +114,15 @@ export default {
             this.$router.push({name:'AddChronicAndIndexRelation'})
         },
         modifyRelation(row) {
-            // console.log(row,'row')
-            // const item = Object.assign({},row);
-            // this.$router.push({name:'AddChronicAndIndexRelation',params:{isEdit:true,data:item}});
+            const param = {
+                diseaseId: row.diseaseId
+            }
+            api.getIndexConfigLists(param).then((res) => {
+                if(res.data.code == '0') {
+                    const item = Object.assign({},row,{data: res.data.data});
+                    this.$router.push({name:'AddChronicAndIndexRelation',params:{isEdit:true,data:item}});
+                }
+            })
         },
         currentChange(next) {
             this.currentPage = next;
@@ -156,9 +162,12 @@ export default {
             resolve();
           }).catch(() => {});
         },
-        showDelDialog(id){
+        showDelDialog(row){
+          const param = {
+              diseaseId:row.diseaseId
+          }
           this.showConfirmDialog('是否删除该关联?',()=>{
-            api.delLisMappingById({id:id}).then((res)=>{
+            api.cancelIndexConfigAlls(param).then((res)=>{
               if(res.data.code=='0'){
                 this.getDataList();
                 this.warning(res.data.msg || '操作成功','success');