|
@@ -6,8 +6,9 @@
|
6
|
6
|
<div class="app-container ">
|
7
|
7
|
<div class="cell clearfix">
|
8
|
8
|
耗材名称:{{this.$route.query.good_name}}
|
9
|
|
- <!-- 库存:
|
10
|
|
- 厂家: -->
|
|
9
|
+ 库存:{{getInCount(this.$route.query.id)}}
|
|
10
|
+ <!-- 厂家:{{this.$route.query.manufacturer}}
|
|
11
|
+ 规格: -->
|
11
|
12
|
</div>
|
12
|
13
|
<div class="cell clearfix">
|
13
|
14
|
<span>日期查询:</span>
|
|
@@ -38,15 +39,15 @@
|
38
|
39
|
@change="endTimeChange"
|
39
|
40
|
></el-date-picker>
|
40
|
41
|
|
41
|
|
- <span>出入库方式:</span>
|
42
|
|
- <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
|
|
42
|
+ <!-- <span>出入库方式:</span> -->
|
|
43
|
+ <!-- <el-select v-model="stock_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
|
43
|
44
|
<el-option
|
44
|
45
|
v-for="(item,index) in stockType"
|
45
|
46
|
:key="index"
|
46
|
47
|
:label="item.name"
|
47
|
48
|
:value="item.id">
|
48
|
49
|
</el-option>
|
49
|
|
- </el-select>
|
|
50
|
+ </el-select> -->
|
50
|
51
|
|
51
|
52
|
|
52
|
53
|
</div>
|
|
@@ -84,9 +85,10 @@
|
84
|
85
|
<span v-if="scope.row.stock_way == 2 && scope.row.count!=0">{{scope.row.count}}</span>
|
85
|
86
|
</template>
|
86
|
87
|
</el-table-column>
|
87
|
|
- <el-table-column prop="drug_name" label="库存剩余量" align="center">
|
|
88
|
+ <el-table-column prop="drug_name" label="剩余库存量" align="center">
|
88
|
89
|
<template slot-scope="scope">
|
89
|
|
- <span v-if="scope.row.stock_way == 4 && scope.row.stock_count!=0">{{scope.row.stock_count}} </span>
|
|
90
|
+ <!-- <span v-if="scope.row.stock_way == 4 && scope.row.stock_count!=0">{{scope.row.stock_count}} </span> -->
|
|
91
|
+ {{getInCount(scope.row.good_id)- getOutCount(scope.row.good_id) - getAutoCount(scope.row.good_id)}}
|
90
|
92
|
</template>
|
91
|
93
|
</el-table-column>
|
92
|
94
|
<el-table-column prop="drug_name" label="进/出货单价" align="center">
|
|
@@ -133,15 +135,15 @@
|
133
|
135
|
<script>
|
134
|
136
|
import { uParseTime } from '@/utils/tools'
|
135
|
137
|
import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
136
|
|
- import {getStockInList,getStockOutList} from "@/api/drug/drug_stock";
|
|
138
|
+ import {getStockInList} from "@/api/drug/drug_stock";
|
|
139
|
+ import {getStockDrugCount} from "@/api/stock"
|
137
|
140
|
export default {
|
138
|
141
|
name: 'stockIn',
|
139
|
142
|
created() {
|
140
|
|
- // var drugCategory = getDictionaryDataConfig('system','drug_category')
|
141
|
|
- // this.drugCategory.push(...drugCategory)
|
142
|
|
- // this.drugTypeList = getDictionaryDataConfig('system','drug_type')
|
|
143
|
+
|
143
|
144
|
this.getlist()
|
144
|
|
- this.getOutList()
|
|
145
|
+ this.getStockDrugCount()
|
|
146
|
+
|
145
|
147
|
},
|
146
|
148
|
components: {
|
147
|
149
|
BreadCrumb
|
|
@@ -184,7 +186,11 @@
|
184
|
186
|
{id:2,name:"自动出库"},
|
185
|
187
|
{id:3,name:"入库"},
|
186
|
188
|
],
|
187
|
|
-
|
|
189
|
+ countList:[],
|
|
190
|
+ outCountList:[],
|
|
191
|
+ autoCountList:[],
|
|
192
|
+ keywords:"",
|
|
193
|
+ obj:{},
|
188
|
194
|
}
|
189
|
195
|
},
|
190
|
196
|
methods:{
|
|
@@ -192,11 +198,11 @@
|
192
|
198
|
|
193
|
199
|
handleSizeChange(val) {
|
194
|
200
|
this.limit = val
|
195
|
|
- this.GetAllDrugStockQueryList()
|
|
201
|
+ this.getlist()
|
196
|
202
|
},
|
197
|
203
|
handleCurrentChange(val) {
|
198
|
204
|
this.page = val
|
199
|
|
- this.GetAllDrugStockQueryList()
|
|
205
|
+ this.getlist()
|
200
|
206
|
},
|
201
|
207
|
|
202
|
208
|
startTimeChange: function(val) {
|
|
@@ -206,7 +212,7 @@
|
206
|
212
|
this.$message.error("开始时间不能大于结束时间");
|
207
|
213
|
this.start_time = "";
|
208
|
214
|
} else {
|
209
|
|
- this.GetAllDrugStockQueryList();
|
|
215
|
+ this.getlist()
|
210
|
216
|
}
|
211
|
217
|
},
|
212
|
218
|
endTimeChange: function(val) {
|
|
@@ -215,10 +221,9 @@
|
215
|
221
|
this.$message.error("结束时间不能小于开始时间");
|
216
|
222
|
this.end_time = "";
|
217
|
223
|
} else {
|
218
|
|
- this.GetAllDrugStockQueryList();
|
|
224
|
+ this.getlist()
|
219
|
225
|
}
|
220
|
226
|
},
|
221
|
|
- changeDrug(){},
|
222
|
227
|
getManufacturer(id){
|
223
|
228
|
var name = ""
|
224
|
229
|
for(let i=0;i<this.manufacturerList.length;i++){
|
|
@@ -262,26 +267,58 @@
|
262
|
267
|
}
|
263
|
268
|
})
|
264
|
269
|
},
|
265
|
|
- // getOutList(){
|
266
|
|
- // var params= {
|
267
|
|
- // limit:this.limit,
|
268
|
|
- // page:this.page,
|
269
|
|
- // id:this.$route.query.id,
|
270
|
|
- // start_time:this.start_time,
|
271
|
|
- // end_time:this.end_time,
|
272
|
|
- // }
|
273
|
|
- // getStockOutList(params).then(response=>{
|
274
|
|
- // if(response.data.state == 1){
|
275
|
|
- // var outlist = response.data.data.outList
|
276
|
|
- // console.log("出库数据",outlist)
|
277
|
|
- // for(let i=0;i<outlist.length;i++){
|
278
|
|
- // outlist[i].stock_way = 2
|
279
|
|
- // this.tableList.push(outlist[i])
|
280
|
|
- // }
|
281
|
|
- // console.log("hhhhhhhhhhh",this.tableList)
|
282
|
|
- // }
|
283
|
|
- // })
|
284
|
|
- // }
|
|
270
|
+ getStockDrugCount(){
|
|
271
|
+ var params ={
|
|
272
|
+ keywords: this.keywords,
|
|
273
|
+ start_time:this.start_time,
|
|
274
|
+ end_time:this.end_time,
|
|
275
|
+ }
|
|
276
|
+ getStockDrugCount(params).then(response=>{
|
|
277
|
+ if(response.data.state == 1){
|
|
278
|
+ var count = response.data.data.count
|
|
279
|
+ console.log("详情入库统计",count)
|
|
280
|
+ this.countList = count
|
|
281
|
+ var outlist = response.data.data.outList
|
|
282
|
+ console.log("详情出库数量",outlist)
|
|
283
|
+ this.outCountList = outlist
|
|
284
|
+ var autoCount = response.data.data.autoCount
|
|
285
|
+ console.log("详情自动出库",autoCount)
|
|
286
|
+ this.autoCountList = autoCount
|
|
287
|
+ }
|
|
288
|
+ })
|
|
289
|
+ },
|
|
290
|
+ getInCount(id){
|
|
291
|
+ var count= ""
|
|
292
|
+ for(let i=0;i<this.countList.length;i++){
|
|
293
|
+ if(id == this.countList[i].good_id){
|
|
294
|
+ count = this.countList[i].count
|
|
295
|
+ }
|
|
296
|
+ }
|
|
297
|
+ return count
|
|
298
|
+ },
|
|
299
|
+ getOutCount(id){
|
|
300
|
+ console.log("id222",id)
|
|
301
|
+ var count = ""
|
|
302
|
+ for(let i=0;i<this.outCountList.length;i++){
|
|
303
|
+ if(id == this.outCountList[i].good_id){
|
|
304
|
+ count = this.outCountList[i].count
|
|
305
|
+ }
|
|
306
|
+ }
|
|
307
|
+ return count
|
|
308
|
+ },
|
|
309
|
+ getAutoCount(id){
|
|
310
|
+ var count= ""
|
|
311
|
+ for(let i=0;i<this.autoCountList.length;i++){
|
|
312
|
+ if(id == this.autoCountList[i].good_id){
|
|
313
|
+ count = this.outCountList[i].count
|
|
314
|
+ }
|
|
315
|
+ }
|
|
316
|
+ return count
|
|
317
|
+ },
|
|
318
|
+ getTimestamp(time) {
|
|
319
|
+ // 把时间日期转成时间戳
|
|
320
|
+ return new Date(time).getTime() / 1000;
|
|
321
|
+ },
|
285
|
322
|
}
|
286
|
323
|
}
|
287
|
324
|
</script>
|