瀏覽代碼

Merge branch 'superman' of http://git.shengws.com/zhangbj/xt_vue into superman

xiaoming_global 5 年之前
父節點
當前提交
3117c90139

+ 166 - 41
src/xt_pages/stock/cancelStockOrderAdd.vue 查看文件

288
             }, [])
288
             }, [])
289
 
289
 
290
 
290
 
291
+
292
+
293
+
291
             this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
294
             this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
292
             this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
295
             this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
293
             this.form.manufacturer =0
296
             this.form.manufacturer =0
339
       }, showDialog(index, row) {
342
       }, showDialog(index, row) {
340
         this.currentIndex = index
343
         this.currentIndex = index
341
         this.propForm.goodType = []
344
         this.propForm.goodType = []
345
+        this.propForm.goods = []
342
 
346
 
343
-
344
-        if (this.form.manufacturer == 0 && this.form.dealer == 0) {
347
+        if (this.form.manufacturer == -1 && this.form.dealer == -1) {
345
           for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
348
           for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
346
-            this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
349
+            if (this.warehouseOutInfoList[i].info.dealers.id == 0 && this.warehouseOutInfoList[i].info.manufacturers.id == 0) {
350
+              this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
351
+              this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
352
+            }
347
           }
353
           }
348
-          const obj3 = {}
349
-          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
350
-            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
351
-            return cur
352
-          }, [])
354
+        }
353
 
355
 
354
-        } else {
355
-          if(this.form.manufacturer == 0 && this.form.dealer != 0){
356
-            for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
357
-              if(this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer){
358
-                this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
359
-              }
356
+        if (this.form.manufacturer == -1 && this.form.dealer == 0) {
357
+          for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
358
+            if (this.warehouseOutInfoList[i].info.manufacturers.id == 0) {
359
+              this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
360
+              this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
360
             }
361
             }
361
           }
362
           }
362
-          if(this.form.manufacturer != 0 && this.form.dealer == 0){
363
-            for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
364
-              if(this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer){
365
-                this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
366
-              }
363
+        }
364
+
365
+        if (this.form.manufacturer == -1 && this.form.dealer != 0) {
366
+          for (let i = 0; i < this.warehouseInfoList.length; i++) {
367
+            if (this.warehouseOutInfoList[i].info.manufacturers.id == 0 && this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer) {
368
+              this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
369
+              this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
370
+
367
             }
371
             }
368
           }
372
           }
369
-          if(this.form.manufacturer != 0 && this.form.dealer != 0){
370
-            for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
371
-              if(this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer && this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer){
372
-                this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
373
-              }
374
-            }
373
+        }
374
+
375
+        if (this.form.manufacturer == 0 && this.form.dealer == 0) {
376
+          for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
377
+            this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
378
+            this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
379
+
375
           }
380
           }
376
-          const obj3 = {}
377
-          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
378
-            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
379
-            return cur
380
-          }, [])
381
         }
381
         }
382
 
382
 
383
+        if (this.form.manufacturer == 0 && this.form.dealer == -1) {
384
+          for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
385
+            if (this.warehouseOutInfoList[i].info.dealers.id == 0) {
386
+              this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
387
+              this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
388
+
389
+            }
390
+          }
391
+        }
383
 
392
 
393
+        if (this.form.manufacturer != 0 && this.form.dealer == -1) {
394
+          for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
395
+            if (this.warehouseOutInfoList[i].info.dealers.id == 0 && this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer) {
396
+              this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
397
+              this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
384
 
398
 
385
-        this.$refs.dialog.show()
399
+            }
400
+          }
401
+        }
386
 
402
 
403
+        if (this.form.manufacturer != 0 && this.form.dealer != 0) {
404
+          for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
405
+            if (this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer && this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer) {
406
+              this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
407
+              this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
387
 
408
 
388
-        this.currentIndex = index
389
-        if (this.form.manufacturer == '' || this.form.manufacturer == 0) {
409
+            }
410
+          }
411
+        }
390
 
412
 
