Browse Source

手机端

xiaoming_global 5 years ago
parent
commit
ab7728cb66

+ 10 - 10
src/pages/advice/DialysisAdviceTable.vue View File

@@ -193,9 +193,9 @@
193 193
 </template>
194 194
 
195 195
 <script>
196
-import SideBar from '@/pages/layout/SideBar';
197
-import { parseTime } from '@/utils';
198
-import { getSchedualDoctors } from '@/api/advice';
196
+import SideBar from '@/pages/layout/SideBar'
197
+import { parseTime } from '@/utils'
198
+import { getSchedualDoctors } from '@/api/advice'
199 199
 
200 200
 export default {
201 201
   name: 'DialysisAdviceTable',
@@ -294,10 +294,10 @@ export default {
294 294
                   advices: []
295 295
                 }
296 296
               )
297
-            };
297
+            }
298 298
             var initGroupBlock = function (group, advice) {
299 299
               group.group_no = advice.groupno
300
-            };
300
+            }
301 301
 
302 302
             var advice_groups = []
303 303
             var group = newGroupObject()
@@ -325,7 +325,7 @@ export default {
325 325
                   group.advices.push(advice)
326 326
                   advice_groups.push(group)
327 327
                   group = newGroupObject()
328
-                  continue;
328
+                  continue
329 329
                 }
