XMLWAN 3 年前
父节点
当前提交
e67ca9f317

+ 59 - 63
src/api/drug/drug_stock.js 查看文件

@@ -1,7 +1,6 @@
1 1
 import request from '@/utils/request'
2 2
 
3 3
 export function postDrugWarehouse(params, warehousing_time, manufacturer_id, dealer_id, type) {
4
-
5 4
   return request({
6 5
     url: '/api/drugwarehouse/create?warehousing_time=' + warehousing_time + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type,
7 6
     method: 'post',
@@ -186,9 +185,9 @@ export function DeleteDrugWarehouseInfoItem(params) {
186 185
   })
187 186
 }
188 187
 
189
-export function EditDrugWarehouse(params, warehousing_time, id,type,manufacturer_id,dealer_id) {
188
+export function EditDrugWarehouse(params, warehousing_time, id, type, manufacturer_id, dealer_id) {
190 189
   return request({
191
-    url: '/api/drugwarehouse/edit?warehousing_time=' + warehousing_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
190
+    url: '/api/drugwarehouse/edit?warehousing_time=' + warehousing_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id,
192 191
     method: 'post',
193 192
     data: params
194 193
   })
@@ -234,9 +233,9 @@ export function deleteDrugSalesReturnInfo(params) {
234 233
   })
235 234
 }
236 235
 
237
-export function editDrugSalesReturnInfo(params, return_time, id,type,manufacturer_id,dealer_id) {
236
+export function editDrugSalesReturnInfo(params, return_time, id, type, manufacturer_id, dealer_id) {
238 237
   return request({
239
-    url: '/api/drugsalesreturn/edit?return_time=' + return_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
238
+    url: '/api/drugsalesreturn/edit?return_time=' + return_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id,
240 239
     method: 'post',
241 240
     data: params
242 241
   })
@@ -274,9 +273,9 @@ export function getDrugWarehouseOutInfo(params) {
274 273
   })
275 274
 }
276 275
 
277
-export function editDrugWarehouseoutInfo(params, warehouse_out_time, id,type,manufacturer_id,dealer_id) {
276
+export function editDrugWarehouseoutInfo(params, warehouse_out_time, id, type, manufacturer_id, dealer_id) {
278 277
   return request({
279
-    url: '/api/drugwarehouseout/edit?warehouse_out_time=' + warehouse_out_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
278
+    url: '/api/drugwarehouseout/edit?warehouse_out_time=' + warehouse_out_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id,
280 279
     method: 'post',
281 280
     data: params
282 281
   })
@@ -290,9 +289,9 @@ export function getDrugCancelStockList(params) {
290 289
   })
291 290
 }
292 291
 
293
-export function editDrugCancelStockInfo(params, cancel_stock_time, id,type,manufacturer_id,dealer_id) {
292
+export function editDrugCancelStockInfo(params, cancel_stock_time, id, type, manufacturer_id, dealer_id) {
294 293
   return request({
295
-    url: '/api/drugcancelstockinfo/edit?cancel_time=' + cancel_stock_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id=" + dealer_id,
294
+    url: '/api/drugcancelstockinfo/edit?cancel_time=' + cancel_stock_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id,
296 295
     method: 'post',
297 296
     data: params
298 297
   })
@@ -345,8 +344,6 @@ export function getStockDetail(params) {
345 344
   })
346 345
 }
347 346
 
348
-
349
-
350 347
 export function getPrintStockGood(params) {
351 348
   return request({
352 349
     url: '/api/print/stock',
@@ -355,8 +352,6 @@ export function getPrintStockGood(params) {
355 352
   })
356 353
 }
357 354
 
358
-
359
-
360 355
 export function getDrugWarehouseOutUser(params) {
361 356
   return request({
362 357
     url: '/api/drugwarehouseout/user',
@@ -365,96 +360,97 @@ export function getDrugWarehouseOutUser(params) {
365 360
   })
366 361
 }
367 362
 
368
-
369 363
 export function createDrugStockAutomaticReduceConfig(is_open) {
370 364
   return request({
371
-    url: '/api/drugstock/automaticreduce/isopen?is_open='+is_open,
372
-    method: 'post',
365
+    url: '/api/drugstock/automaticreduce/isopen?is_open=' + is_open,
366
+    method: 'post'
373 367
   })
374 368
 }
375 369
 
376 370
 export function getDrugStockAutomaticReduceConfig() {
377 371
   return request({
378 372
     url: '/api/drugstockautomaticreduce/get',
379
-    method: 'get',
373
+    method: 'get'
380 374
   })
381 375
 }
382 376
 
383
-
384
-export function getDrugIndetail(params){
377
+export function getDrugIndetail(params) {
385 378
   return request({
386
-    url:"/api/drugstock/getdrugindetail",
387
-    method:"Get",
388
-    params:params
379
+    url: '/api/drugstock/getdrugindetail',
380
+    method: 'Get',
381
+    params: params
389 382
   })
390 383
 }
391 384
 
392
-
393
-export function getDrugCancelOrder(params){
394
-  
395
-   return request({
396
-     url:"/api/drugstock/getdrugcancelorder",
397
-     method:"get",
398
-     params:params
399
-   })
385
+export function getDrugCancelOrder(params) {
386
+  return request({
387
+    url: '/api/drugstock/getdrugcancelorder',
388
+    method: 'get',
389
+    params: params
390
+  })
400 391
 }
401 392
 
402
-export function getDrugOutDetail(params){
403
-  
393
+export function getDrugOutDetail(params) {
404 394
   return request({
405
-    url:"/api/drugstock/getdrugoutdetail",
406
-    method:"get",
407
-    params:params
395
+    url: '/api/drugstock/getdrugoutdetail',
396
+    method: 'get',
397
+    params: params
408 398
   })
409 399
 }
410 400
 
411
-export function getDrugCancelDetail(params){
412
-
401
+export function getDrugCancelDetail(params) {
413 402
   return request({
414
-    url:"/api/drugstock/getdrugcanceldetail",
415
-    method:"Get",
416
-    params:params
403
+    url: '/api/drugstock/getdrugcanceldetail',
404
+    method: 'Get',
405
+    params: params
417 406
   })
418 407
 }
419 408
 
420
-
421
-export function getDrugAutoMaticList(params){
422
-  
409
+export function getDrugAutoMaticList(params) {
423 410
   return request({
424
-    url:"/api/drugstock/getdrugautomaticlist",
425
-    method:"Get",
426
-    params:params,
411
+    url: '/api/drugstock/getdrugautomaticlist',
412
+    method: 'Get',
413
+    params: params
427 414
   })
428 415
 }
429 416
 
430
-
431
-export function getDrugWarehouseOrderInfo(params){
432
-   
417
+export function getDrugWarehouseOrderInfo(params) {
433 418
   return request({
434
-    url:"/api/drugstock/getdrugwarehouseorderinfo",
435
-    method:"get",
436
-    params:params
419
+    url: '/api/drugstock/getdrugwarehouseorderinfo',
420
+    method: 'get',
421
+    params: params
437 422
   })
438 423
 }
439 424
 
440
-
441
-export function getDrugStockList(params){
442
-  
425
+export function getDrugStockList(params) {
443 426
   return request({
444
-    url:"/api/drugstock/drugstocklist",
445
-    method:"get",
446
-    params:params
427
+    url: '/api/drugstock/drugstocklist',
428
+    method: 'get',
429
+    params: params
447 430
   })
448 431
 }
449 432
 
433
+export function getDrugStockFlow(params) {
434
+  return request({
435
+    url: '/api/drugstock/getdrugstockflow',
436
+    method: 'Get',
437
+    params: params
438
+  })
439
+}
450 440
 
451
-export function getDrugStockFlow(params){
452
-  
441
+export function getOutDrugStockFlow(params) {
453 442
   return request({
454
-    url:"/api/drugstock/getdrugstockflow",
455
-    method:"Get",
456
-    params:params
443
+    url: '/api/drugoutstock/getoutdrugstockflow',
444
+    method: 'get',
445
+    params: params
457 446
   })
458 447
 }
459 448
 
449
+export function getBatchOrderDetail(params) {
450
+  return request({
451
+    url: '/api/drug/getbatchorderdetail',
452
+    method: 'get',
453
+    params: params
454
+  })
455
+}
460 456
 

+ 8 - 0
src/api/stock.js 查看文件

@@ -617,3 +617,11 @@ export function postSearchGoodList(keyword, params) {
617 617
     params: params
618 618
   })
619 619
 }
620
+
621
+export function getAllStockList(params) {
622
+  return request({
623
+    url: '/api/good/getallstocklist',
624
+    method: 'get',
625
+    params: params
626
+  })
627
+}

+ 58 - 17
src/xt_pages/stock/drugs/drugBatchNumber.vue 查看文件

@@ -43,39 +43,39 @@
43 43
         :data="tableList"
44 44
         border
45 45
         style="width: 100%">
46
-        <el-table-column prop="date" label="序号" width="180">
46
+        <el-table-column prop="date" label="序号" width="180" align="center">
47 47
            <template  slot-scope="scope">
48
-              
48
+              {{scope.$index + 1}}
49 49
            </template>
50 50
         </el-table-column>
51
-        <el-table-column prop="drug_type" label="入库单据编码" width="180">
51
+        <el-table-column prop="drug_type" label="入库单据编码" width="180" align="center">
52 52
            <template slot-scope="scope">
53
-           
53
+              {{scope.row.warehousing_order}}
54 54
            </template>
55 55
         </el-table-column>
56
-        <el-table-column prop="drug_name" label="操作日期">
56
+        <el-table-column prop="drug_name" label="操作日期" align="center">
57 57
            <template slot-scope="scope">
58
-            
58
+              {{getTime(scope.row.ctime)}}
59 59
            </template>
60 60
         </el-table-column>
61
-        <el-table-column prop="drug_name" label="有效期">
61
+        <el-table-column prop="drug_name" label="有效期" align="center">
62 62
            <template slot-scope="scope">
63
-          
63
+              {{getTime(scope.row.expiry_date)}}
64 64
            </template>
65 65
         </el-table-column>
66
-         <el-table-column prop="drug_name" label="批号">
66
+         <el-table-column prop="drug_name" label="批号" align="center">
67 67
            <template slot-scope="scope">
68
-           
68
+              {{scope.row.number}}
69 69
            </template>
70 70
         </el-table-column>
71
-         <el-table-column prop="drug_name" label="入库数量">
71
+         <el-table-column prop="drug_name" label="入库数量" align="center">
72 72
            <template slot-scope="scope">
73
-            
73
+              {{scope.row.stock_max_number}}{{scope.row.max_unit}}{{scope.row.stock_min_number}}{{scope.row.min_unit}}
74 74
            </template>
75 75
         </el-table-column>
76
-        <el-table-column prop="drug_name" label="进货单价">
76
+        <el-table-column prop="drug_name" label="进货单价" align="center">
77 77
            <template slot-scope="scope">
78
-            
78
+              {{scope.row.price}}
79 79
            </template>
80 80
         </el-table-column>
81 81
        </el-table>
@@ -104,7 +104,7 @@
104 104
 <script>
105 105
   import { uParseTime } from '@/utils/tools'
106 106
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
107
-  import { getAllDrugStockQueryList,getDrugStockList } from '@/api/drug/drug_stock'
107
+  import { getBatchOrderDetail } from '@/api/drug/drug_stock'
108 108
   import SettingDialog from './settingDialog/index'
109 109
   import { getDictionaryDataConfig } from "@/utils/data";
110 110
   export default {
@@ -113,7 +113,7 @@
113 113
       var drugCategory = getDictionaryDataConfig('system','drug_category')
114 114
       this.drugCategory.push(...drugCategory)
115 115
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
116
-    //   this.getlist()
116
+       this.getlist()
117 117
     },
118 118
     components: {
119 119
       SettingDialog,
@@ -153,7 +153,48 @@
153 153
       }
154 154
     },
155 155
     methods:{
156
-
156
+      getlist(){
157
+         var params = {
158
+           drug_id:this.$route.query.drug_id,
159
+           page:this.page,
160
+           limit:this.limit,
161
+         }
162
+        getBatchOrderDetail(params).then(response=>{
163
+           if(response.data.state == 1){
164
+              var detail =  response.data.data.detail
165
+              console.log("detail2343434",detail)
166
+              this.tableList = detail
167
+              var total = response.data.data.total
168
+              console.log("total",total)
169
+           }
170
+        })
171
+      },
172
+      getTime(val) {
173
+       if(val < 0){
174
+           return ""
175
+       }
176
+       if(val == ""){
177
+          return ""
178
+        }else {
179
+          return uParseTime(val, '{y}-{m}-{d}')
180
+        }
181
+     },
182
+   handleSizeChange(val) {
183
+      this.limit = val;
184
+      this.getlist();
185
+    },
186
+    handleCurrentChange(val) {
187
+      this.page = val;
188
+      this.getlist();
189
+    },
190
+    startTimeChange(val){
191
+      this.start_time = val
192
+      this.getlist()
193
+    },
194
+    endTimeChange(val){
195
+      this.end_time = val
196
+      this.getlist()
197
+    }
157 198
     }
158 199
   }
159 200
 </script>

+ 62 - 16
src/xt_pages/stock/drugs/drugStockFlow.vue 查看文件

@@ -57,52 +57,61 @@
57 57
         style="width: 100%">
58 58
         <el-table-column prop="date" label="序号" width="180">
59 59
            <template  slot-scope="scope">
60
-              
60
+              {{scope.$index + 1}}
61 61
            </template>
62 62
         </el-table-column>
63 63
         <el-table-column prop="drug_type" label="出入库方式" width="180">
64 64
            <template slot-scope="scope">
65
-           
65
+             <span v-if="scope.row.drug_way == 4">入库</span>
66
+             <span v-if="scope.row.drug_way == 2">出库</span>
66 67
            </template>
67 68
         </el-table-column>
68 69
         <el-table-column prop="drug_name" label="出/入库单据编码">
69 70
            <template slot-scope="scope">
71
+             <span v-if="scope.row.drug_way == 2"> {{scope.row.warehouse_out_order_number}}</span>
72
+             <span v-if="scope.row.drug_way == 4">{{scope.row.warehousing_order}}</span>
70 73
             
71 74
            </template>
72 75
         </el-table-column>
73 76
         <el-table-column prop="drug_name" label="操作日期">
74 77
            <template slot-scope="scope">
75
-          
78
+             {{getTime(scope.row.ctime)}}
76 79
            </template>
77 80
         </el-table-column>
78 81
          <el-table-column prop="drug_name" label="出入库数量">
79 82
            <template slot-scope="scope">
80
-           
83
+             <span v-if="scope.row.drug_way == 4"> {{scope.row.warehouse_out_order_number}}</span>
84
+             <span v-if="scope.row.drug_way == 2">{{scope.row.warehousing_order}}</span>
81 85
            </template>
82 86
         </el-table-column>
83 87
          <el-table-column prop="drug_name" label="库存剩余量">
84 88
            <template slot-scope="scope">
85
-            
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>
86 91
            </template>
87 92
         </el-table-column>
88 93
         <el-table-column prop="drug_name" label="进/出货单价">
89 94
            <template slot-scope="scope">
90
-            
95
+             <span v-if="scope.row.drug_way == 4"> {{scope.row.price}}</span>
96
+             <span v-if="scope.row.drug_way == 2">{{scope.row.price}}</span>
91 97
            </template>
92 98
         </el-table-column>
93 99
          <el-table-column prop="drug_name" label="有效期">
94 100
            <template slot-scope="scope">
95
-            
101
+             <span v-if="scope.row.drug_way == 4"> {{getTime(scope.row.expiry_date)}}</span>
102
+             <span v-if="scope.row.drug_way == 2">{{getTime(scope.row.expiry_date)}}</span>
96 103
            </template>
97 104
         </el-table-column>
98 105
         <el-table-column prop="drug_name" label="批号">
99 106
            <template slot-scope="scope">
100
-            
107
+             <span v-if="scope.row.drug_way == 2"> {{scope.row.number}}</span>
108
+             <span v-if="scope.row.drug_way == 4">{{scope.row.number}}</span>
101 109
            </template>
102 110
         </el-table-column>
103 111
         <el-table-column prop="drug_name" label="供应商">
104 112
            <template slot-scope="scope">
105
-            
113
+             <span v-if="scope.row.drug_way == 4"> {{getManufacturer(scope.row.manufacturer)}}</span>
114
+             <span v-if="scope.row.drug_way == 2">{{getManufacturer(scope.row.manufacturer)}}</span>
106 115
            </template>
107 116
         </el-table-column>
108 117
        </el-table>
@@ -131,7 +140,7 @@
131 140
 <script>
132 141
   import { uParseTime } from '@/utils/tools'
133 142
   import BreadCrumb from '@/xt_pages/components/bread-crumb'
134
-  import { getDrugStockFlow } from '@/api/drug/drug_stock'
143
+  import { getDrugStockFlow,getOutDrugStockFlow } from '@/api/drug/drug_stock'
135 144
   import SettingDialog from './settingDialog/index'
136 145
   import { getDictionaryDataConfig } from "@/utils/data";
137 146
   export default {
@@ -141,6 +150,7 @@
141 150
       this.drugCategory.push(...drugCategory)
142 151
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
143 152
       this.getlist()
153
+      this.getOutList()
144 154
     },
145 155
     components: {
146 156
       SettingDialog,
@@ -197,24 +207,50 @@
197 207
              end_time:this.end_time,
198 208
              page:this.page,
199 209
              limit:this.limit,
200
-             stock_type:this.stockType,  
210
+             stock_type:this.stock_type,  
201 211
            }
202 212
           console.log("params",params)
203 213
          getDrugStockFlow(params).then(response=>{
204 214
            if(response.data.state == 1){
205 215
             var list = response.data.data.list
206 216
             console.log("入库数据",list)
207
-            this.list = list
217
+            for(let i=0;i<list.length;i++){
218
+               list[i].drug_way = 4
219
+               this.tableList.push(list[i])
220
+            }
221
+           
208 222
             var total = response.data.data.total
209 223
             this.total = total
210 224
             var manufacturerList = response.data.data.manufacturerList
211 225
             this.manufacturerList = manufacturerList
212
-            var outList = response.data.data.outList
213
-            console.log("出库数据",outList)
214
-            this.outList = outList
226
+           
215 227
            }
216 228
          })  
217 229
        },
230
+       getOutList(){
231
+          var params = {
232
+             drug_id:this.$route.query.drug_id,
233
+             start_time:this.start_time,
234
+             end_time:this.end_time,
235
+             page:this.page,
236
+             limit:this.limit,
237
+             stock_type:this.stock_type,  
238
+           }
239
+          console.log("出库数据",params)
240
+         getOutDrugStockFlow(params).then(response=>{
241
+            if(response.data.state == 1){
242
+               var outList = response.data.data.outList
243
+               for(let i=0;i<outList.length;i++){
244
+                  outList[i].drug_way = 2
245
+                  this.tableList.push(outList[i])
246
+               }
247
+              // for(let i=0;i<this.tableList.length;i++){
248
+              //   this.tableList[i].index = i+1
249
+              // }
250
+              console.log("列表数据",this.tableList)
251
+            }
252
+         })
253
+       },
218 254
        handleSizeChange(val) {
219 255
         this.limit = val
220 256
         this.GetAllDrugStockQueryList()
@@ -252,7 +288,17 @@
252 288
          }
253 289
        }
254 290
        return name
255
-     }
291
+     },
292
+    getTime(val) {
293
+      if(val < 0){
294
+          return ""
295
+      }
296
+      if(val == ""){
297
+        return ""
298
+      }else {
299
+        return uParseTime(val, '{y}-{m}-{d}')
300
+      }
301
+     },
256 302
     }
257 303
   }
258 304
 </script>

+ 1 - 1
src/xt_pages/stock/drugs/drugStockInOrder.vue 查看文件

@@ -320,7 +320,7 @@
320 320
 
321 321
         <el-table-column label="规格&单位" align="center">
322 322
           <template slot-scope="scope">
323
-             {{scope.row.drug.dosage}}&nbsp;{{scope.row.drug.max_unit}}*{{scope.row.drug.unval}}{{scope.row.drug.min_unit}}/{{scope.row.drug.packing_unit}}
323
+             {{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}}
324 324
           </template>
325 325
         </el-table-column>
326 326
        

+ 162 - 32
src/xt_pages/stock/drugs/drugStockOutOrder.vue 查看文件

@@ -9,8 +9,7 @@
9 9
         style="float:right;"
10 10
         type="primary"
11 11
         icon="el-icon-circle-plus-outline"
12
-        >新增</el-button
13
-      >
12
+        >新增</el-button>
14 13
     </div>
15 14
     <div class="app-container">
16 15
       <div class="cell clearfix">
@@ -75,6 +74,7 @@
75 74
       </div>
76 75
 
77 76
       <el-table
77
+        @current-change="handleSearch"
78 78
         :data="warehouseOutDate"
79 79
         :class="signAndWeighBoxPatients"
80 80
         style="width: 100%"
@@ -135,7 +135,7 @@
135 135
         <el-table-column label="操作" align="center" width="240">
136 136
           <template slot-scope="scope">
137 137
            
138
-            <el-tooltip
138
+            <!-- <el-tooltip
139 139
               class="item"
140 140
               effect="dark"
141 141
               content="详情"
@@ -148,7 +148,7 @@
148 148
                 @click="handleSearch(scope.row.id,scope.row.warehouse_out_time,scope.row.warehouse_out_order_number)"
149 149
               >
150 150
               </el-button>
151
-            </el-tooltip>
151
+            </el-tooltip> -->
152 152
 
153 153
             <el-tooltip
154 154
               class="item"
@@ -195,6 +195,101 @@
195 195
       </el-pagination>
196 196
     </div>
197 197
 
198
+    <div v-show="tableShow" style="margin-bottom:10px">
199
+      <el-table
200
+        :data="tableList"
201
+        :class="signAndWeighBoxPatients"
202
+        style="width: 100%"
203
+        border
204
+        highlight-current-row
205
+        ref="multipleTable"
206
+        @selection-change="select"
207
+        :row-style="{ color: '#303133' }"
208
+        :header-cell-style="{
209
+          backgroundColor: 'rgb(245, 247, 250)',
210
+          color: '#606266'
211
+        }"
212
+      >
213
+        <el-table-column type="selection" width="55" align="center"> </el-table-column>
214
+
215
+        <el-table-column label="药品名称" align="center">
216
+          <template slot-scope="scope">
217
+             {{scope.row.drug.drug_name}}
218
+          </template>
219
+        </el-table-column>
220
+        <el-table-column label="药品类型" align="center">
221
+          <template slot-scope="scope">
222
+              {{getDrugType(scope.row.drug.drug_type)}}
223
+          </template>
224
+        </el-table-column>
225
+         <el-table-column label="规格&单位" align="center">
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}}
228
+          </template>
229
+        </el-table-column>
230
+       
231
+        <el-table-column label="批号" align="center">
232
+          <template slot-scope="scope">
233
+           {{scope.row.number}}
234
+          </template>
235
+        </el-table-column>
236
+        
237
+        <el-table-column label="出库数量" align="center">
238
+          <template slot-scope="scope">
239
+             {{scope.row.count}}
240
+          </template>
241
+        </el-table-column>
242
+
243
+       <el-table-column label="进货价" align="center">
244
+          <template slot-scope="scope">
245
+            {{scope.row.price}}
246
+          </template>
247
+        </el-table-column>
248
+
249
+      
250
+       <el-table-column label="总价" align="center">
251
+          <template slot-scope="scope">
252
+             {{scope.row.total_price}}
253
+          </template>
254
+        </el-table-column>
255
+      
256
+
257
+       <el-table-column label="生产厂家" align="center">
258
+          <template slot-scope="scope">
259
+             {{getManufacturerName(scope.row.drug.manufacturer)}}
260
+          </template>
261
+        </el-table-column>
262
+
263
+
264
+       <el-table-column label="生产日期" align="center">
265
+          <template slot-scope="scope">
266
+             {{getTime(scope.row.product_date)}}
267
+          </template>
268
+        </el-table-column>
269
+       
270
+
271
+       <el-table-column label="有效日期" align="center">
272
+          <template slot-scope="scope">
273
+             {{getTime(scope.row.expiry_date)}}
274
+          </template>
275
+        </el-table-column>
276
+
277
+        <el-table-column label="批准文号" align="center">
278
+          <template slot-scope="scope">
279
+             {{scope.row.number}}
280
+          </template>
281
+        </el-table-column>
282
+
283
+
284
+        <el-table-column label="备注" align="center">
285
+          <template slot-scope="scope">
286
+            {{scope.row.remark}}
287
+          </template>
288
+        </el-table-column>
289
+      </el-table>
290
+
291
+    </div>
292
+
198 293
 
