Browse Source

化验大小项被回滚放开-1

zhouna 5 years ago
parent
commit
5fa0cf23d6
1 changed files with 236 additions and 236 deletions
  1. 236 236
      src/components/icss/AddChemicalAndCommonMapping.vue

+ 236 - 236
src/components/icss/AddChemicalAndCommonMapping.vue

@@ -13,26 +13,26 @@
         <div class="AddChemicalAndCommonMappingBox clearfix">
         <div class="AddChemicalAndCommonMappingBox clearfix">
             <div class="titleBox clearfix">
             <div class="titleBox clearfix">
                 <p class="title">关联公表项</p>
                 <p class="title">关联公表项</p>
-                <p class="title">关联化验项</p> 
+                <p class="title">关联化验项</p>
             </div>
             </div>
             <div class="rightBox">
             <div class="rightBox">
                 <div class="itemLabel">
                 <div class="itemLabel">
                     <label  class="itemLabelName">选择公表项:</label>
                     <label  class="itemLabelName">选择公表项:</label>
-                    <input class="searchInput"  @focus="focuInput" type="text" v-model = "uniqueText"> 
+                    <input class="searchInput"  @focus="focuInput" type="text" v-model = "uniqueText">
                     <span class="searchName" @click="searchMealItem(3)">搜索</span>
                     <span class="searchName" @click="searchMealItem(3)">搜索</span>
-                    <ul 
-                        v-if="showUniqueNameList&&uniqueNameList.length >0"
-                        class="itemList uniqueNameList" 
-                        ref="uniqueNameList"
+                    <ul
+                            v-if="showUniqueNameList&&uniqueNameList.length >0"
+                            class="itemList uniqueNameList"
+                            ref="uniqueNameList"
                     >
                     >
-                      <li 
-                        v-for="item in uniqueNameList" 
-                        class="mealNameItem ellipsis"
-                        :title="item.conceptName"
-                        @click="selectUniqueName(item)"
-                        :key="item.conceptName">
-                        {{item.conceptName}}
-                      </li>
+                        <li
+                                v-for="item in uniqueNameList"
+                                class="mealNameItem ellipsis"
+                                :title="item.conceptName"
+                                @click="selectUniqueName(item)"
+                                :key="item.conceptName">
+                            {{item.conceptName}}
+                        </li>
                     </ul>
                     </ul>
                 </div>
                 </div>
                 <div class="itemLabel">
                 <div class="itemLabel">
@@ -40,32 +40,32 @@
                     <span class="selectItemName">{{form.uniqueName}}</span>
                     <span class="selectItemName">{{form.uniqueName}}</span>
                 </div>
                 </div>
             </div>
             </div>
-            
+
             <div class="midBox">
             <div class="midBox">
                 <img class="midLogo" src="../../images/relation.png" alt="">
                 <img class="midLogo" src="../../images/relation.png" alt="">
                 <p class="midTitle">相互关联</p>
                 <p class="midTitle">相互关联</p>
             </div>
             </div>
             <div class="leftBox clearfix" >
             <div class="leftBox clearfix" >
-                
+
                 <div class="itemLabel clearfix">
                 <div class="itemLabel clearfix">
-                    <label class="itemLabelName">选择化验大项:</label> 
-                    <input class="searchInput" @focus="focuInput" type="text" v-model = "mealText"> 
+                    <label class="itemLabelName">选择化验大项:</label>
+                    <input class="searchInput" @focus="focuInput" type="text" v-model = "mealText">
                     <span class="searchName" @click="searchMealItem(1)">搜索</span>
                     <span class="searchName" @click="searchMealItem(1)">搜索</span>
-                    <ul 
-                        v-if="showMealNameList&&mealNameList.length >0"
-                        class="itemList mealNameList" 
-                        ref="mealNameList"
+                    <ul
+                            v-if="showMealNameList&&mealNameList.length >0"
+                            class="itemList mealNameList"
+                            ref="mealNameList"
                     >
                     >
-                      <li 
-                        v-for="item in mealNameList" 
-                        class="mealNameItem ellipsis"
-                        :title="item.name"
-                        @click="selectMealName(item)"
-                        :key="item.id">
-                        {{item.name}}
-                      </li>
+                        <li
+                                v-for="item in mealNameList"
+                                class="mealNameItem ellipsis"
+                                :title="item.conceptName"
+                                @click="selectMealName(item)"
+                                :key="item.conceptId">
+                            {{item.conceptName}}
+                        </li>
                     </ul>
                     </ul>