391
-        } else {
392
-          this.$refs.dialog.show()
413
+        if (this.form.manufacturer == 0 && this.form.dealer != 0) {
414
+          for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
415
+            if (this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer) {
416
+              this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
417
+              this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
393
 
418
 
419
+            }
420
+          }
421
+        }
422
+        if (this.form.manufacturer != 0 && this.form.dealer == 0) {
394
           for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
423
           for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
395
-            if (this.warehouseOutInfoList[i].manufacturer == this.form.manufacturer) {
396
-              this.propForm.goodType.push(this.warehouseOutInfoList[i].GoodInfo.GoodsType)
424
+            if (this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer) {
425
+              this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
426
+              this.propForm.goodInfo.push(this.warehouseOutInfoList[i].info)
427
+            }
428
+          }
429
+        }
430
+
431
+        // if (this.form.manufacturer == 0 && this.form.dealer == 0) {
432
+        //   for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
433
+        //     this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
434
+        //   }
435
+        //   const obj3 = {}
436
+        //   this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
437
+        //     obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
438
+        //     return cur
439
+        //   }, [])
440
+        //
441
+        // } else {
442
+        //   if(this.form.manufacturer == 0 && this.form.dealer != 0){
443
+        //     for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
444
+        //       if(this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer){
445
+        //         this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
446
+        //       }
447
+        //     }
448
+        //   }
449
+        //   if(this.form.manufacturer != 0 && this.form.dealer == 0){
450
+        //     for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
451
+        //       if(this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer){
452
+        //         this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
453
+        //       }
454
+        //     }
455
+        //   }
456
+        //   if(this.form.manufacturer != 0 && this.form.dealer != 0){
457
+        //     for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
458
+        //       if(this.warehouseOutInfoList[i].info.dealers.id == this.form.dealer && this.warehouseOutInfoList[i].info.manufacturers.id == this.form.manufacturer){
459
+        //         this.propForm.goodType.push(this.warehouseOutInfoList[i].info.type)
460
+        //       }
461
+        //     }
462
+        //   }
463
+        //   const obj3 = {}
464
+        //   this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
465
+        //     obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
466
+        //     return cur
467
+        //   }, [])
468
+        // }
469
+
470
+        const obj3 = {}
471
+        this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
472
+          obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
473
+          return cur
474
+        }, [])
475
+        const obj4 = {}
476
+        this.propForm.goodInfo = this.propForm.goodInfo.reduce((cur, next) => {
477
+          obj4[next.id] ? '' : obj4[next.id] = true && cur.push(next)
478
+          return cur
479
+        }, [])
480
+
481
+        for (let i = 0; i < this.propForm.goodType.length; i++) {
482
+          let goodInfo = []
483
+          let goodObj = {}
484
+
485
+          for (let a = 0; a < this.propForm.goodInfo.length; a++) {
486
+            var respObj = this.propForm.goodInfo[a]
487
+            respObj['isSelected'] = false
488
+            if (respObj.type.id == this.propForm.goodType[i].id && respObj.id != 0) {
489
+                console.log(respObj.id)
490
+                goodInfo.push(respObj)
397
             }
491
             }
398
           }
492
           }
399
-          const obj3 = {}
400
-          this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
401
-            obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
493
+          const obj = {}
494
+          goodInfo = goodInfo.reduce((cur, next) => {
495
+            obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
402
             return cur
496
             return cur
403
-          }, [])
497
+          }, []) // 设置cur默认类型为数组,并且初始值为空的数组
498
+
499
+          if(goodInfo.length != 0) {
500
+            this.$set(goodObj, this.propForm.goodType[i].id, goodInfo)
501
+            this.propForm.goods.push(goodObj)
502
+
503
+          }
404
         }
504
         }
