Browse Source

自备药

XMLWAN 4 years ago
parent
commit
252593b64a

+ 9 - 9
src/App.vue View File

23
     }
23
     }
24
   },
24
   },
25
   created(){
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
   methods: {
37
   methods: {

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

1113
           this.groupForm.adviceNames[
1113
           this.groupForm.adviceNames[
1114
             this.nameForm.index
1114
             this.nameForm.index
1115
             ].delivery_way = this.nameForm.delivery_way
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
         } else {
1120
         } else {
1120
           this.groupForm.adviceNames.push(this.nameForm)
1121
           this.groupForm.adviceNames.push(this.nameForm)
1121
         }
1122
         }
2417
             this.src_type = this.drugSpec[i].type
2418
             this.src_type = this.drugSpec[i].type
2418
             this.form.drug_id = this.drugSpec[i].id
2419
             this.form.drug_id = this.drugSpec[i].id
2419
             this.form.way = this.drugSpec[i].type
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
         index: 0,
634
         index: 0,
635
         id: 0,
635
         id: 0,
636
         children: [],
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
       submitGroupForm: {
641
       submitGroupForm: {
642
         advice_type: "",
642
         advice_type: "",
657
         parent_id: 0,
657
         parent_id: 0,
658
         drug_id:"",
658
         drug_id:"",
659
         way:"",
659
         way:"",
660
-        drug_name_id:"",
660
+        drug_name_id:0,
661
       },
661
       },
662
       selectedTemp: { id: 0, name: "", org_id: 0, list: [], rows: [] },
662
       selectedTemp: { id: 0, name: "", org_id: 0, list: [], rows: [] },
663
       selectedTemplate: [],
663
       selectedTemplate: [],
915
                       _this.groupForm.adviceNames[index].children[j].delivery_way = _this.nameForm.delivery_way;
915
                       _this.groupForm.adviceNames[index].children[j].delivery_way = _this.nameForm.delivery_way;
916
                       _this.groupForm.adviceNames[index].children[j].execution_frequency =_this.nameForm.execution_frequency;
916
                       _this.groupForm.adviceNames[index].children[j].execution_frequency =_this.nameForm.execution_frequency;
917
                       _this.groupForm.adviceNames[index].children[j].remark =_this.nameForm.remark;
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
                       _this.$set(_this.groupForm.adviceNames[index].children,j,_this.groupForm.adviceNames[index].children[j]
921
                       _this.$set(_this.groupForm.adviceNames[index].children,j,_this.groupForm.adviceNames[index].children[j]
922
                      
922
                      
923
                       );
923
                       );
940
                   _this.groupForm.adviceNames[index].delivery_way =_this.nameForm.delivery_way;
940
                   _this.groupForm.adviceNames[index].delivery_way =_this.nameForm.delivery_way;
941
                   _this.groupForm.adviceNames[index].execution_frequency =_this.nameForm.execution_frequency;
941
                   _this.groupForm.adviceNames[index].execution_frequency =_this.nameForm.execution_frequency;
942
                   _this.groupForm.adviceNames[index].remark =_this.nameForm.remark;
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
                   _this.$set(
946
                   _this.$set(
947
                     _this.groupForm.adviceNames,
947
                     _this.groupForm.adviceNames,
948
                     index,
948
                     index,
1084
       this.selectedTemplate = selection;
1084
       this.selectedTemplate = selection;
1085
     },
1085
     },
1086
     selectAdvice(selection, row) {
1086
     selectAdvice(selection, row) {
1087
-      // this.selectedTemplate = [];
1088
-
1089
-      // console.log(selection);
1087
+     
1088
+     console.log("row",row)
1090
 
1089
 
1091
       var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id]
1090
       var adviceArray = this.adviceTemplateMaps[this.selectedTemp.id]
1092
         .DoctorAdviceTemplate;
1091
         .DoctorAdviceTemplate;
1476
       this.templateFormVisible = true;
1475
       this.templateFormVisible = true;
1477
     },
1476
     },
1478
     selectGroupAdvice(row) {
1477
     selectGroupAdvice(row) {
1478
+      console.log("row-----",row)
1479
       this.groupSelectRow = row;
1479
       this.groupSelectRow = row;
1480
     },
1480
     },
1481
     groupClassName({ row, rowIndex }) {
1481
     groupClassName({ row, rowIndex }) {
1508
       this.adminusername = xtuser.user.user_name;
1508
       this.adminusername = xtuser.user.user_name;
1509
     },
1509
     },
1510
     selectAllTemplateAdvice(selection) {
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
       for (let y = 0; y < adviceArray.length; y++) {
1513
       for (let y = 0; y < adviceArray.length; y++) {
1514
         adviceArray[y].selection = false;
1514
         adviceArray[y].selection = false;
1515
       }
1515
       }

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

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

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

13
                 <el-form-item class="width50" label="开嘱时间 : " prop="name">
13
                 <el-form-item class="width50" label="开嘱时间 : " prop="name">
14
                     张三
14
                     张三
15
                 </el-form-item>
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
                     <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="textarea"></el-input>
17
                     <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="textarea"></el-input>
18
                 </el-form-item>
18
                 </el-form-item>
19
                 <el-form-item class="width50" label="药品规格 : " prop="name">
19
                 <el-form-item class="width50" label="药品规格 : " prop="name">

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

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

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

26
                 value-format="yyyy-MM-dd"
26
                 value-format="yyyy-MM-dd"
27
                 @change="changeStartime"
27
                 @change="changeStartime"
28
                 ></el-date-picker>
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
                  <el-autocomplete
29
                  <el-autocomplete
40
                   style="margin:16px 5px"
30
                   style="margin:16px 5px"
41
                   popper-class="my-autocomplete"
31
                   popper-class="my-autocomplete"
146
 import warehousing from "./components/warehousing"
136
 import warehousing from "./components/warehousing"
147
 import warehouseOut from "./components/warehouseOut"
137
 import warehouseOut from "./components/warehouseOut"
148
 const moment = require('moment')
138
 const moment = require('moment')
139
+import { PostSearch } from '@/api/patient'
149
 import { getCurrentPatient,saveRadio,getStockList,DeleteDrugNameById,getDrugSet } from "@/api/drug/drug"
140
 import { getCurrentPatient,saveRadio,getStockList,DeleteDrugNameById,getDrugSet } from "@/api/drug/drug"
150
 export default {
141
 export default {
151
     components:{
142
     components:{
358
             key = keyword
349
             key = keyword
359
           }
350
           }
360
           let searchArray = []
351
           let searchArray = []
361
-          getCurrentPatient(key).then(response => {
352
+          PostSearch(key).then(response => {
362
             if (response.data.state == 1) {
353
             if (response.data.state == 1) {
363
               searchArray = response.data.data.patient
354
               searchArray = response.data.data.patient
355
+              console.log("searchArray",searchArray)
356
+           
364
               cb(searchArray)
357
               cb(searchArray)
365
             }
358
             }
366
           })
359
           })
367
           return searchArray
360
           return searchArray
368
         },
361
         },
369
         handleSelect(val){
362
         handleSelect(val){
370
-          console.log("val",val.id)
371
-          console.log("2222",this.tablePatient)
363
+          console.log("val",val)
372
           this.search_input = val.name
364
           this.search_input = val.name
373
           for(let i=0;i<this.tablePatient.length;i++){
365
           for(let i=0;i<this.tablePatient.length;i++){
374
              if(this.tablePatient[i].id == val.id){
366
              if(this.tablePatient[i].id == val.id){
375
-               console.log("建立")
376
                this.$refs.monthlyPlanTable.setCurrentRow(this.tablePatient[i])
367
                this.$refs.monthlyPlanTable.setCurrentRow(this.tablePatient[i])
377
              }
368
              }
378
           }
369
           }

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

83
                 <el-table-column align="center" prop="name" label="规格名称">
83
                 <el-table-column align="center" prop="name" label="规格名称">
84
                     <template slot-scope="scope">{{ scope.row.drug_spec }}</template>
84
                     <template slot-scope="scope">{{ scope.row.drug_spec }}</template>
85
                 </el-table-column>
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
                     <template slot-scope="scope">{{ scope.row.min_unit }}</template>
87
                     <template slot-scope="scope">{{ scope.row.min_unit }}</template>
88
-                </el-table-column>
88
+                </el-table-column> -->
89
                 <el-table-column align="center" prop="name" label="自备量" width="80">
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
                 </el-table-column>
91
                 </el-table-column>
92
                 <el-table-column align="center" prop="name" label="已使用" width="80">
92
                 <el-table-column align="center" prop="name" label="已使用" width="80">
93
                     <template slot-scope="scope">{{ scope.row.Count }}</template>
93
                     <template slot-scope="scope">{{ scope.row.Count }}</template>
94
                 </el-table-column>
94
                 </el-table-column>
95
                 <el-table-column align="center" prop="name" label="剩余" width="80">
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
                 </el-table-column>
97
                 </el-table-column>
98
             </el-table>
98
             </el-table>
99
         </div>
99
         </div>
121
             search_input:"",
121
             search_input:"",
122
             options:[],
122
             options:[],
123
             value:"",
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
             drug_spec:"",
129
             drug_spec:"",
130
             drugName:[],
130
             drugName:[],
131
             rulleName:[]
131
             rulleName:[]
137
         },
137
         },
138
         exportList(){
138
         exportList(){
139
          import('@/vendor/Export2Excel').then(excel => {
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
          for(let i=0;i<this.tableData.length;i++){
142
          for(let i=0;i<this.tableData.length;i++){
143
             this.tableData[i].margin = this.tableData[i].Total - this.tableData[i].Count
143
             this.tableData[i].margin = this.tableData[i].Total - this.tableData[i].Count
144
          }
144
          }
258
               }
258
               }
259
               var outStockList =  response.data.data.outStockList
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
                                     <td width="80">姓名</td>
26
                                     <td width="80">姓名</td>
27
                                     <td>药品名称</td>
27
                                     <td>药品名称</td>
28
                                     <td>规格名称</td>
28
                                     <td>规格名称</td>
29
-                                    <td width="70">单位</td>
29
+                                    <!-- <td width="70">单位</td> -->
30
                                     <td width="70">自备量</td>
30
                                     <td width="70">自备量</td>
31
                                     <td width="70">已使用</td>
31
                                     <td width="70">已使用</td>
32
                                     <td width="70">剩余</td>
32
                                     <td width="70">剩余</td>
39
                                     <td>{{item.name}}</td>
39
                                     <td>{{item.name}}</td>
40
                                     <td>{{item.drug_name}}</td>
40
                                     <td>{{item.drug_name}}</td>
41
                                     <td>{{item.drug_spec}}</td>
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
                                     <td>{{item.Count}}</td>
44
                                     <td>{{item.Count}}</td>
45
-                                    <td>{{item.store_number - item.Count}}</td>
45
+                                    <td>{{item.Total?item.Total:0 - item.Count}}</td>
46
                                 </tr>
46
                                 </tr>
47
                             </tbody>
47
                             </tbody>
48
                         </table>
48
                         </table>
97
             drug_spec:this.drug_spec,
97
             drug_spec:this.drug_spec,
98
             search_input:this.keyword
98
             search_input:this.keyword
99
           }
99
           }
100
+        console.log("params------",params)
100
         getAllPatientStockList(params).then(response=>{
101
         getAllPatientStockList(params).then(response=>{
101
             if(response.data.state == 1){
102
             if(response.data.state == 1){
102
               var stocklist = response.data.data.stocklist
103
               var stocklist = response.data.data.stocklist
105
                  stocklist[i].Count = 0
106
                  stocklist[i].Count = 0
106
               }
107
               }
107
               var outStockList =  response.data.data.outStockList
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
             break
155
             break
156
         }
156
         }
157
         return sex
157
         return sex
158
-      }, querySearchAsync(keyword, cb) {
158
+      },
159
+       querySearchAsync(keyword, cb) {
159
         let key = ''
160
         let key = ''
160
         if (keyword != undefined) {
161
         if (keyword != undefined) {
161
           key = keyword
162
           key = keyword
170
             cb([])
171
             cb([])
171
           }
172
           }
172
         })
173
         })
173
-      }, handleSelect(val) {
174
+      },
175
+       handleSelect(val) {
174
         this.$router.push('/patients/patient/' + val.id)
176
         this.$router.push('/patients/patient/' + val.id)
175
       }
177
       }
176
 
178
 

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

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