330 330
               } else {
331 331
                 if (group.group_no > 0 && group.group_no != advice.groupno) {
@@ -392,11 +392,11 @@ export default {
392 392
     getAdaviceType (type, parent_id) {
393 393
       if (parent_id == 0) {
394 394
         if (type == 1) {
395
-          return '长嘱';
395
+          return '长嘱'
396 396
         } else if (type == 2) {
397
-          return '临嘱';
397
+          return '临嘱'
398 398
         } else if (type == 3) {
399
-          return '临嘱';
399
+          return '临嘱'
400 400
         }
401 401
       }
402 402
     },
@@ -425,7 +425,7 @@ export default {
425 425
     parseTime: function (time, layout) {
426 426
       // console.log(time);
427 427
       if (time == 0) {
428
-        return '';
428
+        return ''
429 429
       }
430 430
       return parseTime(time, layout)
431 431
     },

+ 181 - 174
src/pages/main/dialog/new_order/AddNewOrders.vue View File

@@ -52,14 +52,18 @@
52 52
                 <td
53 53
                   style="text-align: left; padding-left: 5px; padding-right: 5px;"
54 54
                 >{{ advice.title }}</td>
55
+
55 56
                 <td v-if="advice.advice_desc">{{ advice.advice_desc }}{{advice.drug_spec_unit}}</td>
57
+
56 58
                 <td
57 59
                   v-if="advice.prescribing_number"
58 60
                 >{{ advice.prescribing_number }}{{ advice.prescribing_number_unit }}</td>
59 61
                 <td v-else></td>
60 62
                 <td v-if="advice.single_dose">{{ advice.single_dose }} {{ advice.single_dose_unit }}</td>
61 63
                 <td v-else></td>
64
+
62 65
                 <td>{{ advice.delivery_way }}</td>
66
+
63 67
                 <td>{{ advice.execution_frequency }}</td>
64 68
               </tr>
65 69
               <tr
@@ -82,19 +86,43 @@
82 86
                     v-if="subdrug.single_dose"
83 87
                   >{{ subdrug.single_dose }} {{ subdrug.single_dose_unit }}</span>
84 88
                 </td>
85
-                
89
+
86 90
                 <td></td>
87 91
                 <td></td>
88 92
               </tr>
89 93
             </template>
90 94
           </table>-->
91
-          <el-table :data="tableData" border style="width: 100%" @row-click="click">
92
-            <el-table-column fixed prop="date" label="医嘱内容" width="150"></el-table-column>
93
-            <el-table-column prop="name" label="药品规格" width="120"></el-table-column>
94
-            <el-table-column prop="province" label="开药数量" width="120"></el-table-column>
95
-            <el-table-column prop="city" label="单次用量" width="120"></el-table-column>
96
-            <el-table-column prop="address" label="给药途径" width="300"></el-table-column>
97
-            <el-table-column prop="zip" label="执行频率" width="120"></el-table-column>
95
+          <el-table :data="advices" border style="width: 100%" :row-class-name="tableRowClassName" @row-click="clickAdviceAction">
96
+            <el-table-column fixed prop="date" label="医嘱内容" width="150">
97
+              <template slot-scope="scope">
98
+                   {{ scope.row.title }}
99
+              </template>
100
+            </el-table-column>
101
+            <el-table-column prop="name" label="药品规格" width="120">
102
+              <template slot-scope="scope">
103
+              {{ scope.row.prescribing_number }}{{ scope.row.prescribing_number_unit }}
104
+              </template>
105
+            </el-table-column>
106
+            <el-table-column prop="province" label="开药数量" width="120">
107
+              <template slot-scope="scope">
108
+              {{ scope.row.prescribing_number }}{{ scope.row.prescribing_number_unit }}
109
+              </template>
110
+            </el-table-column>
111
+            <el-table-column prop="city" label="单次用量" width="120">
112
+              <template slot-scope="scope">
113
+
114
+              </template>
115
+            </el-table-column>
116
+            <el-table-column prop="address" label="给药途径" width="300">
117
+               <template slot-scope="scope">
118
+                   {{ scope.row.delivery_way }}
119
+               </template>
120
+            </el-table-column>
121
+            <el-table-column prop="zip" label="执行频率" width="120">
122
+              <template slot-scope="scope">
123
+                  {{ scope.row.execution_frequency }}
124
+              </template>
125
+            </el-table-column>
98 126
           </el-table>
99 127
         </div>
100 128
       </div>
@@ -139,16 +167,16 @@
139 167
 </template>
140 168
 
141 169
 <script>
142
-import SingleOptionDialog from "./single_option_dialog";
143
-import OrderFormDialog from "./order_form";
144
-import AdviceTemplate from "./select_advice_template_dialog";
145
-import { Toast } from "vant";
146
-import { parseTime } from "@/utils";
147
-import { batchCreateAdvices } from "@/api/advice";
148
-import { setTimeout } from "timers";
170
+import SingleOptionDialog from './single_option_dialog'
171
+import OrderFormDialog from './order_form'
172
+import AdviceTemplate from './select_advice_template_dialog'
173
+import { Toast } from 'vant'
174
+import { parseTime } from '@/utils'
175
+import { batchCreateAdvices } from '@/api/advice'
176
+import { setTimeout } from 'timers'
149 177
 
150 178
 export default {
151
-  name: "AddNewOrdersDialogContent",
179
+  name: 'AddNewOrdersDialogContent',
152 180
   components: {
153 181
     SingleOptionDialog,
154 182
     OrderFormDialog,
@@ -166,170 +194,147 @@ export default {
166 194
     },
167 195
     advice_templates: {
168 196
       type: Array,
169
-      default: function() {
170
-        return [];
197
+      default: function () {
198
+        return []
171 199
       }
172 200
     },
173 201
     drug_spec_unit_options: {
174 202
       type: Array,
175
-      default: function() {
176
-        return [];
203
+      default: function () {
204
+        return []
177 205
       }
178 206
     },
179 207
     delivery_way_options: {
180 208
       type: Array,
181
-      default: function() {
182
-        return [];
209
+      default: function () {
210
+        return []
183 211
       }
184 212
     },
185 213
     execution_frequency_options: {
186 214
       type: Array,
187
-      default: function() {
188
-        return [];
215
+      default: function () {
216
+        return []
189 217
       }
190 218
     },
191 219
     single_dose_unit_options: {
192 220
       type: Array,
193
-      default: function() {
194
-        return [];
221
+      default: function () {
222
+        return []
195 223
       }
196 224
     },
197 225
     prescribing_number_unit_options: {
198 226
       type: Array,
199
-      default: function() {
200
-        return [];
227
+      default: function () {
228
+        return []
201 229
       }
202 230
     }
203 231
   },
204
-  data() {
232
+  data () {
205 233
     return {
206 234
       show_dialog_key: 0,
207 235
       loading: false,
208 236
 
209
-      record_date_str: "",
237
+      record_date_str: '',
210 238
       start_time: new Date(),
211
-      start_time_str: "",
239
+      start_time_str: '',
212 240
 
213 241
       selecting_advice_index: -1,
214 242
       selecting_subdrug_index: -1,
215 243
       advices: [],
216
-      tableData: [
217
-        {
218
-          date: "2016-05-02",
219
-          name: "123",
220
-          province: "上海",
221
-          city: "普陀区",
222
-          address: "上海市普陀区金沙江路 1518 弄",
223
-          zip: 200333
224
-        },
225
-        {
226
-          date: "2016-05-04",
227
-          name: "456",
228
-          province: "上海",
229
-          city: "普陀区",
230
-          address: "上海市普陀区金沙江路 1517 弄",
231
-          zip: 200333
232
-        },
233
-        {
234
-          date: "2016-05-01",
235
-          name: "789",
236
-          province: "上海",
237
-          city: "普陀区",
238
-          address: "上海市普陀区金沙江路 1519 弄",
239
-          zip: 200333
240
-        },
241
-        {
242
-          date: "2016-05-03",
243
-          name: "565345",
244
-          province: "上海",
245
-          city: "普陀区",
246
-          address: "上海市普陀区金沙江路 1516 弄",
247
-          zip: 200333
248
-        }
249
-      ]
250
-    };
244
+      tableData: []
245
+    }
251 246
   },
252
-  mounted() {
253
-    this.record_date_str = parseTime(new Date(), "{y}-{m}-{d}");
247
+  mounted () {
248
+    this.record_date_str = parseTime(new Date(), '{y}-{m}-{d}')
254 249
     this.start_time_str =
255
-      parseTime(this.start_time, "{y}-{m}-{d} {h}:{i}") + ":00";
250
+      parseTime(this.start_time, '{y}-{m}-{d} {h}:{i}') + ':00'
256 251
   },
257 252
   methods: {
258
-    click(row, column, event) {
259
-      console.log(row);
260
-      console.log(column);
261
-      console.log(event);
253
+    click (row, column, event) {
254
+      alert('aaa')
255
+      // console.log(row)
256
+      // console.log(column)
257
+      // console.log(event)
262 258
     },
263
-    backAction: function() {
264
-      this.$emit("back-action");
259
+    backAction: function () {
260
+      this.$emit('back-action')
265 261
     },
266
-    addOrderByTemplateAction: function() {
267
-      this.show_dialog_key = 1;
268
-      this.selecting_advice_index = -1;
262
+    addOrderByTemplateAction: function () {
263
+      this.show_dialog_key = 1
264
+      this.selecting_advice_index = -1
269 265
     },
270
-    addNewOrderAction: function() {
271
-      this.show_dialog_key = 2;
272
-      this.$refs.order_form.showWithNew();
273
-      this.selecting_advice_index = -1;
266
+    addNewOrderAction: function () {
267
+      this.show_dialog_key = 2
268
+      this.$refs.order_form.showWithNew()
269
+      this.selecting_advice_index = -1
274 270
     },
275
-    clickAdviceAction: function(advice_index) {
276
-      this.selecting_advice_index = advice_index;
277
-      this.selecting_subdrug_index = -1;
271
+    // clickAdviceAction: function (advice_index) {
272
+    //   this.selecting_advice_index = advice_index
273
+    //   this.selecting_subdrug_index = -1
274
+    // },
275
+
276
+    tableRowClassName (row, rowIndex) {
277
+      row.index = rowIndex
278 278
     },
279
-    clickSubdrugAction: function(advice_index, subdrug_index) {
280
-      this.selecting_advice_index = advice_index;
281
-      this.selecting_subdrug_index = subdrug_index;
279
+    clickAdviceAction (row, event, column) {
280
+      console.log(row.index)
281
+      this.selecting_advice_index = row.index
282
+      this.selecting_subdrug_index = -1
282 283
     },
283
-    modifyOrderAction: function() {
284
+    clickSubdrugAction: function (advice_index, subdrug_index) {
285
+      this.selecting_advice_index = advice_index
286
+      this.selecting_subdrug_index = subdrug_index
287
+    },
288
+    modifyOrderAction: function () {
284 289
       if (this.selecting_advice_index >= 0) {
285 290
         if (this.selecting_subdrug_index < 0) {
286
-          this.show_dialog_key = 2;
291
+          this.show_dialog_key = 2
287 292
           this.$refs.order_form.showWithEdit(
288 293
             this.advices[this.selecting_advice_index]
289
-          );
294
+          )
290 295
         } else {
291
-          this.show_dialog_key = 2;
296
+          this.show_dialog_key = 2
292 297
           this.$refs.order_form.showWithEdit(
293 298
             this.advices[this.selecting_advice_index].subdrugs[
294 299
               this.selecting_subdrug_index
295 300
             ]
296
-          );
301
+          )
297 302
         }
298 303
       } else {
299
-        Toast.fail("请先选择医嘱内容");
304
+        Toast.fail('请先选择医嘱内容')
300 305
       }
301 306
     },
302
-    deleteOrderAction: function() {
307
+    deleteOrderAction: function () {
303 308
       if (this.selecting_advice_index >= 0) {
304 309
         if (this.selecting_subdrug_index < 0) {
305
-          this.advices.splice(this.selecting_advice_index, 1);
306
-          this.selecting_advice_index = -1;
310
+          this.advices.splice(this.selecting_advice_index, 1)
311
+          this.selecting_advice_index = -1
307 312
         } else {
308
-          var advice = this.advices[this.selecting_advice_index];
309
-          advice.subdrugs.splice(this.selecting_subdrug_index, 1);
310
-          this.selecting_advice_index = -1;
311
-          this.selecting_subdrug_index = -1;
313
+          var advice = this.advices[this.selecting_advice_index]
314
+          advice.subdrugs.splice(this.selecting_subdrug_index, 1)
315
+          this.selecting_advice_index = -1
316
+          this.selecting_subdrug_index = -1
312 317
         }
313 318
       } else {
314
-        Toast.fail("请先选择医嘱内容");
319
+        Toast.fail('请先选择医嘱内容')
315 320
       }
316 321
     },
317
-    selectStartTimeAction: function() {
318
-      this.$refs.start_time_picker.open();
322
+    selectStartTimeAction: function () {
323
+      this.$refs.start_time_picker.open()
319 324
     },
320
-    comfirmAction: function() {
325
+    comfirmAction: function () {
321 326
       if (this.advices.length == 0) {
322
-        Toast.fail("请创建医嘱");
323
-        return;
327
+        Toast.fail('请创建医嘱')
328
+        return
324 329
       }
325 330
 
326
-      var data = {};
327
-      data.advice_type = 2;
328
-      data.advice_date = this.record_date_str;
329
-      data.start_time = this.start_time_str;
330
-      var adviceJSONs = [];
331
+      var data = {}
332
+      data.advice_type = 2
333
+      data.advice_date = this.record_date_str
334
+      data.start_time = this.start_time_str
335
+      var adviceJSONs = []
331 336
       for (let index = 0; index < this.advices.length; index++) {
332
-        const advice = this.advices[index];
337
+        const advice = this.advices[index]
333 338
         var json = {
334 339
           advice_name: advice.title,
335 340
           advice_desc: advice.advice_desc,
@@ -343,9 +348,9 @@ export default {
343 348
           execution_frequency: advice.execution_frequency,
344 349
           remark: advice.remark,
345 350
           subdrugs: []
346
-        };
351
+        }
347 352
         for (let s_i = 0; s_i < advice.subdrugs.length; s_i++) {
348
-          const subdrug = advice.subdrugs[s_i];
353
+          const subdrug = advice.subdrugs[s_i]
349 354
           json.subdrugs.push({
350 355
             advice_name: subdrug.title,
351 356
             advice_desc: subdrug.advice_desc,
@@ -355,47 +360,49 @@ export default {
355 360
             single_dose_unit: subdrug.single_dose_unit,
356 361
             prescribing_number: String(subdrug.prescribing_number),
357 362
             prescribing_number_unit: subdrug.prescribing_number_unit
358
-          });
363
+          })
359 364
         }
360
-        adviceJSONs.push(json);
365
+        adviceJSONs.push(json)
361 366
       }
362 367
 
363
-      data.adviceNames = adviceJSONs;
368
+      data.adviceNames = adviceJSONs
364 369
       // console.log(adviceJSONs)
365 370
 
366
-      this.loading = true;
371
+      this.loading = true
367 372
       batchCreateAdvices(this.patient_id, this.group_no, data)
368 373
         .then(rs => {
369
-          this.loading = false;
370
-          var resp = rs.data;
374
+          this.loading = false
375
+          var resp = rs.data
376
+
371 377
           if (resp.state == 1) {
372 378
             // 返回数组,清空数据,隐藏弹框
373
-            this.$emit("did-create-advices", resp.data.advices);
374
-            var t = this;
375
-            setTimeout(function() {
376
-              t.advices.splice(0, t.advices.length);
377
-              t.show_dialog_key = 0;
378
-              t.selecting_advice_index = -1;
379
-            }, 500);
379
+            this.$emit('did-create-advices', resp.data.advices)
380
+            console.log('resp.data.advices', resp.data.advices)
381
+            var t = this
382
+            setTimeout(function () {
383
+              t.advices.splice(0, t.advices.length)
384
+              t.show_dialog_key = 0
385
+              t.selecting_advice_index = -1
386
+            }, 500)
380 387
           } else {
381
-            Toast.fail(resp.msg);
388
+            Toast.fail(resp.msg)
382 389
           }
383 390
         })
384 391
         .catch(err => {
385
-          this.loading = false;
386
-          Toast.fail(err);
387
-        });
392
+          this.loading = false
393
+          Toast.fail(err)
394
+        })
388 395
       // batchCreateAdvices()
389 396
     },
390 397
 
391
-    didSelectStartTime: function(time) {
392
-      this.start_time_str = parseTime(time, "{y}-{m}-{d} {h}:{i}") + ":00";
398
+    didSelectStartTime: function (time) {
399
+      this.start_time_str = parseTime(time, '{y}-{m}-{d} {h}:{i}') + ':00'
393 400
     },
394
-    didSelectTemplateAdvice: function(resp_advices) {
395
-      this.show_dialog_key = 0;
396
-      var advices = [];
401
+    didSelectTemplateAdvice: function (resp_advices) {
402
+      this.show_dialog_key = 0
403
+      var advices = []
397 404
       for (let index = 0; index < resp_advices.length; index++) {
398
-        const adv = resp_advices[index];
405
+        const adv = resp_advices[index]
399 406
         if (adv.parent_id == 0) {
400 407
           advices.push({
401 408
             id: adv.id,
@@ -410,14 +417,14 @@ export default {
410 417
             prescribing_number: adv.prescribing_number,
411 418
             prescribing_number_unit: adv.prescribing_number_unit,
412 419
             subdrugs: []
413
-          });
420
+          })
414 421
         }
415 422
       }
416 423
       for (let r_a_i = 0; r_a_i < resp_advices.length; r_a_i++) {
417
-        const resp_adv = resp_advices[r_a_i];
424
+        const resp_adv = resp_advices[r_a_i]
418 425
         if (resp_adv.parent_id > 0) {
419 426
           for (let p_i = 0; p_i < advices.length; p_i++) {
420
-            const p_adv = advices[p_i];
427
+            const p_adv = advices[p_i]
421 428
             if (p_adv.id == resp_adv.parent_id) {
422 429
               var subdrug = {
423 430
                 id: resp_adv.id,
@@ -431,14 +438,14 @@ export default {
431 438
                 single_dose_unit: resp_adv.single_dose_unit,
432 439
                 prescribing_number: resp_adv.prescribing_number,
433 440
                 prescribing_number_unit: resp_adv.prescribing_number_unit
434
-              };
435
-              p_adv.subdrugs.push(subdrug);
436
-              break;
441
+              }
442
+              p_adv.subdrugs.push(subdrug)
443
+              break
437 444
             }
438 445
           }
439 446
         }
440 447
       }
441
-      this.advices.push(...advices);
448
+      this.advices.push(...advices)
442 449
     },
443 450
     // didSelectOrderTemplate: function(index) {
444 451
     //   this.show_dialog_key = 0;
@@ -499,45 +506,45 @@ export default {
499 506
     //   }
500 507
     //   this.advices.push(...advices);
501 508
     // },
502
-    didAddNewOrder: function(order) {
503
-      this.$refs.order_form.dismiss();
504
-      this.show_dialog_key = 0;
505
-      order.id = 0;
506
-      order.subdrugs = [];
507
-      this.advices.push(order);
509
+    didAddNewOrder: function (order) {
510
+      this.$refs.order_form.dismiss()
511
+      this.show_dialog_key = 0
512
+      order.id = 0
513
+      order.subdrugs = []
514
+      this.advices.push(order)
508 515
     },
509
-    didModifyOrder: function(order) {
510
-      this.$refs.order_form.dismiss();
511
-      this.show_dialog_key = 0;
516
+    didModifyOrder: function (order) {
517
+      this.$refs.order_form.dismiss()
518
+      this.show_dialog_key = 0
512 519
       if (this.selecting_advice_index >= 0) {
513
-        var advice = this.advices[this.selecting_advice_index];
520
+        var advice = this.advices[this.selecting_advice_index]
514 521
         if (this.selecting_subdrug_index < 0) {
515
-          advice.title = order.title;
516
-          advice.advice_desc = order.advice_desc;
522
+          advice.title = order.title
523
+          advice.advice_desc = order.advice_desc
517 524
           // advice.drug_spec = order.drug_spec;
518
-          advice.drug_spec_unit = order.drug_spec_unit;
519
-          advice.delivery_way = order.delivery_way;
520
-          advice.execution_frequency = order.execution_frequency;
521
-          advice.single_dose = order.single_dose;
522
-          advice.single_dose_unit = order.single_dose_unit;
523
-          advice.prescribing_number = order.prescribing_number;
524
-          advice.prescribing_number_unit = order.prescribing_number_unit;
525
-          advice.remark = order.remark;
525
+          advice.drug_spec_unit = order.drug_spec_unit
526
+          advice.delivery_way = order.delivery_way
527
+          advice.execution_frequency = order.execution_frequency
528
+          advice.single_dose = order.single_dose
529
+          advice.single_dose_unit = order.single_dose_unit
530
+          advice.prescribing_number = order.prescribing_number
531
+          advice.prescribing_number_unit = order.prescribing_number_unit
532
+          advice.remark = order.remark
526 533
         } else {
527
-          var subdrug = advice.subdrugs[this.selecting_subdrug_index];
528
-          subdrug.title = order.title;
529
-          subdrug.advice_desc = order.advice_desc;
534
+          var subdrug = advice.subdrugs[this.selecting_subdrug_index]
535
+          subdrug.title = order.title
536
+          subdrug.advice_desc = order.advice_desc
530 537
           // subdrug.drug_spec = order.drug_spec;
531
-          subdrug.drug_spec_unit = order.drug_spec_unit;
532
-          subdrug.single_dose = order.single_dose;
533
-          subdrug.single_dose_unit = order.single_dose_unit;
534
-          subdrug.prescribing_number = order.prescribing_number;
535
-          subdrug.prescribing_number_unit = order.prescribing_number_unit;
538
+          subdrug.drug_spec_unit = order.drug_spec_unit
539
+          subdrug.single_dose = order.single_dose
540
+          subdrug.single_dose_unit = order.single_dose_unit
541
+          subdrug.prescribing_number = order.prescribing_number
542
+          subdrug.prescribing_number_unit = order.prescribing_number_unit
536 543
         }
537 544
       }
538 545
     }
539 546
   }
540
-};
547
+}
541 548
 </script>
542 549
 
543 550
 <style style="stylesheet/scss" lang="scss" scoped>

+ 1 - 1
src/styles/style.scss View File

@@ -217,7 +217,7 @@ body {
217 217
     @include text-align;
218 218
     margin: 0.25rem 0;
219 219
     color: #34495e;
220
-    font-size: 0.36rem;
220
+    font-size: 0.32rem;
221 221
     padding: 0 0.3rem;
222 222
   }
223 223
   .forbid {