Browse Source

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

xiaoming_global 5 years ago
parent
commit
3117c90139

+ 166 - 41
src/xt_pages/stock/cancelStockOrderAdd.vue View File

@@ -288,6 +288,9 @@
288 288
             }, [])
289 289
 
290 290
 
291
+
292
+
293
+
291 294
             this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
292 295
             this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
293 296
             this.form.manufacturer =0
@@ -339,69 +342,191 @@
339 342
       }, showDialog(index, row) {
340 343
         this.currentIndex = index
341 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 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 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 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 530
       }, back() {
406 531
         this.$router.go(-1)
407 532
       }, submit() {

+ 0 - 3
src/xt_pages/stock/stockOutOrderAdd.vue View File

@@ -479,10 +479,7 @@
479 479
           }, []) // 设置cur默认类型为数组,并且初始值为空的数组
480 480
 
481 481
           this.$set(goodObj, this.propForm.goodType[i].id, goodInfo)
482
-          console.log(goodObj)
483 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 View File

@@ -44,15 +44,14 @@
44 44
         </el-row>
45 45
         <el-row style="margin-bottom: 20px">
46 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 56
           <el-col :span="5">
58 57
             <el-button
@@ -157,6 +156,7 @@
157 156
 
158 157
     </el-dialog>
159 158
 
159
+
160 160
     <el-dialog title="选择医嘱模板" :visible.sync="templateFormVisible" width="72%" :close-on-click-modal="false">
161 161
       <el-row :gutter="20">
162 162
         <el-col :span="8">
@@ -235,6 +235,20 @@
235 235
                 <span v-if="scope.row.parent_row==0">{{scope.row.execution_frequency}}</span>
236 236
               </template>
237 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 252
           </el-table>
239 253
         </el-col>
240 254
       </el-row>
@@ -282,7 +296,6 @@
282 296
         </el-button>
283 297
       </div>
284 298
     </el-dialog>
285
-
286 299
     <el-dialog :title="nameFormTitle" :visible.sync="nameFormVisible" width="700px">
287 300
       <el-form ref="nameForm" :rules="nameRules" :model="nameForm" label-width="90px">
288 301
         <el-row>
@@ -470,9 +483,9 @@
470 483
     DeleteDoctorAdvice,
471 484
     DeleteGroupAdvice,
472 485
     EditDoctorAdvice,
473
-    getAdviceConfig,
474 486
     getDoctorAdviceList,
475
-    StopDoctorAdvice
487
+    StopDoctorAdvice,
488
+    getAdviceConfig
476 489
   } from "@/api/advice";
477 490
 
478 491
 
@@ -520,6 +533,11 @@
520 533
           id: 0,
521 534
           children: [],
522 535
         },
536
+
537
+        drugOptions: [],
538
+        deliveryWayOptions: [],
539
+        executionFrequencyOptions: [],
540
+        adviceTemplates:[],
523 541
         submitGroupForm: {
524 542
           advice_type: "",
525 543
           advice_date: "",
@@ -532,6 +550,7 @@
532 550
         selectedTemp: {'id': 0, name: '', org_id: 0, 'list': [], 'rows': []},
533 551
         selectedTemplate: [],
534 552
         allSelectedTemplate:[],
553
+        adviceTemplateMaps:{},
535 554
 
536 555
       }
537 556
     },
@@ -540,12 +559,7 @@
540 559
       adviceType: 0,
541 560
       adminusername: '',
542 561
       rowKey: 0,
543
-      adviceTemplates: {
544
-        type: Array,
545
-        default: function () {
546
-          return []
547
-        }
548
-      },
562
+
549 563
       weekList: [
550 564
         { id: 1, name: '周一' },
551 565
         { id: 2, name: '周二' },
@@ -577,29 +591,13 @@
577 591
           return []
578 592
         }
579 593
       },
580
-      deliveryWayOptions: {
581
-        type: Array,
582
-        default: () => []
583
-      },
594
+
584 595
       unitsOption: {
585 596
         type: Array,
586 597
         default: function () {
587 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 601
         type: Array,
604 602
         default: function () {
605 603
           return []
@@ -1274,6 +1272,10 @@
1274 1272
               children: [],
1275 1273
               parent_row: 0,
1276 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 1280
             if ('children' in this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index] && this.adviceTemplateMaps[mapid].DoctorAdviceTemplate[index].children.length > 0) {
1279 1281
               var parentRow = thisRowKey;
@@ -1302,7 +1304,6 @@
1302 1304
               }
1303 1305
               this.$set(item, 'children', item.children);
1304 1306
             }
1305
-
1306 1307
             this.selectedTemp.list.unshift(item);
1307 1308
 
1308 1309
           }
@@ -1330,6 +1331,11 @@
1330 1331
                 execution_frequency: adviceTemplate.DoctorAdviceTemplate[index].execution_frequency,
1331 1332
                 advice_id: adviceTemplate.DoctorAdviceTemplate[index].id,
1332 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 1339
                 isEdit: 0,
1334 1340
                 id: 0,
1335 1341
                 children: [],
@@ -1410,6 +1416,14 @@
1410 1416
             delivery_way: this.allSelectedTemplate[index].delivery_way,
1411 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 1427
             isEdit: 0,
1414 1428
             id: 0,
1415 1429
             children: [],
@@ -1510,6 +1524,12 @@
1510 1524
                 prescribing_number_unit: groups[index].prescribing_number_unit,
1511 1525
                 delivery_way: groups[index].delivery_way,
1512 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 1533
                 isEdit: 0,
1514 1534
                 index: 0,
1515 1535
                 id: groups[index].id,
@@ -1543,6 +1563,7 @@
1543 1563
                 this.$set(item, 'children', item.children);
1544 1564
               }
1545 1565
               this.groupForm.adviceNames.unshift(item);
1566
+              console.log(this.groupForm)
1546 1567
             }
1547 1568
             return false;
1548 1569
           }
@@ -1752,6 +1773,16 @@
1752 1773
         if (typeof (this.$refs.templatetable) != 'undefined') {
1753 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 1786
         this.templateFormVisible = true;
1756 1787
       }, selectAllTemplateAdvice(selection) {
1757 1788
         var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id].DoctorAdviceTemplate
@@ -1794,7 +1825,71 @@
1794 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 1894
     watch: {
1800 1895
       'rowKey': function () {

+ 28 - 1
src/xt_pages/user/components/PatientDetail.vue View File

@@ -1110,6 +1110,11 @@ export default {
1110 1110
             } else {
1111 1111
               this.patientPrint.hospital_first_dialysis_date = ''
1112 1112
             }
1113
+
1114
+
1115
+            this.checkIdCardNo()
1116
+
1117
+
1113 1118
           } else {
1114 1119
             console.log('patient get err state')
1115 1120
             this.$notify.error({
@@ -1203,7 +1208,29 @@ export default {
1203 1208
         height: 200,
1204 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 1234
     // qrcode(params){
1208 1235
     //    new QRCode('qrcode',{
1209 1236
     //        width:200,

+ 5 - 0
src/xt_pages/user/components/PatientForm.vue View File

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

+ 4 - 1
src/xt_pages/user/doctorAdvice.vue View File

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