|
@@ -0,0 +1,934 @@
|
|
1
|
+<template>
|
|
2
|
+ <div class="main-contain">
|
|
3
|
+ <div class="position">
|
|
4
|
+ <bread-crumb :crumbs="crumbs"></bread-crumb>
|
|
5
|
+ <el-button
|
|
6
|
+ size="small"
|
|
7
|
+ @click="handleWarehouse"
|
|
8
|
+ class="filter-item"
|
|
9
|
+ style="float: right"
|
|
10
|
+ type="primary"
|
|
11
|
+ icon="el-icon-circle-plus-outline"
|
|
12
|
+ >新增</el-button
|
|
13
|
+ >
|
|
14
|
+ </div>
|
|
15
|
+
|
|
16
|
+ <div class="app-container">
|
|
17
|
+ <div class="cell clearfix">
|
|
18
|
+ <label class="title"><span class="name">患者</span> :</label>
|
|
19
|
+ <el-select
|
|
20
|
+ size="small"
|
|
21
|
+ v-model="patient_id"
|
|
22
|
+ filterable
|
|
23
|
+ placeholder="请选择患者"
|
|
24
|
+ style="width: 200px"
|
|
25
|
+ @change="changeStoreHouse"
|
|
26
|
+ >
|
|
27
|
+ <el-option
|
|
28
|
+ v-for="(option, index) in patientList"
|
|
29
|
+ :key="index"
|
|
30
|
+ :label="option.name"
|
|
31
|
+ :value="option.id"
|
|
32
|
+ >
|
|
33
|
+ </el-option>
|
|
34
|
+ </el-select>
|
|
35
|
+ <el-input
|
|
36
|
+ size="small"
|
|
37
|
+ style="width: 200px"
|
|
38
|
+ v-model.trim="searchKey"
|
|
39
|
+ class="filter-item"
|
|
40
|
+ placeholder="单据编码/制单人/药品名称"
|
|
41
|
+ />
|
|
42
|
+ <el-button
|
|
43
|
+ size="small"
|
|
44
|
+ class="filter-item"
|
|
45
|
+ type="primary"
|
|
46
|
+ icon="el-icon-search"
|
|
47
|
+ @click="search"
|
|
48
|
+ >搜索</el-button
|
|
49
|
+ >
|
|
50
|
+ <div style="margin-left: 10px">
|
|
51
|
+ <label class="title"><span class="name">入库时间</span> : </label>
|
|
52
|
+ <el-date-picker
|
|
53
|
+ size="small"
|
|
54
|
+ v-model="start_time"
|
|
55
|
+ prefix-icon="el-icon-date"
|
|
56
|
+ :editable="false"
|
|
57
|
+ style="width: 196px"
|
|
58
|
+ type="date"
|
|
59
|
+ placeholder="选择日期时间"
|
|
60
|
+ align="right"
|
|
61
|
+ format="yyyy-MM-dd"
|
|
62
|
+ value-format="yyyy-MM-dd"
|
|
63
|
+ @change="startTimeChange"
|
|
64
|
+ ></el-date-picker>
|
|
65
|
+ <span class="cellLine"> - </span>
|
|
66
|
+ <el-date-picker
|
|
67
|
+ size="small"
|
|
68
|
+ v-model="end_time"
|
|
69
|
+ prefix-icon="el-icon-date"
|
|
70
|
+ :editable="false"
|
|
71
|
+ style="width: 196px"
|
|
72
|
+ type="date"
|
|
73
|
+ placeholder="选择日期时间"
|
|
74
|
+ align="right"
|
|
75
|
+ format="yyyy-MM-dd"
|
|
76
|
+ value-format="yyyy-MM-dd"
|
|
77
|
+ @change="endTimeChange"
|
|
78
|
+ ></el-date-picker>
|
|
79
|
+ </div>
|
|
80
|
+ <!-- <div style="margin-left: 10px">
|
|
81
|
+ <span>审核状态:</span>
|
|
82
|
+ <el-select
|
|
83
|
+ v-model="check_id"
|
|
84
|
+ style="width: 140px; margin-right: 10px"
|
|
85
|
+ placeholder="请选择"
|
|
86
|
+ @change="changeTypeName"
|
|
87
|
+ >
|
|
88
|
+ <el-option
|
|
89
|
+ v-for="item in checkList"
|
|
90
|
+ :key="item.id"
|
|
91
|
+ :label="item.name"
|
|
92
|
+ :value="item.id"
|
|
93
|
+ >
|
|
94
|
+ </el-option>
|
|
95
|
+ </el-select>
|
|
96
|
+ </div> -->
|
|
97
|
+ </div>
|
|
98
|
+
|
|
99
|
+ <div class="cell clearfix">
|
|
100
|
+ <el-checkbox
|
|
101
|
+ style="width: 70px"
|
|
102
|
+ v-model="checked"
|
|
103
|
+ @change="changeAllSelected"
|
|
104
|
+ >全选</el-checkbox
|
|
105
|
+ >
|
|
106
|
+ <el-button size="small" icon="el-icon-delete" @click="batchDelete"
|
|
107
|
+ >删除</el-button
|
|
108
|
+ >
|
|
109
|
+ <el-button size="small" type="primary" @click="drugPrint()"
|
|
110
|
+ >打印</el-button
|
|
111
|
+ >
|
|
112
|
+ <el-button size="small" type="primary" @click="toExport()" :disabled="exportLoding">导出</el-button>
|
|
113
|
+ <div>
|
|
114
|
+ <span> </span>
|
|
115
|
+ <label class="title"><span class="name">审核状态</span> :</label>
|
|
116
|
+ <el-select
|
|
117
|
+ size="small"
|
|
118
|
+ v-model="check_type"
|
|
119
|
+ filterable
|
|
120
|
+ placeholder="请选择仓库"
|
|
121
|
+ style="width: 200px"
|
|
122
|
+ @change="changeCheckType"
|
|
123
|
+ >
|
|
124
|
+ <el-option
|
|
125
|
+ v-for="(option, index) in checkList"
|
|
126
|
+ :key="index"
|
|
127
|
+ :label="option.name"
|
|
128
|
+ :value="option.id"
|
|
129
|
+ >
|
|
130
|
+ </el-option>
|
|
131
|
+ </el-select>
|
|
132
|
+ </div>
|
|
133
|
+ </div>
|
|
134
|
+
|
|
135
|
+ <el-table
|
|
136
|
+ :data="tableList"
|
|
137
|
+ :class="signAndWeighBoxPatients"
|
|
138
|
+ style="width: 100%"
|
|
139
|
+ border
|
|
140
|
+ highlight-current-row
|
|
141
|
+ v-loading="Warehouse.loading"
|
|
142
|
+ ref="multipleTable"
|
|
143
|
+ @selection-change="select"
|
|
144
|
+ :row-style="{ color: '#303133' }"
|
|
145
|
+ :header-cell-style="{
|
|
146
|
+ backgroundColor: 'rgb(245, 247, 250)',
|
|
147
|
+ color: '#606266',
|
|
148
|
+ }"
|
|
149
|
+ @current-change="handleCurrentChangeOne"
|
|
150
|
+ >
|
|
151
|
+ <el-table-column align="center" type="selection" width="55">
|
|
152
|
+ </el-table-column>
|
|
153
|
+
|
|
154
|
+ <el-table-column label="药品名称" align="center">
|
|
155
|
+ <template slot-scope="scope">
|
|
156
|
+ {{ scope.row.drug.drug_name }}
|
|
157
|
+ </template>
|
|
158
|
+ </el-table-column>
|
|
159
|
+
|
|
160
|
+ <el-table-column label="药品类型" align="center">
|
|
161
|
+ <template slot-scope="scope">
|
|
162
|
+ {{ GetDrugTypeName(scope.row.drug.drug_type) }}
|
|
163
|
+ </template>
|
|
164
|
+ </el-table-column>
|
|
165
|
+
|
|
166
|
+ <el-table-column label="规格" align="center">
|
|
167
|
+ <template slot-scope="scope">
|
|
168
|
+ {{ scope.row.drug.dose }} {{ scope.row.drug.dose_unit }} * {{ scope.row.drug.min_number}} {{ scope.row.drug.min_unit}} / {{ scope.row.max_unit }}
|
|
169
|
+ </template>
|
|
170
|
+ </el-table-column>
|
|
171
|
+
|
|
172
|
+ <el-table-column label="批号" align="center">
|
|
173
|
+ <template slot-scope="scope">
|
|
174
|
+ {{ scope.row.batch_number }}
|
|
175
|
+ </template>
|
|
176
|
+ </el-table-column>
|
|
177
|
+
|
|
178
|
+ <el-table-column label="入库数量" align="center">
|
|
179
|
+ <template slot-scope="scope">
|
|
180
|
+ {{ scope.row.warehousing_count }} {{ scope.row.max_unit }}
|
|
181
|
+ </template>
|
|
182
|
+ </el-table-column>
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+ <el-table-column label="生产厂家" align="center">
|
|
187
|
+ <template slot-scope="scope">
|
|
188
|
+ {{ getManufacturer(scope.row.manufacturer) }}
|
|
189
|
+ </template>
|
|
190
|
+ </el-table-column>
|
|
191
|
+
|
|
192
|
+ <el-table-column label="生产日期" align="center">
|
|
193
|
+ <template slot-scope="scope">
|
|
194
|
+ {{ getTime(scope.row.product_date) }}
|
|
195
|
+ </template>
|
|
196
|
+ </el-table-column>
|
|
197
|
+
|
|
198
|
+ <el-table-column label="有效日期" align="center">
|
|
199
|
+ <template slot-scope="scope">
|
|
200
|
+ {{ getTime(scope.row.expiry_date) }}
|
|
201
|
+ </template>
|
|
202
|
+ </el-table-column>
|
|
203
|
+
|
|
204
|
+ <el-table-column label="备注" align="center">
|
|
205
|
+ <template slot-scope="scope">
|
|
206
|
+ {{ scope.row.remark }}
|
|
207
|
+ </template>
|
|
208
|
+ </el-table-column>
|
|
209
|
+
|
|
210
|
+ <el-table-column label="操作" align="center" width="240">
|
|
211
|
+ <template slot-scope="scope">
|
|
212
|
+ <el-tooltip
|
|
213
|
+ class="item"
|
|
214
|
+ effect="dark"
|
|
215
|
+ content="编辑"
|
|
216
|
+ placement="top"
|
|
217
|
+ >
|
|
218
|
+ <el-button
|
|
219
|
+ size="small"
|
|
220
|
+ type="primary"
|
|
221
|
+ icon="el-icon-edit-outline"
|
|
222
|
+ @click="handleEdit(scope.$index, scope.row)"
|
|
223
|
+ >
|
|
224
|
+ </el-button>
|
|
225
|
+ </el-tooltip>
|
|
226
|
+ <el-tooltip
|
|
227
|
+ class="item"
|
|
228
|
+ effect="dark"
|
|
229
|
+ content="删除"
|
|
230
|
+ placement="top"
|
|
231
|
+ >
|
|
232
|
+ <el-button
|
|
233
|
+ size="small"
|
|
234
|
+ type="danger"
|
|
235
|
+ icon="el-icon-delete"
|
|
236
|
+ @click="handleDelete(scope.$index, scope.row)"
|
|
237
|
+ >
|
|
238
|
+ </el-button>
|
|
239
|
+ </el-tooltip>
|
|
240
|
+ </template>
|
|
241
|
+ </el-table-column>
|
|
242
|
+ </el-table>
|
|
243
|
+
|
|
244
|
+ <el-pagination
|
|
245
|
+ @size-change="handleSizeChange"
|
|
246
|
+ @current-change="handleCurrentChange"
|
|
247
|
+ :page-sizes="[5, 10, 50, 100]"
|
|
248
|
+ :page-size="5"
|
|
249
|
+ background
|
|
250
|
+ style="margin-top: 20px; text-align: right"
|
|
251
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
252
|
+ :total="total"
|
|
253
|
+ >
|
|
254
|
+ </el-pagination>
|
|
255
|
+
|
|
256
|
+ </div>
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+ </div>
|
|
260
|
+</template>
|
|
261
|
+
|
|
262
|
+<script>
|
|
263
|
+import { uParseTime } from "@/utils/tools";
|
|
264
|
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
|
|
265
|
+import {
|
|
266
|
+ deleteDrugWarehouseInfo,
|
|
267
|
+ getDrugWarehouseInfoList,
|
|
268
|
+ exportDrugList,
|
|
269
|
+
|
|
270
|
+} from "@/api/drug/drug_stock";
|
|
271
|
+import { getAllDrugList } from "@/api/data";
|
|
272
|
+import { getDictionaryDataConfig } from "@/utils/data";
|
|
273
|
+import BreadCrumb from "../../components/bread-crumb";
|
|
274
|
+ import { getallPatientList,getAllSelfDrugWarehouseInfoList,deleteSelfWarehouseInfo} from "@/api/drug/drug"
|
|
275
|
+export default {
|
|
276
|
+ name: "drugStockInOrder",
|
|
277
|
+ components: { BreadCrumb },
|
|
278
|
+ created() {
|
|
279
|
+ this.org_id = this.$store.getters.xt_user.org.id
|
|
280
|
+ if (this.$route.path == "/Pharmacy/drugs/stock/in") {
|
|
281
|
+ this.crumbs = [
|
|
282
|
+ { path: false, name: "药品管理" },
|
|
283
|
+ { path: "/stock/drugs/stock/query", name: "入库单·" },
|
|
284
|
+ ];
|
|
285
|
+ }
|
|
286
|
+ this.drugTypeList = getDictionaryDataConfig("system", "drug_type");
|
|
287
|
+ var nowDate = new Date();
|
|
288
|
+ var nowYear = nowDate.getFullYear();
|
|
289
|
+ var nowMonth = nowDate.getMonth() + 1;
|
|
290
|
+ var nowDay = nowDate.getDate();
|
|
291
|
+ this.end_time =
|
|
292
|
+ nowYear +
|
|
293
|
+ "-" +
|
|
294
|
+ (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
|
|
295
|
+ "-" +
|
|
296
|
+ (nowDay < 10 ? "0" + nowDay : nowDay);
|
|
297
|
+ nowDate.setMonth(nowDate.getMonth() - 1);
|
|
298
|
+ nowYear = nowDate.getFullYear();
|
|
299
|
+ nowMonth = nowDate.getMonth() + 1;
|
|
300
|
+ nowDay = nowDate.getDate();
|
|
301
|
+ this.start_time =
|
|
302
|
+ nowYear +
|
|
303
|
+ "-" +
|
|
304
|
+ (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
|
|
305
|
+ "-" +
|
|
306
|
+ (nowDay < 10 ? "0" + nowDay : nowDay);
|
|
307
|
+
|
|
308
|
+ this.getallPatientList()
|
|
309
|
+
|
|
310
|
+ this.getAllSelfDrugWarehouseInfoList()
|
|
311
|
+ },
|
|
312
|
+ data() {
|
|
313
|
+ return {
|
|
314
|
+ crumbs: [
|
|
315
|
+ { path: false, name: "库存管理" },
|
|
316
|
+ { path: false, name: "入库单" },
|
|
317
|
+ ],
|
|
318
|
+ searchKey: "",
|
|
319
|
+ type: 1,
|
|
320
|
+ page: 1,
|
|
321
|
+ limit: 5,
|
|
322
|
+ checked: false,
|
|
323
|
+ total: 0,
|
|
324
|
+ pageTotal: 0,
|
|
325
|
+ pageSelect: 0,
|
|
326
|
+ adminUserOptions: [],
|
|
327
|
+ multipleSelection: [],
|
|
328
|
+ signAndWeighBoxPatients: "sign-and-weigh-box-patients",
|
|
329
|
+ start_time: "",
|
|
330
|
+ end_time: "",
|
|
331
|
+ selectedTableData: [],
|
|
332
|
+ Warehouse: {
|
|
333
|
+ loading: false,
|
|
334
|
+ warehouseDate: [],
|
|
335
|
+ tableCurrentIndex: "",
|
|
336
|
+ },
|
|
337
|
+
|
|
338
|
+ WarehouseInfo: {
|
|
339
|
+ loading: false,
|
|
340
|
+ warehouseInfoDate: [],
|
|
341
|
+ },
|
|
342
|
+ check_id: 0,
|
|
343
|
+
|
|
344
|
+ startTime: "",
|
|
345
|
+ dialogVisible: false,
|
|
346
|
+ showOne: false,
|
|
347
|
+ drugTypeList: [],
|
|
348
|
+ manufacturerList: [],
|
|
349
|
+ order_id: "",
|
|
350
|
+ dealerList: [],
|
|
351
|
+ exportList: [],
|
|
352
|
+ houseList: [],
|
|
353
|
+ storehouse_id: 0,
|
|
354
|
+ check_type: 0,
|
|
355
|
+ checkList: [
|
|
356
|
+ { id: 0, name: "全部" },
|
|
357
|
+ { id: 1, name: "已审核" },
|
|
358
|
+ { id: 2, name: "未审核" },
|
|
359
|
+ ],
|
|
360
|
+ exportLoding:false,
|
|
361
|
+ org_id:0,
|
|
362
|
+ patient_id:0,
|
|
363
|
+ patientList:[],
|
|
364
|
+ tableList:[],
|
|
365
|
+ manufacturerList:[],
|
|
366
|
+ dealerList:[],
|
|
367
|
+ drugTypeList:[],
|
|
368
|
+ };
|
|
369
|
+ },
|
|
370
|
+
|
|
371
|
+ methods: {
|
|
372
|
+
|
|
373
|
+ getAllSelfDrugWarehouseInfoList(){
|
|
374
|
+ var params = {
|
|
375
|
+ keyword:this.searchKey,
|
|
376
|
+ patient_id:this.patient_id,
|
|
377
|
+ }
|
|
378
|
+ getAllSelfDrugWarehouseInfoList(params).then(response=>{
|
|
379
|
+ if(response.data.state ==1){
|
|
380
|
+ var infoList = response.data.data.infoList
|
|
381
|
+ console.log("infolist22222222222222",infoList)
|
|
382
|
+ this.tableList = infoList
|
|
383
|
+ this.manufacturerList = response.data.data.manufacturerList
|
|
384
|
+ this.dealerList = response.data.data.dealerList
|
|
385
|
+ this.drugTypeList = response.data.data.drugTypeList
|
|
386
|
+
|
|
387
|
+ }
|
|
388
|
+ })
|
|
389
|
+ },
|
|
390
|
+ tableRowClassName({ row, rowIndex }) {
|
|
391
|
+ // 把每一行的索引放进row
|
|
392
|
+ row.index = rowIndex;
|
|
393
|
+ },
|
|
394
|
+ onRowClick(row, event, column) {
|
|
395
|
+ this.WarehouseInfo.warehouseInfoDate = [];
|
|
396
|
+ this.Warehouse.tableCurrentIndex = row.index;
|
|
397
|
+ const params = {
|
|
398
|
+ id: row.id,
|
|
399
|
+ };
|
|
400
|
+ this.WarehouseInfo.loading = true;
|
|
401
|
+ getDrugWarehouseInfoList(params).then((response) => {
|
|
402
|
+ if (response.data.state == 0) {
|
|
403
|
+ this.WarehouseInfo.loading = false;
|
|
404
|
+ this.$message.error(response.data.msg);
|
|
405
|
+ return false;
|
|
406
|
+ } else {
|
|
407
|
+ this.WarehouseInfo.loading = false;
|
|
408
|
+ for (let i = 0; i < response.data.data.info.length; i++) {
|
|
409
|
+ this.WarehouseInfo.warehouseInfoDate.push(
|
|
410
|
+ response.data.data.info[i]
|
|
411
|
+ );
|
|
412
|
+ }
|
|
413
|
+ }
|
|
414
|
+ });
|
|
415
|
+ },
|
|
416
|
+ getXuserName(id) {
|
|
417
|
+ if (id <= 0) {
|
|
418
|
+ return "";
|
|
419
|
+ }
|
|
420
|
+ var name = "";
|
|
421
|
+ if (
|
|
422
|
+ this.adminUserOptions == null ||
|
|
423
|
+ typeof this.adminUserOptions.length === "undefined"
|
|
424
|
+ ) {
|
|
425
|
+ return name;
|
|
426
|
+ }
|
|
427
|
+ var leng = this.adminUserOptions.length;
|
|
428
|
+ if (leng == 0) {
|
|
429
|
+ return name;
|
|
430
|
+ }
|
|
431
|
+ for (let index = 0; index < leng; index++) {
|
|
432
|
+ if (this.adminUserOptions[index].id == id) {
|
|
433
|
+ name = this.adminUserOptions[index].name;
|
|
434
|
+ break;
|
|
435
|
+ }
|
|
436
|
+ }
|
|
437
|
+ return name;
|
|
438
|
+ },
|
|
439
|
+ fetchAllDoctorAndNurse() {
|
|
440
|
+ fetchAllDoctorAndNurse().then((response) => {
|
|
441
|
+ if (response.data.state == 1) {
|
|
442
|
+ this.doctorOptions = response.data.data.doctors;
|
|
443
|
+ }
|
|
444
|
+ });
|
|
445
|
+ },
|
|
446
|
+ fetchAllAdminUsers() {
|
|
447
|
+ fetchAllAdminUsers().then((response) => {
|
|
448
|
+ if (response.data.state == 1) {
|
|
449
|
+ this.adminUserOptions = response.data.data.users;
|
|
450
|
+
|
|
451
|
+ var alen = this.adminUserOptions.length;
|
|
452
|
+ for (let index = 0; index < alen; index++) {
|
|
453
|
+ if (this.adminUserOptions[index].user_type == 2) {
|
|
454
|
+ // this.doctorOptions.push(this.adminUserOptions[index]);
|
|
455
|
+ }
|
|
456
|
+ }
|
|
457
|
+ }
|
|
458
|
+ });
|
|
459
|
+ },
|
|
460
|
+ clicks: function () {},
|
|
461
|
+ handleWarehouse: function () {
|
|
462
|
+ this.$router.push({path:"/stock/selfwarehouse/info/add"})
|
|
463
|
+ },
|
|
464
|
+ handleSelectionChange: function (val) {
|
|
465
|
+ this.multipleSelection = val;
|
|
466
|
+ },
|
|
467
|
+ handleSizeChange(val) {
|
|
468
|
+ this.limit = val;
|
|
469
|
+ this.GetWarehouse();
|
|
470
|
+ },
|
|
471
|
+ handleCurrentChange(val) {
|
|
472
|
+ this.page = val;
|
|
473
|
+ this.GetWarehouse();
|
|
474
|
+ },
|
|
475
|
+ startTimeChange(val) {
|
|
476
|
+ var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
|
|
477
|
+ if (time > 0) {
|
|
478
|
+ this.$message.error("结束时间不能小于开始时间");
|
|
479
|
+ this.start_time = "";
|
|
480
|
+ } else {
|
|
481
|
+ this.startTime = this.getTimestamp(val);
|
|
482
|
+ this.start_time = val;
|
|
483
|
+ this.GetWarehouse();
|
|
484
|
+ }
|
|
485
|
+ },
|
|
486
|
+ endTimeChange(val) {
|
|
487
|
+ var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
|
|
488
|
+ if (time < 0) {
|
|
489
|
+ this.$message.error("结束时间不能小于开始时间");
|
|
490
|
+ this.end_time = "";
|
|
491
|
+ } else {
|
|
492
|
+ this.end_time = val;
|
|
493
|
+ this.GetWarehouse();
|
|
494
|
+ }
|
|
495
|
+ },
|
|
496
|
+ getTimestamp(time) {
|
|
497
|
+ // 把时间日期转成时间戳
|
|
498
|
+ return new Date(time).getTime() / 1000;
|
|
499
|
+ },
|
|
500
|
+ calculate: function (val) {
|
|
501
|
+ return Math.round(parseFloat(val) * 100) / 100;
|
|
502
|
+ },
|
|
503
|
+
|
|
504
|
+ handleEdit: function (index, row) {
|
|
505
|
+
|
|
506
|
+ this.$router.push({path:"/stock/selfwarehouse/info/edit?id="+row.id+"&is_sys="+row.is_sys+"&is_check="+row.is_check})
|
|
507
|
+
|
|
508
|
+ },
|
|
509
|
+ search(){
|
|
510
|
+
|
|
511
|
+ },
|
|
512
|
+ handleSearch(id) {
|
|
513
|
+ this.WarehouseInfo.warehouseInfoDate = [];
|
|
514
|
+ this.GetOrderDetail(id);
|
|
515
|
+ this.dialogVisible = true;
|
|
516
|
+ },
|
|
517
|
+ GetOrderDetail(order_id) {
|
|
518
|
+ const params = {
|
|
519
|
+ id: order_id,
|
|
520
|
+ };
|
|
521
|
+
|
|
522
|
+ this.WarehouseInfo.warehouseInfoDate = [];
|
|
523
|
+ getDrugWarehouseInfoList(params).then((response) => {
|
|
524
|
+ if (response.data.state == 0) {
|
|
525
|
+ this.$message.error(response.data.msg);
|
|
526
|
+ return false;
|
|
527
|
+ } else {
|
|
528
|
+ var obj = {total_count:0,is_total:1}
|
|
529
|
+ for (let i = 0; i < response.data.data.info.length; i++) {
|
|
530
|
+ response.data.data.info[i].is_total = 0
|
|
531
|
+ this.showOne = true;
|
|
532
|
+ this.WarehouseInfo.warehouseInfoDate.push(
|
|
533
|
+ response.data.data.info[i]
|
|
534
|
+ );
|
|
535
|
+ obj.total_count += (response.data.data.info[i].warehousing_count *response.data.data.info[i].price)
|
|
536
|
+ }
|
|
537
|
+ this.WarehouseInfo.warehouseInfoDate.push(obj)
|
|
538
|
+
|
|
539
|
+ this.WarehouseInfo.warehouse = response.data.data.warehousing;
|
|
540
|
+ this.getAllDrugList();
|
|
541
|
+ }
|
|
542
|
+ });
|
|
543
|
+ },
|
|
544
|
+ handleDelete: function (index, row) {
|
|
545
|
+
|
|
546
|
+ this.$confirm('确定删除' + row.name + row.sub_name + '方案吗?', '提示', {
|
|
547
|
+ confirmButtonText: '确定',
|
|
548
|
+ cancelButtonText: '取消',
|
|
549
|
+ type: 'warning'
|
|
550
|
+ }).then(() => {
|
|
551
|
+ deleteSelfWarehouseInfo(row.id).then(response => {
|
|
552
|
+ if (response.data.state == 0) {
|
|
553
|
+ this.$message.error(response.data.msg)
|
|
554
|
+ return false
|
|
555
|
+ } else {
|
|
556
|
+ this.$notify({
|
|
557
|
+ title: '成功',
|
|
558
|
+ message: '删除成功',
|
|
559
|
+ type: 'success',
|
|
560
|
+ duration: 2000
|
|
561
|
+ })
|
|
562
|
+ this.tableData.splice(index, 1)
|
|
563
|
+
|
|
564
|
+ }
|
|
565
|
+ })
|
|
566
|
+ })
|
|
567
|
+ },
|
|
568
|
+ changeAllSelected: function (val) {
|
|
569
|
+ if (val) {
|
|
570
|
+ this.$refs.multipleTable.toggleAllSelection();
|
|
571
|
+ } else {
|
|
572
|
+ this.$refs.multipleTable.clearSelection();
|
|
573
|
+ }
|
|
574
|
+ },
|
|
575
|
+ select(selection) {
|
|
576
|
+ var ids = [];
|
|
577
|
+ for (let i = 0; i < selection.length; i++) {
|
|
578
|
+ ids.push(selection[i].id);
|
|
579
|
+ }
|
|
580
|
+ this.order_id = ids.join(",");
|
|
581
|
+ this.selectedTableData = selection;
|
|
582
|
+ this.exportDrugList();
|
|
583
|
+ },
|
|
584
|
+ batchDelete() {
|
|
585
|
+ if (this.selectedTableData.length <= 0) {
|
|
586
|
+ this.$message.error("请选择要删除的记录");
|
|
587
|
+ return;
|
|
588
|
+ }
|
|
589
|
+ const ids = [];
|
|
590
|
+ const idOne = [];
|
|
591
|
+ for (let i = 0; i < this.selectedTableData.length; i++) {
|
|
592
|
+ if (this.selectedTableData[i].is_check == 1) {
|
|
593
|
+ this.$message.error("已审核单据不能删除!");
|
|
594
|
+ return false;
|
|
595
|
+ }
|
|
596
|
+ if (this.selectedTableData[i].is_sys == 13) {
|
|
597
|
+ this.$message.error("调拨入库数据不能删除!");
|
|
598
|
+ return false;
|
|
599
|
+ }
|
|
600
|
+ ids.push(this.selectedTableData[i].id);
|
|
601
|
+ if (this.selectedTableData[i].supply_warehouse_id > 0) {
|
|
602
|
+ idOne.push(this.selectedTableData[i].supply_warehouse_id);
|
|
603
|
+ }
|
|
604
|
+ }
|
|
605
|
+
|
|
606
|
+ for (let i = 0; i < idOne.length; i++) {
|
|
607
|
+ if (idOne[i] > 0) {
|
|
608
|
+ this.$message.error("自动入库数据不能删除!");
|
|
609
|
+ return false;
|
|
610
|
+ }
|
|
611
|
+ }
|
|
612
|
+ const idStr = ids.join(",");
|
|
613
|
+ const params = {
|
|
614
|
+ ids: idStr,
|
|
615
|
+ };
|
|
616
|
+ this.$confirm("确认删除入库单记录?", "删除入库单记录", {
|
|
617
|
+ confirmButtonText: "确定",
|
|
618
|
+ cancelButtonText: "取消",
|
|
619
|
+ type: "warning",
|
|
620
|
+ })
|
|
621
|
+ .then(() => {
|
|
622
|
+ deleteDrugWarehouseInfo(params).then((response) => {
|
|
623
|
+ if (response.data.state == 0) {
|
|
624
|
+ this.$message.error(response.data.msg);
|
|
625
|
+ return false;
|
|
626
|
+ } else {
|
|
627
|
+ this.$notify({
|
|
628
|
+ title: "成功",
|
|
629
|
+ message: "删除成功",
|
|
630
|
+ type: "success",
|
|
631
|
+ duration: 2000,
|
|
632
|
+ });
|
|
633
|
+
|
|
634
|
+ for (let i = 0; i < ids.length; i++) {
|
|
635
|
+ for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
|
|
636
|
+ if (ids[i] == this.Warehouse.warehouseDate[y].id) {
|
|
637
|
+ this.Warehouse.warehouseDate.splice(y, 1);
|
|
638
|
+ }
|
|
639
|
+ }
|
|
640
|
+ }
|
|
641
|
+ }
|
|
642
|
+ });
|
|
643
|
+ })
|
|
644
|
+ .catch(() => {});
|
|
645
|
+ },
|
|
646
|
+ handleCurrentChangeOne(val) {
|
|
647
|
+ this.GetOrderDetail(val.id);
|
|
648
|
+ },
|
|
649
|
+ getTime(val) {
|
|
650
|
+ if (val < 0) {
|
|
651
|
+ return "";
|
|
652
|
+ }
|
|
653
|
+ if (val == "") {
|
|
654
|
+ return "";
|
|
655
|
+ } else {
|
|
656
|
+ return uParseTime(val, "{y}-{m}-{d}");
|
|
657
|
+ }
|
|
658
|
+ },
|
|
659
|
+ getDrugType(id) {
|
|
660
|
+ var name = "";
|
|
661
|
+ for (let i = 0; i < this.drugTypeList.length; i++) {
|
|
662
|
+ if (id == this.drugTypeList[i].id) {
|
|
663
|
+ name = this.drugTypeList[i].name;
|
|
664
|
+ }
|
|
665
|
+ }
|
|
666
|
+ return name;
|
|
667
|
+ },
|
|
668
|
+ getAllDrugList() {
|
|
669
|
+ getAllDrugList().then((response) => {
|
|
670
|
+ if (response.data.state == 1) {
|
|
671
|
+ var manufacturerList = response.data.data.manufacturerList;
|
|
672
|
+ this.manufacturerList = manufacturerList;
|
|
673
|
+ this.dealerList = response.data.data.dealerList;
|
|
674
|
+ }
|
|
675
|
+ });
|
|
676
|
+ },
|
|
677
|
+ getManufacturer(id) {
|
|
678
|
+ var name = "";
|
|
679
|
+ for (let i = 0; i < this.manufacturerList.length; i++) {
|
|
680
|
+ if (id == this.manufacturerList[i].id) {
|
|
681
|
+ name = this.manufacturerList[i].manufacturer_name;
|
|
682
|
+ }
|
|
683
|
+ }
|
|
684
|
+ return name;
|
|
685
|
+ },
|
|
686
|
+ getDealer(id) {
|
|
687
|
+ var name = "";
|
|
688
|
+ for (let i = 0; i < this.dealerList.length; i++) {
|
|
689
|
+ if (id == this.dealerList[i].id) {
|
|
690
|
+ name = this.dealerList[i].dealer_name;
|
|
691
|
+ }
|
|
692
|
+ }
|
|
693
|
+ return name;
|
|
694
|
+ },
|
|
695
|
+ getDictionaryDataConfig(module, filed_name) {
|
|
696
|
+ return getDictionaryDataConfig(module, filed_name);
|
|
697
|
+ },
|
|
698
|
+ drugPrint() {
|
|
699
|
+ if (this.order_id == "") {
|
|
700
|
+ this.$message.error("请选择入库单");
|
|
701
|
+ } else {
|
|
702
|
+ this.$router.push({
|
|
703
|
+ path: "/stock/drugStockInOrderDetailPrint?id=" + this.order_id,
|
|
704
|
+ });
|
|
705
|
+ }
|
|
706
|
+ },
|
|
707
|
+ exportDrugList() {
|
|
708
|
+ var params = {
|
|
709
|
+ order_id: this.order_id,
|
|
710
|
+ };
|
|
711
|
+ this.exportLoding = true
|
|
712
|
+ exportDrugList(params).then((response) => {
|
|
713
|
+ if (response.data.state == 1) {
|
|
714
|
+ var list = response.data.data.list;
|
|
715
|
+
|
|
716
|
+ for (let i = 0; i < list.length; i++) {
|
|
717
|
+ list[i].product_date = this.getTime(list[i].product_date);
|
|
718
|
+ list[i].expiry_date = this.getTime(list[i].expiry_date);
|
|
719
|
+ }
|
|
720
|
+ this.exportList = list;
|
|
721
|
+ this.exportLoding = false
|
|
722
|
+ var manufacturerList = response.data.data.manufacturerList;
|
|
723
|
+ this.manufacturerList = manufacturerList;
|
|
724
|
+ var dealerList = response.data.data.dealerList;
|
|
725
|
+
|
|
726
|
+ this.dealerList = dealerList;
|
|
727
|
+ }
|
|
728
|
+ });
|
|
729
|
+ },
|
|
730
|
+
|
|
731
|
+ lili(){
|
|
732
|
+ console.log("exportList",this.exportList)
|
|
733
|
+ },
|
|
734
|
+ toExport() {
|
|
735
|
+ if (this.order_id == "") {
|
|
736
|
+ this.$message.error("请勾选入库单");
|
|
737
|
+ }
|
|
738
|
+ for (let i = 0; i < this.exportList.length; i++) {
|
|
739
|
+ this.exportList[i].index = i + 1;
|
|
740
|
+ this.exportList[i].warehousing_time = this.getTime(this.exportList[i].warehousing_time)
|
|
741
|
+ this.exportList[i].unit =
|
|
742
|
+ this.exportList[i].dose +
|
|
743
|
+ this.exportList[i].dose_unit +
|
|
744
|
+ "*" +
|
|
745
|
+ this.exportList[i].min_number +
|
|
746
|
+ this.exportList[i].min_unit +
|
|
747
|
+ "/" +
|
|
748
|
+ this.exportList[i].max_unit;
|
|
749
|
+
|
|
750
|
+ this.exportList[i].total_price = (
|
|
751
|
+ this.exportList[i].warehousing_count * this.exportList[i].price
|
|
752
|
+ ).toFixed(2);
|
|
753
|
+ for (let j = 0; j < this.manufacturerList.length; j++) {
|
|
754
|
+ if (this.exportList[i].manufacturer == this.manufacturerList[j].id) {
|
|
755
|
+ this.exportList[i].manufacturer =
|
|
756
|
+ this.manufacturerList[j].manufacturer_name;
|
|
757
|
+ }
|
|
758
|
+ if (this.exportList[i].manufacturer == 0) {
|
|
759
|
+ this.exportList[i].manufacturer = "";
|
|
760
|
+ }
|
|
761
|
+ }
|
|
762
|
+
|
|
763
|
+ for (let z = 0; z < this.dealerList.length; z++) {
|
|
764
|
+ if (this.exportList[i].dealer == this.dealerList[z].id) {
|
|
765
|
+ this.exportList[i].dealer = this.dealerList[z].dealer_name;
|
|
766
|
+ }
|
|
767
|
+ if (this.exportList[i].dealer == 0) {
|
|
768
|
+ this.exportList[i].dealer = "";
|
|
769
|
+ }
|
|
770
|
+
|
|
771
|
+ }
|
|
772
|
+ }
|
|
773
|
+
|
|
774
|
+ import("@/vendor/Export2Excel").then((excel) => {
|
|
775
|
+ for (let i = 0; i < this.exportList.length; i++) {
|
|
776
|
+ for (let j = 0; j < this.drugTypeList.length; j++) {
|
|
777
|
+ if (this.exportList[i].drug_type == this.drugTypeList[j].id) {
|
|
778
|
+ this.exportList[i].drug_type = this.drugTypeList[j].name;
|
|
779
|
+ }
|
|
780
|
+ }
|
|
781
|
+ }
|
|
782
|
+
|
|
783
|
+ const tHeader = [
|
|
784
|
+ "序号",
|
|
785
|
+ "单据日期",
|
|
786
|
+ "药品名称",
|
|
787
|
+ "药品类型",
|
|
788
|
+ "规格&单位",
|
|
789
|
+ "批号",
|
|
790
|
+ "入库数量",
|
|
791
|
+ "进货价",
|
|
792
|
+ "总价",
|
|
793
|
+ "生产厂家",
|
|
794
|
+ "生产日期",
|
|
795
|
+ "有效日期",
|
|
796
|
+ "经销商",
|
|
797
|
+ "批注文号",
|
|
798
|
+ "备注",
|
|
799
|
+ ];
|
|
800
|
+ const filterVal = [
|
|
801
|
+ "index",
|
|
802
|
+ "warehousing_time",
|
|
803
|
+ "drug_name",
|
|
804
|
+ "drug_type",
|
|
805
|
+ "unit",
|
|
806
|
+ "batch_number",
|
|
807
|
+ "warehousing_count",
|
|
808
|
+ "price",
|
|
809
|
+ "total_price",
|
|
810
|
+ "manufacturer",
|
|
811
|
+ "product_date",
|
|
812
|
+ "expiry_date",
|
|
813
|
+ "dealer",
|
|
814
|
+ "number",
|
|
815
|
+ "remark",
|
|
816
|
+ ];
|
|
817
|
+
|
|
818
|
+ const data = this.formatJson(filterVal, this.exportList);
|
|
819
|
+ excel.export_json_to_excel({
|
|
820
|
+ header: tHeader,
|
|
821
|
+ data,
|
|
822
|
+ filename: "药品入库单详情",
|
|
823
|
+ });
|
|
824
|
+ this.downloadLoading = false;
|
|
825
|
+ });
|
|
826
|
+ },
|
|
827
|
+ formatJson(filterVal, jsonData) {
|
|
828
|
+ return jsonData.map((v) => filterVal.map((j) => v[j]));
|
|
829
|
+ },
|
|
830
|
+ getHouseName(id) {
|
|
831
|
+ var storehouse_name = "";
|
|
832
|
+ for (let i = 0; i < this.houseList.length; i++) {
|
|
833
|
+ if (id == this.houseList[i].id) {
|
|
834
|
+ storehouse_name = this.houseList[i].storehouse_name;
|
|
835
|
+ }
|
|
836
|
+ }
|
|
837
|
+ return storehouse_name;
|
|
838
|
+ },
|
|
839
|
+ changeStoreHouse() {
|
|
840
|
+ this.GetWarehouse();
|
|
841
|
+ },
|
|
842
|
+ changeCheckType() {
|
|
843
|
+ this.GetWarehouse();
|
|
844
|
+ },
|
|
845
|
+
|
|
846
|
+ getallPatientList(){
|
|
847
|
+ getallPatientList().then(response=>{
|
|
848
|
+ if(response.data.state ==1){
|
|
849
|
+ var patient = response.data.data.patient
|
|
850
|
+ console.log("patient====",patient)
|
|
851
|
+ this.patientList = []
|
|
852
|
+ var obj = {id:0,name:"全部"}
|
|
853
|
+ this.patientList.push(obj)
|
|
854
|
+ for(let i=0;i<patient.length;i++){
|
|
855
|
+ this.patientList.push(patient[i])
|
|
856
|
+ }
|
|
857
|
+ }
|
|
858
|
+ })
|
|
859
|
+ },
|
|
860
|
+ GetDrugTypeName(drug_type){
|
|
861
|
+ var name = ""
|
|
862
|
+ for(let i=0;i<this.drugTypeList.length;i++){
|
|
863
|
+ if(drug_type == this.drugTypeList[i].value){
|
|
864
|
+ name = this.drugTypeList[i].name
|
|
865
|
+ }
|
|
866
|
+ }
|
|
867
|
+ return name
|
|
868
|
+ },
|
|
869
|
+ getManufacturer(id){
|
|
870
|
+ var manufacturer_name = ""
|
|
871
|
+ for(let i=0;i<this.manufacturerList.length;i++){
|
|
872
|
+ if(id == this.manufacturerList[i].id){
|
|
873
|
+ manufacturer_name = this.manufacturerList[i].manufacturer_name
|
|
874
|
+ }
|
|
875
|
+ }
|
|
876
|
+ return
|
|
877
|
+ },
|
|
878
|
+ getDealerName(id){
|
|
879
|
+ var dealer_name = ""
|
|
880
|
+ for(let i=0;i<this.dealerList.length;i++){
|
|
881
|
+ if(id == this.dealerList[i].dealer_name){
|
|
882
|
+ dealer_name = this.dealerList[i].dealer_name
|
|
883
|
+ }
|
|
884
|
+ }
|
|
885
|
+ return dealer_name
|
|
886
|
+ }
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+ },
|
|
890
|
+};
|
|
891
|
+</script>
|
|
892
|
+
|
|
893
|
+<style rel="stylesheet/css" lang="scss" scoped>
|
|
894
|
+.information {
|
|
895
|
+ border: 1px #dcdfe6 solid;
|
|
896
|
+ padding: 30px 20px 30px 20px;
|
|
897
|
+
|
|
898
|
+ .border {
|
|
899
|
+ border-bottom: 1px #dcdfe6 solid;
|
|
900
|
+ margin: 0px 0 20px 0;
|
|
901
|
+ }
|
|
902
|
+}
|
|
903
|
+
|
|
904
|
+.edit_separater {
|
|
905
|
+ border-top: 1px solid rgb(233, 233, 233);
|
|
906
|
+ margin-top: 15px;
|
|
907
|
+ margin-bottom: 15px;
|
|
908
|
+}
|
|
909
|
+</style>
|
|
910
|
+
|
|
911
|
+<style>
|
|
912
|
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
|
|
913
|
+ font-size: 12px;
|
|
914
|
+}
|
|
915
|
+
|
|
916
|
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
|
|
917
|
+ background: #6fb5fa;
|
|
918
|
+}
|
|
919
|
+
|
|
920
|
+.count {
|
|
921
|
+ color: #bd2c00;
|
|
922
|
+}
|
|
923
|
+.el-table td,
|
|
924
|
+.el-table th.is-leaf,
|
|
925
|
+.el-table--border,
|
|
926
|
+.el-table--group {
|
|
927
|
+ border-color: #d0d3da;
|
|
928
|
+}
|
|
929
|
+.el-table--border::after,
|
|
930
|
+.el-table--group::after,
|
|
931
|
+.el-table::before {
|
|
932
|
+ background-color: #d0d3da;
|
|
933
|
+}
|
|
934
|
+</style>
|