-                    
+
                 </div>
                 </div>
                 <div class="itemLabel clearfix">
                 <div class="itemLabel clearfix">
                     <label  class="itemLabelName isRequired">已选择化验大项:</label>
                     <label  class="itemLabelName isRequired">已选择化验大项:</label>
@@ -73,21 +73,21 @@
                 </div>
                 </div>
                 <div class="itemLabel clearfix">
                 <div class="itemLabel clearfix">
                     <label  class="itemLabelName">选择化验小项:</label>
                     <label  class="itemLabelName">选择化验小项:</label>
-                    <input class="searchInput"  @focus="focuInput" type="text" v-model = "itemText"> 
+                    <input class="searchInput"  @focus="focuInput" type="text" v-model = "itemText">
                     <span class="searchName" @click="searchMealItem(2)">搜索</span>
                     <span class="searchName" @click="searchMealItem(2)">搜索</span>
-                    <ul 
-                        v-if="showItemNameList&&itemNameList.length >0"
-                        class="itemList itemNameList" 
-                        ref="itemNameList"
+                    <ul
+                            v-if="showItemNameList&&itemNameList.length >0"
+                            class="itemList itemNameList"
+                            ref="itemNameList"
                     >
                     >
-                      <li 
-                        v-for="item in itemNameList" 
-                        class="mealNameItem ellipsis"
-                        :title="item.name+'-'+item.tagName"
-                        @click="selectItemName(item)"
-                        :key="item.id">
-                        {{item.name}}-{{item.tagName}}
-                      </li>
+                        <li
+                                v-for="item in itemNameList"
+                                class="mealNameItem ellipsis"
+                                :title="item.conceptName"
+                                @click="selectItemName(item)"
+                                :key="item.conceptId">
+                            {{item.conceptName}}
+                        </li>
                     </ul>
                     </ul>
                 </div>
                 </div>
                 <div class="itemLabel">
                 <div class="itemLabel">
@@ -96,184 +96,184 @@
                 </div>
                 </div>
             </div>
             </div>
         </div>
         </div>
-       <div class="btn">
-           <!-- <span class="sumbit" @click="submitForm">建立关联</span> -->
-           <el-button
-                type="primary"
-                :disabled = 'saveDisable'
-                @click="submitForm"
+        <div class="btn">
+            <!-- <span class="sumbit" @click="submitForm">建立关联</span> -->
+            <el-button
+                    type="primary"
+                    :disabled = 'saveDisable'
+                    @click="submitForm"
             >建立关联</el-button>
             >建立关联</el-button>
-        </div> 
+        </div>
     </div>
     </div>
-    
+
 </template>
 </template>
 <script>
 <script>
