seimin 2 年 前
コミット
aa867121b6
共有4 個のファイルを変更した31 個の追加21 個の削除を含む
  1. 1 1
      main.js
  2. 2 2
      manifest.json
  3. 16 15
      pages/index/index.vue
  4. 12 3
      pages/search/search.vue

+ 1 - 1
main.js

@@ -12,7 +12,7 @@ import {
12 12
 Vue.prototype.$request = request
13 13
 
14 14
 Vue.config.productionTip = false
15
-console.info('v1.0.4')
15
+console.info('v1.0.5')
16 16
 
17 17
 App.mpType = 'app'
18 18
 

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
2 2
     "name" : "医疗服务中心转运系统",
3 3
     "appid" : "__UNI__FEB1B1E",
4 4
     "description" : "医疗服务中心转运系统",
5
-    "versionName" : "1.0.4",
6
-    "versionCode" : 104,
5
+    "versionName" : "1.0.5",
6
+    "versionCode" : 105,
7 7
     "transformPx" : false,
8 8
     "app-plus" : {
9 9
         /* 5+App特有相关 */

+ 16 - 15
pages/index/index.vue

@@ -119,31 +119,18 @@
119 119
       uni.$on('scancodedate', data => {
120 120
         let code = data.code || '';
121 121
         // 过滤
122
-        if (code.startsWith('2#')) {
123
-          code = code.slice(2);
124
-        }
122
+        code = code.replace(/^2#/, '')
125 123
         uni.navigateTo({
126 124
           url: `/pages/search/search?txt=${code}`,
127 125
         })
128 126
       })
129 127
     },
130
-    watch: {
131
-      // 首页搜索内容
132
-      searchText(newVal) {
133
-        if (newVal && this.flag) {
134
-          this.flag = false;
135
-          uni.navigateTo({
136
-            url: `/pages/search/search?txt=${newVal}`,
137
-          })
138
-        }
139
-      },
140
-    },
141 128
     data() {
142 129
       return {
143 130
         isFocus: false,
144 131
         reFresh: '',
145 132
         openSpecimen: false, //标本的开通权限
146
-        searchText: '', //首页搜索内容
133
+        searchText1: '', //首页搜索内容
147 134
         placeholderStyle: "color:#999;font-size:30rpx;line-height:66rpx;",
148 135
         urgentNum: 0, //急标数量
149 136
         ordinaryNum: 0, //普标数量
@@ -163,6 +150,20 @@
163 150
         "deptDisplay",
164 151
         "specimenButton",
165 152
       ]),
153
+      searchText: {
154
+        get: function() {
155
+          return this.searchText1;
156
+        },
157
+        set: function(newVal) {
158
+          this.searchText1 = newVal.replace(/^2#/, '');
159
+          if (this.searchText1 && this.flag) {
160
+            this.flag = false;
161
+            uni.navigateTo({
162
+              url: `/pages/search/search?txt=${this.searchText1}`,
163
+            })
164
+          }
165
+        },
166
+      },
166 167
     },
167 168
     methods: {
168 169
       ...mapMutations('other', [

+ 12 - 3
pages/search/search.vue

@@ -120,7 +120,7 @@
120 120
         taskTypeList: [], //任务类型列表
121 121
         pickerTitle: "", //一键建单picker的title
122 122
         debounceInp: null,
123
-        keyword: "",
123
+        keyword1: "",
124 124
         searchList: {
125 125
           patientList: [],
126 126
           specimenList: [],
@@ -141,6 +141,14 @@
141 141
     computed: {
142 142
       ...mapState("login", ["loginInfo"]),
143 143
       ...mapState('other', ["deptDisplay"]),
144
+      keyword: {
145
+        get: function() {
146
+          return this.keyword1;
147
+        },
148
+        set: function(newVal) {
149
+          this.keyword1 = newVal.replace(/^2#/, '');
150
+        },
151
+      },
144 152
     },
145 153
     methods: {
146 154
       ...mapMutations('other', ['changeQucikCreateOrderType', 'clearPatientBuildData', 'changePatientBuildData']),
@@ -167,6 +175,7 @@
167 175
       //监听输入
168 176
       inputChange(event = '') {
169 177
         let keyWord = event.detail ? event.detail.value : event;
178
+        keyWord = keyWord.replace(/^2#/, '');
170 179
         // 长度小于等于0,返回空数组
171 180
         // 长度小于等于4,只搜索床号
172 181
         // 长度大于4,搜索患者住院号,患者二维码,标本码,检查单号
@@ -206,7 +215,7 @@
206 215
       this.reachBottom();
207 216
     },
208 217
     onPullDownRefresh() {
209
-      this.inputChange(this.keyword)
218
+      this.inputChange(this.keyword);
210 219
     },
211 220
     created() {
212 221
       this.debounceInp = debounce(this.inputChange, 500);
@@ -217,7 +226,7 @@
217 226
     onLoad(queryParams) {
218 227
       this.queryParams = queryParams;
219 228
       this.keyword = queryParams.txt;
220
-      this.inputChange(queryParams.txt);
229
+      this.inputChange(this.keyword);
221 230
     },
222 231
     mounted() {
223 232
       this.$refs.search.inputVal = this.queryParams.txt;