瀏覽代碼

自备药

XMLWAN 4 年之前
父節點
當前提交
e216ba6966
共有 2 個文件被更改,包括 24 次插入4 次删除
  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 查看文件

265
       methods:"get",
265
       methods:"get",
266
       params:params
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 查看文件

137
 import warehouseOut from "./components/warehouseOut"
137
 import warehouseOut from "./components/warehouseOut"
138
 const moment = require('moment')
138
 const moment = require('moment')
139
 import { PostSearch } from '@/api/patient'
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
 export default {
141
 export default {
142
     components:{
142
     components:{
143
         BreadCrumb,
143
         BreadCrumb,
359
           })
359
           })
360
           return searchArray
360
           return searchArray
361
         },
361
         },
362
-        handleSelect(val){
363
-          console.log("val",val)
362
+        handleSelect(val){   
364
           this.search_input = val.name
363
           this.search_input = val.name
365
           for(let i=0;i<this.tablePatient.length;i++){
364
           for(let i=0;i<this.tablePatient.length;i++){
366
              if(this.tablePatient[i].id == val.id){
365
              if(this.tablePatient[i].id == val.id){
368
              }
367
              }
369
           }
368
           }
370
           this.getlist()
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
     created(){
385
     created(){
378
     watch: {
390
     watch: {
379
      tablePatient: function() {
391
      tablePatient: function() {
380
       this.$nextTick(function() {
392
       this.$nextTick(function() {
381
-         console.log("222222",this.tablePatient[0])
382
         this.$refs.monthlyPlanTable.setCurrentRow(this.tablePatient[0])
393
         this.$refs.monthlyPlanTable.setCurrentRow(this.tablePatient[0])
383
       })
394
       })
384
     }
395
     }