XMLWAN 3 vuotta sitten
vanhempi
commit
8bf01c1085

+ 16 - 0
src/api/drug/drug_stock.js Näytä tiedosto

@@ -469,3 +469,19 @@ export function getStockOutList(params) {
469 469
     params: params
470 470
   })
471 471
 }
472
+
473
+export function getDrugCountList(params) {
474
+  return request({
475
+    url: '/api/drug/getdrugcountlist',
476
+    method: 'get',
477
+    params: params
478
+  })
479
+}
480
+
481
+export function getSinleOrderDetail(params) {
482
+  return request({
483
+    url: '/api/drug/getsingleorderdetail',
484
+    method: 'get',
485
+    params: params
486
+  })
487
+}

+ 34 - 34
src/router/modules/selfPreparedMedicine.js Näytä tiedosto

@@ -21,30 +21,30 @@ export default {
21 21
     },
22 22
 
23 23
     {
24
-        path: '/stock/selfPreparedMedicineIndex',
25
-        component: () => import('@/xt_pages/stock/selfPreparedMedicine/index'),
26
-        name: 'selfPreparedMedicineIndex',
27
-        meta: { title: 'selfPreparedMedicineIndex', noCache: true }
24
+      path: '/stock/selfPreparedMedicineIndex',
25
+      component: () => import('@/xt_pages/stock/selfPreparedMedicine/index'),
26
+      name: 'selfPreparedMedicineIndex',
27
+      meta: { title: 'selfPreparedMedicineIndex', noCache: true }
28 28
     },
29 29
     {
30
-        path: '/stock/selfPreparedMedicineQuery',
31
-        component: () => import('@/xt_pages/stock/selfPreparedMedicine/query'),
32
-        name: 'selfPreparedMedicineQuery',
33
-        meta: { title: 'selfPreparedMedicineQuery', noCache: true }
30
+      path: '/stock/selfPreparedMedicineQuery',
31
+      component: () => import('@/xt_pages/stock/selfPreparedMedicine/query'),
32
+      name: 'selfPreparedMedicineQuery',
33
+      meta: { title: 'selfPreparedMedicineQuery', noCache: true }
34 34
     },
35 35
     {
36
-        path: '/stock/selfPreparedMedicineQueryPrint',
37
-        component: () => import('@/xt_pages/stock/selfPreparedMedicine/queryPrint'),
38
-        name: 'selfPreparedMedicineQueryPrint',
39
-        hidden: true,
40
-        is_menu: false,
41
-        meta: { title: 'selfPreparedMedicineQueryPrint', noCache: true }
36
+      path: '/stock/selfPreparedMedicineQueryPrint',
37
+      component: () => import('@/xt_pages/stock/selfPreparedMedicine/queryPrint'),
38
+      name: 'selfPreparedMedicineQueryPrint',
39
+      hidden: true,
40
+      is_menu: false,
41
+      meta: { title: 'selfPreparedMedicineQueryPrint', noCache: true }
42 42
     },
43 43
     {
44
-        path: '/stock/selfPreparedMedicineInfo',
45
-        component: () => import('@/xt_pages/stock/selfPreparedMedicine/info'),
46
-        name: 'selfPreparedMedicineInfo',
47
-        meta: { title: 'selfPreparedMedicineInfo', noCache: true }
44
+      path: '/stock/selfPreparedMedicineInfo',
45
+      component: () => import('@/xt_pages/stock/selfPreparedMedicine/info'),
46
+      name: 'selfPreparedMedicineInfo',
47
+      meta: { title: 'selfPreparedMedicineInfo', noCache: true }
48 48
     },