199 294
     <el-dialog
200 295
       title="出库详细"
@@ -249,7 +344,6 @@
249 344
           </el-table-column>
250 345
           <el-table-column label="总价" min-width="20" align="center">
251 346
             <template slot-scope="scope">
252
-              <!-- {{calculate(scope.row.price*scope.row.count)}} -->
253 347
               <span v-if="drugConfig.is_open == 0 || drugConfig.is_open == 2">{{(scope.row.count * getRetailPrice(scope.row.drug_id)).toFixed(2)}}</span>
254 348
               <span v-if="drugConfig.is_open == 1">{{(getRetailPrice(scope.row.drug_id) * getDrugCount(scope.row.drug_id)).toFixed(2)}}</span>
255 349
             </template>
@@ -364,7 +458,7 @@ import {
364 458
   getDrugAutoMaticList
365 459
 } from "@/api/drug/drug_stock";
366 460
 import BreadCrumb from "../../components/bread-crumb";
367
-
461
+import { getInitializtion } from '@/api/stock'
368 462
 export default {
369 463
   name: "salesReturnOrder",
370 464
   components: { BreadCrumb },
@@ -389,20 +483,6 @@ export default {
389 483
       (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
390 484
       "-" +
391 485
       (nowDay < 10 ? "0" + nowDay : nowDay);
392
-    //    var date1 = new Date();
393
-    // var date2 = new Date(date1);
394
-
395
-    // //-30为30天前,+30可以获得30天后的日期
396
-    // date2.setDate(date1.getDate() - 30);
397
-
398
-    // //30天前(月份判断是否小于10,小于10的前面+0)
399
-    // var agoDay = `${date2.getFullYear()}-${date2.getMonth() + 1<10?`0${date2.getMonth() + 1}`:date2.getMonth() + 1}-${date2.getDate()}`;
400
-      
401
-    // //当前日期
402
-    // var nowDay = `${date1.getFullYear()}-${date1.getMonth() + 1<10?`0${date1.getMonth() + 1}`:date1.getMonth() + 1}-${date1.getDate()}`;
403
-
404
-    //  this.start_time = agoDay
405
-    //  console.log("333333332222",this.start_time)
406 486
     this.GetWarehouseOut();
407 487
     this.GetConfigInfo();
408 488
     this.fetchAllAdminUsers();
@@ -442,7 +522,11 @@ export default {
442 522
       userList:[],
443 523
       list:[],
444 524
       drugConfig:{},
445
-      drugList:[]
525
+      drugList:[],
526
+      tableList:[],
527
+      drugTypeList:[],
528
+      tableShow:false,
529
+      manufacturerList:[],
446 530
     };
447 531
   },
448 532
   methods: {
@@ -588,14 +672,18 @@ export default {
588 672
         query: { id: row.id, type: this.type }
589 673
       });
590 674
     },
591
-    handleSearch(id,time,warehouse_out_order_number){
592
-    
593
-      this.warehousingOutInfo.warehousingOutData = []
594
-      this.GetOrderDetail(id)
595
-      this.list = []
596
-      this.getDrugAutoMaticList(id,time,warehouse_out_order_number)
597
-      this.dialogVisible = true
598
-      
675
+    // handleSearch(id,time,warehouse_out_order_number){
676
+    //   this.warehousingOutInfo.warehousingOutData = []
677
+    //   this.GetOrderDetail(id)
678
+    //   this.list = []
679
+    //   this.getDrugAutoMaticList(id,time,warehouse_out_order_number)
680
+    //   this.dialogVisible = true
681
+    // },
682
+    handleSearch(val){
683
+       this.getInitializtion()
684
+       this.GetOrderDetail(val.id)
685
+       this.list = []
686
+       this.getDrugAutoMaticList(val.id,val.time,val.warehouse_out_order_number)
599 687
     },
600 688
     GetOrderDetail(order_id) {
601 689
         const params = {
@@ -607,13 +695,18 @@ export default {
607 695
             this.$message.error(response.data.msg)
608 696
             return false
609 697
           } else {
610
-          
698
+            this.tableShow = true
611 699
             this.warehousingOutInfo.warehousingOutData=[]
612 700
             for (let i = 0; i < response.data.data.list.length; i++) {
613
-
614 701
               this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
702
+              this.tableList.push(response.data.data.list[i])
703
+
615 704
             }
705
+            console.log("详情",this.tableList)
616 706
             this.warehousingOutInfo.info = response.data.data.info
707
+            var manulist = response.data.data.manulist
708
+            this.manufacturerList = manulist
709
+            console.log("厂家列表",this.manufacturerList)
617 710
             this.handleSpanTempArr()
618 711
           }
619 712
         })
@@ -828,7 +921,44 @@ export default {
828 921
          }
829 922
       }
830 923
       return price
831
-    }
924
+    },
925
+    getTime(val) {
926
+      if(val < 0){
927
+          return ""
928
+      }
929
+      if(val == ""){
930
+        return ""
931
+      }else {
932
+        return uParseTime(val, '{y}-{m}-{d}')
933
+      }
934
+    },
935
+    getInitializtion(){
936
+      getInitializtion().then(response=>{
937
+          if(response.data.state ==1){
938
+            var drugTypeList = response.data.data.drugTypeList
939
+            console.log("hhhhhhh",drugTypeList)
940
+            this.drugTypeList = drugTypeList
941
+          }
942
+      })
943
+    },
944
+   getDrugType(id){
945
+     var name = ""
946
+     for(let i=0;i<this.drugTypeList.length;i++){
947
+       if(id == this.drugTypeList[i].value){
948
+           name = this.drugTypeList[i].name
949
+       } 
950
+     }
951
+     return name
952
+   },
953
+   getManufacturerName(id){
954
+     var name = ""
955
+     for(let i=0;i<this.manufacturerList.length;i++){
956
+       if(id == this.manufacturerList[i].id){
957
+          name = this.manufacturerList[i].manufacturer_name
958
+       }
959
+     }
960
+     return name
961
+   }
832 962
   }
