|
@@ -17,7 +17,9 @@
|
17
|
17
|
align="right"
|
18
|
18
|
format="yyyy-MM-dd"
|
19
|
19
|
value-format="yyyy-MM-dd"
|
|
20
|
+ :picker-options="pickerOptions"
|
20
|
21
|
@change="startTimeChange"
|
|
22
|
+ :clearable="false"
|
21
|
23
|
></el-date-picker>
|
22
|
24
|
<span>-</span>
|
23
|
25
|
<el-date-picker
|
|
@@ -31,7 +33,9 @@
|
31
|
33
|
align="right"
|
32
|
34
|
format="yyyy-MM-dd"
|
33
|
35
|
value-format="yyyy-MM-dd"
|
|
36
|
+ :picker-options="pickerOptions"
|
34
|
37
|
@change="endTimeChange"
|
|
38
|
+ :clearable="false"
|
35
|
39
|
></el-date-picker>
|
36
|
40
|
<span style="font-size:14px;color:#606266">药品类型:</span>
|
37
|
41
|
<el-select v-model="good_type" style="width:200px;margin-right:10px;" placeholder="请选择"
|
|
@@ -48,6 +52,7 @@
|
48
|
52
|
<el-button type="primary" icon="el-icon-search" @click="seach">搜索</el-button>
|
49
|
53
|
</div>
|
50
|
54
|
<div>
|
|
55
|
+ <el-button type="primary" @click="toOverCount">调试</el-button>
|
51
|
56
|
<el-button type="primary" @click="toPrint">打印</el-button>
|
52
|
57
|
<el-button type="primary" @click="exportList">导出</el-button>
|
53
|
58
|
</div>
|
|
@@ -152,7 +157,7 @@
|
152
|
157
|
</div>
|
153
|
158
|
</template>
|
154
|
159
|
<script>
|
155
|
|
-import { getStorehouseList,getPurchaseNewDrugQuery } from "@/api/drug/drug"
|
|
160
|
+import { getStorehouseList,getPurchaseNewDrugQuery,getDrugOverCount } from "@/api/drug/drug"
|
156
|
161
|
const moment = require('moment')
|
157
|
162
|
import { uParseTime } from '@/utils/tools'
|
158
|
163
|
export default {
|
|
@@ -175,8 +180,8 @@ export default {
|
175
|
180
|
total:0,
|
176
|
181
|
keyword:"",
|
177
|
182
|
drugTypeList:[],
|
178
|
|
- start_time:moment().startOf('month').format("YYYY-MM-DD"),
|
179
|
|
- end_time:moment().endOf('month').format("YYYY-MM-DD"),
|
|
183
|
+ start_time:"",
|
|
184
|
+ end_time:"",
|
180
|
185
|
countList:[],
|
181
|
186
|
outCountList:[],
|
182
|
187
|
autoCountList:[],
|
|
@@ -191,6 +196,11 @@ export default {
|
191
|
196
|
good_name:"",
|
192
|
197
|
specification_name:"",
|
193
|
198
|
loading:false,
|
|
199
|
+ pickerOptions:{ //禁用当前日期之前的日期
|
|
200
|
+ disabledDate(v) {
|
|
201
|
+ return v.getTime() < 1667232000000
|
|
202
|
+ },
|
|
203
|
+ },
|
194
|
204
|
}
|
195
|
205
|
|
196
|
206
|
},
|
|
@@ -375,21 +385,31 @@ export default {
|
375
|
385
|
console.log("list23323223322332232323322323wode",list)
|
376
|
386
|
for(let i=0;i<list.length;i++){
|
377
|
387
|
list[i].last_price_in = 0
|
378
|
|
- list[i].drugIn = this.getDrugWarehouseInfoOne(list[i].DrugWarehouseInfoStart,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].DrugWarehouseOutInfoStart,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].WareStartStockCancelInfo)
|
379
|
|
- list[i].drugInMoney = this.getDrugInMoneyOne(list[i].DrugWarehouseInfoStart,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].DrugWarehouseOutInfoStart,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].WareStartStockCancelInfo)
|
380
|
|
- list[i].drugSaleMoney = this.getSaleMoneyOne(list[i].DrugWarehouseInfoStart,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].DrugWarehouseOutInfoStart,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].WareStartStockCancelInfo)
|
|
388
|
+ list[i].drugIn = this.GetDrugStartFlow(list[i].DrugStatFlow.over_count,list[i].min_number,list[i].min_unit,list[i].max_unit)
|
|
389
|
+ // list[i].drugIn = this.getDrugWarehouseInfoOne(list[i].DrugWarehouseInfoStart,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].DrugWarehouseOutInfoStart,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].WareStartStockCancelInfo)
|
|
390
|
+ // list[i].drugInMoney = this.getDrugInMoneyOne(list[i].DrugWarehouseInfoStart,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].DrugWarehouseOutInfoStart,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].WareStartStockCancelInfo)
|
|
391
|
+ // list[i].drugSaleMoney = this.getSaleMoneyOne(list[i].DrugWarehouseInfoStart,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].DrugWarehouseOutInfoStart,list[i].WareStartStockInventoryProfit,list[i].WareStartStockInventoryLosses,list[i].WareStartStockCancelInfo)
|
|
392
|
+ list[i].drugInMoney = "/"
|
|
393
|
+ list[i].drugSaleMoney = "/"
|
381
|
394
|
|
382
|
395
|
list[i].drugAdd = this.drugAddInfo(list[i].DrugWarehouseInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryProfit)
|
383
|
|
- list[i].drugAddPrice = this.getdrugAddPrice(list[i].DrugWarehouseInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryProfit)
|
384
|
|
- list[i].drugAddSalePrice = this.drugAddSalePrice(list[i].DrugWarehouseInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryProfit)
|
|
396
|
+ // list[i].drugAddPrice = this.getdrugAddPrice(list[i].DrugWarehouseInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryProfit)
|
|
397
|
+ // list[i].drugAddSalePrice = this.drugAddSalePrice(list[i].DrugWarehouseInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryProfit)
|
|
398
|
+ list[i].drugAddPrice = "/"
|
|
399
|
+ list[i].drugAddSalePrice = "/"
|
385
|
400
|
|
386
|
401
|
list[i].drugOut= this.getDrugOut(list[i].DrugWarehouseOutInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryLosses,list[i].WareStartEndStockCancelInfo)
|
387
|
|
- list[i].drugOutPrice = this.getDrugOutPrice(list[i].DrugWarehouseOutInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryLosses,list[i].WareStartEndStockCancelInfo)
|
388
|
|
- list[i].drugOutSalePrice = this.getDrugOutSaleprice(list[i].DrugWarehouseOutInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryLosses,list[i].WareStartEndStockCancelInfo)
|
389
|
|
-
|
390
|
|
- list[i].overDrug = this.getDrugWarehouseInfo(list[i].DrugWarehouseInfoEnd,list[i].DrugWarehouseOutInfoEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].WareEndStockCancelInfo)
|
391
|
|
- list[i].overDrugPrice = this.getDrugInMoney(list[i].DrugWarehouseInfoEnd,list[i].DrugWarehouseOutInfoEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].WareEndStockCancelInfo)
|
392
|
|
- list[i].oveDrugSaleMoney = this.getSaleMoney(list[i].DrugWarehouseInfoEnd,list[i].DrugWarehouseOutInfoEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].WareEndStockCancelInfo)
|
|
402
|
+ // list[i].drugOutPrice = this.getDrugOutPrice(list[i].DrugWarehouseOutInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryLosses,list[i].WareStartEndStockCancelInfo)
|
|
403
|
+ // list[i].drugOutSalePrice = this.getDrugOutSaleprice(list[i].DrugWarehouseOutInfoStartEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareStartEndStockInventoryLosses,list[i].WareStartEndStockCancelInfo)
|
|
404
|
+ list[i].drugOutPrice = "/"
|
|
405
|
+ list[i].drugOutSalePrice = "/"
|
|
406
|
+
|
|
407
|
+ // list[i].overDrug = this.getDrugWarehouseInfo(list[i].DrugWarehouseInfoEnd,list[i].DrugWarehouseOutInfoEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].WareEndStockCancelInfo)
|
|
408
|
+ // list[i].overDrugPrice = this.getDrugInMoney(list[i].DrugWarehouseInfoEnd,list[i].DrugWarehouseOutInfoEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].WareEndStockCancelInfo)
|
|
409
|
+ // list[i].oveDrugSaleMoney = this.getSaleMoney(list[i].DrugWarehouseInfoEnd,list[i].DrugWarehouseOutInfoEnd,list[i].min_number,list[i].min_unit,list[i].max_unit,list[i].WareEndStockInventoryProfit,list[i].WareEndStockInventoryLosses,list[i].WareEndStockCancelInfo)
|
|
410
|
+ list[i].overDrug = this.GetDrugEndFlow(list[i].DrugEndFlow.over_count,list[i].min_number,list[i].min_unit,list[i].max_unit)
|
|
411
|
+ list[i].overDrugPrice = "/"
|
|
412
|
+ list[i].oveDrugSaleMoney = "/"
|
393
|
413
|
}
|
394
|
414
|
this.tableList = list;
|
395
|
415
|
this.total = response.data.data.total
|
|
@@ -995,6 +1015,9 @@ export default {
|
995
|
1015
|
}
|
996
|
1016
|
},
|
997
|
1017
|
open(){
|
|
1018
|
+
|
|
1019
|
+ this.start_time = moment().year(2022).month(10).date(1).format('YYYY-MM-DD')
|
|
1020
|
+ this.end_time = moment().year(2022).month(10).date(1).format('YYYY-MM-DD')
|
998
|
1021
|
this.houseList= []
|
999
|
1022
|
this.drugTypeList = []
|
1000
|
1023
|
this.getStorehouseList()
|
|
@@ -1199,7 +1222,7 @@ export default {
|
1199
|
1222
|
|
1200
|
1223
|
},
|
1201
|
1224
|
toPrint(){
|
1202
|
|
- this.$router.push({path:"/drugs/purchase/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&page="+this.page+"&limit="+this.limit+"&keyword="+this.keyword+"&good_type="+this.good_type})
|
|
1225
|
+ this.$router.push({path:"/drugs/purchase/new/query/print?start_time="+this.start_time+"&end_time="+this.end_time+"&page="+this.page+"&limit="+this.limit+"&keyword="+this.keyword+"&good_type="+this.good_type})
|
1203
|
1226
|
},
|
1204
|
1227
|
exportList: function() {
|
1205
|
1228
|
for(let i=0;i<this.tableList.length;i++){
|
|
@@ -1233,6 +1256,63 @@ export default {
|
1233
|
1256
|
formatJson(filterVal, jsonData) {
|
1234
|
1257
|
return jsonData.map(v => filterVal.map(j => v[j]));
|
1235
|
1258
|
},
|
|
1259
|
+ GetDrugStartFlow(total,min_number,min_unit,max_unit){
|
|
1260
|
+ var min_str = ""
|
|
1261
|
+ var max_str = ""
|
|
1262
|
+ if (total < min_number) {
|
|
1263
|
+ min_str = total + min_unit;
|
|
1264
|
+ }
|
|
1265
|
+ if (total == 0) {
|
|
1266
|
+ min_str = "";
|
|
1267
|
+ max_str = "";
|
|
1268
|
+ }
|
|
1269
|
+ if (total >= min_number) {
|
|
1270
|
+ if (parseInt(total / min_number) != 0) {
|
|
1271
|
+ max_str = parseInt(total / min_number) + max_unit;
|
|
1272
|
+ }
|
|
1273
|
+ if (total % min_number != 0) {
|
|
1274
|
+ min_str = (total % min_number) + min_unit;
|
|
1275
|
+ }
|
|
1276
|
+ }
|
|
1277
|
+ if(max_str == "" && min_str == ""){
|
|
1278
|
+ return "0"
|
|
1279
|
+ }else{
|
|
1280
|
+ return max_str + min_str;
|
|
1281
|
+ }
|
|
1282
|
+ },
|
|
1283
|
+ GetDrugEndFlow(total,min_number,min_unit,max_unit){
|
|
1284
|
+
|
|
1285
|
+ var min_str = ""
|
|
1286
|
+ var max_str = ""
|
|
1287
|
+ if (total < min_number) {
|
|
1288
|
+ min_str = total + min_unit;
|
|
1289
|
+ }
|
|
1290
|
+ if (total == 0) {
|
|
1291
|
+ min_str = "";
|
|
1292
|
+ max_str = "";
|
|
1293
|
+ }
|
|
1294
|
+ if (total >= min_number) {
|
|
1295
|
+ if (parseInt(total / min_number) != 0) {
|
|
1296
|
+ max_str = parseInt(total / min_number) + max_unit;
|
|
1297
|
+ }
|
|
1298
|
+ if (total % min_number != 0) {
|
|
1299
|
+ min_str = (total % min_number) + min_unit;
|
|
1300
|
+ }
|
|
1301
|
+ }
|
|
1302
|
+ if(max_str == "" && min_str == ""){
|
|
1303
|
+ return "0"
|
|
1304
|
+ }else{
|
|
1305
|
+ return max_str + min_str;
|
|
1306
|
+ }
|
|
1307
|
+ },
|
|
1308
|
+ toOverCount(){
|
|
1309
|
+ getDrugOverCount().then(response=>{
|
|
1310
|
+ if(response.data.state == 1){
|
|
1311
|
+ var msg = response.data.data.msg
|
|
1312
|
+ this.$message.success("调试成功")
|
|
1313
|
+ }
|
|
1314
|
+ })
|
|
1315
|
+ }
|
1236
|
1316
|
}
|
1237
|
1317
|
}
|
1238
|
1318
|
</script>
|