|
@@ -0,0 +1,455 @@
|
|
1
|
+<template>
|
|
2
|
+ <div>
|
|
3
|
+ <div style="display: flex;justify-content: space-between;margin-bottom:10px;">
|
|
4
|
+ <div class="cell clearfix">
|
|
5
|
+ <span>入库时间:</span>
|
|
6
|
+ <el-date-picker
|
|
7
|
+ size="small"
|
|
8
|
+ v-model="start_time"
|
|
9
|
+ prefix-icon="el-icon-date"
|
|
10
|
+ :editable="false"
|
|
11
|
+ style="width: 196px;"
|
|
12
|
+ type="date"
|
|
13
|
+ placeholder="选择日期时间"
|
|
14
|
+ align="right"
|
|
15
|
+ format="yyyy-MM-dd"
|
|
16
|
+ value-format="yyyy-MM-dd"
|
|
17
|
+ @change="startTimeChange"
|
|
18
|
+ ></el-date-picker>-
|
|
19
|
+ <el-date-picker
|
|
20
|
+ size="small"
|
|
21
|
+ v-model="end_time"
|
|
22
|
+ prefix-icon="el-icon-date"
|
|
23
|
+ :editable="false"
|
|
24
|
+ style="width: 196px;margin-right:10px;"
|
|
25
|
+ type="date"
|
|
26
|
+ placeholder="选择日期时间"
|
|
27
|
+ align="right"
|
|
28
|
+ format="yyyy-MM-dd"
|
|
29
|
+ value-format="yyyy-MM-dd"
|
|
30
|
+ @change="endTimeChange"
|
|
31
|
+ ></el-date-picker>
|
|
32
|
+ </div>
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+ <div>
|
|
36
|
+ <div>销售状态:</div>
|
|
37
|
+ <el-select size="small" v-model="is_sale" placeholder="请选择"
|
|
38
|
+ style="width:100px;margin-left:10px;" @change="changeStock">
|
|
39
|
+ <el-option
|
|
40
|
+ label="不限"
|
|
41
|
+ value="0">
|
|
42
|
+ </el-option>
|
|
43
|
+ <el-option
|
|
44
|
+ v-for="item,index in items"
|
|
45
|
+ :key="index"
|
|
46
|
+ :label="item.name"
|
|
47
|
+ :value="item.id">
|
|
48
|
+ </el-option>
|
|
49
|
+ </el-select>
|
|
50
|
+ </div>
|
|
51
|
+
|
|
52
|
+ <div>
|
|
53
|
+ <div>变更状态:</div>
|
|
54
|
+ <el-select size="small" v-model="change_type" placeholder="请选择"
|
|
55
|
+ style="width:100px;margin-left:10px;" @change="change">
|
|
56
|
+ <el-option
|
|
57
|
+ label="不限"
|
|
58
|
+ value="0">
|
|
59
|
+ </el-option>
|
|
60
|
+ <el-option
|
|
61
|
+ v-for="item,index in changes"
|
|
62
|
+ :key="index"
|
|
63
|
+ :label="item.name"
|
|
64
|
+ :value="item.id">
|
|
65
|
+ </el-option>
|
|
66
|
+ </el-select>
|
|
67
|
+ </div>
|
|
68
|
+ <div>
|
|
69
|
+ <el-button type="primary" @click="query()">查询</el-button>
|
|
70
|
+ <el-button type="primary" @click="change_stock()">变更</el-button>
|
|
71
|
+ <el-button type="primary" @click="exportdata()">导出</el-button>
|
|
72
|
+
|
|
73
|
+ <!-- <el-button type="primary" @click="change()">变更</el-button>-->
|
|
74
|
+ </div>
|
|
75
|
+ </div>
|
|
76
|
+ <el-table :data="tableData" border :row-style="{ color: '#303133' }" ref="table2"
|
|
77
|
+ :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
|
|
78
|
+ max-height="600"
|
|
79
|
+ @select="selectCostInfo"
|
|
80
|
+ @selection-change="changeCostInfoTableData"
|
|
81
|
+ @select-all="changeAllCostInfoTableData"
|
|
82
|
+ highlight-current-row>
|
|
83
|
+ <el-table-column
|
|
84
|
+ align="center"
|
|
85
|
+ type="selection"
|
|
86
|
+ width="55"
|
|
87
|
+ ></el-table-column>
|
|
88
|
+ <el-table-column align="center" prop="name" label="药品名称">
|
|
89
|
+ <template slot-scope="scope">{{scope.row.drug_name}}</template>
|
|
90
|
+ </el-table-column>
|
|
91
|
+ <el-table-column align="center" prop="name" label="药品类型">
|
|
92
|
+ <template slot-scope="scope">{{scope.row.drug_type}}</template>
|
|
93
|
+ </el-table-column>
|
|
94
|
+ <el-table-column align="center" prop="name" label="规格单位">
|
|
95
|
+ <template slot-scope="scope">{{scope.row.spec}}</template>
|
|
96
|
+ </el-table-column>
|
|
97
|
+ <el-table-column align="center" prop="name" label="国家编码">
|
|
98
|
+ <template slot-scope="scope">{{scope.row.code}}</template>
|
|
99
|
+ </el-table-column>
|
|
100
|
+ <el-table-column align="center" prop="name" label="批号">
|
|
101
|
+ <template slot-scope="scope">{{scope.row.batch_number}}</template>
|
|
102
|
+ </el-table-column>
|
|
103
|
+ <el-table-column align="center" prop="name" label="数量">
|
|
104
|
+ <template slot-scope="scope">
|
|
105
|
+ <div>{{scope.row.count}}{{scope.row.unit}}</div>
|
|
106
|
+ </template>
|
|
107
|
+ </el-table-column>
|
|
108
|
+
|
|
109
|
+ <el-table-column align="center" prop="total" label="开方日期">
|
|
110
|
+ <template slot-scope="scope">
|
|
111
|
+ <div>{{scope.row.p_date}}</div>
|
|
112
|
+ </template>
|
|
113
|
+ </el-table-column>
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+ <el-table-column align="center" prop="total" label="结算日期">
|
|
117
|
+ <template slot-scope="scope">
|
|
118
|
+ <div>{{scope.row.e_date}}</div>
|
|
119
|
+ </template>
|
|
120
|
+ </el-table-column>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+ <el-table-column align="center" prop="total" label="销售状态">
|
|
124
|
+ <template slot-scope="scope">
|
|
125
|
+ <div>{{scope.row.is_sale?'已销售':'未销售'}}</div>
|
|
126
|
+ </template>
|
|
127
|
+ </el-table-column>
|
|
128
|
+
|
|
129
|
+ <el-table-column align="center" prop="total" label="变更状态">
|
|
130
|
+ <template slot-scope="scope">
|
|
131
|
+ <div>{{scope.row.is_bg?'已变更':'未变更'}}</div>
|
|
132
|
+ </template>
|
|
133
|
+ </el-table-column>
|
|
134
|
+
|
|
135
|
+ <el-table-column align="center" prop="total" label="盘存日期">
|
|
136
|
+ <template slot-scope="scope">
|
|
137
|
+ <div>{{scope.row.pc_date}}</div>
|
|
138
|
+ </template>
|
|
139
|
+ </el-table-column>
|
|
140
|
+
|
|
141
|
+ <el-table-column label="操作" width="200">
|
|
142
|
+ <template slot-scope="scope">
|
|
143
|
+ <el-button v-if="!scope.row.is_sale || scope.row.is_sale == 0" type="primary" @click="sigle_stock(scope.row)">盘存</el-button>
|
|
144
|
+ <el-button type="primary" @click="deleteStock(scope.row)">删除</el-button>
|
|
145
|
+ </template>
|
|
146
|
+ </el-table-column>
|
|
147
|
+ </el-table>
|
|
148
|
+ <el-pagination
|
|
149
|
+ @size-change="handleSizeChange"
|
|
150
|
+ @current-change="handleCurrentChange"
|
|
151
|
+ :page-size="5"
|
|
152
|
+ :page-sizes="[10, 20, 50, 100,500,1000,2000]"
|
|
153
|
+ background
|
|
154
|
+ style="margin-top:20px;float: right"
|
|
155
|
+ :total="value"
|
|
156
|
+ ></el-pagination>
|
|
157
|
+
|
|
158
|
+ <el-table v-show="false" :data="tableData" border :row-style="{ color: '#303133' }" ref="table"
|
|
159
|
+ :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
|
|
160
|
+ max-height="600"
|
|
161
|
+ @select="selectCostInfo"
|
|
162
|
+ @selection-change="changeCostInfoTableData"
|
|
163
|
+ @select-all="changeAllCostInfoTableData"
|
|
164
|
+ highlight-current-row>
|
|
165
|
+ <el-table-column
|
|
166
|
+ align="center"
|
|
167
|
+ type="selection"
|
|
168
|
+ width="55"
|
|
169
|
+ ></el-table-column>
|
|
170
|
+ <el-table-column align="center" prop="name" label="药品名称">
|
|
171
|
+ <template slot-scope="scope">{{scope.row.drug_name}}</template>
|
|
172
|
+ </el-table-column>
|
|
173
|
+ <el-table-column align="center" prop="name" label="药品类型">
|
|
174
|
+ <template slot-scope="scope">{{scope.row.drug_type}}</template>
|
|
175
|
+ </el-table-column>
|
|
176
|
+ <el-table-column align="center" prop="name" label="规格单位">
|
|
177
|
+ <template slot-scope="scope">{{scope.row.spec}}</template>
|
|
178
|
+ </el-table-column>
|
|
179
|
+ <el-table-column align="center" prop="name" label="国家编码">
|
|
180
|
+ <template slot-scope="scope">{{scope.row.code}}</template>
|
|
181
|
+ </el-table-column>
|
|
182
|
+ <el-table-column align="center" prop="name" label="批号">
|
|
183
|
+ <template slot-scope="scope">{{scope.row.batch_number}}</template>
|
|
184
|
+ </el-table-column>
|
|
185
|
+ <el-table-column align="center" prop="name" label="数量">
|
|
186
|
+ <template slot-scope="scope">
|
|
187
|
+ <div>{{scope.row.count}}{{scope.row.unit}}</div>
|
|
188
|
+ </template>
|
|
189
|
+ </el-table-column>
|
|
190
|
+
|
|
191
|
+ <el-table-column align="center" prop="total" label="开方日期">
|
|
192
|
+ <template slot-scope="scope">
|
|
193
|
+ <div>{{scope.row.p_date}}</div>
|
|
194
|
+ </template>
|
|
195
|
+ </el-table-column>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+ <el-table-column align="center" prop="total" label="结算日期">
|
|
199
|
+ <template slot-scope="scope">
|
|
200
|
+ <div>{{scope.row.e_date}}</div>
|
|
201
|
+ </template>
|
|
202
|
+ </el-table-column>
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+ <el-table-column align="center" prop="total" label="盘存状态">
|
|
206
|
+ <template slot-scope="scope">
|
|
207
|
+ <div>{{scope.row.is_pc?'已盘存':'未盘存'}}</div>
|
|
208
|
+ </template>
|
|
209
|
+ </el-table-column>
|
|
210
|
+
|
|
211
|
+ <el-table-column align="center" prop="total" label="变更状态">
|
|
212
|
+ <template slot-scope="scope">
|
|
213
|
+ <div>{{scope.row.is_bg?'已变更':'未变更'}}</div>
|
|
214
|
+ </template>
|
|
215
|
+ </el-table-column>
|
|
216
|
+
|
|
217
|
+ <el-table-column align="center" prop="total" label="盘存日期">
|
|
218
|
+ <template slot-scope="scope">
|
|
219
|
+ <div>{{scope.row.pc_date}}</div>
|
|
220
|
+ </template>
|
|
221
|
+ </el-table-column>
|
|
222
|
+
|
|
223
|
+ </el-table>
|
|
224
|
+
|
|
225
|
+ </div>
|
|
226
|
+
|
|
227
|
+ <!-- </div> -->
|
|
228
|
+</template>
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+<script>
|
|
232
|
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
|
233
|
+import { GetDrugChangeStock } from '../../api/new_stock/stock'
|
|
234
|
+import { getDictionaryDataConfig } from "@/utils/data";
|
|
235
|
+import { uParseTime } from '@/utils/tools'
|
|
236
|
+import axios from 'axios'
|
|
237
|
+const moment = require('moment')
|
|
238
|
+export default {
|
|
239
|
+ components: {
|
|
240
|
+ BreadCrumb
|
|
241
|
+ },
|
|
242
|
+ data() {
|
|
243
|
+ return {
|
|
244
|
+ drugTypeList: [{ id: 0, name: "全部" }],
|
|
245
|
+ start_time: new Date(new Date().getFullYear(), new Date().getMonth(), 1).toLocaleDateString('en-CA'),
|
|
246
|
+ end_time: new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).toLocaleDateString('en-CA'),
|
|
247
|
+ tableData: [],
|
|
248
|
+ change_type:"0",
|
|
249
|
+ selection:[],
|
|
250
|
+ page:1,
|
|
251
|
+ limit:10,
|
|
252
|
+ value:0,
|
|
253
|
+ is_sale:"0",
|
|
254
|
+ items: [
|
|
255
|
+ { id: 1, name: '已盘存' },
|
|
256
|
+ { id: 2, name: '未盘存' },
|
|
257
|
+ ],
|
|
258
|
+ changes: [
|
|
259
|
+ { id: 1, name: '已变更' },
|
|
260
|
+ { id: 2, name: '未变更' },
|
|
261
|
+ ]
|
|
262
|
+ }
|
|
263
|
+ },
|
|
264
|
+ methods: {
|
|
265
|
+ deleteStock(row){
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+ },
|
|
270
|
+ sigle_stock(row){
|
|
271
|
+ var that = this;
|
|
272
|
+ let params = {
|
|
273
|
+ ids:row.id,
|
|
274
|
+ admin_user_id:this.$store.getters.xt_user.user.id
|
|
275
|
+ };
|
|
276
|
+ axios.get('http://127.0.0.1:9532/api/changedrug',{params:params}).then(function(response) {
|
|
277
|
+ if (response.data.state == 0) {
|
|
278
|
+ that.$message.error(response.data.data.msg);
|
|
279
|
+ return false
|
|
280
|
+ } else {
|
|
281
|
+ if(response.data.data.failed_code == -10){
|
|
282
|
+ that.$confirm(response.data.data.msg, '医保错误信息', {
|
|
283
|
+ confirmButtonText: '确 定',
|
|
284
|
+ type: 'warning'
|
|
285
|
+ }).then(() => {
|
|
286
|
+ }).catch(() => {
|
|
287
|
+ })
|
|
288
|
+ }else{
|
|
289
|
+
|
|
290
|
+ }
|
|
291
|
+ }
|
|
292
|
+ }).catch(function(error) {
|
|
293
|
+ })
|
|
294
|
+ },
|
|
295
|
+ handleSizeChange(val) {
|
|
296
|
+ this.limit = val
|
|
297
|
+ this.GetDrugStock()
|
|
298
|
+ },
|
|
299
|
+ handleCurrentChange(val) {
|
|
300
|
+ this.page = val
|
|
301
|
+ this.GetDrugStock()
|
|
302
|
+ },
|
|
303
|
+ selectCostInfo(selection, row) {
|
|
304
|
+ this.selection = selection
|
|
305
|
+ }, changeCostInfoTableData(val) {
|
|
306
|
+ this.selection = val
|
|
307
|
+ }, changeAllCostInfoTableData(selection) {
|
|
308
|
+ this.selection = selection
|
|
309
|
+ },
|
|
310
|
+ delete(){
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+ },
|
|
314
|
+ exportdata(){
|
|
315
|
+ let list = []
|
|
316
|
+ // for (let i = 0; i < this.tableData.length; i++) {
|
|
317
|
+ // let order = this.tableData[i]
|
|
318
|
+ // let name = order.name
|
|
319
|
+ // let item_name = order.item_name
|
|
320
|
+ // let count = order.count
|
|
321
|
+ // let price = order.price.toFixed(2)
|
|
322
|
+ // let pay_sumamt = (order.price.toFixed(2) * order.count).toFixed(2)
|
|
323
|
+ // let total = order.total.toFixed(2)
|
|
324
|
+ //
|
|
325
|
+ // let obj = {
|
|
326
|
+ // '患者姓名': name,
|
|
327
|
+ // '项目名称': item_name,
|
|
328
|
+ // '数量': count,
|
|
329
|
+ // '单价': price,
|
|
330
|
+ // '费用': pay_sumamt,
|
|
331
|
+ // '费用总额': total
|
|
332
|
+ // }
|
|
333
|
+ // list.push(obj)
|
|
334
|
+ // }
|
|
335
|
+ import('@/vendor/Export2Excel').then(excel => {
|
|
336
|
+ const tHeader = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
|
|
337
|
+ const filterVal = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
|
|
338
|
+ const data = this.formatJson(filterVal, list)
|
|
339
|
+ excel.export_json_to_excel1({
|
|
340
|
+ header: tHeader,
|
|
341
|
+ data,
|
|
342
|
+ filename: '明细',
|
|
343
|
+ ref: this.$refs['table'].$el
|
|
344
|
+ })
|
|
345
|
+ })
|
|
346
|
+
|
|
347
|
+ },formatJson(filterVal, jsonData) {
|
|
348
|
+ return jsonData.map(v => filterVal.map(j => v[j]))
|
|
349
|
+ },
|
|
350
|
+ change_stock(){
|
|
351
|
+ let ids = ""
|
|
352
|
+ for (var i = 0; i < this.selection.length; i++){
|
|
353
|
+ if (ids.length == 0){
|
|
354
|
+ ids = this.selection[i].id
|
|
355
|
+ }else{
|
|
356
|
+ ids = ids + "," + this.selection[i].id
|
|
357
|
+ }
|
|
358
|
+ }
|
|
359
|
+ var that = this;
|
|
360
|
+ let params = {
|
|
361
|
+ ids:ids,
|
|
362
|
+ admin_user_id:this.$store.getters.xt_user.user.id
|
|
363
|
+ };
|
|
364
|
+ axios.get('http://127.0.0.1:9532/api/changedrug',{params:params}).then(function(response) {
|
|
365
|
+ if (response.data.state == 0) {
|
|
366
|
+ that.$message.error(response.data.data.msg);
|
|
367
|
+ return false
|
|
368
|
+ } else {
|
|
369
|
+ if(response.data.data.failed_code == -10){
|
|
370
|
+ that.$confirm(response.data.data.msg, '医保错误信息', {
|
|
371
|
+ confirmButtonText: '确 定',
|
|
372
|
+ type: 'warning'
|
|
373
|
+ }).then(() => {
|
|
374
|
+ }).catch(() => {
|
|
375
|
+ })
|
|
376
|
+ }else{
|
|
377
|
+
|
|
378
|
+ }
|
|
379
|
+ }
|
|
380
|
+ }).catch(function(error) {
|
|
381
|
+ })
|
|
382
|
+
|
|
383
|
+ },
|
|
384
|
+ query(){
|
|
385
|
+ this.GetDrugStock()
|
|
386
|
+
|
|
387
|
+ },
|
|
388
|
+ change(){
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+ },getDrugType(id) {
|
|
392
|
+ var name = "";
|
|
393
|
+ for (let i = 0; i < this.drugTypeList.length; i++) {
|
|
394
|
+ if (this.drugTypeList[i].id == id) {
|
|
395
|
+ name = this.drugTypeList[i].name;
|
|
396
|
+ }
|
|
397
|
+ }
|
|
398
|
+
|
|
399
|
+ return name;
|
|
400
|
+ }, getTime(val) {
|
|
401
|
+ if(val == "" || val == undefined){
|
|
402
|
+ return ""
|
|
403
|
+ }else {
|
|
404
|
+ return uParseTime(val, '{y}-{m}-{d}')
|
|
405
|
+ }
|
|
406
|
+ },GetDrugStock(){
|
|
407
|
+ this.tableData = []
|
|
408
|
+ let params = {
|
|
409
|
+ start_time: this.start_time,
|
|
410
|
+ end_time: this.end_time,
|
|
411
|
+ page:this.page,
|
|
412
|
+ limit:this.limit,
|
|
413
|
+ is_sale:this.is_sale,
|
|
414
|
+ is_bg:this.change_type
|
|
415
|
+ }
|
|
416
|
+ GetDrugChangeStock(params).then(response => {
|
|
417
|
+ if (response.data.state == 0) {
|
|
418
|
+ this.$message.error(response.data.msg)
|
|
419
|
+ return false
|
|
420
|
+ } else {
|
|
421
|
+ this.value = response.data.data.total
|
|
422
|
+ for(let i =0; i < response.data.data.info.length; i++){
|
|
423
|
+ let obj = {
|
|
424
|
+ id:response.data.data.info[i].id,
|
|
425
|
+ drug_name:response.data.data.info[i].BaseDrugLib.drug_name,
|
|
426
|
+ drug_type:this.getDrugType(response.data.data.info[i].BaseDrugLib.drug_type),
|
|
427
|
+ spec: response.data.data.info[i].BaseDrugLib.dose + response.data.data.info[i].BaseDrugLib.dose_unit + "*" + response.data.data.info[i].BaseDrugLib.min_number + response.data.data.info[i].BaseDrugLib.min_unit+"/" +response.data.data.info[i].BaseDrugLib.max_unit,
|
|
428
|
+ code:response.data.data.info[i].BaseDrugLib.medical_insurance_number,
|
|
429
|
+ batch_number:response.data.data.info[i].batch_number,
|
|
430
|
+ count: response.data.data.info[i].PCount,
|
|
431
|
+ p_date:this.getTime(response.data.data.info[i].PDate),
|
|
432
|
+ e_date:(response.data.data.info[i].SDate),
|
|
433
|
+ is_sale:response.data.data.info[i].is_sale,
|
|
434
|
+ pc_date:response.data.data.info[i].pc_date,
|
|
435
|
+ is_bg:response.data.data.info[i].is_change,
|
|
436
|
+ unit:response.data.data.info[i].Unit
|
|
437
|
+ }
|
|
438
|
+ this.tableData.push(obj)
|
|
439
|
+ }
|
|
440
|
+ }
|
|
441
|
+ })
|
|
442
|
+ },
|
|
443
|
+ changeStock(){
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+ },
|
|
447
|
+ },
|
|
448
|
+ created() {
|
|
449
|
+ var drugTypeList = getDictionaryDataConfig("system", "drug_type");
|
|
450
|
+ this.drugTypeList.push(...drugTypeList);
|
|
451
|
+ this.GetDrugStock()
|
|
452
|
+ }
|
|
453
|
+}
|
|
454
|
+</script>
|
|
455
|
+
|