505
+        console.log(this.propForm.goods)
506
+
507
+
508
+
509
+        this.$refs.dialog.show()
510
+      // }
511
+
512
+
513
+        // this.currentIndex = index
514
+        // if (this.form.manufacturer == '' || this.form.manufacturer == 0) {
515
+        //
516
+        // } else {
517
+        //   this.$refs.dialog.show()
518
+        //
519
+        //   for (let i = 0; i < this.warehouseOutInfoList.length; i++) {
520
+        //     if (this.warehouseOutInfoList[i].manufacturer == this.form.manufacturer) {
521
+        //       this.propForm.goodType.push(this.warehouseOutInfoList[i].GoodInfo.GoodsType)
522
+        //     }
523
+        //   }
524
+        //   const obj3 = {}
525
+        //   this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
526
+        //     obj3[next.id] ? '' : obj3[next.id] = true && cur.push(next)
527
+        //     return cur
528
+        //   }, [])
529
+        // }
405
       }, back() {
530
       }, back() {
406
         this.$router.go(-1)
531
         this.$router.go(-1)
407
       }, submit() {
532
       }, submit() {

+ 0 - 3
src/xt_pages/stock/stockOutOrderAdd.vue 查看文件

479
           }, []) // 设置cur默认类型为数组,并且初始值为空的数组
479
           }, []) // 设置cur默认类型为数组,并且初始值为空的数组
480
 
480
 
481
           this.$set(goodObj, this.propForm.goodType[i].id, goodInfo)
481
           this.$set(goodObj, this.propForm.goodType[i].id, goodInfo)
482
-          console.log(goodObj)
483
           this.propForm.goods.push(goodObj)
482
           this.propForm.goods.push(goodObj)
484
-          console.log(this.propForm.goods)
485
-
486
         }
483
         }
487
 
484
 
488
 
485
 

+ 133 - 38
src/xt_pages/user/components/EditGroupAdvice.vue 查看文件

44
         </el-row>
44
         </el-row>
45
         <el-row style="margin-bottom: 20px">
45
         <el-row style="margin-bottom: 20px">
46
           <el-col :span="2">&nbsp;</el-col>
46
           <el-col :span="2">&nbsp;</el-col>
47
-          <!--<el-col :span="5">-->
48
-            <!--<el-button-->
49
-              <!--:disabled="$store.getters.xt_user.subscibe.state==3?true:false"-->
50
-              <!--@click="openAdviceTemplate()"-->
51
-              <!--round-->
52
-              <!---->
53
-            <!--&gt;选择医嘱模板-->
54
-            <!--</el-button>-->
55
-          <!--</el-col>-->
47
+          <el-col :span="5">
48
+            <el-button
49
+              :disabled="$store.getters.xt_user.subscibe.state==3?true:false"
50
+              @click="openAdviceTemplate()"
51
+              round
52
+            >选择医嘱模板
53
+            </el-button>
54
+          </el-col>
56
 
55
 
57
           <el-col :span="5">
56
           <el-col :span="5">
58
             <el-button
57
             <el-button
157
 
156
 
158
     </el-dialog>
157
     </el-dialog>
159
 
158
 
159
+
160
     <el-dialog title="选择医嘱模板" :visible.sync="templateFormVisible" width="72%" :close-on-click-modal="false">
160
     <el-dialog title="选择医嘱模板" :visible.sync="templateFormVisible" width="72%" :close-on-click-modal="false">
161
       <el-row :gutter="20">
161
       <el-row :gutter="20">
162
         <el-col :span="8">
162
         <el-col :span="8">
235
                 <span v-if="scope.row.parent_row==0">{{scope.row.execution_frequency}}</span>
235
                 <span v-if="scope.row.parent_row==0">{{scope.row.execution_frequency}}</span>
236
               </template>
236
               </template>
237
             </el-table-column>
237
             </el-table-column>
238
+
239
+            <el-table-column
240
+              v-if="groupForm.advice_type == 1"
241
+              label="提醒频率"
242
+              min-width="80"
243
+              align="center"
244
+            >
245
+              <template slot-scope="scope">
246
+                <span v-if="scope.row.frequency_type == 1">每次必推</span>
247
+                <span v-if="scope.row.frequency_type == 2">{{scope.row.day_count}}天/1次</span>
248
+                <span v-if="scope.row.frequency_type == 3">每周{{scope.row.week_days}}</span>
249
+              </template>
250
+            </el-table-column>
251
+
238
           </el-table>
252
           </el-table>
239
         </el-col>
253
         </el-col>
240
       </el-row>
254
       </el-row>
282
         </el-button>
296
         </el-button>
283
       </div>
297
       </div>
284
     </el-dialog>
298
     </el-dialog>
285
-
286
     <el-dialog :title="nameFormTitle" :visible.sync="nameFormVisible" width="700px">
