Browse Source

自备药

XMLWAN 4 years ago
parent
commit
e216ba6966
2 changed files with 24 additions and 4 deletions
  1. 9 0
      src/api/drug/drug.js
  2. 15 4
      src/xt_pages/stock/selfPreparedMedicine/index.vue

+ 9 - 0
src/api/drug/drug.js View File

@@ -265,4 +265,13 @@ export function DeleteDrugNameById(params){
265 265
       methods:"get",
266 266
       params:params
267 267
    })
268
+}
269
+
270
+export function getPatientDetail(id,params){
271
+   console.log("id------",id)
272
+   return request({
273
+      url:"/api/drug/getpatientdetail?id="+id,
274
+      methods:"Get",
275
+      params:params
276
+   })
268 277
 }

+ 15 - 4
src/xt_pages/stock/selfPreparedMedicine/index.vue View File

@@ -137,7 +137,7 @@ import warehousing from "./components/warehousing"
137 137
 import warehouseOut from "./components/warehouseOut"
138 138
 const moment = require('moment')
139 139
 import { PostSearch } from '@/api/patient'
140
-import { getCurrentPatient,saveRadio,getStockList,DeleteDrugNameById,getDrugSet } from "@/api/drug/drug"
140
+import { getCurrentPatient,saveRadio,getStockList,DeleteDrugNameById,getDrugSet,getPatientDetail } from "@/api/drug/drug"
141 141
 export default {
142 142
     components:{
143 143
         BreadCrumb,
@@ -359,8 +359,7 @@ export default {
359 359
           })
360 360
           return searchArray
361 361
         },
362
-        handleSelect(val){
363
-          console.log("val",val)
362
+        handleSelect(val){   
364 363
           this.search_input = val.name
365 364
           for(let i=0;i<this.tablePatient.length;i++){
366 365
              if(this.tablePatient[i].id == val.id){
@@ -368,6 +367,19 @@ export default {
368 367
              }
369 368
           }
370 369
           this.getlist()
370
+          this.getPatientDetail(val.id)
371
+        },
372
+
373
+        getPatientDetail(id){
374
+          getPatientDetail(id).then(response=>{
375
+             if(response.data.state == 1){
376
+               var patientDetail =  response.data.data.patientDetail
377
+               console.log("patientDetail",patientDetail)
378
+               var arr = []
379
+               arr.push(patientDetail)
380
+               this.tablePatient = arr
381
+             }
382
+          })
371 383
         }
372 384
     },
373 385
     created(){
@@ -378,7 +390,6 @@ export default {
378 390
     watch: {
379 391
      tablePatient: function() {
380 392
       this.$nextTick(function() {
381
-         console.log("222222",this.tablePatient[0])
382 393
         this.$refs.monthlyPlanTable.setCurrentRow(this.tablePatient[0])
383 394
       })
384 395
     }