Browse Source

关联维护-药品关联,样式

zhouna 4 years ago
parent
commit
8abdfd6dc6

+ 57 - 6
src/components/base/LinkContent.vue

@@ -25,7 +25,7 @@
                 <p class="midTitle">相互关联</p>
             </div>
             <div class="rightBox">
-                <el-form-item :label="labelName+':'" prop="searchText">
+                <el-form-item :label="labelName+':'" class="top-label" prop="searchText">
                     <el-select
                             v-model="form.searchText"
                             filterable
@@ -48,6 +48,20 @@
                         ></el-option>
                     </el-select>
                 </el-form-item>
+                <div v-if="similarWords.length" class="similar-term">
+                    <table>
+                        <thead>
+                            <th>词名</th>
+                            <th>来源</th>
+                        </thead>
+                        <tbody>
+                            <tr v-for="word in similarWords">
+                                <td>{{word.name}}</td>
+                                <td>{{word.source}}</td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </div>
                 <el-form-item :label="labelName+'预览:'">
                     <!-- <span class="previewInfo">{{!isEdit ? form.searchText.name : form.searchText}}</span> -->
                     <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
@@ -66,8 +80,8 @@
 <style lang="less" scoped>
     .AddChemicalAndCommonMappingBox{
     /deep/ .el-form-item{
-        height: 30px;
-        margin-bottom: 10px;
+        /*height: 30px;*/
+        margin-bottom: 18px;
     .el-form-item__content,.el-form-item__label,.el-input,.el-input__inner{
         height: 30px;
         line-height: initial;
@@ -80,6 +94,15 @@
         color: #333;
     }
     }
+    /deep/ .top-label{
+        .el-form-item__label,.el-form-item__content{
+            float: none;
+        }
+        .el-form-item__content,.el-select{
+            margin-left:0!important;
+            width: 314px;
+        }
+    }
     .leftBox /deep/ .el-input__suffix{
         top:-4px;
     }
@@ -217,17 +240,45 @@
         color: #333;
         font-weight: bold;
     }
+    .similar-term{
+        width: 314px;
+        border: 1px solid #DCDFE6;
+        margin-bottom: 7px;
+        table{
+            width: 100%;
+            border-collapse: collapse;
+        }
+        thead{
+            background: #F7F7F7;
+        }
+        tr{
+            cursor: pointer;
+            &.active{
+                background: #ECF9FB;
+            }
+        }
+        th,td{
+            height: 34px;
+            line-height: 34px;
+            text-align: center;
+            &:first-child{
+                border-right: 1px solid #DCDFE6;
+
+            }
+        }
+    }
 </style>
 <script>
     import api from '@api/cdss.js';
     export default {
-        props:['labelName','form'],
+        props:['labelName','form','termType','valName'],
         data:function () {
             return {
                 linkedWords:'',   //已关联术语
                 isEdit: false,
                 editId: '',
                 uniqueNameList: [],
+                similarWords:[{name:'aaa',source:'sss'}],
                 /*form: {
                     searchText: '', //搜索字段
                     hisName: '',
@@ -257,7 +308,7 @@
                 }
                 this.showDrop = true;
                 let params = {
-                    type: 4, //诊断
+                    type: this.termType, //诊断
                     inputStr: query,
                     sex: 3,
                     age: 0
@@ -265,7 +316,7 @@
                 api.retrievalSearch(params).then(res => {
                     this.showDrop = false;
                     if (res.data.code === '0') {
-                        this.uniqueNameList = res.data.data.diseaseNames;
+                        this.uniqueNameList = res.data.data[this.valName];
                     }
                 });
             },

+ 1 - 1
src/components/cdssManage/disease/Disease.vue

@@ -72,7 +72,7 @@
       </div>
     </div>
     <LtModal v-if="modalVisiable" :disabled="saveDisable" @confirm="submitForm" @close="closeModal">
-      <LinkContent :form="form" ref="relationForm" labelName="诊断名称"/>
+      <LinkContent :form="form" ref="relationForm" labelName="诊断名称" termType="4" valName="diseaseNames"/>
     </LtModal>
   </div>
 </template>

+ 2 - 2
src/components/cdssManage/drug/DrugManage.vue

@@ -62,7 +62,7 @@
       </div>
     </div>
     <LtModal v-if="modalVisiable" :disabled="saveDisable" @confirm="submitForm" @close="closeModal">
-      <LinkContent :form="form" ref="relationForm" labelName="药品名称"/>
+      <LinkContent :form="form" ref="relationForm" labelName="药品名称" termType="5" valName="drugNames"/>
     </LtModal>
   </div>
 </template>
@@ -466,7 +466,7 @@ export default {
     },
     // 建立关联-参数处理
     submitForm() {
-        this.$refs.relationForm.validate(valid => {
+        this.$refs.relationForm.$refs.innerForm.validate(valid => {
             if (valid) {
                 const { searchText, hisName, form } = this.form;
                 let params = {