299
     <el-dialog :title="nameFormTitle" :visible.sync="nameFormVisible" width="700px">
287
       <el-form ref="nameForm" :rules="nameRules" :model="nameForm" label-width="90px">
300
       <el-form ref="nameForm" :rules="nameRules" :model="nameForm" label-width="90px">
288
         <el-row>
301
         <el-row>
470
     DeleteDoctorAdvice,
483
     DeleteDoctorAdvice,
471
     DeleteGroupAdvice,
484
     DeleteGroupAdvice,
472
     EditDoctorAdvice,
485
     EditDoctorAdvice,
473
-    getAdviceConfig,
474
     getDoctorAdviceList,
486
     getDoctorAdviceList,
475
-    StopDoctorAdvice
487
+    StopDoctorAdvice,
488
+    getAdviceConfig
476
   } from "@/api/advice";
489
   } from "@/api/advice";
477
 
490
 
478
 
491
 
520
           id: 0,
533
           id: 0,
521
           children: [],
534
           children: [],
522
         },
535
         },
536
+
537
+        drugOptions: [],
538
+        deliveryWayOptions: [],
539
+        executionFrequencyOptions: [],
540
+        adviceTemplates:[],
523
         submitGroupForm: {
541
         submitGroupForm: {
524
           advice_type: "",
542
           advice_type: "",
525
           advice_date: "",
543
           advice_date: "",
532
         selectedTemp: {'id': 0, name: '', org_id: 0, 'list': [], 'rows': []},
550
         selectedTemp: {'id': 0, name: '', org_id: 0, 'list': [], 'rows': []},
533
         selectedTemplate: [],
551
         selectedTemplate: [],
534
         allSelectedTemplate:[],
552
         allSelectedTemplate:[],
553
+        adviceTemplateMaps:{},
535
 
554
 
536
       }
555
       }
537
     },
556
     },
540
       adviceType: 0,
559
       adviceType: 0,
541
       adminusername: '',
560
       adminusername: '',
542
       rowKey: 0,
561
       rowKey: 0,
543
-      adviceTemplates: {
544
-        type: Array,
545
-        default: function () {
546
-          return []
547
-        }
548
-      },
562
+
549
       weekList: [
563
       weekList: [
550
         { id: 1, name: '周一' },
564
         { id: 1, name: '周一' },
551
         { id: 2, name: '周二' },
565
         { id: 2, name: '周二' },
577
           return []
591
           return []
578
         }
592
         }
579
       },
593
       },
580
-      deliveryWayOptions: {
581
-        type: Array,
582
-        default: () => []
583
-      },
594
+
584
       unitsOption: {
595
       unitsOption: {
585
         type: Array,
596
         type: Array,
586
         default: function () {
597
         default: function () {
587
           return []
598
           return []
588
         }
599
         }
589
-      },
590
-      executionFrequencyOptions: {
591
-        type: Array,
592
-        default: function () {
593
-          return []
594
-        }
595
-      },
596
-      adviceTemplateMaps: {
597
-        type: Object,
598
-        default: function () {
599
-          return {}
600
-        }
601
-      },
602
-      adviceTableData: {
600
+      }, adviceTableData: {
603
         type: Array,
601
         type: Array,
604
         default: function () {
602
         default: function () {
605
           return []
603
           return []
1274
               children: [],
1272
               children: [],
1275
               parent_row: 0,
1273
               parent_row: 0,
1276
               row_key: thisRowKey,
1274
               row_key: thisRowKey,
1275
+              day_count: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].day_count,
1276
+              week_days: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].week_days,
1277
+              frequency_type: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].frequency_type,
1278
+
1277
             }
1279
             }
1278
             if ('children' in this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index] && this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].children.length > 0) {
1280
             if ('children' in this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index] && this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].children.length > 0) {
1279
               var parentRow = thisRowKey;
1281
               var parentRow = thisRowKey;
1302
               }
1304
               }
1303
               this.$set(item, 'children', item.children);
1305
               this.$set(item, 'children', item.children);
1304
             }
1306
             }
1305
-
1306
             this.selectedTemp.list.unshift(item);
1307
             this.selectedTemp.list.unshift(item);
1307
 
1308
 