833 963
 };
834 964
 </script>

+ 8 - 8
src/xt_pages/stock/drugs/query.vue 查看文件

@@ -87,11 +87,11 @@
87 87
         :data="tableList"
88 88
         border
89 89
         style="width: 100%">
90
-        <el-table-column prop="date" label="药品编号" width="180">
90
+        <!-- <el-table-column prop="date" label="药品编号" width="180">
91 91
            <template  slot-scope="scope">
92 92
               
93 93
            </template>
94
-        </el-table-column>
94
+        </el-table-column> -->
95 95
         <el-table-column prop="drug_type" label="药品类型" width="180">
96 96
            <template slot-scope="scope">
97 97
              {{getDrugType(scope.row.drug_type)}}
@@ -104,7 +104,7 @@
104 104
         </el-table-column>
105 105
         <el-table-column prop="drug_name" label="规格&&单位">
106 106
            <template slot-scope="scope">
107
-             {{scope.row.dosage + scope.row.max_unit +"*"+scope.row.min_number+scope.row.min_unit+"/"+scope.row.packing_unit}}
107
+             {{scope.row.dose + scope.row.dose_unit +"*"+scope.row.min_number+scope.row.min_unit+"/"+scope.row.max_unit}}
108 108
            </template>
109 109
         </el-table-column>