49 49
     {
50 50
       path: '/stock/stockprint',
@@ -53,40 +53,40 @@ export default {
53 53
       hidden: true,
54 54
       is_menu: false,
55 55
       meta: { title: 'stockprint', noCache: true }
56
-     },
57
-     {
58
-       path:"/stock/selfstockprint",
59
-       component:()=>import('@/xt_pages/stock/selfStockPrint'),
60
-       name:'selfStockQuery',
61
-       hidden:true,
62
-       is_menu:false,
63
-       meta:{title:'selfStockPrint',noCache:true}
64
-     },
56
+    },
57
+    {
58
+      path: '/stock/selfstockprint',
59
+      component: () => import('@/xt_pages/stock/selfStockPrint'),
60
+      name: 'selfStockQuery',
61
+      hidden: true,
62
+      is_menu: false,
63
+      meta: { title: 'selfStockPrint', noCache: true }
64
+    },
65 65
 
66
-     {
66
+    {
67 67
       path: '/stock/stockprint',
68 68
       component: () => import('@/xt_pages/stock/stockPrint'),
69 69
       name: 'stockqueryprint',
70 70
       hidden: true,
71 71
       is_menu: false,
72 72
       meta: { title: 'stockprint', noCache: true }
73
-     },
73
+    },
74 74
 
75
-     {
75
+    {
76 76
       path: '/stock/in/detail/print',
77 77
       component: () => import('@/xt_pages/stock/stockInOrderDetailPrint'),
78 78
       name: 'stockInDetailPrint',
79 79
       hidden: true,
80 80
       is_menu: false,
81
-      meta: { title: 'stockInDetailPrint',noCache: true }
81
+      meta: { title: 'stockInDetailPrint', noCache: true }
82 82
     },
83 83
     {
84
-      path: '/stock/out/detail',
84
+      path: '/stock/out/detail/print',
85 85
       component: () => import('@/xt_pages/stock/stockOutOrderDetailPrint'),
86 86
       name: 'stockOutDetailPrint',
87 87
       hidden: true,
88 88
       is_menu: false,
89
-      meta: { title: 'stockOutDetailPrint',noCache: true }
90
-    },
89
+      meta: { title: 'stockOutDetailPrint', noCache: true }
90
+    }
91 91
   ]
92 92
 }

+ 9 - 9
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue Näytä tiedosto

@@ -64,16 +64,16 @@
64 64
 
65 65
                         </el-button>
66 66
 
67
-                        <!--<el-button-->
68
-                                <!--size="small" @click="sz_open(8)" type="primary"-->
69
-                        <!--&gt;预结算-->
70
-                        <!--</el-button>-->
67
+                        <el-button
68
+                                size="small" @click="sz_open(8)" type="primary"
69
+                        >预结算
70
+                        </el-button>
71 71
 
72
-                        <!--<el-button-->
73
-                                <!--v-if="this.order.order_status == 1"-->
74
-                                <!--size="small" @click="sz_open(7)" type="primary"-->
75
-                        <!--&gt;撤销明细-->
76
-                        <!--</el-button>-->
72
+                        <el-button
73
+                                v-if="this.order.order_status == 1"
74
+                                size="small" @click="sz_open(7)" type="primary"
75
+                        >撤销明细
76
+                        </el-button>
77 77
 
78 78
                         <el-button
79 79
                                 v-if="(this.hisPatientInfo.id > 0 && this.order.id == 0) || this.order.order_status == 1"

+ 89 - 15
src/xt_pages/stock/drugs/drugStockFlow.vue Näytä tiedosto

@@ -62,8 +62,8 @@
62 62
         </el-table-column>
63 63
         <el-table-column prop="drug_type" label="出入库方式" width="180">
64 64
            <template slot-scope="scope">
65
-             <span v-if="scope.row.drug_way == 4">入库</span>
66
-             <span v-if="scope.row.drug_way == 2">出库</span>
65
+             <span v-if="scope.row.drug_way == 4">手动入库</span>
66
+             <span v-if="scope.row.drug_way == 2">手动出库</span>
67 67
            </template>
68 68
         </el-table-column>
69 69
         <el-table-column prop="drug_name" label="出/入库单据编码">