-import api from '@api/icss.js';
+  import api from '@api/icss.js';
 
 
-export default {
+  export default {
     name: 'AddChemicalAndCommonMapping',
     name: 'AddChemicalAndCommonMapping',
     data() {
     data() {
-        return {
-            mealText: '', //化验大项搜索文字内容
-            itemText: '',   //化验小项搜索文字内容
-            uniqueText: '',     //公表项搜索文字内容
-            isEdit: false,
-            mealNameList:[],
-            itemNameList: [],
-            uniqueNameList:[],
-            showMealNameList: false,
-            showItemNameList: false,
-            showUniqueNameList: false,
-            form: {
-              mealName: '', //大项名称
-              mealId: '', //大项Id
-              itemName: '',   //小项名称
-              itemId: '',     //小项Id
-              uniqueName: '',    //公表名称,必填
-              uniqueId:'' //公表项Id
-            },
-            saveDisable: false  //保存按钮禁止点击
-            
-        }
+      return {
+        mealText: '', //化验大项搜索文字内容
+        itemText: '',   //化验小项搜索文字内容
+        uniqueText: '',     //公表项搜索文字内容
+        isEdit: false,
+        mealNameList:[],
+        itemNameList: [],
+        uniqueNameList:[],
+        showMealNameList: false,
+        showItemNameList: false,
+        showUniqueNameList: false,
+        form: {
+          mealName: '', //大项名称
+          mealId: '', //大项Id
+          itemName: '',   //小项名称
+          itemId: '',     //小项Id
+          uniqueName: '',    //公表名称,必填
+          uniqueId:'' //公表项Id
+        },
+        saveDisable: false  //保存按钮禁止点击
+
+      }
     },
     },
     created() {
     created() {
-        //修改(不需要)
-        // const { isEdit, data } = this.$route.params
-        // if(isEdit) {
-        //     this.isEdit = isEdit;
-        //     this.form.mealName = data.mealName
-        //     this.form.itemName = data.itemName
-        //     this.form.uniqueName = data.uniqueName
-        // }
+      //修改(不需要)
+      // const { isEdit, data } = this.$route.params
+      // if(isEdit) {
+      //     this.isEdit = isEdit;
+      //     this.form.mealName = data.mealName
+      //     this.form.itemName = data.itemName
+      //     this.form.uniqueName = data.uniqueName
+      // }
     },
     },
     methods: {
     methods: {
-        close() {
-            this.mealNameList = [];
-            this.itemNameList =[];
-            this.uniqueNameList = [];
-            this.showSearchList()
-        },
-        searchMealItem(type) {
-            if( type == '1' || type == '2') {
-                this.getTagList(type)
-            } else if ( type == '3') {
-                this.getAllLisConcept()
-            }
-            
-        },
-        getTagList(type) {
-            let param = {}
+      close() {
+        this.mealNameList = [];
+        this.itemNameList =[];
+        this.uniqueNameList = [];
+        this.showSearchList()
+      },
+      searchMealItem(type) {
+        if( type == '1' || type == '2') {
+          this.getTagList(type)
+        } else if ( type == '3') {
+          this.getAllLisConcept()
+        }
+
+      },
+      getTagList(type) {
+        let param = {
+          relationPosition: 3
+        }
+        if (type == 1) {
+          param.name = this.mealText
+          param.typeId = 12
+        } else if (type == 2) {
+          param.name = this.itemText
+          param.typeId = 13
+        }
+        if(!param.name) {
+          return
+        }
+        api.getConceptInfoAssay(param).then((res) => {
+          if (res.data.code === '0') {
             if (type == 1) {
             if (type == 1) {
-                param.name = this.mealText
-                param.tagType = [7]
-                param.type = 5
+              this.mealNameList = res.data.data
+              this.showSearchList('showMealNameList')
             } else if (type == 2) {
             } else if (type == 2) {
-                param.name = this.itemText
-                param.tagType = [1]
-                param.type = 5
+
+              this.itemNameList = res.data.data
+              this.showSearchList('showItemNameList')
             }
             }
-          if(!param.name) {
-            return
           }
           }
-          api.getConceptInfoAssay(param).then((res) => {
-                if (res.data.code === '0') {
-                     if (type == 1) {
-                        this.mealNameList = res.data.data
-                        this.showSearchList('showMealNameList')
-                    } else if (type == 2) {
-                       
-                        this.itemNameList = res.data.data
-                        this.showSearchList('showItemNameList')
-                    }
-                }
-            })
-            
-        },
-        getAllLisConcept() {
-            const param = {
-                conceptName: this.uniqueText
-            }
-          if(!param.conceptName) {
-            return
+        })
+
+      },
+      getAllLisConcept() {
+        const param = {
+          conceptName: this.uniqueText
+        }
+        if(!param.conceptName) {
+          return
+        }
+        api.getAllLisConcept(param).then((res) => {
+          if(res.data.code === '0') {
+            this.uniqueNameList = res.data.data
+            this.showSearchList('showUniqueNameList')
           }
           }
-            api.getAllLisConcept(param).then((res) => {
-                if(res.data.code === '0') {
-                    this.uniqueNameList = res.data.data
-                    this.showSearchList('showUniqueNameList')
-                }
-            })
-        },
-        focuInput() {
-            this.showSearchList()
-        },
-        showSearchList(type) {
-            this.showMealNameList = false
-            this.showItemNameList = false
-            this.showUniqueNameList = false
-            if(type === 'showMealNameList') {
-                this.showMealNameList = true
-            } else if (type === 'showItemNameList') {
-                this.showItemNameList = true
-            } else if (type === 'showUniqueNameList'){
-                this.showUniqueNameList = true
-            }
-        },
-        selectMealName(item) {
-          this.form.mealName = item.conceptName
-          this.form.mealId = item.conceptId
-          // this.$refs['mealNameList'].style.display='none'
-          this.mealText = ''
-          this.mealNameList = []
-        },
+        })
+      },
+      focuInput() {
+        this.showSearchList()
+      },
+      showSearchList(type) {
+        this.showMealNameList = false
+        this.showItemNameList = false
+        this.showUniqueNameList = false
+        if(type === 'showMealNameList') {
+          this.showMealNameList = true
+        } else if (type === 'showItemNameList') {
+          this.showItemNameList = true
+        } else if (type === 'showUniqueNameList'){
+          this.showUniqueNameList = true
+        }
+      },
+      selectMealName(item) {
+        this.form.mealName = item.conceptName
+        this.form.mealId = item.conceptId
+        // this.$refs['mealNameList'].style.display='none'
+        this.mealText = ''
+        this.mealNameList = []
+      },
       selectItemName(item) {
       selectItemName(item) {
         this.form.itemName = item.conceptName
         this.form.itemName = item.conceptName
         this.form.itemId = item.conceptId
         this.form.itemId = item.conceptId
         this.itemText = ''
         this.itemText = ''
         this.itemNameList = []
         this.itemNameList = []
       },
       },
-        selectUniqueName(item) {
-          this.form.uniqueName = item.conceptName
-          this.form.uniqueId = item.conceptId
-          //搜索公表项自动填充大小项(目前暂时不需要)
-          // let nameArr = item.conceptName.split('--');
-          // this.form.mealName = nameArr[0]
-          // this.form.itemName = nameArr[1]
-          // this.$refs['uniqueNameList'].style.display='none'
-          this.uniqueText = ''
-          this.uniqueNameList = []
-        },
-        initForm() {
-          this.form.mealName = ''
-          this.form.mealId = ''
-          this.form.itemName = ''
-          this.form.itemId = ''
-          this.form.uniqueName = ''
-          this.form.uniqueId = ''
-        },
-        submitForm() {
-        const { mealName, itemName, uniqueName } = this.form
-        if (!mealName || !uniqueName) {
-            this.warning('请填写相关数据')
-            return
+      selectUniqueName(item) {
+        this.form.uniqueName = item.conceptName
+        this.form.uniqueId = item.conceptId
+        //搜索公表项自动填充大小项(目前暂时不需要)
+        // let nameArr = item.conceptName.split('--');
+        // this.form.mealName = nameArr[0]
+        // this.form.itemName = nameArr[1]
+        // this.$refs['uniqueNameList'].style.display='none'
+        this.uniqueText = ''
+        this.uniqueNameList = []
+      },
+      initForm() {
+        this.form.mealName = ''
+        this.form.mealId = ''
+        this.form.itemName = ''
+        this.form.itemId = ''
+        this.form.uniqueName = ''
+        this.form.uniqueId = ''
+      },
+      submitForm() {
+        const { itemId, mealId, uniqueId } = this.form
+        if (!mealId || !uniqueId) {
+          this.warning('请填写相关数据')
+          return
         }
         }
         //通过必填验证,提交保存
         //通过必填验证,提交保存
         const param = {
         const param = {
-            "itemName": itemName,
-            "mealName": mealName,
-            "uniqueName": uniqueName
+          "itemId": itemId,
+          "mealId": mealId,
+          "uniqueId": uniqueId
         }
         }
         this.showSaveDialog(param);
         this.showSaveDialog(param);
       },
       },
       saveLisMapping(param, msg, type) {
       saveLisMapping(param, msg, type) {
         api.saveLisMapping(param).then((res) => {
         api.saveLisMapping(param).then((res) => {
-            if (res.data.code === '0') {
+          if (res.data.code === '0') {
             this.warning(res.data.msg || msg, type);
             this.warning(res.data.msg || msg, type);
             // this.$router.push({name: 'ChemicalAndCommonMapping'});
             // this.$router.push({name: 'ChemicalAndCommonMapping'});
             this.initForm();
             this.initForm();
-            } else {
-                this.warning(res.data.msg)
-            }
-            this.saveDisable = false
+          } else {
+            this.warning(res.data.msg)
+          }
+          this.saveDisable = false
         })
         })
       },
       },
       showSaveDialog(param) {
       showSaveDialog(param) {
@@ -281,18 +281,18 @@ export default {
         //   if(this.isEdit) {
         //   if(this.isEdit) {
         //       this.saveLisMapping(param)
         //       this.saveLisMapping(param)
         //   } else {
         //   } else {
-            this.saveDisable = true  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
-            api.hasLisMapping(param).then((res) => {
-                if (!res.data.data) {
-                    this.saveLisMapping(param, '关联建立成功', 'success' )
-                } else {
-                    this.showConfirmDialog('该关联已存在是否替换旧的关系信息', () => {
-                        this.saveLisMapping(param, '关联建立成功', 'success' )
-                    });
-                }
-            }).catch((err) => {
-                this.warning(err);
-            })
+        this.saveDisable = true  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+        api.hasLisMapping(param).then((res) => {
+          if (!res.data.data) {
+            this.saveLisMapping(param, '关联建立成功', 'success' )
+          } else {
+            this.showConfirmDialog('该关联已存在是否替换旧的关系信息', () => {
+              this.saveLisMapping(param, '关联建立成功', 'success' )
+            });
+          }
+        }).catch((err) => {
+          this.warning(err);
+        })
 
 
         //   }
         //   }
       },
       },
@@ -306,8 +306,8 @@ export default {
         }).then(() => {
         }).then(() => {
           resolve();
           resolve();
         }).catch(() => {
         }).catch(() => {
-            this.saveDisable = false
-            this.warning('建立失败','error')
+          this.saveDisable = false
+          this.warning('建立失败','error')
         });
         });
       },
       },
       warning(msg, type) {
       warning(msg, type) {
@@ -319,10 +319,10 @@ export default {
       },
       },
 
 
     }
     }
