Browse Source

518合并代码

XMLWAN 2 years ago
parent
commit
cbf345b1f7
2 changed files with 91 additions and 11 deletions
  1. 8 0
      src/api/his/advice.js
  2. 83 11
      src/xt_pages/stock/test.vue

+ 8 - 0
src/api/his/advice.js View File

@@ -15,3 +15,11 @@ export function getPharmacyBaseDrug(params) {
15 15
     params: params
16 16
   })
17 17
 }
18
+
19
+export function updatePharmacyBaseDrug(params) {
20
+  return request({
21
+    url: '/api/advice/updatepharmacybasedrug',
22
+    method: 'Get',
23
+    params: params
24
+  })
25
+}

+ 83 - 11
src/xt_pages/stock/test.vue View File

@@ -72,30 +72,54 @@
72 72
       </div>
73 73
       <div class="mainRight">
74 74
         <el-tabs v-model="titleType">
75
+           <el-button type="primary" @click="toSend">发药</el-button>
75 76
           <el-tab-pane label="明细" name="明细">
76
-           
77
+            
77 78
            <el-table
78 79
             :data="tableData"
79 80
             border
80 81
             style="width: 100%">
81
-            <el-table-column prop="date" label="序号" width="180">
82
+            <el-table-column prop="date" label="序号" width="180" align="center">
82 83
               <template slot-scope="scope">
83
-
84
+                 {{scope.$index + 1}}
84 85
               </template>
85 86
             </el-table-column>
86
-            <el-table-column  prop="name" label="单据编码" width="180">
87
+           
88
+            <el-table-column prop="address" label="患者姓名" align="center">
89
+               <template slot-scope="scope">
90
+                 {{getPatientName(scope.row.patient_id)}}
91
+              </template>
87 92
             </el-table-column>
88
-            <el-table-column prop="address" label="患者姓名">
93
+            <el-table-column prop="address" label="单次用量" align="center">
94
+              <template  slot-scope="scope">
95
+                 {{scope.row.single_dose}}
96
+               </template>
89 97
             </el-table-column>
90
-            <el-table-column prop="address" label="单次用量">
98
+             <el-table-column prop="address" label="用法" align="center">
99
+               <template  slot-scope="scope">
100
+                 {{scope.row.delivery_way}}
101
+               </template>
91 102
             </el-table-column>
92
-             <el-table-column prop="address" label="用法">
103
+             <el-table-column prop="address" label="频率" align="center">
104
+               <template  slot-scope="scope">
105
+                 {{scope.row.execution_frequency}}
106
+               </template>
93 107
             </el-table-column>
94
-             <el-table-column prop="address" label="频率">
108
+             <el-table-column prop="address" label="天数" align="center">
109
+                <template  slot-scope="scope">
110
+                 {{scope.row.day}}
111
+               </template>
95 112
             </el-table-column>
96
-             <el-table-column prop="address" label="天数">
113
+            <el-table-column prop="address" label="总量" align="center">
114
+               <template  slot-scope="scope">
115
+                 {{scope.row.prescribing_number}}
116
+               </template>
97 117
             </el-table-column>
98
-            <el-table-column prop="address" label="总量">
118
+            <el-table-column  prop="name" label="数据来源" width="180" align="center">
119
+                <template  slot-scope="scope">
120
+                 <span v-if="scope.row.type == 1">血透</span>
121
+                 <span v-if="scope.row.type == 2">HIS</span>
122
+               </template>
99 123
             </el-table-column>
100 124
           </el-table>
101 125
 
@@ -108,7 +132,7 @@
108 132
 </template>
109 133
 
110 134
 <script>
111
-import { getTodayAdviceList,getPharmacyBaseDrug } from "@/api/his/advice";
135
+import { getTodayAdviceList,getPharmacyBaseDrug,updatePharmacyBaseDrug } from "@/api/his/advice";
112 136
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
113 137
 const moment = require('moment')
114 138
 export default {
@@ -129,6 +153,7 @@ export default {
129 153
       keywords: "",
130 154
       start_time:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
131 155
       tableData:[],
156
+      patientList:[],
132 157
     };
133 158
   },
134 159
 
@@ -226,11 +251,58 @@ export default {
226 251
         if(response.data.state == 1){
227 252
            var advicelist = response.data.data.advicelist
228 253
            console.log("advicelist23323232323323",advicelist)
254
+           for(let i=0;i<advicelist.length;i++){
255
+             advicelist[i].type = 1
256
+             advicelist[i].day = " "
257
+             this.tableData.push(advicelist[i])
258
+           }
229 259
            var hisAdviceList = response.data.data.hisAdviceList
230 260
            console.log("hisadvicelist23233232233",hisAdviceList)
261
+           for(let i=0;i<hisAdviceList.length;i++){
262
+             hisAdviceList[i].type = 2
263
+             this.tableData.push(hisAdviceList[i])
264
+           }
231 265
            var patient = response.data.data.patient
232 266
            console.log("patient23322323232332",patient)
267
+           console.log("tabedaadddddddd",this.tableData)
268
+           this.patientList = patient
269
+        }
270
+      })
271
+    },
272
+    getPatientName(id){
273
+       var name = ""
274
+       for(let i=0;i<this.patientList.length;i++){
275
+          if(id == this.patientList[i].id){
276
+             name = this.patientList[i].name
277
+          }
278
+       }
279
+       return name
280
+    },
281
+    toSend(){
282
+      var blood_ids = []
283
+      var his_ids = []
284
+      var bloodStr = ""
285
+      var hisStr = ""
286
+      console.log("table3223233232322323",this.tableData)
287
+      for(let i=0;i<this.tableData.length;i++){
288
+        if(this.tableData[i].type == 1){
289
+          blood_ids.push(this.tableData[i].id)
290
+        }
291
+        if(this.tableData[i].type == 2){
292
+          his_ids.push(this.tableData[i].id)
233 293
         }
294
+      }
295
+
296
+      console.log("blood_ids223我",blood_ids)
297
+      console.log("his_ids22222我",his_ids)
298
+      bloodStr = blood_ids.join(",")
299
+      hisStr =  his_ids.join(",")
300
+       var params = {
301
+         bloodStr:bloodStr,
302
+         hisStr:hisStr,
303
+       }
304
+      updatePharmacyBaseDrug(params).then(response=>{
305
+
234 306
       })
235 307
     }
236 308
   },