@@ -84,10 +84,12 @@
84 84
              <span v-if="scope.row.drug_way == 2">{{scope.row.warehousing_order}}</span>
85 85
            </template>
86 86
         </el-table-column>
87
-         <el-table-column prop="drug_name" label="库存剩余量">
87
+         <el-table-column prop="drug_name" label="剩余库存量">
88 88
            <template slot-scope="scope">
89
-             <span v-if="scope.row.drug_way == 4"> {{scope.row.stock_max_numbe}}{{scope.row.max_unit}}{{scope.row.stock_min_number}}{{scope.row.min_unit}}</span>
90
-             <span v-if="scope.row.drug_way == 2">{{scope.row.count}}</span>
89
+             <!-- <span v-if="scope.row.drug_way == 4"> {{scope.row.stock_max_numbe}}{{scope.row.max_unit}}{{scope.row.stock_min_number}}{{scope.row.min_unit}}</span>
90
+             <span v-if="scope.row.drug_way == 2">{{scope.row.count}}</span> -->
91
+              {{getInCount(scope.row.drug_id) - getOutCount(scope.row.drug_id) - getAutoCount(scope.row.drug_id)}}
92
+             <span></span>
91 93
            </template>
92 94
         </el-table-column>
93 95
         <el-table-column prop="drug_name" label="进/出货单价">
@@ -140,7 +142,7 @@
140 142
 <script>
141 143
   import { uParseTime } from '@/utils/tools'
142 144
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
143
-  import { getDrugStockFlow,getOutDrugStockFlow } from '@/api/drug/drug_stock'
145
+  import { getDrugStockFlow,getOutDrugStockFlow,getDrugCountList } from '@/api/drug/drug_stock'
144 146
   import SettingDialog from './settingDialog/index'
145 147
   import { getDictionaryDataConfig } from "@/utils/data";
146 148
   export default {
@@ -151,6 +153,7 @@
151 153
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
152 154
       this.getlist()
153 155
       this.getOutList()
156
+      this.getDrugCountList()
154 157
     },
155 158
     components: {
156 159
       SettingDialog,
@@ -193,10 +196,13 @@
193 196
           {id:0,name:"全部"},
194 197
           {id:1,name:"手动出库"},
195 198
           {id:2,name:"自动出库"},
196
-          {id:3,name:"入库"},
199
+          {id:3,name:"手动入库"},
197 200
 
198 201
         ],
199 202
         outList:[],
203
+        countList:[],
204
+        outCountList:[],
205
+        autoCountList:[],
200 206
       }
201 207
     },
202 208
     methods:{
@@ -244,20 +250,17 @@
244 250
                   outList[i].drug_way = 2
245 251
                   this.tableList.push(outList[i])
246 252
                }
247
-              // for(let i=0;i<this.tableList.length;i++){
248
-              //   this.tableList[i].index = i+1
249
-              // }
250 253
               console.log("列表数据",this.tableList)
251 254
             }
252 255
          })
253 256
        },
254 257
        handleSizeChange(val) {
255 258
         this.limit = val
256
-        this.GetAllDrugStockQueryList()
259
+        this.getlist()
257 260
       },
258 261
       handleCurrentChange(val) {
259 262
         this.page = val
260
-        this.GetAllDrugStockQueryList()
263
+        this.getlist()
261 264
       },
262 265
         
263 266
     startTimeChange: function(val) {
@@ -267,7 +270,7 @@
267 270
         this.$message.error("开始时间不能大于结束时间");
268 271
         this.start_time = "";
269 272
       } else {
270
-        this.GetAllDrugStockQueryList();
273
+        this.getlist();
271 274
       }
272 275
     },
273 276
     endTimeChange: function(val) {
@@ -276,10 +279,9 @@
276 279
         this.$message.error("结束时间不能小于开始时间");
277 280
         this.end_time = "";
278 281
       } else {
279
-        this.GetAllDrugStockQueryList();
282
+        this.getlist();
280 283
       }