110 110
          <el-table-column prop="drug_name" label="进货单价">
@@ -120,7 +120,7 @@
120 120
         <el-table-column prop="drug_name" label="剩余库存量">
121 121
            <template slot-scope="scope">
122 122
             <span v-if="scope.row.stock_max_number!=''">
123
-              {{scope.row.stock_max_number}}{{scope.row.packing_unit}}
123
+              {{scope.row.stock_max_number}}{{scope.row.max_unit}}
124 124
               <span v-if="scope.row.stock_min_number!=''">
125 125
                 {{scope.row.stock_min_number}}{{scope.row.min_unit}}
126 126
               </span>
@@ -137,7 +137,7 @@
137 137
             >
138 138
               <el-button
139 139
                 size="small"
140
-                type="warning"
140
+                type="primary"
141 141
                 icon="el-icon-edit-outline"
142 142
                 @click="handleDetail(scope.row.drug_id)"
143 143
               >
@@ -427,7 +427,7 @@
427 427
        
428 428
         
429 429
          const data = this.formatJson(filterVal, this.tableData)
430
-         console.log("data",data)
430
+        //  console.log("data",data)
431 431
         
432 432
          excel.export_json_to_excel({
433 433
            header: tHeader,
@@ -470,7 +470,7 @@
470 470
         getDrugStockList(params).then(response=>{
471 471
           if(response.data.state == 1){
472 472
              var list = response.data.data.list
473
-           
473
+             console.log("list",list)
474 474
              this.tableList = list
475 475
              var total = response.data.data.total
476 476
              this.total = total
@@ -504,7 +504,7 @@
504 504
         this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+id})
505 505
       },
506 506
       handleBatch(id){
507
-        this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id'+id})
507
+        this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+id})
508 508
       }