-}
+  }
 </script>
 </script>
 <style lang="less">
 <style lang="less">
-.AddChemicalAndCommonMappingWrapper {
+    .AddChemicalAndCommonMappingWrapper {
     .AddChemicalAndCommonMappingBox {
     .AddChemicalAndCommonMappingBox {
         min-width: 940px;
         min-width: 940px;
     }
     }
@@ -331,16 +331,16 @@ export default {
         top: 0;
         top: 0;
     }
     }
     // .groupTitle {
     // .groupTitle {
-    //     width: calc(100% - 50px);
-    //     height: 40px;
-    //     background: #fff;
-    //     padding: 0 20px 0 30px;
-    //     margin-bottom: 20px;
-    //     line-height: 40px;
-    //     position: relative;
-    //     z-index: 5;
-            
-    // }
+       //     width: calc(100% - 50px);
+       //     height: 40px;
+       //     background: #fff;
+       //     padding: 0 20px 0 30px;
+       //     margin-bottom: 20px;
+       //     line-height: 40px;
+       //     position: relative;
+       //     z-index: 5;
+
+       // }
     .titleBox {
     .titleBox {
         padding:  0 0 10px 0px;
         padding:  0 0 10px 0px;
     }
     }
@@ -403,7 +403,7 @@ export default {
         border: 1px solid #a9a9a9;
         border: 1px solid #a9a9a9;
         margin: 8px 0 0 0;
         margin: 8px 0 0 0;
     }
     }