281 284
      },
282
-     changeDrug(){},
283 285
      getManufacturer(id){
284 286
        var name = ""
285 287
        for(let i=0;i<this.manufacturerList.length;i++){
@@ -299,6 +301,78 @@
299 301
         return uParseTime(val, '{y}-{m}-{d}')
300 302
       }
301 303
      },
304
+    getDrugCountList(){
305
+         var params = {
306
+          keyword: this.keywords,
307
+          start_time:this.start_time,
308
+          end_time:this.end_time,
309
+         }
310
+      getDrugCountList(params).then(response=>{
311
+          if(response.data.state == 1){
312
+            var countlist =  response.data.data.countList
313
+            console.log("入库数据",countlist)
314
+            this.countList = countlist
315
+            var outcountlist = response.data.data.outCountList
316
+            console.log("出库数据",outcountlist)
317
+            this.outCountList = this.outCountList
318
+            var aucountlist = response.data.data.auCountList
319
+            console.log("自动数据",aucountlist)
320
+            this.autoCountList = aucountlist
321
+          }
322
+        })
323
+      },
324
+      getInCount(id){
325
+        var count = ""
326
+        for(let i=0;i<this.countList.length;i++){
327
+           if(id == this.countList[i].drug_id){
328
+             count = this.countList[i].count
329
+           }
330
+        }
331
+        return count
332
+      },
333
+
334
+      getOutCount(id){
335
+        var count = ""
336
+        for(let i=0;i<this.outCountList.length;i++){
337
+           if(id == this.outCountList[i].drug_id){
338
+               count = this.outCountList[i].count
339
+           }
340
+        }
341
+        return count
342
+      },
343
+      getAutoCount(id){
344
+        var count= ""
345
+        for(let i=0;i<this.autoCountList.length;i++){
346
+          if(id == this.autoCountList[i].drug_id){
347
+            count = this.autoCountList[i].count
348
+          }
349
+        }
350
+        return count
351
+      },
352
+      getTimestamp(time) { // 把时间日期转成时间戳
353
+        return (new Date(time)).getTime() / 1000
354
+      },
355
+      changeDrug(val){
356
+        
357
+        var arr = []
358
+        if(val == 3){
359
+          for(let i=0;i<this.tableList.length;i++){
360
+            if(this.tableList[i].drug_way == 4){
361
+
362
+              arr.push(this.tableList[i])
363
+            }
364
+          }
365
+          this.tableList = arr
366
+        }
367
+        if(val == 1){
368
+          for(let i=0;i<this.tableList.length;i++){
369
+            if(this.tableList[i].drug_way == 2){
370
+              arr.push(this.tableList[i])
371
+            }
372
+          }
373
+          this.tableList = arr
374
+        }
375
+      }
302 376
     }
303 377
   }
304 378
 </script>

+ 1 - 1
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue Näytä tiedosto

@@ -98,7 +98,7 @@
98 98
               <span>药品类型</span>
99 99
             </template>
100 100
              <template slot-scope="scope">
101
-               <el-select v-model="scope.row.drug_type" filterable placeholder="请输入药品类型">
101
+               <el-select v-model="scope.row.drug_type" filterable placeholder="请选择药品类型">
102 102
                 <el-option
103 103
                   v-for="(option, index) in drugTypeList"
104 104
                   :key="index"

+ 23 - 6
src/xt_pages/stock/drugs/drugStockOutOrder.vue Näytä tiedosto

@@ -214,17 +214,17 @@
214 214
 
215 215
         <el-table-column label="药品名称" align="center">
216 216
           <template slot-scope="scope">
217
-             {{scope.row.drug.drug_name}}
217
+             {{scope.row.drug_name}}
218 218
           </template>
219 219
         </el-table-column>
220 220
         <el-table-column label="药品类型" align="center">
221 221
           <template slot-scope="scope">
222
-              {{getDrugType(scope.row.drug.drug_type)}}
222
+              {{getDrugType(scope.row.drug_type)}}
223 223
           </template>