509 509
     }
510 510
   }

+ 130 - 8
src/xt_pages/stock/stockQuery.vue 查看文件

@@ -64,7 +64,7 @@
64 64
       </div>
65 65
       
66 66
 
67
-      <el-table
67
+      <!-- <el-table
68 68
         :row-style="{ color: '#303133' }"
69 69
         :header-cell-style="{
70 70
           backgroundColor: 'rgb(245, 247, 250)',
@@ -153,6 +153,79 @@
153 153
             <span>{{stockInCount(scope.row)  - stockOutCount(scope.row) }}</span>
154 154
           </template>
155 155
         </el-table-column>
156
+      </el-table> -->
157
+       <el-table
158
+        :row-style="{ color: '#303133' }"
159
+        :header-cell-style="{
160
+          backgroundColor: 'rgb(245, 247, 250)',
161
+          color: '#606266'
162
+        }"
163
+        :data="tableList"
164
+        :class="signAndWeighBoxPatients"
165
+        border
166
+        v-loading="WarehouseInfo.loading"
167
+      >
168
+        <el-table-column label="耗材类型" align="center">
169
+          <template slot-scope="scope">
170
+            <span>{{getGoodType(scope.row.good_type_id)}}</span>
171
+         </template>
172
+        </el-table-column>
173
+        <el-table-column label="耗材名称" align="center">
174
+          <template slot-scope="scope">
175
+            {{ scope.row.good_name }}
176
+          </template>
177
+        </el-table-column>
178
+        <el-table-column label="规格&单位" align="center">
179
+            <template slot-scope="scope">
180
+              <span>{{ scope.row.specification_name }}*{{scope.row.min_number}}{{scope.row.min_unit}}</span>
181
+            </template>
182
+         </el-table-column>
183
+        <el-table-column label="进货单价" align="center">
184
+          <template slot-scope="scope">
185
+            {{scope.row.price}}
186
+          </template>
187
+        </el-table-column>
188
+        <el-table-column label="厂商">
189
+          <template slot-scope="scope">
190
+           {{getManufacture(scope.row.manufacturer)}}
191
+          </template>
192
+        </el-table-column>
193
+       <el-table-column label="剩余库存量">
194
+         <template slot-scope="scope">
195
+          <span v-if="scope.row.stock_count!=0">{{scope.row.stock_count}}</span>
196
+         </template>
197
+       </el-table-column>
198
+       <el-table-column label="操作" align="center" width="260px">
199
+          <template slot-scope="scope">
200
+            <el-tooltip
201
+              class="item"
202
+              effect="dark"
203
+              content="库存流水"
204
+              placement="top"
205
+            >
206
+              <el-button
207
+                size="small"
208
+                type="primary"
209
+                icon="el-icon-edit-outline"
210
+              >
211
+              </el-button>
212
+            </el-tooltip>
213
+
214
+            <el-tooltip
215
+              class="item"
216
+              type="primary"
217
+              content="批次"
218
+              placement="top"
219
+            >
220
+              <el-button
221
+                size="small"
222
+                type="danger"
223
+                icon="el-icon-edit-outline"
224
+              >
225
+              </el-button>
226
+            </el-tooltip>
227
+          </template>
228
+        </el-table-column>
156 229
       </el-table>
