Selaa lähdekoodia

select框 失去焦点清空列表

morphone1995 4 vuotta sitten
vanhempi
commit
bcf3ee25fc

+ 6 - 1
src/components/icss/AddMedicinePrompt.vue

@@ -17,6 +17,7 @@
             :loading="showDrop"
             loading-text="加载中..."
             @change="changeWord"
+            @visible-change="handleVisible"
             value-key="conceptId"
             @clear="handleClear"
             ref="termName"
@@ -347,7 +348,11 @@ export default {
         this.upload = false;
       }
     },
-
+    handleVisible(flag) {
+      if (!flag) {
+        this.terms = [];
+      }
+    },
     reOrder(isUp, i) {
       let temp = {},
         it = {};

+ 2 - 2
src/components/icss/MedicinePrompt.vue

@@ -41,8 +41,8 @@
         <el-table-column
                         label="状态">
                     <template slot-scope="scope">
-                        <span v-if="scope.row.isDeleted=='N'">启用</span>
-                        <span v-if="scope.row.isDeleted=='Y'">未启用</span>
+                        <span v-if="scope.row.isDeleted=='N'">启用</span>
+                        <span v-if="scope.row.isDeleted=='Y'">用</span>
                     </template>
         </el-table-column>
         <el-table-column label="操作" width="140">

+ 11 - 6
src/components/icss/dept/AddDept.vue

@@ -50,7 +50,7 @@
                   :loading="showDrop"
                   loading-text="加载中..."
                   @change="changeWord"
-                  @focus="handleFocus"
+                  @visible-change="handleVisible"
                   placeholder="搜索"
                   :remote-method="searchTerms"
                   reserve-keyword
@@ -96,7 +96,7 @@ export default {
       rules: {
         hisName: [
           { required: true, message: '请输入科室名称', trigger: 'change' },
-          { max: 80, message: '科室名称最多80字', trigger: 'change' },
+          { max: 80, message: '科室名称最多80字', trigger: 'change' }
         ],
         hisCode: [{ max: 80, message: '科室编码最多80字', trigger: 'change' }],
         searchText: [
@@ -104,7 +104,8 @@ export default {
         ]
       },
       saveDisable: false, //保存按钮禁止点击
-      showDrop: false //下拉框显示文字
+      showDrop: false, //下拉框显示文字
+      searchInfo: ''
     };
   },
   created() {
@@ -123,9 +124,10 @@ export default {
     // 搜索列表
     searchTerms(query) {
       if (!query) {
-        this.uniqueNameList = []
+        this.uniqueNameList = [];
         return;
       }
+      this.searchInfo = query;
       this.showDrop = true;
       let params = {
         type: 7, //科室
@@ -143,8 +145,11 @@ export default {
     changeWord(newVal) {
       console.log(newVal);
     },
-    // 获取焦点
-    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
 
     // 初始化表单数据
     initForm() {

+ 7 - 0
src/components/icss/disease/AddChemicalAndCommonMapping.vue

@@ -48,6 +48,7 @@
                   loading-text="加载中..."
                   @change="changeWord"
                   @focus="handleFocus"
+                  @visible-change="handleVisible"
                   placeholder="搜索"
                   :remote-method="searchTerms"
                   reserve-keyword
@@ -144,6 +145,12 @@ export default {
       this.form.searchText = newValue.name;
       this.form.icdCode = newValue.icd10Code;
     },
+
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
     // 获取焦点
     handleFocus() {},
 

+ 7 - 0
src/components/icss/drug/AddDrug.vue

@@ -48,6 +48,7 @@
                   loading-text="加载中..."
                   @change="changeWord"
                   @focus="handleFocus"
+                  @visible-change="handleVisible"
                   placeholder="搜索"
                   :remote-method="searchTerms"
                   reserve-keyword
@@ -156,6 +157,12 @@ export default {
     // 获取焦点
     handleFocus() {},
 
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
     // 初始化表单数据
     initForm() {
       this.form.hisName = '';

+ 6 - 1
src/components/icss/fusion/AddFusion.vue

@@ -48,6 +48,7 @@
                   loading-text="加载中..."
                   @change="changeWord"
                   @focus="handleFocus"
+                  @visible-change="handleVisible"
                   placeholder="搜索"
                   :remote-method="searchTerms"
                   reserve-keyword
@@ -136,7 +137,11 @@ export default {
     changeWord() {},
     // 获取焦点
     handleFocus() {},
-
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
     // 初始化表单数据
     initForm() {
       this.form.hisName = '';

+ 6 - 0
src/components/icss/lis/AddLis.vue

@@ -58,6 +58,7 @@
                   loading-text="加载中..."
                   @change="changeWord"
                   @focus="handleFocus"
+                  @visible-change="handleVisible"
                   placeholder="搜索"
                   :remote-method="searchTerms"
                   reserve-keyword
@@ -172,6 +173,11 @@ export default {
       // this.searchTerms(this.queryText);
       // this.uniqueNameList = [];
     },
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
     handleclick() {},
 
     handleChoose(val) {

+ 6 - 1
src/components/icss/operation/AddOperation.vue

@@ -48,6 +48,7 @@
                   loading-text="加载中..."
                   @change="changeWord"
                   @focus="handleFocus"
+                  @visible-change="handleVisible"
                   placeholder="搜索"
                   :remote-method="searchTerms"
                   reserve-keyword
@@ -136,7 +137,11 @@ export default {
     changeWord() {},
     // 获取焦点
     handleFocus() {},
-
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
     // 初始化表单数据
     initForm() {
       this.form.hisName = '';

+ 6 - 1
src/components/icss/pacs/AddPacs.vue

@@ -48,6 +48,7 @@
                   loading-text="加载中..."
                   @change="changeWord"
                   @focus="handleFocus"
+                  @visible-change="handleVisible"
                   placeholder="搜索"
                   :remote-method="searchTerms"
                   reserve-keyword
@@ -136,7 +137,11 @@ export default {
     changeWord() {},
     // 获取焦点
     handleFocus() {},
-
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
     // 初始化表单数据
     initForm() {
       this.form.hisName = '';