Browse Source

自备药

XMLWAN 4 years ago
parent
commit
252593b64a

+ 9 - 9
src/App.vue View File

@@ -23,15 +23,15 @@ export default {
23 23
     }
24 24
   },
25 25
   created(){
26
-    getOrgs().then(response => {
27
-      if (response.data.state === 1) {
28
-        var creator = response.data.data.creator;
29
-        console.log("creator", creator);
30
-        sessionStorage.setItem("org_id",creator.org_id);
31
-        sessionStorage.setItem("admin_user_id",creator.admin_user_id);
32
-        this.getToken(creator.org_id,creator.admin_user_id)
33
-      }
34
-    });
26
+    // getOrgs().then(response => {
27
+    //   if (response.data.state === 1) {
28
+    //     var creator = response.data.data.creator;
29
+    //     console.log("creator", creator);
30
+    //     sessionStorage.setItem("org_id",creator.org_id);
31
+    //     sessionStorage.setItem("admin_user_id",creator.admin_user_id);
32
+    //     this.getToken(creator.org_id,creator.admin_user_id)
33
+    //   }
34
+    // });
35 35
     
36 36
   },
37 37
   methods: {

+ 11 - 4
src/xt_pages/dialysis/details/dialog/DoctorAdviceDialog.vue View File

@@ -1113,9 +1113,10 @@
1113 1113
           this.groupForm.adviceNames[
1114 1114
             this.nameForm.index
1115 1115
             ].delivery_way = this.nameForm.delivery_way
1116
-          this.groupForm.adviceNames[
1117
-            this.nameForm.index
1118
-            ].execution_frequency = this.nameForm.execution_frequency
1116
+          this.groupForm.adviceNames[this.nameForm.index].execution_frequency = this.nameForm.execution_frequency
1117
+          this.groupForm.adviceNames[this.nameForm.index].drug_name_id = this.nameForm.drug_name_id
1118
+          this.groupForm.adviceNames[this.nameForm.index].way = this.nameForm.way
1119
+          this.groupForm.adviceNames[this.nameForm.index].drug_id = this.nameForm.drug_id
1119 1120
         } else {
1120 1121
           this.groupForm.adviceNames.push(this.nameForm)
1121 1122
         }
@@ -2417,7 +2418,13 @@
2417 2418
             this.src_type = this.drugSpec[i].type
2418 2419
             this.form.drug_id = this.drugSpec[i].id
2419 2420
             this.form.way = this.drugSpec[i].type
2420
-            this.form.drug_name_id = this.drugSpec[i].drug_name_id
2421
+            if(this.drugSpec[i].drug_name_id){
2422
+              console.log("22222",this.drugSpec[i].drug_name_id)
2423
+               this.form.drug_name_id = this.drugSpec[i].drug_name_id
2424
+            }else{
2425
+              this.form.drug_name_id = 0
2426
+            }
2427
+           
2421 2428
           }
2422 2429
         }
2423 2430
       },

+ 15 - 15
src/xt_pages/dialysis/details/dialog/adviceDialog/AddGroupAdvice.vue View File

@@ -634,9 +634,9 @@ export default {
634 634
         index: 0,
635 635
         id: 0,
636 636
         children: [],
637
-        drug_id:"",
638
-        way:"",
639
-        drug_name_id:"",
637
+        drug_id:0,
638
+        way:0,
639
+        drug_name_id:0,
640 640
       },