157 230
       <el-pagination
158 231
         @size-change="handleSizeChange"
@@ -176,15 +249,17 @@ import BreadCrumb from "@/xt_pages/components/bread-crumb";
176 249
 import {
177 250
   GetAllGoodInfo,
178 251
   GetAllGoodType,
179
-  getAllStockQueryList
252
+  getAllStockQueryList,
253
+  getAllStockList
180 254
 } from "@/api/stock";
181 255
 
182 256
 export default {
183 257
   name: "stockIn",
184 258
   created() {
185
-    this.GetAllStockQuery();
259
+    // this.GetAllStockQuery();
186 260
     this.GetAllGoodInfo();
187 261
     this.GetAllGoodType();
262
+    this.getlist()
188 263
   },
189 264
   components: {
190 265
     BreadCrumb
@@ -213,6 +288,8 @@ export default {
213 288
       value:"",
214 289
       type_name:"",
215 290
       types:[],
291
+      tableList:[],
292
+      manufacturerList:[]
216 293
     };
217 294
   },
218 295
   methods: {
@@ -290,6 +367,7 @@ export default {
290 367
             this.goodType.push(response.data.data.goodType[i]);
291 368
             this.types.push(response.data.data.goodType[i])
292 369
           }
370
+          
293 371
           console.log("商品类型",this.types)
294 372
         }
295 373
       });