1308
           }
1309
           }
1330
                 execution_frequency: adviceTemplate.DoctorAdviceTemplate[index].execution_frequency,
1331
                 execution_frequency: adviceTemplate.DoctorAdviceTemplate[index].execution_frequency,
1331
                 advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
1332
                 advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
1332
                 selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
1333
                 selection: adviceTemplate.DoctorAdviceTemplate[index].selection,
1334
+                day_count: adviceTemplate.DoctorAdviceTemplate[index].day_count,
1335
+                frequency_type: adviceTemplate.DoctorAdviceTemplate[index].frequency_type,
1336
+                week_days: adviceTemplate.DoctorAdviceTemplate[index].week_days,
1337
+                template_id: 'T' + adviceTemplate.DoctorAdviceTemplate[index].id,
1338
+
1333
                 isEdit: 0,
1339
                 isEdit: 0,
1334
                 id: 0,
1340
                 id: 0,
1335
                 children: [],
1341
                 children: [],
1410
             delivery_way: this.allSelectedTemplate[index].delivery_way,
1416
             delivery_way: this.allSelectedTemplate[index].delivery_way,
1411
             execution_frequency: this.allSelectedTemplate[index].execution_frequency,
1417
             execution_frequency: this.allSelectedTemplate[index].execution_frequency,
1412
 
1418
 
1419
+
1420
+            day_count: this.allSelectedTemplate[index].day_count.toString(),
1421
+            frequency_type: this.allSelectedTemplate[index].frequency_type,
1422
+            week_days: this.allSelectedTemplate[index].week_days,
1423
+            template_id: this.allSelectedTemplate[index].template_id,
1424
+
1425
+
1426
+
1413
             isEdit: 0,
1427
             isEdit: 0,
1414
             id: 0,
1428
             id: 0,
1415
             children: [],
1429
             children: [],
1510
                 prescribing_number_unit: groups[index].prescribing_number_unit,
1524
                 prescribing_number_unit: groups[index].prescribing_number_unit,
1511
                 delivery_way: groups[index].delivery_way,
1525
                 delivery_way: groups[index].delivery_way,
1512
                 execution_frequency: groups[index].execution_frequency,
1526
                 execution_frequency: groups[index].execution_frequency,
1527
+
1528
+                day_count: groups[index].day_count,
1529
+                frequency_type: groups[index].frequency_type,
1530
+                week_day: groups[index].week_day,
1531
+                template_id: groups[index].template_id,
1532
+
1513
                 isEdit: 0,
1533
                 isEdit: 0,
1514
                 index: 0,
1534
                 index: 0,
1515
                 id: groups[index].id,
1535
                 id: groups[index].id,
1543
                 this.$set(item, 'children', item.children);
1563
                 this.$set(item, 'children', item.children);
1544
               }
1564
               }
1545
               this.groupForm.adviceNames.unshift(item);
1565
               this.groupForm.adviceNames.unshift(item);
1566
+              console.log(this.groupForm)
1546
             }
1567
             }
1547
             return false;
1568
             return false;
1548
           }
1569
           }
1752
         if (typeof (this.$refs.templatetable) != 'undefined') {
1773
         if (typeof (this.$refs.templatetable) != 'undefined') {
1753
           this.$refs.templatetable.setCurrentRow(null);
1774
           this.$refs.templatetable.setCurrentRow(null);
1754
         }
1775
         }
1776
+
1777
+
1778
+        if (this.groupForm.advice_type == 1) {
1779
+          this.getAdviceConfig(1)
1780
+        } else if (this.groupForm.advice_type == 3) {
1781
+          this.getAdviceConfig(0)
1782
+        }
1783
+
1784
+
1785
+
1755
         this.templateFormVisible = true;
1786
         this.templateFormVisible = true;
1756
       }, selectAllTemplateAdvice(selection) {
1787
       }, selectAllTemplateAdvice(selection) {
1757
         var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id].DoctorAdviceTemplate
1788
         var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id].DoctorAdviceTemplate
1794
             adviceTemplate.DoctorAdviceTemplate[index].selection = false
1825
             adviceTemplate.DoctorAdviceTemplate[index].selection = false
1795
           }
1826
           }