-    
+
     .searchName {
     .searchName {
         text-align: center;
         text-align: center;
         border-left: none;
         border-left: none;
@@ -439,37 +439,37 @@ export default {
         width: calc(100% - 160px);
         width: calc(100% - 160px);
     }
     }
     .btn {
     .btn {
-         position: relative;
-            background-color: #fff;
-            margin: 0px 20px;
-            padding: 20px;
-            min-width: 960px;
-            height: 80px;
-            .el-button {
-                position: absolute;
-                right: 80px;
-                top: 20px;
-            }
+        position: relative;
+        background-color: #fff;
+        margin: 0px 20px;
+        padding: 20px;
+        min-width: 960px;
+        height: 80px;
+    .el-button {
+        position: absolute;
+        right: 80px;
+        top: 20px;
+    }
     }
     }
     .sumbit {
     .sumbit {
         position: absolute;
         position: absolute;
         display: inline-block;
         display: inline-block;
         width: 80px;
         width: 80px;
         height: 30px;
         height: 30px;
-        line-height: 30px;  
+        line-height: 30px;
         border: 1px solid #a9a9a9;
         border: 1px solid #a9a9a9;
         text-align: center;
         text-align: center;
         right: 100px;
         right: 100px;
     }
     }
-}
-.confirmRealation {
+    }
+    .confirmRealation {
     .cancelButton{
     .cancelButton{
         border: 1px solid #a9a9a9;
         border: 1px solid #a9a9a9;
-        span {
-            color: #606266;
-        }
-    }  
-    
+    span {
+        color: #606266;
+    }
+    }
+
 
 
-}
+    }
 </style>
 </style>