@@ -311,11 +389,13 @@ export default {
311 389
     },
312 390
     handleSizeChange(val) {
313 391
       this.limit = val;
314
-      this.GetAllStockQuery();
392
+      // this.GetAllStockQuery();
393
+      this.getlist()
315 394
     },
316 395
     handleCurrentChange(val) {
317 396
       this.page = val;
318
-      this.GetAllStockQuery();
397
+      // this.GetAllStockQuery();
398
+       this.getlist()
319 399
     },
320 400
     calculate: function(val) {
321 401
       return Math.round(parseFloat(val) * 100) / 100;
@@ -328,7 +408,8 @@ export default {
328 408
         this.start_time = "";
329 409
       } else {
330 410
         this.start_time = val
331
-        this.GetAllStockQuery();
411
+        // this.GetAllStockQuery();
412
+         this.getlist()
332 413
       }
333 414
     },
334 415
     endTimeChange: function(val) {
@@ -338,7 +419,8 @@ export default {
338 419
         this.end_time = "";
339 420
       } else {
340 421
         this.end_time = val
341
-        this.GetAllStockQuery();
422
+        // this.GetAllStockQuery();
423
+         this.getlist()
342 424
       }
343 425
      
344 426
     },
@@ -376,7 +458,8 @@ export default {
376 458
     showStockOutDetailDialog: function() {},
377 459
     showCancelStockDetailDialog: function() {},
378 460
     search: function() {
379
-      this.GetAllStockQuery();
461
+      // this.GetAllStockQuery();
462
+      this.getlist()
380 463
     },
381 464
 
382 465
     exportList(){
@@ -421,6 +504,45 @@ export default {
421 504
       // 把时间日期转成时间戳
422 505
       return new Date(time).getTime() / 1000;
423 506
     },
507
+    getGoodType(id){
508
+      var name = ""
509
+      for(let i=0;i<this.goodType.length;i++){
510
+        if(id == this.goodType[i].id){
511
+           name = this.goodType[i].type_name
512
+        }
513
+      }
514
+      return name
515
+    },
516
+    getlist(){
517
+      const params = {
518
+        page: this.page,
519
+        limit: this.limit,
520
+        keyword: this.keywords,
521
+        start_time:this.start_time,
522
+        end_time:this.end_time,
523
+        type_name:this.type_name,
524
+      };
525
+
526
+      getAllStockList(params).then(response=>{
527
+         if(response.data.state == 1){
528
+          var list = response.data.data.list
529
+          console.log("list22222",list)
530
+          this.tableList = list
531
+          var total = response.data.data.total
532
+           var manufacturerList = response.data.data.manufacturerList
533
+           this.manufacturerList = manufacturerList
534
+         }
535
+      })
536
+    },
537
+    getManufacture(id){
538
+       var name = ""
539
+       for(let i=0;i<this.manufacturerList.length;i++){
540
+         if(id == this.manufacturerList[i].id){
541
+           name = this.manufacturerList[i].manufacturer_name
542
+         }
543
+       }
544
+       return name
545
+    }
424 546
   }
425 547
 };
426 548
 </script>