1796
         }
1827
         }
1797
-      }
1828
+      },getAdviceConfig(type) {
1829
+        getAdviceConfig(type).then(response => {
1830
+          if (response.data.state == 1) {
1831
+            this.deliveryWayOptions =
1832
+              response.data.data.drugways === null
1833
+                ? []
1834
+                : response.data.data.drugways
1835
+            this.executionFrequencyOptions =
1836
+              response.data.data.efs === null ? [] : response.data.data.efs
1837
+            this.adviceTemplates =
1838
+              response.data.data.advice_templates === null
1839
+                ? []
1840
+                : response.data.data.advice_templates
1841
+
1842
+            var templateLen = this.adviceTemplates.length
1843
+            for (let index = 0; index < templateLen; index++) {
1844
+              if (!this.adviceTemplates[index].DoctorAdviceTemplate) {
1845
+                continue
1846
+              }
1847
+
1848
+              var DoctorAdviceTemplate = this.adviceTemplates[index]
1849
+                .DoctorAdviceTemplate
1850
+              for (let i = 0; i < DoctorAdviceTemplate.length; i++) {
1851
+                DoctorAdviceTemplate[i].selection = false
1852
+              }
1853
+
1854
+              var item = this.adviceTemplates[index]
1855
+              item.DoctorAdviceTemplate = []
1856
+              var datMap = {}
1857
+              for (const key in DoctorAdviceTemplate) {
1858
+                if (DoctorAdviceTemplate[key].parent_id == 0) {
1859
+                  datMap[DoctorAdviceTemplate[key].id] =
1860
+                    DoctorAdviceTemplate[key]
1861
+                }
1862
+              }
1863
+
1864
+              for (const key in DoctorAdviceTemplate) {
1865
+                if (DoctorAdviceTemplate[key].parent_id in datMap) {
1866
+                  if ('children' in datMap[DoctorAdviceTemplate[key].parent_id]) {
1867
+                    datMap[DoctorAdviceTemplate[key].parent_id].children.push(
1868
+                      DoctorAdviceTemplate[key]
1869
+                    )
1870
+                  } else {
1871
+                    datMap[DoctorAdviceTemplate[key].parent_id].children = []
1872
+                    datMap[DoctorAdviceTemplate[key].parent_id].children.push(
1873
+                      DoctorAdviceTemplate[key]
1874
+                    )
1875
+                  }
1876
+                }
1877
+              }
1878
+              for (const key in datMap) {
1879
+                item.DoctorAdviceTemplate.push(datMap[key])
1880
+              }
1881
+
1882
+              this.$set(
1883
+                this.adviceTemplateMaps,
1884
+                this.adviceTemplates[index].id,
1885
+                item
1886
+              )
1887
+              console.log(this.adviceTemplates)
1888
+            }
1889
+          }
1890
+        })
1891
+      },
1892
+
1798
     },
1893
     },
1799
     watch: {
1894
     watch: {
1800
       'rowKey': function () {
1895
       'rowKey': function () {

+ 28 - 1
src/xt_pages/user/components/PatientDetail.vue 查看文件

1110
             } else {
1110
             } else {
1111
               this.patientPrint.hospital_first_dialysis_date = ''
1111
               this.patientPrint.hospital_first_dialysis_date = ''
1112
             }
1112
             }
1113
+
1114
+
1115
+            this.checkIdCardNo()
1116
+
1117
+
1113
           } else {
1118
           } else {
1114
             console.log('patient get err state')
1119
             console.log('patient get err state')
1115
             this.$notify.error({
1120
             this.$notify.error({
1203
         height: 200,
1208
         height: 200,
1204
         text: 'user_id:' + patientID + ',' + 'name:' + name + ',' + 'dialysis_no:' + dialysisNo + ',' + 'gender:' + gender + ',' + 'idcard_no:' + idCardNo + ',' + 'phone:' + phone + ',' + 'healthcare_no:' + healthCareNo
1209
         text: 'user_id:' + patientID + ',' + 'name:' + name + ',' + 'dialysis_no:' + dialysisNo + ',' + 'gender:' + gender + ',' + 'idcard_no:' + idCardNo + ',' + 'phone:' + phone + ',' + 'healthcare_no:' + healthCareNo
1205
       })
1210
       })
1206
-    }
1211
+    }, checkIdCardNo() {
1212
+      if (!isCardNo(this.form.idCardNo)) {
1213
+        this.$message.error('身份证号码信息有误!')
1214
+        this.form.birth = ''
1215
+        return false
1216
+      }
1217
+      var thisLen = this.form.idCardNo.length
1218
+      var birth = ''
1219
+      if (thisLen == 15) {
1220
+        birth = '19' + this.form.idCardNo.substr(6, 6)
1221
+      } else {
1222
+        birth = this.form.idCardNo.substr(6, 8)
1223
+      }
1224
+      this.form.birth =
1225
+        birth.substr(0, 4) +
1226
+        '-' +
1227
+        birth.substr(4, 2) +
1228
+        '-' +
1229
+        birth.substr(6, 2)
1230
+
1231
+      this.form.age = jsGetAge(this.form.birth, '-')
1232
+    },
1233
+
1207
     // qrcode(params){