224 224
         </el-table-column>
225 225
          <el-table-column label="规格&单位" align="center">
226 226
           <template slot-scope="scope">
227
-             {{scope.row.drug.dose}}&nbsp;{{scope.row.drug.dose_unit}}*{{scope.row.drug.min_number}}{{scope.row.drug.min_unit}}/{{scope.row.drug.max_unit}}
227
+             {{scope.row.dose}}&nbsp;{{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
228 228
           </template>
229 229
         </el-table-column>
230 230
        
@@ -256,7 +256,7 @@
256 256
 
257 257
        <el-table-column label="生产厂家" align="center">
258 258
           <template slot-scope="scope">
259
-             {{getManufacturerName(scope.row.drug.manufacturer)}}
259
+             {{getManufacturerName(scope.row.manufacturer)}}
260 260
           </template>
261 261
         </el-table-column>
262 262
 
@@ -455,7 +455,8 @@ import {
455 455
   getDrugWarehouseOutList,
456 456
   getDrugWarehouseOutInfo,
457 457
   getDrugWarehouseOutUser,
458
-  getDrugAutoMaticList
458
+  getDrugAutoMaticList,
459
+  getSinleOrderDetail
459 460
 } from "@/api/drug/drug_stock";
460 461
 import BreadCrumb from "../../components/bread-crumb";
461 462
 import { getInitializtion } from '@/api/stock'
@@ -681,10 +682,12 @@ export default {
681 682
     //   this.dialogVisible = true
682 683
     // },
683 684
     handleSearch(val){
685
+       console.log("val2222222222",val)
684 686
        this.getInitializtion()
685
-       this.GetOrderDetail(val.id)
687
+       this.getSinleOrderDetail(val.id)
686 688
        this.list = []
687 689
        this.getDrugAutoMaticList(val.id,val.time,val.warehouse_out_order_number)
690
+
688 691
     },
689 692
     GetOrderDetail(order_id) {
690 693
         const params = {
@@ -959,6 +962,20 @@ export default {
959 962
        }
960 963
      }
961 964
      return name
965
+   },
966
+   getSinleOrderDetail(id){
967
+       var params = {
968
+         id:id,
969
+       }
970
+     getSinleOrderDetail(params).then(response=>{
971
+        if(response.data.state == 1){
972
+          this.tableShow = true
973
+          this.tableList = []
974
+          var list =  response.data.data.list
975
+          console.log("list",list)
976
+          this.tableList = list
977
+        }
978
+     })
962 979
    }
963 980
   }
964 981
 };

+ 13 - 10
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue Näytä tiedosto

@@ -155,7 +155,7 @@
155 155
               </el-form-item>
156 156
             </template>
157 157
           </el-table-column>
158
-          <el-table-column align="center" width="150">
158
+          <!-- <el-table-column align="center" width="150">
159 159
             <template slot="header" slot-scope="scope" >
160 160
                   <span>批号</span>
161 161
               </template>
@@ -167,7 +167,7 @@
167 167
                     ></el-input>
168 168
                   </el-form-item>
169 169
               </template>
170
-          </el-table-column>
170
+          </el-table-column> -->
171 171
           <el-table-column width="120" align="center">
172 172
             <template slot="header" slot-scope="scope">
173 173
               <span>出库数量<span style="color: red">*</span></span>
@@ -256,7 +256,7 @@
256 256
               ></el-date-picker>
257 257
             </template>
258 258
           </el-table-column>
259
-        
259
+<!--         
260 260
         <el-table-column align="center" width="150" label="批准文号">
261 261
             <template slot-scope="scope">
262 262
               <el-form-item style="padding-top: 20px">
@@ -266,7 +266,7 @@
266 266
                 ></el-input>
267 267
               </el-form-item>
268 268
             </template>
269
-          </el-table-column>
269
+          </el-table-column> -->
270 270
 
271 271
           <el-table-column label="备注" width="120" align="center">
272 272
             <template slot-scope="scope">
@@ -505,6 +505,9 @@ export default {
505 505
       tempObj["retail_price"] = "";
506 506
       tempObj["remark"] = "";
507 507
       tempObj["min_unit"] = "";
508
+      tempObj['dose'] = ""
509
+      tempObj['dose_unit'] = ""
510
+      tempObj["min_number"] = ""
508 511
       this.recordInfo.recordData.push(tempObj);
509 512
     },
510 513
     handleDelete: function(index, row) {
@@ -613,7 +616,7 @@ export default {
613 616
             stockOut: this.recordInfo.recordData
614 617
           };
615 618
           console.log("params222222",params)
616
-      
619
+          
617 620
           postDrugWarehouseOut(
618 621
             params,
619 622
             this.warehouse_out_time,
@@ -689,7 +692,7 @@ export default {
689 692
             this.recordInfo.recordData[i].max_unit = val.max_unit
690 693
             this.recordInfo.recordData[i].min_number = val.min_number
691 694
             this.recordInfo.recordData[i].min_unit = val.min_unit
692
-            this.recordInfo.recordData[i].packing_unit = val.packing_unit
695
+         
693 696
             this.recordInfo.recordData[i].number = val.number
694 697
             this.recordInfo.recordData[i].last_price = val.last_price
695 698
             this.recordInfo.recordData[i].manufacturer = val.manufacturer
@@ -775,18 +778,18 @@ export default {
775 778
       (nowDay < 10 ? "0" + nowDay : nowDay);
776 779
     const tempObj = {};
777 780
     tempObj["drug_id"] = 0;
778
-    tempObj['dosage'] = ''
779 781
     tempObj['max_unit'] = ''
780
-    tempObj['unval'] = ''
781 782
     tempObj['min_unit'] = '',
782
-    tempObj['packing_unit'] = '',
783 783
     tempObj["return_count"] = 0;
784 784
     tempObj["price"] = "";
785 785
     tempObj["remark"] = "";
786
-    tempObj["min_unit"] = "";
787 786
     tempObj['manufacturer'] = ''
788 787
     tempObj['batch_number'] = ''
789 788
     tempObj['drug_type'] = ''
789
+    tempObj['dose'] = ""
790
+    tempObj['dose_unit'] = ""
791
+    tempObj["min_number"] = ""
792
+    
790 793
     this.recordInfo.recordData.push(tempObj);
791 794
     this.GetConfigInfo();
792 795
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 7 - 6
src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue Näytä tiedosto

@@ -78,7 +78,7 @@
78 78
                   max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
79 79
         >
80 80
 
81
-          <el-table-column align="center" width="200">
81
+          <el-table-column align="center" width="150px">
82 82
             <template slot="header" slot-scope="scope">
83 83
               <span>药品名称<span style="color: red">*</span></span>
84 84
             </template>
@@ -133,7 +133,7 @@
133 133
               </el-form-item>
134 134
             </template>
135 135
           </el-table-column>
136
-         <el-table-column align="center" width="150">
136
+         <!-- <el-table-column align="center" width="150">
137 137
             <template slot="header" slot-scope="scope" >
138 138
                   <span>批号</span>
139 139
               </template>
@@ -145,7 +145,7 @@
145 145
                     ></el-input>
146 146
                   </el-form-item>
147 147
               </template>
148
-          </el-table-column>
148
+          </el-table-column> -->
149 149
            <el-table-column width="120" align="center">
150 150
             <template slot="header" slot-scope="scope">
151 151
               <span>出库数量<span style="color: red">*</span></span>
@@ -230,7 +230,7 @@
230 230
               ></el-date-picker>
231 231
             </template>
232 232
           </el-table-column>
233
-           <el-table-column align="center" width="150" label="批准文号">
233
+           <!-- <el-table-column align="center" width="150" label="批准文号">
234 234
             <template slot-scope="scope">
235 235
               <el-form-item style="padding-top: 20px">
236 236
                 <el-input
@@ -239,7 +239,7 @@
239 239
                 ></el-input>
240 240
               </el-form-item>
241 241
             </template>
242
-          </el-table-column>
242
+          </el-table-column> -->
243 243
 
244 244
           <el-table-column label="备注" width="120" align="center">
245 245
             <template slot-scope="scope">
@@ -247,7 +247,7 @@
247 247
             </template>
248 248
           </el-table-column>
249 249
 
250
-          <el-table-column label="操作" align="center" min-width="20">
250
+          <el-table-column label="操作" align="center" width="150" fixed="right">
251 251
             <template slot-scope="scope">
252 252
               <el-tooltip class="item" effect="dark" content="新增" placement="top">
253 253
 
@@ -548,6 +548,7 @@
548 548
             const params = {
549 549
               'stockOut': this.recordInfo.recordData
550 550
             }
551
+            console.log("params----",params)
551 552
             editDrugWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
552 553
               if (response.data.state == 0) {
553 554
                 this.$message.error(response.data.msg)

+ 67 - 10
src/xt_pages/stock/drugs/query.vue Näytä tiedosto

@@ -68,7 +68,7 @@
68 68
             style="width: 200px;"
69 69
             class="filter-item"
70 70
             v-model.trim="keywords"
71
-            placeholder="商品名称/规格名称"
71
+            placeholder="药品名称"
72 72
           />
73 73
           <el-button
74 74
             size="small"
@@ -111,14 +111,19 @@
111 111
              {{getManufacturerList(scope.row.manufacturer)}}
112 112
            </template>
113 113
         </el-table-column>
114
+        <el-table-column prop="drug_name" label="入库数量" align="center">
115
+           <template slot-scope="scope">
116
+              {{getInCount(scope.row.drug_id)}}
117
+           </template>
118
+        </el-table-column>
119
+        <el-table-column prop="drug_name" label="出库数量" align="center">
120
+           <template slot-scope="scope">
121
+             {{getOutCount(scope.row.drug_id)}}
122
+           </template>
123
+        </el-table-column>
114 124
         <el-table-column prop="drug_name" label="剩余库存量" align="center">
115 125
            <template slot-scope="scope">
116
-            <span v-if="scope.row.stock_max_number!=''">
117
-              {{scope.row.stock_max_number}}{{scope.row.max_unit}}
118
-              <span v-if="scope.row.stock_min_number!=''">
119
-                {{scope.row.stock_min_number}}{{scope.row.min_unit}}
120
-              </span>
121
-            </span> 
126
+            {{getInCount(scope.row.drug_id) - getOutCount(scope.row.drug_id) - getAutoCount(scope.row.drug_id)}}
122 127
            </template>
123 128
         </el-table-column>
124 129
         <el-table-column prop="drug_name" label="操作" align="center">
@@ -163,7 +168,7 @@
163 168
 <script>
164 169
   import { uParseTime } from '@/utils/tools'
165 170
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
166
-  import { getAllDrugStockQueryList,getDrugStockList } from '@/api/drug/drug_stock'
171
+  import { getAllDrugStockQueryList,getDrugStockList,getDrugCountList } from '@/api/drug/drug_stock'
167 172
   import SettingDialog from './settingDialog/index'
168 173
   import { getDictionaryDataConfig } from "@/utils/data";
169 174
   export default {
@@ -174,6 +179,7 @@
174 179
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
175 180
   
176 181
       this.getlist()
182
+      this.getDrugCountList()
177 183
     },
178 184
     components: {
179 185
       SettingDialog,
@@ -208,7 +214,11 @@
208 214
         ],
209 215
         drugTypeList:[],
210 216
         tableList:[],
211
-        manufacturerList:[]
217
+        manufacturerList:[],
218
+        countList:[],
219
+        outCountList:[],
220
+        autoCountList:[],
221
+        keyword:"",
212 222
       }
213 223
     },
214 224
     methods: {
@@ -396,7 +406,6 @@
396 406
       showCancelStockDetailDialog: function() {
397 407
       },
398 408
       search: function() {
399
-        // this.GetAllDrugStockQueryList()
400 409
         this.getlist()
401 410
       }, 
402 411
       setting: function() {
@@ -489,6 +498,54 @@
489 498
       },
490 499
       handleBatch(id){
491 500
         this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+id})
501
+      },
502
+      getDrugCountList(){
503
+         var params = {
504
+          keyword: this.keywords,
505
+          start_time:this.start_time,
506
+          end_time:this.end_time,
507
+         }
508
+        getDrugCountList(params).then(response=>{
509
+          if(response.data.state == 1){
510
+            var countlist =  response.data.data.countList
511
+            console.log("入库数据",countlist)
512
+            this.countList = countlist
513
+            var outcountlist = response.data.data.outCountList
514
+            console.log("出库数据",outcountlist)
515
+            this.outCountList = this.outCountList
516
+            var aucountlist = response.data.data.auCountList
517
+            console.log("自动数据",aucountlist)
518
+            this.autoCountList = aucountlist
519
+          }
520
+        })
521
+      },
522
+      getInCount(id){
523
+        var count = ""
524
+        for(let i=0;i<this.countList.length;i++){
525
+           if(id == this.countList[i].drug_id){
526
+             count = this.countList[i].count
527
+           }
528
+        }
529
+        return count
530
+      },
531
+
532
+      getOutCount(id){
533
+        var count = ""
534
+        for(let i=0;i<this.outCountList.length;i++){
535
+           if(id == this.outCountList[i].drug_id){
536
+               count = this.outCountList[i].count
537
+           }
538
+        }
539
+        return count
540
+      },
541
+      getAutoCount(id){
542
+        var count= ""
543
+        for(let i=0;i<this.autoCountList.length;i++){
544
+          if(id == this.autoCountList[i].drug_id){
545
+            count = this.autoCountList[i].count
546
+          }
547
+        }
548
+        return count
492 549
       }
493 550
     }
494 551
   }

+ 15 - 4
src/xt_pages/stock/stockOutOrder.vue Näytä tiedosto

@@ -69,9 +69,8 @@
69 69
           @change="changeAllSelected"
70 70
           >全选</el-checkbox
71 71
         >
72
-        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
73
-          >删除</el-button
74
-        >
72
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete">删除</el-button>
73
+        <el-button size="small" type="primary" @click="toPrint">打印</el-button>
75 74
       </div>
76 75
 
77 76
       <el-table
@@ -817,6 +816,8 @@ export default {
817 816
       userList:[],
818 817
       editdialogVisibleTwo:false,
819 818
       editdialogVisibleThree:false,
819
+      order_id:0,
820
+      warehouse_out_time:"",
820 821
     };
821 822
   },
822 823
   methods: {
@@ -1029,6 +1030,9 @@ export default {
1029 1030
       }
1030 1031
     },
1031 1032
     select(selection) {
1033
+      console.log("selection",selection)
1034
+      this.order_id = selection[0].id
1035
+      this.warehouse_out_time = selection[0].warehouse_out_time
1032 1036
       this.selectedTableData = selection;
1033 1037
     },
1034 1038
     batchDelete() {
@@ -1551,7 +1555,14 @@ export default {
1551 1555
             }
1552 1556
          })
1553 1557
       },
1554
-    
1558
+      toPrint(){
1559
+        if(this.order_id == 0){
1560
+          this.$message.error("请选择出库单")
1561
+        }else{
1562
+            this.$router.push({path:"/stock/out/detail/print?id="+this.order_id+"&warehouse_out_time="+this.warehouse_out_time})
1563
+        }
1564
+      
1565
+      }
1555 1566
   }
1556 1567
 };
1557 1568
 </script>