|
@@ -111,25 +111,17 @@
|
111
|
111
|
</el-table-column>
|
112
|
112
|
<el-table-column prop="drug_name" label="入库数量" align="center">
|
113
|
113
|
<template slot-scope="scope">
|
114
|
|
- <!-- {{getInCount(scope.row.drug_id)}} -->
|
115
|
|
- {{getInCount(scope.row.drug_id)}}{{scope.row.max_unit}}
|
|
114
|
+ <span v-if="getWarehoseInfo(scope.row.drug_warehouse_info)!=0">{{getWarehoseInfo(scope.row.drug_warehouse_info)}}{{scope.row.max_unit}}</span>
|
116
|
115
|
</template>
|
117
|
116
|
</el-table-column>
|
118
|
117
|
<el-table-column prop="drug_name" label="出库数量" align="center">
|
119
|
118
|
<template slot-scope="scope">
|
120
|
|
- <!-- {{getOutCount(scope.row.drug_id) + getAutoCount(scope.row.drug_id)}} -->
|
121
|
|
- {{getCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}
|
|
119
|
+ {{getWarehouseOutInfo(scope.row.drug_warehouse_out,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
|
122
|
120
|
</template>
|
123
|
121
|
</el-table-column>
|
124
|
|
- <!-- <el-table-column prop="drug_name" label="退库数量" align="center">
|
125
|
|
- <template slot-scope="scope">
|
126
|
|
- {{getCancelCount(scope.row.drug_id)}}{{scope.row.max_unit}}
|
127
|
|
- </template>
|
128
|
|
- </el-table-column> -->
|
129
|
122
|
<el-table-column prop="drug_name" label="剩余库存量" align="center">
|
130
|
123
|
<template slot-scope="scope">
|
131
|
|
- <span v-if="getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)!=''">{{getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span>
|
132
|
|
- <span v-if="getCountTwo(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit) ==''">0{{scope.row.max_unit}}0{{scope.row.min_unit}}</span>
|
|
124
|
+ <span>{{getOverFlushInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
|
133
|
125
|
</template>
|
134
|
126
|
</el-table-column>
|
135
|
127
|
<el-table-column prop="drug_name" label="操作" align="center" width="200px">
|
|
@@ -150,10 +142,10 @@
|
150
|
142
|
</el-table-column>
|
151
|
143
|
</el-table>
|
152
|
144
|
|
153
|
|
- <el-pagination
|
|
145
|
+ <el-pagination
|
154
|
146
|
@size-change="handleSizeChange"
|
155
|
147
|
@current-change="handleCurrentChange"
|
156
|
|
- :page-sizes="[10, 50, 100,500,1000]"
|
|
148
|
+ :page-sizes="[10, 50, 100,200,500,1000]"
|
157
|
149
|
:page-size="10"
|
158
|
150
|
background
|
159
|
151
|
align="right"
|
|
@@ -181,32 +173,26 @@ import { min } from 'moment'
|
181
|
173
|
export default {
|
182
|
174
|
name: 'stockIn',
|
183
|
175
|
created() {
|
|
176
|
+
|
184
|
177
|
var nowDate = new Date();
|
185
|
178
|
var nowYear = nowDate.getFullYear();
|
186
|
179
|
var nowMonth = nowDate.getMonth() + 1;
|
187
|
180
|
var nowDay = nowDate.getDate();
|
188
|
|
- this.end_time =
|
189
|
|
- nowYear +
|
190
|
|
- "-" +
|
191
|
|
- (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
|
192
|
|
- "-" +
|
193
|
|
- (nowDay < 10 ? "0" + nowDay : nowDay);
|
|
181
|
+ this.end_time =nowYear +"-" +(nowMonth < 10 ? "0" + nowMonth : nowMonth) +"-" +(nowDay < 10 ? "0" + nowDay : nowDay);
|
194
|
182
|
nowDate.setMonth(nowDate.getMonth() - 1);
|
195
|
183
|
nowYear = nowDate.getFullYear();
|
196
|
184
|
nowMonth = nowDate.getMonth() + 1;
|
197
|
185
|
nowDay = nowDate.getDate();
|
198
|
|
- this.start_time =
|
199
|
|
- nowYear +
|
200
|
|
- "-" +
|
201
|
|
- (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
|
202
|
|
- "-" +
|
203
|
|
- (nowDay < 10 ? "0" + nowDay : nowDay);
|
|
186
|
+ this.start_time =nowYear +"-" +(nowMonth < 10 ? "0" + nowMonth : nowMonth) +"-" +(nowDay < 10 ? "0" + nowDay : nowDay);
|
|
187
|
+ this.getlist()
|
204
|
188
|
var drugCategory = getDictionaryDataConfig('system','drug_category')
|
205
|
189
|
this.drugCategory.push(...drugCategory)
|
206
|
190
|
var drugTypeList = getDictionaryDataConfig('system','drug_type')
|
207
|
191
|
this.drugTypeList.push(...drugTypeList)
|
208
|
|
- this.getlist()
|
209
|
|
- this.getDrugCountList()
|
|
192
|
+
|
|
193
|
+ // this.getDrugCountList()
|
|
194
|
+
|
|
195
|
+
|
210
|
196
|
},
|
211
|
197
|
components: {
|
212
|
198
|
SettingDialog,
|
|
@@ -219,13 +205,14 @@ import { min } from 'moment'
|
219
|
205
|
{ path: '/stock/drugs/stock/query', name: '药品库存查询' }
|
220
|
206
|
],
|
221
|
207
|
keywords: '',
|
222
|
|
- total: 0,
|
|
208
|
+
|
223
|
209
|
multipleSelection: [],
|
224
|
210
|
signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
|
225
|
211
|
start_time: '',
|
226
|
212
|
end_time: '',
|
227
|
213
|
page: 1,
|
228
|
214
|
limit: 10,
|
|
215
|
+ total: 0,
|
229
|
216
|
goodType: [],
|
230
|
217
|
goodInfo: [],
|
231
|
218
|
tempArr: [],
|
|
@@ -252,9 +239,45 @@ import { min } from 'moment'
|
252
|
239
|
minCount:[],
|
253
|
240
|
drugOutList:[],
|
254
|
241
|
cancelCountList:[],
|
|
242
|
+ allCountList:[],
|
255
|
243
|
}
|
256
|
244
|
},
|
257
|
245
|
methods: {
|
|
246
|
+ //获取库存
|
|
247
|
+ getlist(){
|
|
248
|
+
|
|
249
|
+ const params = {
|
|
250
|
+ page: this.page,
|
|
251
|
+ limit: this.limit,
|
|
252
|
+ keyword: this.keywords,
|
|
253
|
+ drug_type:this.drug_type,
|
|
254
|
+ start_time:this.start_time,
|
|
255
|
+ end_time:this.end_time,
|
|
256
|
+ }
|
|
257
|
+ console.log("parasm222222",params)
|
|
258
|
+ getDrugStockList(params).then(response=>{
|
|
259
|
+ if(response.data.state == 1){
|
|
260
|
+ var list = response.data.data.list
|
|
261
|
+ console.log("list99999",list)
|
|
262
|
+ for(let i=0;i<list.length;i++){
|
|
263
|
+ for(let j=0;j<list[i].drug_warehouse_info.length;j++){
|
|
264
|
+ list[i].drug_warehouse_info[j].stock_max_number = list[i].min_number * list[i].drug_warehouse_info[j].stock_max_number
|
|
265
|
+ }
|
|
266
|
+ for(let y=0;y<list[i].drug_warehouse_out.length;y++){
|
|
267
|
+ if(list[i].drug_warehouse_out[y].count_unit == list[i].max_unit){
|
|
268
|
+ list[i].drug_warehouse_out[y].count = list[i].drug_warehouse_out[y].count * list[i].min_number
|
|
269
|
+ }
|
|
270
|
+ }
|
|
271
|
+ }
|
|
272
|
+ console.log("列表list232323323232323223",list)
|
|
273
|
+ this.tableList = list
|
|
274
|
+ var total = response.data.data.total
|
|
275
|
+ this.total = total
|
|
276
|
+ this.manufacturerList = response.data.data.manufacturerList
|
|
277
|
+
|
|
278
|
+ }
|
|
279
|
+ })
|
|
280
|
+ },
|
258
|
281
|
handleSpanTempArr() {
|
259
|
282
|
this.tempArr = []
|
260
|
283
|
|
|
@@ -301,47 +324,7 @@ import { min } from 'moment'
|
301
|
324
|
}
|
302
|
325
|
}
|
303
|
326
|
},
|
304
|
|
- GetAllDrugStockQueryList: function() {
|
305
|
|
-
|
306
|
|
- const Params = {
|
307
|
|
- page: this.page,
|
308
|
|
- limit: this.limit,
|
309
|
|
- keyword: this.keywords,
|
310
|
|
- drug_category:this.drug_category,
|
311
|
|
- start_time:this.start_time,
|
312
|
|
- end_time:this.end_time,
|
313
|
|
- }
|
314
|
|
- this.WarehouseInfo.loading = true
|
315
|
|
- this.WarehouseInfo.warehouseInfoDate = []
|
316
|
|
- getAllDrugStockQueryList(Params).then(response => {
|
317
|
|
- if (response.data.state == 0) {
|
318
|
|
- this.WarehouseInfo.loading = false
|
319
|
|
- this.$message.error(response.data.msg)
|
320
|
|
- return false
|
321
|
|
- } else {
|
322
|
|
- this.WarehouseInfo.loading = false
|
323
|
|
- this.total = response.data.data.total
|
324
|
|
- var arr = []
|
325
|
|
- for (let i = 0; i < response.data.data.list.length; i++) {
|
326
|
|
- this.WarehouseInfo.warehouseInfoDate.push(response.data.data.list[i])
|
327
|
|
- arr.push(response.data.data.list[i])
|
328
|
|
- }
|
329
|
|
-
|
330
|
|
- for(let i=0;i<arr.length;i++){
|
331
|
|
- arr[i].stockInCount = this.stockInCount(arr[i])
|
332
|
|
- arr[i].salesReturnCount = this.salesReturnCount(arr[i])
|
333
|
|
- arr[i].reactCount = (this.stockInCount(arr[i]) - this.salesReturnCount(arr[i]))?this.stockInCount(arr[i]) - this.salesReturnCount(arr[i]):0
|
334
|
|
- arr[i].stockOutCount = this.stockOutCount(arr[i])
|
335
|
|
- arr[i].cancelStockCount = this.cancelStockCount(arr[i])?this.cancelStockCount(arr[i]):0
|
336
|
|
- arr[i].reactOutCount = (this.stockOutCount(arr[i]) - this.cancelStockCount(arr[i]))?(this.stockOutCount(arr[i]) - this.cancelStockCount(arr[i])):0
|
337
|
|
- arr[i].overplusCount = (this.stockInCount(arr[i])-this.salesReturnCount(arr[i])-this.stockOutCount(arr[i])+this.cancelStockCount(arr[i]))?this.stockInCount(arr[i])-this.salesReturnCount(arr[i])-this.stockOutCount(arr[i])+this.cancelStockCount(arr[i]):0
|
338
|
|
- }
|
339
|
|
-
|
340
|
|
- this.tableData = arr
|
341
|
|
- this.handleSpanTempArr()
|
342
|
|
- }
|
343
|
|
- })
|
344
|
|
- },
|
|
327
|
+
|
345
|
328
|
getSpecificationName: function(id) {
|
346
|
329
|
let name = ''
|
347
|
330
|
for (let i = 0; i < this.goodInfo.length; i++) {
|
|
@@ -366,12 +349,10 @@ import { min } from 'moment'
|
366
|
349
|
},
|
367
|
350
|
handleSizeChange(val) {
|
368
|
351
|
this.limit = val
|
369
|
|
-
|
370
|
352
|
this.getlist()
|
371
|
353
|
},
|
372
|
354
|
handleCurrentChange(val) {
|
373
|
355
|
this.page = val
|
374
|
|
-
|
375
|
356
|
this.getlist()
|
376
|
357
|
},
|
377
|
358
|
calculate: function(val) {
|
|
@@ -395,7 +376,7 @@ import { min } from 'moment'
|
395
|
376
|
this.$message.error("结束时间不能小于开始时间");
|
396
|
377
|
this.end_time = "";
|
397
|
378
|
} else {
|
398
|
|
- // this.GetAllDrugStockQueryList();
|
|
379
|
+
|
399
|
380
|
this.getlist()
|
400
|
381
|
}
|
401
|
382
|
|
|
@@ -430,14 +411,6 @@ import { min } from 'moment'
|
430
|
411
|
}
|
431
|
412
|
return total
|
432
|
413
|
},
|
433
|
|
- showStockInDetailDialog: function(val) {
|
434
|
|
- },
|
435
|
|
- showSaleReturnDetailDialog: function() {
|
436
|
|
- },
|
437
|
|
- showStockOutDetailDialog: function() {
|
438
|
|
- },
|
439
|
|
- showCancelStockDetailDialog: function() {
|
440
|
|
- },
|
441
|
414
|
search: function() {
|
442
|
415
|
this.getlist()
|
443
|
416
|
},
|
|
@@ -451,9 +424,10 @@ import { min } from 'moment'
|
451
|
424
|
this.tableList[i].drug_type_name = this.getDrugType(this.tableList[i].drug_type)
|
452
|
425
|
this.tableList[i].unit = this.tableList[i].dose + this.tableList[i].dose_unit +"*"+this.tableList[i].min_number+this.tableList[i].min_unit+"/"+this.tableList[i].max_unit
|
453
|
426
|
this.tableList[i].manufacturer_name = this.getManufacturerList(this.tableList[i].manufacturer)
|
454
|
|
- this.tableList[i].inCount = this.getInCount(this.tableList[i].drug_id) + this.tableList[i].max_unit
|
455
|
|
- this.tableList[i].outCount = this.getCount(this.tableList[i].drug_id,this.tableList[i].min_number,this.tableList[i].max_unit,this.tableList[i].min_unit)
|
456
|
|
- this.tableList[i].overplusCount = this.getCountTwo(this.tableList[i].drug_id,this.tableList[i].min_number,this.tableList[i].max_unit,this.tableList[i].min_unit)
|
|
427
|
+
|
|
428
|
+ this.tableList[i].inCount = this.getWarehoseInfo(this.tableList[i].drug_warehouse_info)
|
|
429
|
+ this.tableList[i].outCount = this.getWarehouseOutInfo(this.tableList[i].drug_warehouse_out,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
|
|
430
|
+ this.tableList[i].overplusCount = this.getOverFlushInfo(this.tableList[i].drug_warehouse_info,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
|
457
|
431
|
}
|
458
|
432
|
|
459
|
433
|
console.log("hhhhhhhadhfadf 列表",this.tableList)
|
|
@@ -489,31 +463,6 @@ import { min } from 'moment'
|
489
|
463
|
query: {drug_type:this.drug_type,keyword:this.keywords,start_time:this.start_time,end_time:this.end_time,page:this.page,limit:this.limit}
|
490
|
464
|
});
|
491
|
465
|
},
|
492
|
|
-
|
493
|
|
- //获取库存
|
494
|
|
- getlist(){
|
495
|
|
- const params = {
|
496
|
|
- page: this.page,
|
497
|
|
- limit: this.limit,
|
498
|
|
- keyword: this.keywords,
|
499
|
|
- drug_type:this.drug_type,
|
500
|
|
- start_time:this.start_time,
|
501
|
|
- end_time:this.end_time,
|
502
|
|
- }
|
503
|
|
- console.log("parasm222222",params)
|
504
|
|
- getDrugStockList(params).then(response=>{
|
505
|
|
- if(response.data.state == 1){
|
506
|
|
- var list = response.data.data.list
|
507
|
|
- console.log("list99999",list)
|
508
|
|
- this.tableList = list
|
509
|
|
- var total = response.data.data.total
|
510
|
|
- console.log("total",total)
|
511
|
|
- this.total = total
|
512
|
|
- this.manufacturerList = response.data.data.manufacturerList
|
513
|
|
-
|
514
|
|
- }
|
515
|
|
- })
|
516
|
|
- },
|
517
|
466
|
getDrugType(id){
|
518
|
467
|
|
519
|
468
|
var name = ""
|
|
@@ -543,7 +492,8 @@ import { min } from 'moment'
|
543
|
492
|
}
|
544
|
493
|
}
|
545
|
494
|
var unit = val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
|
546
|
|
- this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+val.drug_id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit})
|
|
495
|
+ var overPlus = this.getOverFlushInfo(val.drug_warehouse_info,val.max_unit,val.min_unit,val.min_number)
|
|
496
|
+ this.$router.push({path:'/drugstock/in/drugstockflow?drug_id='+val.id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit+"&overPlus="+overPlus})
|
547
|
497
|
},
|
548
|
498
|
handleBatch(val){
|
549
|
499
|
var manufacturer_name = ""
|
|
@@ -553,7 +503,8 @@ import { min } from 'moment'
|
553
|
503
|
}
|
554
|
504
|
}
|
555
|
505
|
var unit = val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
|
556
|
|
- this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+val.drug_id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit})
|
|
506
|
+ var overPlus = this.getOverFlushInfo(val.drug_warehouse_info,val.max_unit,val.min_unit,val.min_number)
|
|
507
|
+ this.$router.push({path:'/drugstock/in/drugbatchnumber?drug_id='+val.id+"&drug_name="+val.drug_name+"&manufacturer="+manufacturer_name+"&unit="+unit+"&min_number="+val.min_number+"&max_unit="+val.max_unit+"&min_unit="+val.min_unit+"&overPlus="+overPlus})
|
557
|
508
|
},
|
558
|
509
|
getDrugCountList(){
|
559
|
510
|
var params = {
|
|
@@ -565,19 +516,11 @@ import { min } from 'moment'
|
565
|
516
|
getDrugCountList(params).then(response=>{
|
566
|
517
|
if(response.data.state == 1){
|
567
|
518
|
var countlist = response.data.data.countList
|
568
|
|
- console.log("入库数据",countlist)
|
569
|
519
|
this.countList = countlist
|
570
|
|
- var outcountlist = response.data.data.outCountList
|
571
|
|
- console.log("出库数据",outcountlist)
|
572
|
|
- this.outCountList = outcountlist
|
573
|
|
- var aucountlist = response.data.data.auCountList
|
574
|
|
- console.log("自动数据",aucountlist)
|
575
|
|
- this.autoCountList = aucountlist
|
576
|
520
|
var minCount = response.data.data.minCount
|
577
|
521
|
console.log("minCount",minCount)
|
578
|
522
|
this.minCount = minCount
|
579
|
523
|
var cancelCountList = response.data.data.cancelCountList
|
580
|
|
- console.log("退库数据",cancelCountList)
|
581
|
524
|
this.cancelCountList = cancelCountList
|
582
|
525
|
var info = response.data.data.info
|
583
|
526
|
for(let i=0;i<info.length;i++){
|
|
@@ -585,6 +528,7 @@ import { min } from 'moment'
|
585
|
528
|
info[i].count = info[i].count * info[i].min_number
|
586
|
529
|
}
|
587
|
530
|
}
|
|
531
|
+ console.log("搜有列表",this.autoCountList)
|
588
|
532
|
console.log("info2222222",info)
|
589
|
533
|
this.drugOutList = info
|
590
|
534
|
}
|
|
@@ -627,24 +571,45 @@ import { min } from 'moment'
|
627
|
571
|
}
|
628
|
572
|
return count
|
629
|
573
|
},
|
630
|
|
- getCount(drug_id,min_number,max_unit,min_unit){
|
631
|
|
- var count= 0
|
|
574
|
+ getCount(drug_id,min_number,max_unit,min_unit){
|
|
575
|
+ var total= 0
|
632
|
576
|
var str = ""
|
633
|
577
|
var min_str = ""
|
634
|
|
- for(let i=0;i<this.drugOutList.length;i++){
|
635
|
|
- if(drug_id == this.drugOutList[i].drug_id){
|
636
|
|
- count += parseInt(this.drugOutList[i].count)
|
|
578
|
+ var arr = []
|
|
579
|
+ for(let i=0;i<this.allCountList.length;i++){
|
|
580
|
+ if(drug_id == this.allCountList[i].drug_id){
|
|
581
|
+ arr.push(this.allCountList[i])
|
637
|
582
|
}
|
638
|
583
|
}
|
639
|
|
- if(parseInt(count/min_number)!=0){
|
640
|
|
- str = parseInt(count/min_number)+ max_unit
|
|
584
|
+ var arrTwo = []
|
|
585
|
+ for(let i=0;i<arr.length;i++){
|
|
586
|
+ if(arr[i].drug_id == 1236){
|
|
587
|
+ arrTwo.push(arr[i])
|
|
588
|
+ }
|
|
589
|
+ if(arr[i].count_unit == max_unit){
|
|
590
|
+ arr[i].count = arr[i].count * min_number
|
|
591
|
+ }
|
|
592
|
+ if(arr[i].count_unit == min_unit){
|
|
593
|
+ arr[i].count = arr[i].count
|
|
594
|
+ }
|
|
595
|
+ total += arr[i].count
|
|
596
|
+ }
|
|
597
|
+ if(total<min_number){
|
|
598
|
+ str = ""
|
|
599
|
+ min_str = total + min_unit
|
641
|
600
|
}
|
642
|
|
- if((count%min_number)!=0){
|
643
|
|
- min_str = count%min_number + min_unit
|
|
601
|
+ if(total >= min_number){
|
|
602
|
+ if(parseInt(total/min_number)!=0){
|
|
603
|
+ str = parseInt(total/min_number)+ max_unit
|
|
604
|
+ }
|
|
605
|
+ if((total%min_number)!=0){
|
|
606
|
+ min_str = total%min_number + min_unit
|
|
607
|
+ }
|
644
|
608
|
}
|
|
609
|
+
|
645
|
610
|
return str + min_str
|
646
|
611
|
},
|
647
|
|
-
|
|
612
|
+
|
648
|
613
|
getCountOne(drug_id){
|
649
|
614
|
var count= 0
|
650
|
615
|
for(let i=0;i<this.drugOutList.length;i++){
|
|
@@ -669,12 +634,10 @@ import { min } from 'moment'
|
669
|
634
|
if(parseInt(count/min_number)!=0){
|
670
|
635
|
str = parseInt(count/min_number) + max_unit
|
671
|
636
|
}
|
672
|
|
- console.log("str2222",str)
|
|
637
|
+
|
673
|
638
|
if((count%min_number)!=0){
|
674
|
639
|
str_min = count%min_number + min_unit
|
675
|
640
|
}
|
676
|
|
-
|
677
|
|
- console.log("str0000000",str,str_min)
|
678
|
641
|
return str+str_min
|
679
|
642
|
},
|
680
|
643
|
getCancelCount(id){
|
|
@@ -686,6 +649,77 @@ import { min } from 'moment'
|
686
|
649
|
}
|
687
|
650
|
return count
|
688
|
651
|
},
|
|
652
|
+ getWarehoseInfo(arr){
|
|
653
|
+ var total = 0
|
|
654
|
+ if (arr.length > 0) {
|
|
655
|
+ for(let i=0;i<arr.length;i++){
|
|
656
|
+ total += parseInt(arr[i].warehousing_count)
|
|
657
|
+ }
|
|
658
|
+ }
|
|
659
|
+ if(total == 0){
|
|
660
|
+ total = ""
|
|
661
|
+ }
|
|
662
|
+
|
|
663
|
+ return total
|
|
664
|
+ },
|
|
665
|
+ getOverFlushInfo(arr,max_unit,min_unit,min_number){
|
|
666
|
+
|
|
667
|
+ var max_str= ""
|
|
668
|
+ var min_str = ""
|
|
669
|
+ var total = 0
|
|
670
|
+ var newarr = arr
|
|
671
|
+ if(newarr.length > 0 ){
|
|
672
|
+ for(let i=0;i<newarr.length;i++){
|
|
673
|
+ total += (newarr[i].stock_max_number+newarr[i].stock_min_number)
|
|
674
|
+ }
|
|
675
|
+ }
|
|
676
|
+ if (total < min_number){
|
|
677
|
+ min_str = total + min_unit
|
|
678
|
+ }
|
|
679
|
+ if (total == 0) {
|
|
680
|
+ min_str = ""
|
|
681
|
+ max_str = ""
|
|
682
|
+ }
|
|
683
|
+ if (total >=min_number) {
|
|
684
|
+ if(parseInt(total/min_number)!=0){
|
|
685
|
+ max_str = parseInt(total/min_number) + max_unit
|
|
686
|
+ }
|
|
687
|
+ if(total%min_number!=0){
|
|
688
|
+ min_str = total%min_number + min_unit
|
|
689
|
+ }
|
|
690
|
+
|
|
691
|
+ }
|
|
692
|
+ return max_str + min_str
|
|
693
|
+ },
|
|
694
|
+ getWarehouseOutInfo(arr,max_unit,min_unit,min_number){
|
|
695
|
+ var min_str = ""
|
|
696
|
+ var max_str = ""
|
|
697
|
+ var total = 0
|
|
698
|
+ if (arr.length > 0) {
|
|
699
|
+ for(let i=0;i<arr.length;i++){
|
|
700
|
+ total += parseInt(arr[i].count)
|
|
701
|
+ }
|
|
702
|
+ }
|
|
703
|
+
|
|
704
|
+ if (total < min_number){
|
|
705
|
+ min_str = total + min_unit
|
|
706
|
+ }
|
|
707
|
+ if (total == 0) {
|
|
708
|
+ min_str = ""
|
|
709
|
+ max_str = ""
|
|
710
|
+ }
|
|
711
|
+ if (total >=min_number) {
|
|
712
|
+ if(parseInt(total/min_number)!=0){
|
|
713
|
+ max_str = parseInt(total/min_number) + max_unit
|
|
714
|
+ }
|
|
715
|
+ if(total%min_number!=0){
|
|
716
|
+ min_str = total%min_number + min_unit
|
|
717
|
+ }
|
|
718
|
+
|
|
719
|
+ }
|
|
720
|
+ return max_str + min_str
|
|
721
|
+
|
|
722
|
+ }
|
689
|
723
|
}
|
690
|
724
|
}
|
691
|
725
|
</script>
|