1234
     // qrcode(params){
1208
     //    new QRCode('qrcode',{
1235
     //    new QRCode('qrcode',{
1209
     //        width:200,
1236
     //        width:200,

+ 5 - 0
src/xt_pages/user/components/PatientForm.vue 查看文件

862
         this.submitMsg = '新增患者成功'
862
         this.submitMsg = '新增患者成功'
863
         this.form = Object.assign({}, defaultForm)
863
         this.form = Object.assign({}, defaultForm)
864
       }
864
       }
865
+
866
+
865
     },
867
     },
866
     watch:{
868
     watch:{
867
       "form.record_date":function(val) {
869
       "form.record_date":function(val) {
1083
         })
1085
         })
1084
       },
1086
       },
1085
       checkIdCardNo() {
1087
       checkIdCardNo() {
1088
+        console.log(this.form.idCardNo)
1086
         if (!isCardNo(this.form.idCardNo)) {
1089
         if (!isCardNo(this.form.idCardNo)) {
1087
           this.$message.error('身份证号码信息有误!')
1090
           this.$message.error('身份证号码信息有误!')
1088
           this.form.birth = ''
1091
           this.form.birth = ''
1259
               // if (patietInfo.registrars_id > 0) {
1262
               // if (patietInfo.registrars_id > 0) {
1260
               //   this.form.registrars = patietInfo.registrars_id;
1263
               //   this.form.registrars = patietInfo.registrars_id;
1261
               // }
1264
               // }
1265
+              this.checkIdCardNo()
1266
+
1262
             } else {
1267
             } else {
1263
               this.$notify.error({
1268
               this.$notify.error({
1264
                 title: '错误',
1269
                 title: '错误',

+ 4 - 1
src/xt_pages/user/doctorAdvice.vue 查看文件

2611
             }
2611
             }
2612
           }
2612
           }
2613
         }
2613
         }
2614
+
2615
+        console.log(this.selectedTemp.list)
2614
       },
2616
       },
2615
       spanselecttable({ row, column, rowIndex, columnIndex }) {
2617
       spanselecttable({ row, column, rowIndex, columnIndex }) {
2616
         if (columnIndex == 0) {
2618
         if (columnIndex == 0) {
2700
               day_count: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].day_count,
2702
               day_count: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].day_count,
2701
               week_days: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].week_days,
2703
               week_days: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].week_days,
2702
               frequency_type: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].frequency_type,
2704
               frequency_type: this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].frequency_type,
2705
+
2706
+
2703
               isEdit: 0,
2707
               isEdit: 0,
2704
               id: 0,
2708
               id: 0,
2705
               children: [],
2709
               children: [],
2829
                 this.$set(item, 'children', item.children)
2833
                 this.$set(item, 'children', item.children)
2830
               }
2834
               }
2831
               this.allSelectedTemplate.unshift(item)
2835
               this.allSelectedTemplate.unshift(item)
2832
-              console.log(this.allSelectedTemplate)
2833
               adviceTemplate.DoctorAdviceTemplate[index].selection = false
2836
               adviceTemplate.DoctorAdviceTemplate[index].selection = false
2834
             }
2837
             }
2835
           }
2838
           }