641 641
       submitGroupForm: {
642 642
         advice_type: "",
@@ -657,7 +657,7 @@ export default {
657 657
         parent_id: 0,
658 658
         drug_id:"",
659 659
         way:"",
660
-        drug_name_id:"",
660
+        drug_name_id:0,
661 661
       },
662 662
       selectedTemp: { id: 0, name: "", org_id: 0, list: [], rows: [] },
663 663
       selectedTemplate: [],
@@ -915,9 +915,9 @@ export default {
915 915
                       _this.groupForm.adviceNames[index].children[j].delivery_way = _this.nameForm.delivery_way;
916 916
                       _this.groupForm.adviceNames[index].children[j].execution_frequency =_this.nameForm.execution_frequency;
917 917
                       _this.groupForm.adviceNames[index].children[j].remark =_this.nameForm.remark;
918
-                      _this.groupForm.adviceNames[index].children[j].drug_id = _this.nameForm.drug_id;
919
-                      _this.groupForm.adviceNames[index].children[j].way = _this.nameForm.way;
920
-                      _this.groupForm.adviceNames[index].children[j].drug_name_id = _this.nameForm.drug_name_id;
918
+                      // _this.groupForm.adviceNames[index].children[j].drug_id = _this.nameForm.drug_id;
919
+                      // _this.groupForm.adviceNames[index].children[j].way = _this.nameForm.way;
920
+                      // _this.groupForm.adviceNames[index].children[j].drug_name_id = _this.nameForm.drug_name_id;
921 921
                       _this.$set(_this.groupForm.adviceNames[index].children,j,_this.groupForm.adviceNames[index].children[j]
922 922
                      
923 923
                       );
@@ -940,9 +940,9 @@ export default {
940 940
                   _this.groupForm.adviceNames[index].delivery_way =_this.nameForm.delivery_way;
941 941
                   _this.groupForm.adviceNames[index].execution_frequency =_this.nameForm.execution_frequency;
942 942
                   _this.groupForm.adviceNames[index].remark =_this.nameForm.remark;
943
-                  _this.groupForm.adviceNames[index].children[j].drug_id = _this.nameForm.drug_id;
944
-                  _this.groupForm.adviceNames[index].children[j].way = _this.nameForm.way;
945
-                  _this.groupForm.adviceNames[index].children[j].drug_name_id = _this.nameForm.drug_name_id;
943
+                  // _this.groupForm.adviceNames[index].children[j].drug_id = _this.nameForm.drug_id;
944
+                  // _this.groupForm.adviceNames[index].children[j].way = _this.nameForm.way;
945
+                  // _this.groupForm.adviceNames[index].children[j].drug_name_id = _this.nameForm.drug_name_id;
946 946
                   _this.$set(
947 947
                     _this.groupForm.adviceNames,
948 948
                     index,
@@ -1084,9 +1084,8 @@ export default {
1084 1084
       this.selectedTemplate = selection;
1085 1085
     },
1086 1086
     selectAdvice(selection, row) {
1087
-      // this.selectedTemplate = [];
1088
-
1089
-      // console.log(selection);
1087
+     
1088
+     console.log("row",row)
1090 1089
 
1091 1090
       var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id]
1092 1091
         .DoctorAdviceTemplate;
@@ -1476,6 +1475,7 @@ export default {
1476 1475
       this.templateFormVisible = true;
1477 1476
     },
1478 1477
     selectGroupAdvice(row) {
1478
+      console.log("row-----",row)
1479 1479
       this.groupSelectRow = row;
1480 1480
     },
1481 1481
     groupClassName({ row, rowIndex }) {
@@ -1508,8 +1508,8 @@ export default {
1508 1508
       this.adminusername = xtuser.user.user_name;
1509 1509
     },
1510 1510
     selectAllTemplateAdvice(selection) {
1511
-      var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id]
1512
-        .DoctorAdviceTemplate;
1511
+      console.log("params",selection)
1512
+      var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id].DoctorAdviceTemplate;
1513 1513
       for (let y = 0; y < adviceArray.length; y++) {
1514 1514
         adviceArray[y].selection = false;
1515 1515
       }

+ 3 - 2
src/xt_pages/dialysis/details/dialog/adviceDialog/EditGroupAdvice.vue View File

@@ -2292,6 +2292,7 @@ export default {
2292 2292
       }
2293 2293
     },
2294 2294
     SaveEditAdvices() {
2295
+      console.log("aaa")
2295 2296
       const params = {
2296 2297
         start_time: this.groupForm.start_time,
2297 2298
         groupno: this.groupForm.groupno,
@@ -2426,14 +2427,14 @@ export default {
2426 2427
         return Math.floor(Math.random() * (max - min)) + min;
2427 2428
      },
2428 2429
      querySearch(queryString, cb) {
2429
-        console.log('queryString',queryString)
2430
+       
2430 2431
         var restaurants = this.all_drug;
2431 2432
         restaurants.map(item => {
2432 2433
           item.value = item.drug_name
2433 2434
         })
2434 2435
         var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
2435 2436
         // 调用 callback 返回建议列表的数据
2436
-        console.log('results',results)
2437
+     
2437 2438
         cb(results);
2438 2439
      },
2439 2440
 

+ 1 - 1
src/xt_pages/outpatientDoctorStation/components/advice.vue View File

@@ -13,7 +13,7 @@
13 13
                 <el-form-item class="width50" label="开嘱时间 : " prop="name">
14 14
                     张三
15 15
                 </el-form-item>
16
-                <el-form-item label="医嘱内容 : " prop="name" style="width:100%;">
16
+                <el-form-item label="医嘱内容: " prop="name" style="width:100%;">
17 17
                     <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="textarea"></el-input>
18 18
                 </el-form-item>
19 19
                 <el-form-item class="width50" label="药品规格 : " prop="name">

+ 14 - 13
src/xt_pages/qcd/treatmentControlAnalysis/components/TimePersonal.vue View File

@@ -70,7 +70,7 @@
70 70
       </div>
71 71
       <div style="padding-left:10px;flex:1">
72 72
         <div class="tableTitle">统计表</div>
73
-        <el-table :data="DialysisData" style="width: 100%" border :row-style="{ color: '#303133' }"
73
+        <el-table :data="DialysisData" style="width: 100%" border :row-style="{ color: '#303133' }" 
74 74
         :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
75 75
         >
76 76
           <el-table-column prop="name" label="姓名" width="140">
@@ -84,7 +84,8 @@
84 84
           </el-table-column>
85 85
           <el-table-column prop="mode_id" label="透析模式">
86 86
               <template slot-scope="scope">
87
-                <span>{{ scope.row.mode_id.join("、")}}</span>
87
+                <!-- <span>{{ scope.row.mode_id.join("、") }}</span> -->
88
+                <span>{{getModeIdCount(scope.row.patient_id)}}</span>
88 89
               </template>
89 90
            </el-table-column>
90 91
           <el-table-column prop="address" label="透析总次数" width="140">
@@ -140,7 +141,7 @@ export default {
140 141
           let threeMonths = new Date(new Date().setFullYear(new Date().getFullYear()-1)).getTime() - 24 * 3600 * 1000;
141 142
           return time.getTime() > Date.now() || time.getTime() < threeMonths;;
142 143
         }
143
-      },
144
+      }, 
144 145
       patient_id:0,
145 146
       modeIdCount:[],
146 147
     };
@@ -154,7 +155,7 @@ export default {
154 155
       } else {
155 156
         this.getDialysisList()
156 157
       }
157
-
158
+      
158 159
     },
159 160
     changeEndTime(val) {
160 161
       var time =
@@ -194,13 +195,13 @@ export default {
194 195
          if(response.data.state === 1){
195 196
           var list = response.data.data.list
196 197
           var totallist  =  response.data.data.totallist
197
-          this.total = totallist
198
+          this.total = totallist  
198 199
           var prescriptionList = response.data.data.prescriptionList
199
-
200
+         
200 201
           this.getModeId(prescriptionList)
201 202
           var count = response.data.data.count
202 203
           this.DialysisCount = count
203
-
204
+          
204 205
           var modeIdCount = response.data.data.modeIdCount
205 206
           console.log("modeidcount=====",modeIdCount)
206 207
           for(let i=0;i<modeIdCount.length;i++){
@@ -279,7 +280,7 @@ export default {
279 280
             }
280 281
           })
281 282
           let list = Object.values(dataInfo)
282
-          // console.log("arr",list)
283
+          // console.log("arr",list)    
283 284
           list.map(item => {
284 285
             for (let i = 0; i < prescriptionList.length; i++) {
285 286
               if (item.patient_id === prescriptionList[i].patient_id) {
@@ -346,7 +347,7 @@ export default {
346 347
          }
347 348
        })
348 349
       }
349
-
350
+    
350 351
     },
351 352
     unique(arr) {
352 353
         const res = new Map();
@@ -380,7 +381,7 @@ export default {
380 381
             // console.log("total",total)
381 382
           }
382 383
        })
383
-
384
+     
384 385
     },
385 386
     getModeId(patients){
386 387
       for(let i=0;i<patients.length;i++){
@@ -456,10 +457,10 @@ export default {
456 457
         }
457 458
         let str = ''
458 459
         arr.map(item => {
459
-          str += item.mode_id + '(' + item.Count + '次) 、'
460
+          str += item.mode_id + '(' + item.Count + '次) 、' 
460 461
         })
461 462
         var strs = str.substring(0, str.length - 1)
462
-
463
+       
463 464
         return strs
464 465
       }
465 466
   },
@@ -484,7 +485,7 @@ export default {
484 485
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
485 486
       "-" +
486 487
       (nowDay < 10 ? "0" + nowDay : nowDay);
487
-
488
+    
488 489
      //获取该机构下的所有患者
489 490
      this.getCurrentOrgPatients()
490 491
      //统计列表

+ 5 - 14
src/xt_pages/stock/selfPreparedMedicine/index.vue View File

@@ -26,16 +26,6 @@
26 26
                 value-format="yyyy-MM-dd"
27 27
                 @change="changeStartime"
28 28
                 ></el-date-picker>
29
-                <!-- <el-select v-model="value" placeholder="请选择">
30
-                    <el-option
31
-                    v-for="item in options"
32
-                    :key="item.value"
33
-                    :label="item.label"
34
-                    :value="item.value">
35
-                    </el-option>
36
-                </el-select> -->
37
-                <!-- <el-input style="width: 180px;margin:0 10px;" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/> -->
38
-                <!-- <el-button class="filter-item" type="primary" icon="el-icon-search" @click="searchAction">搜索</el-button> -->
39 29
                  <el-autocomplete
40 30
                   style="margin:16px 5px"
41 31
                   popper-class="my-autocomplete"
@@ -146,6 +136,7 @@ import medicineDetail from "./components/medicineDetail"
146 136
 import warehousing from "./components/warehousing"
147 137
 import warehouseOut from "./components/warehouseOut"
148 138
 const moment = require('moment')
139
+import { PostSearch } from '@/api/patient'
149 140
 import { getCurrentPatient,saveRadio,getStockList,DeleteDrugNameById,getDrugSet } from "@/api/drug/drug"
150 141
 export default {
151 142
     components:{
@@ -358,21 +349,21 @@ export default {
358 349
             key = keyword
359 350
           }
360 351
           let searchArray = []
361
-          getCurrentPatient(key).then(response => {
352
+          PostSearch(key).then(response => {
362 353
             if (response.data.state == 1) {
363 354
               searchArray = response.data.data.patient
355
+              console.log("searchArray",searchArray)
356
+           
364 357
               cb(searchArray)
365 358
             }
366 359
           })
367 360
           return searchArray
368 361
         },
369 362
         handleSelect(val){
370
-          console.log("val",val.id)
371
-          console.log("2222",this.tablePatient)
363
+          console.log("val",val)
372 364
           this.search_input = val.name
373 365
           for(let i=0;i<this.tablePatient.length;i++){
374 366
              if(this.tablePatient[i].id == val.id){
375
-               console.log("建立")
376 367
                this.$refs.monthlyPlanTable.setCurrentRow(this.tablePatient[i])
377 368
              }
378 369
           }

+ 27 - 19
src/xt_pages/stock/selfPreparedMedicine/query.vue View File

@@ -83,17 +83,17 @@
83 83
                 <el-table-column align="center" prop="name" label="规格名称">
84 84
                     <template slot-scope="scope">{{ scope.row.drug_spec }}</template>
85 85
                 </el-table-column>
86
-                <el-table-column align="center" prop="name" label="单位" width="80">
86
+                <!-- <el-table-column align="center" prop="name" label="单位" width="80">
87 87
                     <template slot-scope="scope">{{ scope.row.min_unit }}</template>
88
-                </el-table-column>
88
+                </el-table-column> -->
89 89
                 <el-table-column align="center" prop="name" label="自备量" width="80">
90
-                    <template slot-scope="scope">{{ scope.row.Total }}</template>
90
+                    <template slot-scope="scope">{{ scope.row.Total?scope.row.Total:0 }}</template>
91 91
                 </el-table-column>
92 92
                 <el-table-column align="center" prop="name" label="已使用" width="80">
93 93
                     <template slot-scope="scope">{{ scope.row.Count }}</template>
94 94
                 </el-table-column>
95 95
                 <el-table-column align="center" prop="name" label="剩余" width="80">
96
-                    <template slot-scope="scope">{{ scope.row.Total - scope.row.Count }}</template>
96
+                    <template slot-scope="scope">{{ scope.row.Total?scope.row.Total:0 - scope.row.Count }}</template>
97 97
                 </el-table-column>
98 98
             </el-table>
99 99
         </div>
@@ -121,11 +121,11 @@ export default {
121 121
             search_input:"",
122 122
             options:[],
123 123
             value:"",
124
-            // start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
125
-            // end_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
126
-            start_time:"",
127
-            end_time:"",
128
-            drug_name:0,
124
+            start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
125
+            end_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
126
+            // start_time:"",
127
+            // end_time:"",
128
+            drug_name:"",
129 129
             drug_spec:"",
130 130
             drugName:[],
131 131
             rulleName:[]
@@ -137,8 +137,8 @@ export default {
137 137
         },
138 138
         exportList(){
139 139
          import('@/vendor/Export2Excel').then(excel => {
140
-         const tHeader = ['序号', '透析号', '姓名','药品名称','规格名称','单位','自备量','已使用','剩余']
141
-         const filterVal = ['index', 'dialysis_no', 'name','drug_name','drug_spec','min_unit','Total','Count','margin']
140
+         const tHeader = ['序号', '透析号', '姓名','药品名称','规格名称','自备量','已使用','剩余']
141
+         const filterVal = ['index', 'dialysis_no', 'name','drug_name','drug_spec','Total','Count','margin']
142 142
          for(let i=0;i<this.tableData.length;i++){
143 143
             this.tableData[i].margin = this.tableData[i].Total - this.tableData[i].Count
144 144
          }
@@ -258,16 +258,24 @@ export default {
258 258
               }
259 259
               var outStockList =  response.data.data.outStockList
260 260
 
261
-              
262
-              for(let i=0;i<stocklist.length;i++){
263
-                for(let j=0;j<outStockList.length;j++){
264
-                   if(stocklist[i].patient_id == outStockList[j].patient_id &&stocklist[i].drug_name == outStockList[j].drug_name && stocklist[i].drug_spec == outStockList[j].drug_spec){
265
-                       stocklist[i].Count = outStockList[j].Count
266
-                   }
267
-                }
261
+              // for(let i=0;i<stocklist.length;i++){
262
+              //   for(let j=0;j<outStockList.length;j++){
263
+              //      if(stocklist[i].patient_id == outStockList[j].patient_id &&stocklist[i].drug_name == outStockList[j].drug_name && stocklist[i].drug_spec == outStockList[j].drug_spec){
264
+              //          stocklist[i].Count = outStockList[j].Count
265
+              //      }
266
+              //   }
267
+              // }
268
+
269
+             for(let i=0;i<outStockList.length;i++){
270
+                 for(let j=0;j<stocklist.length;j++){
271
+                     if(outStockList[i].patient_id == stocklist[j].patient_id &&outStockList[i].drug_name == stocklist[j].drug_name && outStockList[i].drug_spec == stocklist[j].drug_spec){
272
+                      outStockList[i].Total = stocklist[j].Total
273
+                   } 
274
+                 }
268 275
               }
269 276
 
270
-              this.tableData = stocklist
277
+
278
+              this.tableData = outStockList
271 279
             }
272 280
         })   
273 281
       }

+ 21 - 12
src/xt_pages/stock/selfPreparedMedicine/queryPrint.vue View File

@@ -26,7 +26,7 @@
26 26
                                     <td width="80">姓名</td>
27 27
                                     <td>药品名称</td>
28 28
                                     <td>规格名称</td>
29
-                                    <td width="70">单位</td>
29
+                                    <!-- <td width="70">单位</td> -->
30 30
                                     <td width="70">自备量</td>
31 31
                                     <td width="70">已使用</td>
32 32
                                     <td width="70">剩余</td>
@@ -39,10 +39,10 @@
39 39
                                     <td>{{item.name}}</td>
40 40
                                     <td>{{item.drug_name}}</td>
41 41
                                     <td>{{item.drug_spec}}</td>
42
-                                    <td>{{item.min_unit}}</td>
43
-                                    <td>{{item.store_number}}</td>
42
+                                    <!-- <td>{{item.min_unit}}</td> -->
43
+                                    <td>{{item.Total?item.Total:0}}</td>
44 44
                                     <td>{{item.Count}}</td>
45
-                                    <td>{{item.store_number - item.Count}}</td>
45
+                                    <td>{{item.Total?item.Total:0 - item.Count}}</td>
46 46
                                 </tr>
47 47
                             </tbody>
48 48
                         </table>
@@ -97,6 +97,7 @@ export default {
97 97
             drug_spec:this.drug_spec,
98 98
             search_input:this.keyword
99 99
           }
100
+        console.log("params------",params)
100 101
         getAllPatientStockList(params).then(response=>{
101 102
             if(response.data.state == 1){
102 103
               var stocklist = response.data.data.stocklist
@@ -105,15 +106,23 @@ export default {
105 106
                  stocklist[i].Count = 0
106 107
               }
107 108
               var outStockList =  response.data.data.outStockList
108
-              for(let i=0;i<stocklist.length;i++){
109
-                for(let j=0;j<outStockList.length;j++){
110
-                   if(stocklist[i].patient_id == outStockList[j].patient_id &&stocklist[i].drug_name == outStockList[j].drug_name && stocklist[i].drug_spec == outStockList[j].drug_spec){
111
-                       stocklist[i].Count = outStockList[j].Count
112
-                   }
113
-                }
109
+              // for(let i=0;i<stocklist.length;i++){
110
+              //   for(let j=0;j<outStockList.length;j++){
111
+              //      if(stocklist[i].patient_id == outStockList[j].patient_id &&stocklist[i].drug_name == outStockList[j].drug_name && stocklist[i].drug_spec == outStockList[j].drug_spec){
112
+              //          stocklist[i].Count = outStockList[j].Count
113
+              //      }
114
+              //   }
115
+              // }
116
+
117
+            for(let i=0;i<outStockList.length;i++){
118
+                 for(let j=0;j<stocklist.length;j++){
119
+                     if(outStockList[i].patient_id == stocklist[j].patient_id &&outStockList[i].drug_name == stocklist[j].drug_name && outStockList[i].drug_spec == stocklist[j].drug_spec){
120
+                      outStockList[i].Total = stocklist[j].Total
121
+                   } 
122
+                 }
114 123
               }
115
-              console.log("stocklist99999",stocklist)
116
-              this.tableData = stocklist
124
+              console.log("stocklist99999",outStockList)
125
+              this.tableData = outStockList
117 126
             }
118 127
         })   
119 128
       }

+ 4 - 2
src/xt_pages/user/components/PatientSidebar.1.vue View File

@@ -155,7 +155,8 @@ export default {
155 155
             break
156 156
         }
157 157
         return sex
158
-      }, querySearchAsync(keyword, cb) {
158
+      },
159
+       querySearchAsync(keyword, cb) {
159 160
         let key = ''
160 161
         if (keyword != undefined) {
161 162
           key = keyword
@@ -170,7 +171,8 @@ export default {
170 171
             cb([])
171 172
           }
172 173
         })
173
-      }, handleSelect(val) {
174
+      },
175
+       handleSelect(val) {
174 176
         this.$router.push('/patients/patient/' + val.id)
175 177
       }
176 178
 

+ 26 - 5
src/xt_pages/user/doctorAdvice.vue View File

@@ -2299,7 +2299,7 @@ export default {
2299 2299
             adviceNames: [],
2300 2300
             advice_doctor: this.groupForm.advice_doctor,
2301 2301
             remark: this.groupForm.remark,
2302
-            parent_id: this.groupForm.parent_id
2302
+            parent_id: this.groupForm.parent_id,
2303 2303
           };
2304 2304
           console.log("22222",submitForm)
2305 2305
           console.log("33333",this.private_drug_config.drug_start)
@@ -2325,17 +2325,21 @@ export default {
2325 2325
           } else if (this.groupForm.advice_type == 3) {
2326 2326
             mode = "1-1";
2327 2327
           }
2328
-          
2328
+        console.log("22222222",this.medicals)
2329
+        console.log("3333333",submitForm)
2330
+      
2329 2331
         if(this.private_drug_config.drug_start == 1){
2330 2332
               for(let index=0;index<submitForm.adviceNames.length;index++){
2331 2333
                   for(let i=0;i<this.medicals.length;i++){
2332 2334
                     if(submitForm.adviceNames[index].drug_id == this.medicals[i].drug_name_id){
2333 2335
                         submitForm.adviceNames[index].way = 2
2336
+                        submitForm.adviceNames[index].drug_name_id = this.medicals[i].drug_name_id
2334 2337
                     }
2335 2338
                   }
2336 2339
               }
2337 2340
           }
2338
-          console.log("this.===",submitForm)
2341
+          console.log("模板数据",submitForm)
2342
+        
2339 2343
           CreateNewGroupAdvice(this.patientID, 0, submitForm, mode).then(
2340 2344
             response => {
2341 2345
               if (response.data.state == 0) {
@@ -2642,6 +2646,7 @@ export default {
2642 2646
           prescribing_number_unit: this.groupSelectRow.prescribing_number_unit,
2643 2647
           way:this.groupSelectRow.way,
2644 2648
           drug_id:this.groupSelectRow.drug_id,
2649
+          drug_name_id:this.groupSelectRow.drug_name_id,
2645 2650
           delivery_way: this.isChild ? "" : this.groupSelectRow.delivery_way,
2646 2651
           execution_frequency: this.isChild
2647 2652
             ? ""
@@ -2684,7 +2689,8 @@ export default {
2684 2689
           children: [],
2685 2690
           parent_row: 0,
2686 2691
           way:"",
2687
-          drug_id:''
2692
+          drug_id:'',
2693
+          drug_name_id:0,
2688 2694
         };
2689 2695
         this.nameFormTitle = "新增医嘱内容";
2690 2696
       }
@@ -3007,6 +3013,7 @@ export default {
3007 3013
           day_count: groups[index].day_count,
3008 3014
           week_day: groups[index].week_day,
3009 3015
           drug_id:groups[index].drug_id,
3016
+          drug_name_id:groups[index].drug_name_id,
3010 3017
           wary:groups[index].way,
3011 3018
           isEdit: 0,
3012 3019
           index: 0,
@@ -3016,6 +3023,7 @@ export default {
3016 3023
           row_key: this.rowKey,
3017 3024
           table: []
3018 3025
         };
3026
+        console.log("itme-----------",item)
3019 3027
         if (item.id in childMap) {
3020 3028
           for (const key in childMap[item.id]) {
3021 3029
             this.rowKey++;
@@ -3034,6 +3042,7 @@ export default {
3034 3042
               execution_frequency: childMap[item.id][key].execution_frequency,
3035 3043
               drug_id:childMap[item.id][key].drug_id,
3036 3044
               way:childMap[item.id][key].way,
3045
+              drug_name_id:childMap[item.id][key].drug_name_id,
3037 3046
               isEdit: 0,
3038 3047
               index: 0,
3039 3048
               id: childMap[item.id][key].id,
@@ -3686,6 +3695,7 @@ export default {
3686 3695
             ].frequency_type,
3687 3696
             drug_id:this.adviceTemplateMaps[mapid].drug_id,
3688 3697
             way:this.adviceTemplateMaps[mapid].way,
3698
+            drug_name_id:this.adviceTemplateMaps[mapid].way,
3689 3699
             isEdit: 0,
3690 3700
             id: 0,
3691 3701
             children: [],
@@ -3718,6 +3728,7 @@ export default {
3718 3728
                 execution_frequency: children[key].execution_frequency,
3719 3729
                 drug_id:children[key].drug_id,
3720 3730
                 way:children[key].way,
3731
+                drug_name_id:children[key].drug_name_id,
3721 3732
                 isEdit: 0,
3722 3733
                 id: 0,
3723 3734
                 children: [],
@@ -3775,6 +3786,7 @@ export default {
3775 3786
               template_id: "T" + adviceTemplate.DoctorAdviceTemplate[index].id,
3776 3787
               drug_id: adviceTemplate.DoctorAdviceTemplate[index].drug_id,
3777 3788
               way:adviceTemplate.DoctorAdviceTemplate[index].way,
3789
+              drug_name_id:adviceTemplate.DoctorAdviceTemplate[index].drug_name_id,
3778 3790
               isEdit: 0,
3779 3791
               id: 0,
3780 3792
               children: [],
@@ -3808,6 +3820,7 @@ export default {
3808 3820
                   execution_frequency: children[key].execution_frequency,
3809 3821
                   drug_id:children[key].drug_id,
3810 3822
                   way:children[key].way,
3823
+                  drug_name_id:children[key].drug_name_id,
3811 3824
                   isEdit: 0,
3812 3825
                   id: 0,
3813 3826
                   children: [],
@@ -3865,6 +3878,7 @@ export default {
3865 3878
           week_days: this.allSelectedTemplate[index].week_days,
3866 3879
           drug_id:this.allSelectedTemplate[index].drug_id,
3867 3880
           way:this.allSelectedTemplate[index].way,
3881
+          drug_name_id:this.allSelectedTemplate[index].drug_name_id,
3868 3882
           isEdit: 0,
3869 3883
           id: 0,
3870 3884
           children: [],
@@ -3892,6 +3906,7 @@ export default {
3892 3906
                 execution_frequency: children[key].execution_frequency,
3893 3907
                 drug_id:children[key].drug_id,
3894 3908
                 way:children[key].way,
3909
+                drug_name_id:children[key].way,
3895 3910
                 isEdit: 0,
3896 3911
                 id: 0,
3897 3912
                 children: [],
@@ -3991,6 +4006,7 @@ export default {
3991 4006
                     execution_frequency: children[key].execution_frequency,
3992 4007
                     drug_id:children[key].drug_id,
3993 4008
                     way:children[key].way,
4009
+                    drug_name_id:children[key].way,
3994 4010
                     isEdit: 0,
3995 4011
                     id: 0,
3996 4012
                     children: [],
@@ -4051,6 +4067,7 @@ export default {
4051 4067
                       _this.groupForm.adviceNames[index].children[j].execution_frequency =_this.nameForm.execution_frequency;
4052 4068
                       _this.groupForm.adviceNames[index].children[j].drug_id = _this.nameForm.drug_id;
4053 4069
                       _this.groupForm.adviceNames[index].children[j].way = _this.nameForm.way;
4070
+
4054 4071
                       _this.$set(
4055 4072
                         _this.groupForm.adviceNames[index].children,
4056 4073
                         j,
@@ -4387,7 +4404,7 @@ export default {
4387 4404
         const params = {
4388 4405
           patient_id:id
4389 4406
         }
4390
-    
4407
+      console.log("params-----",params)
4391 4408
       getSelfMedicalList(params).then(response=>{
4392 4409
          if (response.data.state == 1) {
4393 4410
             this.arr_drug = []
@@ -4470,6 +4487,7 @@ export default {
4470 4487
             }
4471 4488
 
4472 4489
             this.private_drug_config = response.data.data.private_drug_config
4490
+            console.log("medicals",medicalList)
4473 4491
             this.medicals = medicalList
4474 4492
           
4475 4493
       })
@@ -4497,6 +4515,9 @@ export default {
4497 4515
             this.src_type = this.drugSpec[i].type
4498 4516
             this.nameForm.drug_id = this.drugSpec[i].id
4499 4517
             this.nameForm.way = this.drugSpec[i].type
4518
+            if(this.drugSpec[i].drug_name_id){
4519
+               this.nameForm.drug_name_id = 0
4520
+            }
4500 4521
           }
4501 4522
         }
4502 4523
     },