Sfoglia il codice sorgente

Merge branch '20200710_pc_vue_new_branch' into 20200916_pc_vue_new_branch

csx 4 anni fa
parent
commit
1640bcd6b8
38 ha cambiato i file con 11959 aggiunte e 856 eliminazioni
  1. 60 0
      src/api/data.js
  2. 364 0
      src/api/drug/drug_stock.js
  3. 55 6
      src/router/modules/stock.js
  4. 45 45
      src/xt_pages/data/components/addConsumable.vue
  5. 562 410
      src/xt_pages/data/components/addDrugs.vue
  6. 701 97
      src/xt_pages/data/components/consumables.vue
  7. 397 103
      src/xt_pages/data/components/drugs.vue
  8. 59 57
      src/xt_pages/data/specialDictionary.vue
  9. 317 123
      src/xt_pages/stock/Dialog/goodInfoDailog.vue
  10. 174 1
      src/xt_pages/stock/config/goodInfo.vue
  11. 23 0
      src/xt_pages/stock/drugs/cancelDrugStockDetail.vue
  12. 533 0
      src/xt_pages/stock/drugs/cancelDrugStockOrder.vue
  13. 531 0
      src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue
  14. 249 0
      src/xt_pages/stock/drugs/cancelDrugStockOrderDetail.vue
  15. 478 0
      src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue
  16. 340 0
      src/xt_pages/stock/drugs/drguStockQuery.vue
  17. 24 0
      src/xt_pages/stock/drugs/drugSalesReturnDetail.vue
  18. 486 0
      src/xt_pages/stock/drugs/drugSalesReturnEdit.vue
  19. 533 0
      src/xt_pages/stock/drugs/drugSalesReturnOrder.vue
  20. 452 0
      src/xt_pages/stock/drugs/drugSalesReturnOrderAdd.vue
  21. 224 0
      src/xt_pages/stock/drugs/drugSalesReturnOrderDetail.vue
  22. 520 0
      src/xt_pages/stock/drugs/drugStockDetail.vue
  23. 69 0
      src/xt_pages/stock/drugs/drugStockDetailIndex.vue
  24. 24 0
      src/xt_pages/stock/drugs/drugStockInDetail.vue
  25. 553 0
      src/xt_pages/stock/drugs/drugStockInOrder.vue
  26. 705 0
      src/xt_pages/stock/drugs/drugStockInOrderAdd.vue
  27. 281 0
      src/xt_pages/stock/drugs/drugStockInOrderDetail.vue
  28. 703 0
      src/xt_pages/stock/drugs/drugStockInOrderEdit.vue
  29. 24 0
      src/xt_pages/stock/drugs/drugStockOutDetail.vue
  30. 539 0
      src/xt_pages/stock/drugs/drugStockOutOrder.vue
  31. 593 0
      src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue
  32. 300 0
      src/xt_pages/stock/drugs/drugStockOutOrderDetail.vue
  33. 533 0
      src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue
  34. 171 0
      src/xt_pages/stock/drugs/drugStockUserDetail.vue
  35. 249 0
      src/xt_pages/stock/drugs/drugsStockDialog/index.vue
  36. 71 0
      src/xt_pages/stock/drugs/index.vue
  37. 4 1
      src/xt_pages/workforce/schedule_print.vue
  38. 13 13
      src/xt_permission.js

+ 60 - 0
src/api/data.js Vedi File

@@ -107,3 +107,63 @@ export function updateDictionaryTemplate(params) {
107 107
     data: params
108 108
   })
109 109
 }
110
+
111
+
112
+export function createBaseDrugLib(params) {
113
+  return request({
114
+    url: '/api/basedruglib/create',
115
+    method: 'post',
116
+    params: params
117
+  })
118
+}
119
+
120
+
121
+export function editBaseDrugLib(params) {
122
+  return request({
123
+    url: '/api/basedruglib/edit',
124
+    method: 'post',
125
+    params: params
126
+  })
127
+}
128
+
129
+
130
+export function getBaseDrugLib(params) {
131
+  return request({
132
+    url: '/api/basedruglib/get',
133
+    method: 'get',
134
+    params: params
135
+  })
136
+}
137
+
138
+
139
+
140
+export function getBaseDrugLibList(params) {
141
+  return request({
142
+    url: '/api/basedruglib/list',
143
+    method: 'get',
144
+    params: params
145
+  })
146
+}
147
+
148
+
149
+
150
+
151
+export function createMedicineInsurancePercent(params) {
152
+  return request({
153
+    url: '/api/medicineinsurancepercent/create',
154
+    method: 'post',
155
+    data: params
156
+  })
157
+}
158
+
159
+
160
+export function createDrugUnitSafeguard(params) {
161
+  return request({
162
+    url: '/api/drugunitsafeguard/create',
163
+    method: 'post',
164
+    data: params
165
+  })
166
+}
167
+
168
+
169
+

+ 364 - 0
src/api/drug/drug_stock.js Vedi File

@@ -0,0 +1,364 @@
1
+import request from '@/utils/request'
2
+
3
+export function postDrugWarehouse(params, warehousing_time, manufacturer_id, dealer_id, type) {
4
+  return request({
5
+    url: '/api/drugwarehouse/create?warehousing_time=' + warehousing_time + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type,
6
+    method: 'post',
7
+    data: params
8
+  })
9
+}
10
+
11
+export function getDrugWarehouseList(params) {
12
+  return request({
13
+    url: '/api/drugwarehouse/list',
14
+    method: 'get',
15
+    params: params
16
+  })
17
+}
18
+
19
+export function getDrugWarehouseInfoList(params) {
20
+  return request({
21
+    url: '/api/drugwarehouseinfo/list',
22
+    method: 'get',
23
+    params: params
24
+  })
25
+}
26
+
27
+export function postDrugSalesReturn(params, salesReturnTime, salesReturnTotal, dealer_id, manufacturer_id, type) {
28
+  return request({
29
+    url: '/api/drugsalesreturn/create?time=' + salesReturnTime + '&total=' + salesReturnTotal + '&dealer_id=' + dealer_id + '&manufacturer_id=' + manufacturer_id + '&type=' + type,
30
+    method: 'post',
31
+    data: params
32
+  })
33
+}
34
+
35
+export function getDrugWarehouseInfo(params) {
36
+  return request({
37
+    url: '/api/info/get',
38
+    method: 'get',
39
+    params: params
40
+  })
41
+}
42
+
43
+export function getDrugSalesReturnList(params) {
44
+  return request({
45
+    url: '/api/salesreturn/list',
46
+    method: 'get',
47
+    params: params
48
+  })
49
+}
50
+
51
+export function getDrugSalesReturnInfoList(params) {
52
+  return request({
53
+    url: '/api/return/info',
54
+    method: 'get',
55
+    params: params
56
+  })
57
+}
58
+
59
+export function getAllDrugWarehouseInfo(params) {
60
+  return request({
61
+    url: '/api/warehouseinfo',
62
+    method: 'get',
63
+    params: params
64
+  })
65
+}
66
+
67
+export function getDrugWarehouseOutInfoList(params) {
68
+  return request({
69
+    url: '/api/stock/out/info',
70
+    method: 'get',
71
+    params: params
72
+  })
73
+}
74
+
75
+export function postDrugWarehouseOut(params, warehousing_time, dealer_id, manufacturer_id, type) {
76
+  return request({
77
+    url: '/api/drugwarehouseout/create?warehousing_out_time=' + warehousing_time + '&dealer_id=' + dealer_id + '&manufacturer_id=' + manufacturer_id + '&type=' + type,
78
+    method: 'post',
79
+    data: params
80
+  })
81
+}
82
+
83
+export function getDrugWarehouseInfoCountByGoodId(params) {
84
+  return request({
85
+    url: '/api/info/count',
86
+    method: 'get',
87
+    params: params
88
+  })
89
+}
90
+
91
+export function getDrugWarehouseInfoByGoodTypeId(params) {
92
+  return request({
93
+    url: '/api/warehouse/type',
94
+    method: 'get',
95
+    params: params
96
+  })
97
+}
98
+
99
+export function getDrugCancelStockInfoList(params) {
100
+  return request({
101
+    url: '/api/cancel/info',
102
+    method: 'get',
103
+    params: params
104
+  })
105
+}
106
+
107
+export function getAllDrugStockOutList(params) {
108
+  return request({
109
+    url: '/api/out/list',
110
+    method: 'get',
111
+    params: params
112
+  })
113
+}
114
+
115
+export function getAllDrugStockQueryList(params) {
116
+  return request({
117
+    url: '/api/stock/query',
118
+    method: 'get',
119
+    params: params
120
+  })
121
+}
122
+
123
+export function getDrugWarehouseInfoByOrdeNumber(params) {
124
+  return request({
125
+    url: '/api/stock/warehouse/get',
126
+    method: 'get',
127
+    params: params
128
+  })
129
+}
130
+
131
+export function modifyDrugWarehouseInfo(params) {
132
+  return request({
133
+    url: '/api/drugwarehouse/edit',
134
+    method: 'post',
135
+    params: params
136
+  })
137
+}
138
+
139
+export function deleteDrugWarehouseInfo(params) {
140
+  return request({
141
+    url: '/api/drugwarehouse/delete',
142
+    method: 'post',
143
+    params: params
144
+  })
145
+}
146
+
147
+export function getDrugWarehouseOutInfoByOrdeNumber(params) {
148
+  return request({
149
+    url: '/api/stock/out/get',
150
+    method: 'get',
151
+    params: params
152
+  })
153
+}
154
+
155
+export function modifyDrugWarehouseOutInfo(params) {
156
+  return request({
157
+    url: '/api/stock/out/edit',
158
+    method: 'post',
159
+    params: params
160
+  })
161
+}
162
+
163
+export function GetAllConfig() {
164
+  return request({
165
+    url: '/api/drugstock/config',
166
+    method: 'get'
167
+  })
168
+}
169
+
170
+export function GetAllDrugInfoByID(params) {
171
+  return request({
172
+    url: '/api/drugstock/get',
173
+    method: 'get',
174
+    params: params
175
+
176
+  })
177
+}
178
+
179
+export function DeleteDrugWarehouseInfoItem(params) {
180
+  return request({
181
+    url: '/api/drugwarehouseinfo/delete',
182
+    method: 'post',
183
+    params: params
184
+
185
+  })
186
+}
187
+
188
+export function EditDrugWarehouse(params, warehousing_time, id,type,manufacturer_id,dealer_id) {
189
+  return request({
190
+    url: '/api/drugwarehouse/edit?warehousing_time=' + warehousing_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
191
+    method: 'post',
192
+    data: params
193
+  })
194
+}
195
+
196
+export function getDrugSalesReturnConfig(params) {
197
+  return request({
198
+    url: '/api/return/config',
199
+    method: 'get',
200
+    params: params
201
+
202
+  })
203
+}
204
+
205
+export function deleteDrugSalesReturn(params) {
206
+  return request({
207
+    url: '/api/drugsalesreturn/delete',
208
+    method: 'post',
209
+    params: params
210
+  })
211
+}
212
+
213
+export function getDrugSaleReturnInfoList(params) {
214
+  return request({
215
+    url: '/api/stock/drugsalesReturn/list',
216
+    method: 'get',
217
+    params: params
218
+  })
219
+}
220
+
221
+export function getDrugReturnList(params) {
222
+  return request({
223
+    url: '/api/drugsalesreturninfo/list',
224
+    method: 'get',
225
+    params: params
226
+  })
227
+}
228
+export function deleteDrugSalesReturnInfo(params) {
229
+  return request({
230
+    url: '/api/drugsalesreturninfo/delete',
231
+    method: 'post',
232
+    params: params
233
+  })
234
+}
235
+
236
+export function editDrugSalesReturnInfo(params, return_time, id,type,manufacturer_id,dealer_id) {
237
+  return request({
238
+    url: '/api/drugsalesreturn/edit?return_time=' + return_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
239
+    method: 'post',
240
+    data: params
241
+  })
242
+}
243
+
244
+export function deleteDrugWarehouseOut(params) {
245
+  return request({
246
+    url: '/api/drugwarehouseout/delete',
247
+    method: 'post',
248
+    params: params
249
+  })
250
+}
251
+
252
+export function deleteDrugWarehouseOutInfo(params) {
253
+  return request({
254
+    url: '/api/drugwarehouseoutinfo/delete',
255
+    method: 'post',
256
+    params: params
257
+  })
258
+}
259
+
260
+export function getDrugWarehouseOutList(params) {
261
+  return request({
262
+    url: '/api/drugwarehouseout/list',
263
+    method: 'get',
264
+    params: params
265
+  })
266
+}
267
+
268
+export function getDrugWarehouseOutInfo(params) {
269
+  return request({
270
+    url: '/api/drugwarehouseout/info',
271
+    method: 'get',
272
+    params: params
273
+  })
274
+}
275
+
276
+export function editDrugWarehouseoutInfo(params, warehouse_out_time, id,type,manufacturer_id,dealer_id) {
277
+  return request({
278
+    url: '/api/drugwarehouseout/edit?warehouse_out_time=' + warehouse_out_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id="+dealer_id,
279
+    method: 'post',
280
+    data: params
281
+  })
282
+}
283
+
284
+export function getDrugCancelStockList(params) {
285
+  return request({
286
+    url: '/api/drugcancelstock/list',
287
+    method: 'get',
288
+    params: params
289
+  })
290
+}
291
+
292
+export function editDrugCancelStockInfo(params, cancel_stock_time, id,type,manufacturer_id,dealer_id) {
293
+  return request({
294
+    url: '/api/drugcancelstockinfo/edit?cancel_time=' + cancel_stock_time + '&id=' + id+"&type="+type+"&manufacturer_id="+manufacturer_id+"&dealer_id=" + dealer_id,
295
+    method: 'post',
296
+    data: params
297
+  })
298
+}
299
+
300
+export function getDrugCancelStockInfo(params) {
301
+  return request({
302
+    url: '/api/drugcancelstock/info',
303
+    method: 'get',
304
+    params: params
305
+  })
306
+}
307
+
308
+export function deleteDrugCancelStock(params) {
309
+  return request({
310
+    url: '/api/drugcancelstock/delete',
311
+    method: 'post',
312
+    params: params
313
+  })
314
+}
315
+
316
+export function deleteDrugCancelStockInfo(params) {
317
+  return request({
318
+    url: '/api/drugcancelstockinfo/delete',
319
+    method: 'post',
320
+    params: params
321
+  })
322
+}
323
+
324
+export function postDrugCancelStock(params, cancelStockTime, manufacturer_id, dealer_id, type) {
325
+  return request({
326
+    url: '/api/drugcancelstock/create?time=' + cancelStockTime + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type,
327
+    method: 'post',
328
+    data: params
329
+  })
330
+}
331
+export function getDrugCancelStockConfig(params) {
332
+  return request({
333
+    url: '/api/drugcancelstockinfo/config',
334
+    method: 'get',
335
+    params: params
336
+  })
337
+}
338
+
339
+export function getStockDetail(params) {
340
+  return request({
341
+    url: '/api/drugstock/detail',
342
+    method: 'get',
343
+    params: params
344
+  })
345
+}
346
+
347
+
348
+
349
+export function getPrintStockGood(params) {
350
+  return request({
351
+    url: '/api/print/stock',
352
+    method: 'get',
353
+    params: params
354
+  })
355
+}
356
+
357
+
358
+export function getWarehouseOutUser(params) {
359
+  return request({
360
+    url: '/api/drugwarehouseout/user',
361
+    method: 'get',
362
+    params: params
363
+  })
364
+}

+ 55 - 6
src/router/modules/stock.js Vedi File

@@ -171,6 +171,13 @@ export default {
171 171
       hidden: true,
172 172
       is_menu: false,
173 173
       meta: { title: 'stockInOrderAdd', noCache: true }
174
+    },  {
175
+      path: '/drugstock/in/add',
176
+      component: () => import('@/xt_pages/stock/drugs/drugStockInOrderAdd'),
177
+      name: 'drugStockInOrderAdd',
178
+      hidden: true,
179
+      is_menu: false,
180
+      meta: { title: 'drugStockInOrderAdd', noCache: true }
174 181
     },
175 182
     {
176 183
       path: '/stock/in/detail',
@@ -179,6 +186,13 @@ export default {
179 186
       hidden: true,
180 187
       is_menu: false,
181 188
       meta: { title: 'stockInDetail', noCache: true }
189
+    }, {
190
+      path: '/drugstock/in/detail',
191
+      component: () => import('@/xt_pages/stock/drugs/drugStockInDetail'),
192
+      name: 'drugStockInDetail',
193
+      hidden: true,
194
+      is_menu: false,
195
+      meta: { title: 'drugStockInDetail', noCache: true }
182 196
     },
183 197
     {
184 198
       path: '/stock/return/detail',
@@ -195,6 +209,13 @@ export default {
195 209
       hidden: true,
196 210
       is_menu: false,
197 211
       meta: { title: 'salesReturnOrderAdd', noCache: true }
212
+    }, {
213
+      path: '/drugstock/return/add',
214
+      component: () => import('@/xt_pages/stock/drugs/drugSalesReturnOrderAdd'),
215
+      name: 'drugSalesReturnOrderAdd',
216
+      hidden: true,
217
+      is_menu: false,
218
+      meta: { title: 'drugSalesReturnOrderAdd', noCache: true }
198 219
     },
199 220
     {
200 221
       path: '/stock/out/add',
@@ -203,6 +224,13 @@ export default {
203 224
       hidden: true,
204 225
       is_menu: false,
205 226
       meta: { title: 'stockOutOrderAdd', noCache: true }
227
+    }, {
228
+      path: '/drugstock/out/add',
229
+      component: () => import('@/xt_pages/stock/drugs/drugStockOutOrderAdd'),
230
+      name: 'drugStockOutOrderAdd',
231
+      hidden: true,
232
+      is_menu: false,
233
+      meta: { title: 'drugStockOutOrderAdd', noCache: true }
206 234
     },
207 235
     {
208 236
       path: '/stock/out/detail',
@@ -211,6 +239,13 @@ export default {
211 239
       hidden: true,
212 240
       is_menu: false,
213 241
       meta: { title: 'stockOutDetail', noCache: true }
242
+    }, {
243
+      path: '/drugstock/out/detail',
244
+      component: () => import('@/xt_pages/stock/drugs/drugStockOutDetail'),
245
+      name: 'drugStockOutDetail',
246
+      hidden: true,
247
+      is_menu: false,
248
+      meta: { title: 'drugStockOutDetail', noCache: true }
214 249
     },
215 250
     {
216 251
       path: '/stock/cancel/add',
@@ -219,6 +254,13 @@ export default {
219 254
       hidden: true,
220 255
       is_menu: false,
221 256
       meta: { title: 'cancelStockOrderAdd', noCache: true }
257
+    }, {
258
+      path: '/drugstock/cancel/add',
259
+      component: () => import('@/xt_pages/stock/drugs/cancelDrugStockOrderAdd'),
260
+      name: 'cancelDrugStockOrderAdd',
261
+      hidden: true,
262
+      is_menu: false,
263
+      meta: { title: 'cancelDrugStockOrderAdd', noCache: true }
222 264
     },
223 265
     {
224 266
       path: '/stock/cancel/detail',
@@ -227,6 +269,13 @@ export default {
227 269
       hidden: true,
228 270
       is_menu: false,
229 271
       meta: { title: 'cancelStockDetail', noCache: true }
272
+    },  {
273
+      path: '/drugstock/cancel/detail',
274
+      component: () => import('@/xt_pages/stock/drugs/cancelDrugStockDetail'),
275
+      name: 'cancelDrugStockDetail',
276
+      hidden: true,
277
+      is_menu: false,
278
+      meta: { title: 'cancelDrugStockDetail', noCache: true }
230 279
     },
231 280
     {
232 281
       path: '/stock/config',
@@ -317,7 +366,7 @@ export default {
317 366
     },
318 367
     {
319 368
       path: '/stock/drugs/stock/in',
320
-      component: () => import('@/xt_pages/stock/drugs/stockIn'),
369
+      component: () => import('@/xt_pages/stock/drugs/drugStockInOrder'),
321 370
       name: 'drugsStockIn',
322 371
       hidden: true,
323 372
       is_menu: false,
@@ -326,7 +375,7 @@ export default {
326 375
     },
327 376
     {
328 377
       path: '/stock/drugs/stock/out',
329
-      component: () => import('@/xt_pages/stock/drugs/stockOut'),
378
+      component: () => import('@/xt_pages/stock/drugs/drugStockOutOrder'),
330 379
       name: 'drugsStockOut',
331 380
       hidden: true,
332 381
       is_menu: false,
@@ -335,7 +384,7 @@ export default {
335 384
     },
336 385
     {
337 386
       path: '/stock/drugs/stock/return',
338
-      component: () => import('@/xt_pages/stock/drugs/stockReturn'),
387
+      component: () => import('@/xt_pages/stock/drugs/drugSalesReturnOrder'),
339 388
       name: 'drugsStockReturn',
340 389
       hidden: true,
341 390
       is_menu: false,
@@ -344,12 +393,12 @@ export default {
344 393
     },
345 394
     {
346 395
       path: '/stock/drugs/stock/cancel',
347
-      component: () => import('@/xt_pages/stock/drugs/stockCancel'),
348
-      name: 'drugsStockCancel',
396
+      component: () => import('@/xt_pages/stock/drugs/cancelDrugStockOrder'),
397
+      name: 'cancelDrugStockOrder',
349 398
       hidden: true,
350 399
       is_menu: false,
351 400
       num: 3,
352
-      meta: { title: 'drugsStockCancel', noCache: true }
401
+      meta: { title: 'cancelDrugStockOrder', noCache: true }
353 402
     },
354 403
     {
355 404
       path: '/stock/drugs/stock/adjustPrice',

+ 45 - 45
src/xt_pages/data/components/addConsumable.vue Vedi File

@@ -10,16 +10,16 @@
10 10
                 <div>
11 11
                     <el-form :model="form" :rules="rules" ref="form" label-width="100px" style="display: flex;flex-wrap: wrap;justify-content: space-between;">
12 12
                         <el-form-item label="耗材名称 : " prop="name" style="width:100%">
13
-                            <el-input v-model="form.name" placeholder="" maxlength="30"></el-input>
13
+                            <el-input v-model="form.good_name" placeholder="" maxlength="30"></el-input>
14 14
                         </el-form-item>
15 15
                         <el-form-item label="拼音 : " prop="name" style="width:50%">
16
-                            <el-input v-model="form.name" placeholder="" maxlength="30"></el-input>
16
+                            <el-input v-model="form.pinyin" placeholder="" maxlength="30"></el-input>
17 17
                         </el-form-item>
18 18
                         <el-form-item label="五笔 : " prop="name" style="width:50%">
19
-                            <el-input v-model="form.name" placeholder="" maxlength="30"></el-input>
19
+                            <el-input v-model="form.wubi" placeholder="" maxlength="30"></el-input>
20 20
                         </el-form-item>
21 21
                         <el-form-item label="耗材种类 : " prop="name">
22
-                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
22
+                            <el-select v-model="form.good_kind" style="width:160px;" placeholder="请选择">
23 23
                                 <el-option
24 24
                                 v-for="item in options"
25 25
                                 :key="item.value"
@@ -29,7 +29,7 @@
29 29
                             </el-select>
30 30
                         </el-form-item>
31 31
                         <el-form-item label="耗材类型 : " prop="name">
32
-                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
32
+                            <el-select v-model="form.good_type_id" style="width:160px;" placeholder="请选择">
33 33
                                 <el-option
34 34
                                 v-for="item in options"
35 35
                                 :key="item.value"
@@ -39,7 +39,7 @@
39 39
                             </el-select>
40 40
                         </el-form-item>
41 41
                         <el-form-item label="医保等级 : " prop="name">
42
-                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
42
+                            <el-select v-model="form.medical_insurance_level" style="width:160px;" placeholder="请选择">
43 43
                                 <el-option
44 44
                                 v-for="item in options"
45 45
                                 :key="item.value"
@@ -49,10 +49,10 @@
49 49
                             </el-select>
50 50
                         </el-form-item>
51 51
                         <el-form-item label="规格型号 : " prop="name" style="width:100%">
52
-                            <el-input v-model="form.name" placeholder="" maxlength="30"></el-input>
52
+                            <el-input v-model="form.specification_name" placeholder="" maxlength="30"></el-input>
53 53
                         </el-form-item>
54 54
                         <el-form-item label="生产厂商 : " prop="name" style="width:100%">
55
-                            <el-select v-model="value" style="width:100%" placeholder="请选择">
55
+                            <el-select v-model="form.manufacturer" style="width:100%" placeholder="请选择">
56 56
                                 <el-option
57 57
                                 v-for="item in options"
58 58
                                 :key="item.value"
@@ -62,7 +62,7 @@
62 62
                             </el-select>
63 63
                         </el-form-item>
64 64
                         <el-form-item label="单位 : " prop="name">
65
-                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
65
+                            <el-select v-model="form.good_unit" style="width:160px;" placeholder="请选择">
66 66
                                 <el-option
67 67
                                 v-for="item in options"
68 68
                                 :key="item.value"
@@ -72,19 +72,19 @@
72 72
                             </el-select>
73 73
                         </el-form-item>
74 74
                         <el-form-item label="零价 : " prop="name">
75
-                            <el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>
75
+                            <el-input v-model="form.retail_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
76 76
                         </el-form-item>
77 77
                         <el-form-item label="最新进价 : " prop="name">
78
-                            <el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>
78
+                            <el-input v-model="form.buy_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
79 79
                         </el-form-item>
80 80
                         <el-form-item label="库存警戒 : " prop="name">
81
-                            <el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>
81
+                            <el-input v-model="form.stock_warn_count" style="width:160px;" placeholder="" maxlength="30"></el-input>
82 82
                         </el-form-item>
83 83
                         <el-form-item label="医保编码 : " prop="name">
84
-                            <el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>
84
+                            <el-input v-model="form.medical_insurance_number" style="width:160px;" placeholder="" maxlength="30"></el-input>
85 85
                         </el-form-item>
86 86
                         <el-form-item label="是否特病目录:" prop="name">
87
-                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
87
+                            <el-select v-model="form.is_special_diseases" style="width:160px;" placeholder="请选择">
88 88
                                 <el-option
89 89
                                 v-for="item in options"
90 90
                                 :key="item.value"
@@ -94,7 +94,7 @@
94 94
                             </el-select>
95 95
                         </el-form-item>
96 96
                         <el-form-item label="是否备案:" prop="name">
97
-                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
97
+                            <el-select v-model="form.is_record" style="width:160px;" placeholder="请选择">
98 98
                                 <el-option
99 99
                                 v-for="item in options"
100 100
                                 :key="item.value"
@@ -104,7 +104,7 @@
104 104
                             </el-select>
105 105
                         </el-form-item>
106 106
                         <el-form-item label="统计分类:" prop="name">
107
-                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
107
+                            <el-select v-model="from.statistics_category" style="width:160px;" placeholder="请选择">
108 108
                                 <el-option
109 109
                                 v-for="item in options"
110 110
                                 :key="item.value"
@@ -114,40 +114,40 @@
114 114
                             </el-select>
115 115
                         </el-form-item>
116 116
                         <el-form-item label="代理商 : " prop="name" style="visibility: hidden;">
117
-                            <el-input style="width:160px;" placeholder="" maxlength="30"></el-input>
117
+                            <el-input style="width:160px;" v-model="from.agent" placeholder="" maxlength="30"></el-input>
118 118
                         </el-form-item>
119 119
 
120 120
 
121
-                        
121
+
122 122
                         <el-form-item label="状态 : " prop="name">
123
-                            <el-radio-group v-model="radio">
123
+                            <el-radio-group v-model="from.good_status">
124 124
                                 <el-radio :label="1">停用</el-radio>
125 125
                                 <el-radio :label="2">收费</el-radio>
126 126
                             </el-radio-group>
127 127
                         </el-form-item>
128 128
                         <el-form-item label="备注 : " prop="name" style="width:100%;">
129
-                            <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="textarea"></el-input>
129
+                            <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="from.remark"></el-input>
130 130
                         </el-form-item>
131 131
                     </el-form>
132 132
                 </div>
133 133
             </el-tab-pane>
134 134
             <el-tab-pane label="扩展数据" name="second">
135 135
                 <el-form :model="form" :rules="rules" ref="form" label-width="120px" style="display: flex;flex-wrap: wrap;justify-content: space-between;">
136
-                    <el-form-item label="耗材类型 : " prop="name">
137
-                        <el-select v-model="value" style="width:160px;" placeholder="请选择">
138
-                            <el-option
139
-                            v-for="item in options"
140
-                            :key="item.value"
141
-                            :label="item.label"
142
-                            :value="item.value">
143
-                            </el-option>
144
-                        </el-select>
145
-                    </el-form-item>
136
+                    <!--<el-form-item label="耗材类型 : " prop="name">-->
137
+                        <!--<el-select v-model="value" style="width:160px;" placeholder="请选择">-->
138
+                            <!--<el-option-->
139
+                            <!--v-for="item in options"-->
140
+                            <!--:key="item.value"-->
141
+                            <!--:label="item.label"-->
142
+                            <!--:value="item.value">-->
143
+                            <!--</el-option>-->
144
+                        <!--</el-select>-->
145
+                    <!--</el-form-item>-->
146 146
                     <el-form-item label="默认使用数量:" prop="name">
147
-                        <el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>
147
+                        <el-input v-model="form.default_count" style="width:160px;" placeholder="" maxlength="30"></el-input>
148 148
                     </el-form-item>
149 149
                     <el-form-item label="标签:" prop="name">
150
-                        <el-select v-model="value" style="width:160px;" placeholder="请选择">
150
+                        <el-select v-model="from.sign" style="width:160px;" placeholder="请选择">
151 151
                             <el-option
152 152
                             v-for="item in options"
153 153
                             :key="item.value"
@@ -157,7 +157,7 @@
157 157
                         </el-select>
158 158
                     </el-form-item>
159 159
                     <el-form-item label="是否默认:" prop="name">
160
-                        <el-select v-model="value" style="width:160px;" placeholder="请选择">
160
+                        <el-select v-model="from.is_default" style="width:160px;" placeholder="请选择">
161 161
                             <el-option
162 162
                             v-for="item in options"
163 163
                             :key="item.value"
@@ -167,7 +167,7 @@
167 167
                         </el-select>
168 168
                     </el-form-item>
169 169
                     <el-form-item label="是否收费常用项:" prop="name">
170
-                        <el-select v-model="value" style="width:160px;" placeholder="请选择">
170
+                        <el-select v-model="from.is_charge_use" style="width:160px;" placeholder="请选择">
171 171
                             <el-option
172 172
                             v-for="item in options"
173 173
                             :key="item.value"
@@ -177,7 +177,7 @@
177 177
                         </el-select>
178 178
                     </el-form-item>
179 179
                     <el-form-item label="是否收费预估项:" prop="name">
180
-                        <el-select v-model="value" style="width:160px;" placeholder="请选择">
180
+                        <el-select v-model="from.is_charge_predict" style="width:160px;" placeholder="请选择">
181 181
                             <el-option
182 182
                             v-for="item in options"
183 183
                             :key="item.value"
@@ -187,7 +187,7 @@
187 187
                         </el-select>
188 188
                     </el-form-item>
189 189
                     <el-form-item label="是否统计工作量:" prop="name">
190
-                        <el-select v-model="value" style="width:160px;" placeholder="请选择">
190
+                        <el-select v-model="from.is_statistics_work" style="width:160px;" placeholder="请选择">
191 191
                             <el-option
192 192
                             v-for="item in options"
193 193
                             :key="item.value"
@@ -197,10 +197,10 @@
197 197
                         </el-select>
198 198
                     </el-form-item>
199 199
                     <el-form-item label="收费项目排序:" prop="name">
200
-                        <el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>
200
+                        <el-input v-model="form.sort" style="width:160px;" placeholder="" maxlength="30"></el-input>
201 201
                     </el-form-item>
202 202
                     <el-form-item label="是否常用医嘱:" prop="name">
203
-                        <el-select v-model="value" style="width:160px;" placeholder="请选择">
203
+                        <el-select v-model="from.is_use_doctor_advice" style="width:160px;" placeholder="请选择">
204 204
                             <el-option
205 205
                             v-for="item in options"
206 206
                             :key="item.value"
@@ -210,15 +210,15 @@
210 210
                         </el-select>
211 211
                     </el-form-item>
212 212
                     <el-form-item label="代理商:" prop="name">
213
-                        <el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>
214
-                    </el-form-item>
215
-                    <el-form-item label="耗材编码:" prop="name">
216
-                        <el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>
213
+                        <el-input v-model="form.agent" style="width:160px;" placeholder="" maxlength="30"></el-input>
217 214
                     </el-form-item>
215
+                    <!--<el-form-item label="耗材编码:" prop="name">-->
216
+                        <!--<el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>-->
217
+                    <!--</el-form-item>-->
218 218
                     <el-form-item label="耗材编号:" prop="name">
219
-                        <el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>
219
+                        <el-input v-model="form.good_number" style="width:160px;" placeholder="" maxlength="30"></el-input>
220 220
                     </el-form-item>
221
-                        
221
+
222 222
                 </el-form>
223 223
             </el-tab-pane>
224 224
         </el-tabs>
@@ -226,7 +226,7 @@
226 226
 
227 227
         <div slot="footer" class="dialog-footer">
228 228
             <el-button @click="hide">取 消</el-button>
229
-            <el-button type="primary" :loading="submitLoading" @click="submitAction()">保 存</el-button>
229
+            <el-button type="primary"  @click="submitAction()">保 存</el-button>
230 230
         </div>
231 231
   </el-dialog>
232 232
 </template>

+ 562 - 410
src/xt_pages/data/components/addDrugs.vue Vedi File

@@ -1,423 +1,575 @@
1 1
 <template>
2
-    <el-dialog
3
-        :title="formTitle"
4
-        width="900px"
5
-        :visible.sync="visible"
6
-        :before-close="_close"
7
-    >
8
-        <el-tabs v-model="activeName" @tab-click="handleClick">
9
-            <el-tab-pane label="基础数据" name="first">
10
-                <div>
11
-                    <el-form :model="form" :rules="rules" ref="form" label-width="100px" style="display: flex;flex-wrap: wrap;justify-content: space-between;">
12
-                        <el-form-item label="药品名称 : " prop="drug_name" required="drug_name">
13
-                            <el-input v-model="form.drug_name" style="width:160px;" placeholder="" maxlength="30"></el-input>
14
-                        </el-form-item>
15
-                        <el-form-item label="拼音 : " prop="ping_yin" required="ping_yin">
16
-                            <el-input v-model="form.ping_yin" style="width:160px;" placeholder="" maxlength="30"></el-input>
17
-                        </el-form-item>
18
-                        <el-form-item label="五笔 : " prop="five_input" required="five_input">
19
-                            <el-input v-model="form.five_input" style="width:160px;" placeholder="" maxlength="30"></el-input>
20
-                        </el-form-item>
21
-                        <el-form-item label="药品别名 : " prop="name">
22
-                            <el-input v-model="form.drug_alias" style="width:160px;" placeholder="" maxlength="30"></el-input>
23
-                        </el-form-item>
24
-                        <el-form-item label="别名拼音 : " prop="name">
25
-                            <el-input v-model="form.pingyin_alias" style="width:160px;" placeholder="" maxlength="30"></el-input>
26
-                        </el-form-item>
27
-                        <el-form-item label="别名五笔 : " prop="name">
28
-                            <el-input v-model="form.fiveinput_alias" style="width:160px;" placeholder="" maxlength="30"></el-input>
29
-                        </el-form-item>
30
-                        <el-form-item label="药品类别 : " prop="drug_category" required="drug_category">
31
-                            <el-select v-model="form.drug_category" style="width:160px;" placeholder="请选择">
32
-                                <el-option
33
-                                v-for="item in options"
34
-                                :key="item.value"
35
-                                :label="item.label"
36
-                                :value="item.value">
37
-                                </el-option>
38
-                            </el-select>
39
-                        </el-form-item>
40
-                        <el-form-item label="药品规格 : " prop="drug_rules" required="drug_rules">
41
-                            <el-input v-model="form.drug_rules" style="width:160px;" placeholder="" maxlength="30"></el-input>
42
-                        </el-form-item>
43
-                         <el-form-item label="药品类型 : " prop="drug_type" required="drug_type">
44
-                            <el-input v-model="form.drug_type" style="width:160px;" placeholder="" maxlength="30"></el-input>
45
-                        </el-form-item>
46
-                         <el-form-item label="库存警戒:" prop="stock_warn" required="stock_warn">
47
-                            <el-input v-model="form.stock_warn" style="width:160px;" placeholder="" maxlength="30"></el-input>
48
-                        </el-form-item>
49
-                         <el-form-item label="产地:" prop="place_origin" required="place_origin">
50
-                            <el-input v-model="form.place_origin" style="width:160px;" placeholder="" maxlength="30"></el-input>
51
-                        </el-form-item>
52
-                         <el-form-item label="药品剂型 : " prop="drug_formulation" required="drug_formulation">
53
-                            <el-input v-model="form.drug_formulation" style="width:160px;" placeholder="" maxlength="30"></el-input>
54
-                        </el-form-item>
55
-                        <el-form-item label="医保等级 : " prop="medical_coverage" required="medical_coverage">
56
-                            <el-select v-model="form.medical_coverage" style="width:160px;" placeholder="请选择">
57
-                                <el-option
58
-                                v-for="item in options"
59
-                                :key="item.value"
60
-                                :label="item.label"
61
-                                :value="item.value">
62
-                                </el-option>
63
-                            </el-select>
64
-                        </el-form-item>
65
-                        <el-form-item label="最大单位 : " prop="max_units" required="max_units">
66
-                            <el-select v-model="form.max_units" style="width:160px;" placeholder="请选择">
67
-                                <el-option
68
-                                v-for="item in options"
69
-                                :key="item.value"
70
-                                :label="item.label"
71
-                                :value="item.value">
72
-                                </el-option>
73
-                            </el-select>
74
-                        </el-form-item>
75
-                        <el-form-item label="最小单位 : " prop="min_units" required="min_units">
76
-                            <el-select v-model="form.min_untis" style="width:160px;" placeholder="请选择">
77
-                                <el-option
78
-                                v-for="item in options"
79
-                                :key="item.value"
80
-                                :label="item.label"
81
-                                :value="item.value">
82
-                                </el-option>
83
-                            </el-select>
84
-                        </el-form-item>
85
-                        <el-form-item label="单位换算 : " prop="unit_conversion" required="unit_conversion">
86
-                            <el-input v-model="form.unit_conversion" style="width:160px;" placeholder="" maxlength="30"></el-input>
87
-                        </el-form-item>
88
-                        <el-form-item label="零售价(元) : " prop="retail_price" required="retail_price">
89
-                            <el-input v-model="form.retail_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
90
-                        </el-form-item>
91
-                        <el-form-item label="上次进价(元) : " prop="last_entry" required="last_entry">
92
-                            <el-input v-model="form.last_entry" style="width:160px;" placeholder="" maxlength="30"></el-input>
93
-                        </el-form-item>
94
-                        <el-form-item label="开药控制 : " prop="drug_control">
95
-                            <el-select v-model="form.drug_control" style="width:160px;" placeholder="请选择">
96
-                                <el-option
97
-                                v-for="item in options"
98
-                                :key="item.value"
99
-                                :label="item.label"
100
-                                :value="item.value">
101
-                                </el-option>
102
-                            </el-select>
103
-                        </el-form-item>
104
-                        <el-form-item label="批准文号 : " prop="name">
105
-                            <el-input v-model="form.license_number" style="width:160px;" placeholder="" maxlength="30"></el-input>
106
-                        </el-form-item>
107
-                        <el-form-item label="药物分类 : " prop="drug_class" required="drug_class">
108
-                            <el-select v-model="form.drug_class" style="width:160px;" placeholder="请选择">
109
-                                <el-option
110
-                                v-for="item in options"
111
-                                :key="item.value"
112
-                                :label="item.label"
113
-                                :value="item.value">
114
-                                </el-option>
115
-                            </el-select>
116
-                        </el-form-item>
117
-                        <el-form-item label="剂量 : " prop="drug_dose" required="drug_dose">
118
-                            <el-input v-model="form.drug_dose" style="width:70px;margin-right:5px;" placeholder="" maxlength="30"></el-input>
119
-                            <el-select v-model="value" style="width:80px;" placeholder="请选择">
120
-                                <el-option
121
-                                v-for="item in options"
122
-                                :key="item.value"
123
-                                :label="item.label"
124
-                                :value="item.value">
125
-                                </el-option>
126
-                            </el-select>
127
-                        </el-form-item>
128
-                        <el-form-item label="医保编码 : " prop="name">
129
-                            <el-input v-model="form.medical_number" style="width:160px;" placeholder="" maxlength="30"></el-input>
130
-                        </el-form-item>
131
-                        <el-form-item label="生产厂商 : " prop="vendor" required="vendor">
132
-                            <el-select v-model="form.vendor" style="width:160px;" placeholder="请选择">
133
-                                <el-option
134
-                                v-for="item in options"
135
-                                :key="item.value"
136
-                                :label="item.label"
137
-                                :value="item.value">
138
-                                </el-option>
139
-                            </el-select>
140
-                        </el-form-item>
141
-                        <el-form-item label="药理分类 : " prop="name">
142
-                            <el-select v-model="form.pharmacological_classification" style="width:160px;" placeholder="请选择">
143
-                                <el-option
144
-                                v-for="item in options"
145
-                                :key="item.value"
146
-                                :label="item.label"
147
-                                :value="item.value">
148
-                                </el-option>
149
-                            </el-select>
150
-                        </el-form-item>
151
-                        <el-form-item label="统计分类 : " prop="name">
152
-                            <el-select v-model="form.statistical_classification" style="width:160px;" placeholder="请选择">
153
-                                <el-option
154
-                                v-for="item in options"
155
-                                :key="item.value"
156
-                                :label="item.label"
157
-                                :value="item.value">
158
-                                </el-option>
159
-                            </el-select>
160
-                        </el-form-item>
161
-                        <el-form-item label="本位码 : " prop="name">
162
-                            <el-input v-model="form.standard_code" style="width:160px;" placeholder="" maxlength="30"></el-input>
163
-                        </el-form-item>
164
-                        <el-form-item label="是否特病目录:" prop="name">
165
-                            <el-select v-model="form.special_disease_directory" style="width:160px;" placeholder="请选择">
166
-                                <el-option
167
-                                v-for="item in options"
168
-                                :key="item.value"
169
-                                :label="item.label"
170
-                                :value="item.value">
171
-                                </el-option>
172
-                            </el-select>
173
-                        </el-form-item>
174
-                        <el-form-item label="是否备案 : " prop="name">
175
-                            <el-select v-model="form.recorded" style="width:160px;" placeholder="请选择">
176
-                                <el-option
177
-                                v-for="item in options"
178
-                                :key="item.value"
179
-                                :label="item.label"
180
-                                :value="item.value">
181
-                                </el-option>
182
-                            </el-select>
183
-                        </el-form-item>
184
-                        <el-form-item label="代理商 : " prop="name">
185
-                            <el-input v-model="form.agent" style="width:160px;" placeholder="" maxlength="30"></el-input>
186
-                        </el-form-item>
187
-                        <el-form-item label="" prop="name" style="visibility: hidden;">
188
-                            <el-input style="width:160px;" placeholder="" maxlength="30"></el-input>
189
-                        </el-form-item>
190
-                        <el-form-item label="状态 : " prop="name">
191
-                            <el-radio-group v-model="form.drug_status">
192
-                                <el-radio :label="1">停用</el-radio>
193
-                                <el-radio :label="2">贵重</el-radio>
194
-                                <el-radio :label="3">收费</el-radio>
195
-                                <el-radio :label="4">库存管理</el-radio>
196
-                                <el-radio :label="5">默认用药途径收费</el-radio>
197
-                                <el-radio :label="6">注射类</el-radio>
198
-                            </el-radio-group>
199
-                        </el-form-item>
200
-                        <el-form-item label="限制说明 : " prop="name" style="width:100%;">
201
-                            <el-input type="form.restrictions" :rows="2" placeholder="请输入内容" v-model="form.restrictions"></el-input>
202
-                        </el-form-item>
203
-                    </el-form>
204
-                </div>
205
-            </el-tab-pane>
206
-            <el-tab-pane label="扩展数据" name="second">
207
-                <el-form :model="form" :rules="rules" ref="form" label-width="120px" style="display: flex;flex-wrap: wrap;justify-content: space-between;">
208
-                        <el-form-item label="默认给药途径:" prop="name">
209
-                            <el-select v-model="form.default_delivery_route" style="width:160px;" placeholder="请选择">
210
-                                <el-option
211
-                                v-for="item in options"
212
-                                :key="item.value"
213
-                                :label="item.label"
214
-                                :value="item.value">
215
-                                </el-option>
216
-                            </el-select>
217
-                        </el-form-item>
218
-                        <el-form-item label="默认执行频率:" prop="name">
219
-                            <el-select v-model="form.default_frequency" style="width:160px;" placeholder="请选择">
220
-                                <el-option
221
-                                v-for="item in options"
222
-                                :key="item.value"
223
-                                :label="item.label"
224
-                                :value="item.value">
225
-                                </el-option>
226
-                            </el-select>
227
-                        </el-form-item>
228
-                        <el-form-item label="默认单次用量:" prop="name">
229
-                            <el-input v-model="form.default_single_dose" style="width:160px;" placeholder="" maxlength="30"></el-input>
230
-                        </el-form-item>
231
-                        <el-form-item label="默认开药数量:" prop="name">
232
-                            <el-input v-model="form.default_prescribing_quantity" style="width:160px;" placeholder="" maxlength="30"></el-input>
233
-                        </el-form-item>
234
-                        <el-form-item label="标签:" prop="name">
235
-                            <el-select v-model="form.label" style="width:160px;" placeholder="请选择">
236
-                                <el-option
237
-                                v-for="item in options"
238
-                                :key="item.value"
239
-                                :label="item.label"
240
-                                :value="item.value">
241
-                                </el-option>
242
-                            </el-select>
243
-                        </el-form-item>
244
-                        <el-form-item label="收费项目排序:" prop="name">
245
-                            <el-input v-model="form.ranking_charge_items" style="width:160px;" placeholder="" maxlength="30"></el-input>
246
-                        </el-form-item>
247
-                        <el-form-item label="是否常用医嘱:" prop="name">
248
-                            <el-select v-model="form.is_doctor_advice" style="width:160px;" placeholder="请选择">
249
-                                <el-option
250
-                                v-for="item in options"
251
-                                :key="item.value"
252
-                                :label="item.label"
253
-                                :value="item.value">
254
-                                </el-option>
255
-                            </el-select>
256
-                        </el-form-item>
257
-                        <el-form-item label="是否默认:" prop="name">
258
-                            <el-select v-model="form.is_default" style="width:160px;" placeholder="请选择">
259
-                                <el-option
260
-                                v-for="item in options"
261
-                                :key="item.value"
262
-                                :label="item.label"
263
-                                :value="item.value">
264
-                                </el-option>
265
-                            </el-select>
266
-                        </el-form-item>
267
-                        <el-form-item label="是否收费预估项:" prop="name">
268
-                            <el-select v-model="form.is_charge_estimate" style="width:160px;" placeholder="请选择">
269
-                                <el-option
270
-                                v-for="item in options"
271
-                                :key="item.value"
272
-                                :label="item.label"
273
-                                :value="item.value">
274
-                                </el-option>
275
-                            </el-select>
276
-                        </el-form-item>
277
-                        <el-form-item label="是否统计工作量:" prop="name">
278
-                            <el-select v-model="form.statistical_workload" style="width:160px;" placeholder="请选择">
279
-                                <el-option
280
-                                v-for="item in options"
281
-                                :key="item.value"
282
-                                :label="item.label"
283
-                                :value="item.value">
284
-                                </el-option>
285
-                            </el-select>
286
-                        </el-form-item>
287
-                        <el-form-item label="是否收费常用项:" prop="name">
288
-                            <el-select v-model="form.is_common_charge" style="width:160px;" placeholder="请选择">
289
-                                <el-option
290
-                                v-for="item in options"
291
-                                :key="item.value"
292
-                                :label="item.label"
293
-                                :value="item.value">
294
-                                </el-option>
295
-                            </el-select>
296
-                        </el-form-item>
297
-                         <el-form-item label="" prop="name" style="visibility: hidden;">
298
-                            <el-input style="width:160px;" placeholder="" maxlength="30"></el-input>
299
-                        </el-form-item>
300
-                </el-form>
301
-            </el-tab-pane>
302
-        </el-tabs>
2
+  <el-dialog
3
+    :title="formTitle"
4
+    width="900px"
5
+    :visible.sync="visible"
6
+    :before-close="_close"
7
+  >
8
+    <el-tabs v-model="activeName" >
9
+      <el-tab-pane label="基础数据" name="first">
10
+        <div>
11
+          <el-form :model="form" :rules="rules" ref="form" label-width="100px"
12
+                   style="display: flex;flex-wrap: wrap;justify-content: space-between;">
13
+            <el-form-item label="药品名称 : " prop="drug_name" >
14
+              <el-input v-model="form.drug_name" style="width:160px;" placeholder="" maxlength="30"></el-input>
15
+            </el-form-item>
16
+            <el-form-item label="拼音 : " prop="pinyin" >
17
+              <el-input v-model="form.pinyin" style="width:160px;" placeholder="" maxlength="30"></el-input>
18
+            </el-form-item>
19
+            <el-form-item label="五笔 : " prop="wubi">
20
+              <el-input v-model="form.wubi" style="width:160px;" placeholder="" maxlength="30"></el-input>
21
+            </el-form-item>
22
+            <el-form-item label="药品别名 : " prop="drug_alias">
23
+              <el-input v-model="form.drug_alias" style="width:160px;" placeholder="" maxlength="30"></el-input>
24
+            </el-form-item>
25
+            <el-form-item label="别名拼音 : " prop="drug_alias_pinyin">
26
+              <el-input v-model="form.drug_alias_pinyin" style="width:160px;" placeholder="" maxlength="30"></el-input>
27
+            </el-form-item>
28
+            <el-form-item label="别名五笔 : " prop="drug_alias_wubi">
29
+              <el-input v-model="form.drug_alias_wubi" style="width:160px;" placeholder="" maxlength="30"></el-input>
30
+            </el-form-item>
31
+            <el-form-item label="药品类别 : " prop="drug_category" >
32
+              <el-select v-model="form.drug_category" style="width:160px;" placeholder="请选择">
33
+                <el-option
34
+                  v-for="item,index in getDictionaryDataConfig('system','drug_category')"
35
+                  :key="index"
36
+                  :label="item.name"
37
+                  :value="item.id">
38
+                </el-option>
39
+              </el-select>
40
+            </el-form-item>
41
+            <el-form-item label="药品规格 : " prop="drug_spec" >
42
+              <el-input v-model="form.drug_spec" style="width:160px;" placeholder="" maxlength="30"></el-input>
43
+            </el-form-item>
44
+            <el-form-item label="药品类型 : " prop="drug_type">
45
+              <el-input v-model="form.drug_type" style="width:160px;" placeholder="" maxlength="30"></el-input>
46
+            </el-form-item>
47
+            <el-form-item label="库存警戒:" prop="drug_stock_limit" >
48
+              <el-input v-model="form.drug_stock_limit" style="width:160px;" placeholder="" maxlength="30"></el-input>
49
+            </el-form-item>
50
+            <el-form-item label="产地:" prop="drug_origin_place" >
51
+              <el-input v-model="form.drug_origin_place" style="width:160px;" placeholder="" maxlength="30"></el-input>
52
+            </el-form-item>
53
+            <el-form-item label="药品剂型 : " prop="drug_dosage_form" >
54
+              <el-input v-model="form.drug_dosage_form" style="width:160px;" placeholder="" maxlength="30"></el-input>
55
+            </el-form-item>
56
+            <el-form-item label="医保等级 : " prop="medical_insurance_level" >
57
+              <el-select v-model="form.medical_insurance_level" style="width:160px;" placeholder="请选择">
58
+                <el-option
59
+                  v-for="item,index in getDictionaryDataConfig('system','medical_insurance_level')"
60
+                  :key="index"
61
+                  :label="item.name"
62
+                  :value="item.id">
63
+                </el-option>
64
+              </el-select>
65
+            </el-form-item>
66
+            <el-form-item label="最大单位 : " prop="max_unit" >
67
+              <el-select v-model="form.max_unit" style="width:160px;" placeholder="请选择">
68
+                <el-option
69
+                  v-for="item,index in getDataConfig('hemodialysis','units')"
70
+                  :key="index"
71
+                  :label="item.name"
72
+                  :value="item.id">
73
+                </el-option>
74
+              </el-select>
75
+            </el-form-item>
76
+            <el-form-item label="最小单位 : " prop="min_unit" >
77
+              <el-select v-model="form.min_unit" style="width:160px;" placeholder="请选择">
78
+                <el-option
79
+                  v-for="item,index in getDataConfig('hemodialysis','units')"
80
+                  :key="index"
81
+                  :label="item.name"
82
+                  :value="item.id">
83
+                </el-option>
84
+              </el-select>
85
+            </el-form-item>
86
+            <el-form-item label="单位换算 : " prop="unit_matrixing" >
87
+              <el-input v-model="form.unit_matrixing" style="width:160px;" placeholder="" maxlength="30"></el-input>
88
+            </el-form-item>
89
+            <el-form-item label="零售价(元) : " prop="retail_price" >
90
+              <el-input v-model="form.retail_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
91
+            </el-form-item>
92
+            <el-form-item label="上次进价(元) : " prop="last_price" >
93
+              <el-input v-model="form.last_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
94
+            </el-form-item>
95
+            <el-form-item label="开药控制 : " prop="drug_control">
96
+              <el-select v-model="form.drug_control" style="width:160px;" placeholder="请选择">
97
+                <el-option
98
+                  v-for="item,index in getDictionaryDataConfig('system','drug_control')"
99
+                  :key="index"
100
+                  :label="item.name"
101
+                  :value="item.id">
102
+                </el-option>
103
+              </el-select>
104
+            </el-form-item>
105
+            <el-form-item label="批准文号 : " prop="number">
106
+              <el-input v-model="form.number" style="width:160px;" placeholder="" maxlength="30"></el-input>
107
+            </el-form-item>
108
+            <el-form-item label="药物分类 : " prop="drug_classify" >
109
+              <el-select v-model="form.drug_classify" style="width:160px;" placeholder="请选择">
110
+                <el-option
111
+                  v-for="item, index in getDictionaryDataConfig('system','drug_classify')"
112
+                  :key="index"
113
+                  :label="item.name"
114
+                  :value="item.id">
115
+                </el-option>
116
+              </el-select>
117
+            </el-form-item>
118
+            <el-form-item label="剂量 : " prop="drug_dose" >
119
+              <el-input v-model="form.drug_dose" style="width:70px;margin-right:5px;" placeholder=""
120
+                        maxlength="30"></el-input>
121
+              <el-select v-model="form.drug_dose_unit" style="width:80px;" placeholder="请选择">
122
+                <el-option
123
+                  v-for="item,index in getDataConfig('hemodialysis','units')"
124
+                  :key="index"
125
+                  :label="item.name"
126
+                  :value="item.id">
127
+                </el-option>
128
+              </el-select>
129
+            </el-form-item>
130
+            <el-form-item label="医保编码 : " prop="medical_insurance_number">
131
+              <el-input v-model="form.medical_insurance_number" style="width:160px;" placeholder="" maxlength="30"></el-input>
132
+            </el-form-item>
133
+            <el-form-item label="生产厂商 : " prop="manufacturer" >
134
+              <el-select v-model="form.manufacturer" style="width:160px;" placeholder="请选择">
135
+                <el-option
136
+                  v-for="item,index in manufacturers"
137
+                  :key="index"
138
+                  :label="item.manufacturer_name"
139
+                  :value="item.id">
140
+                </el-option>
141
+              </el-select>
142
+            </el-form-item>
143
+            <el-form-item label="药理分类 : " prop="pharmacology_category">
144
+              <el-select v-model="form.pharmacology_category" style="width:160px;" placeholder="请选择">
145
+                <el-option
146
+                  v-for="item,index  in getDictionaryDataConfig('system','pharmacology_category')"
147
+                  :key="index"
148
+                  :label="item.name"
149
+                  :value="item.id">
150
+                </el-option>
151
+              </el-select>
152
+            </el-form-item>
153
+            <el-form-item label="统计分类 : " prop="statistics_category">
154
+              <el-select v-model="form.statistics_category" style="width:160px;" placeholder="请选择">
155
+                <el-option
156
+                  v-for="item,index  in getDictionaryDataConfig('system','statistics_category')"
157
+                  :key="index"
158
+                  :label="item.name"
159
+                  :value="item.id">
160
+                </el-option>
161
+              </el-select>
162
+            </el-form-item>
163
+            <el-form-item label="本位码 : " prop="code">
164
+              <el-input v-model="form.code" style="width:160px;" placeholder="" maxlength="30"></el-input>
165
+            </el-form-item>
166
+            <el-form-item label="是否特病目录:" prop="is_special_diseases">
167
+              <el-select v-model="form.is_special_diseases" style="width:160px;" placeholder="请选择">
168
+                <el-option
169
+                  v-for="item,index in options"
170
+                  :key="index"
171
+                  :label="item.label"
172
+                  :value="item.value">
173
+                </el-option>
174
+              </el-select>
175
+            </el-form-item>
176
+            <el-form-item label="是否备案 : " prop="is_record">
177
+              <el-select v-model="form.is_record" style="width:160px;" placeholder="请选择">
178
+                <el-option
179
+                  v-for="item,index in options"
180
+                  :key="index"
181
+                  :label="item.label"
182
+                  :value="item.value">
183
+                </el-option>
184
+              </el-select>
185
+            </el-form-item>
186
+            <el-form-item label="代理商 : " prop="agent">
187
+              <el-input v-model="form.agent" style="width:160px;" placeholder="" maxlength="30"></el-input>
188
+            </el-form-item>
189
+            <el-form-item label=""  style="visibility: hidden;">
190
+              <el-input style="width:160px;" placeholder="" maxlength="30"></el-input>
191
+            </el-form-item>
192
+            <el-form-item label="状态 : " prop="drug_status">
193
+              <el-checkbox-group v-model="drug_status">
194
+                <el-checkbox label="停用">停用</el-checkbox>
195
+                <el-checkbox label="贵重">贵重</el-checkbox>
196
+                <el-checkbox label="收费">收费</el-checkbox>
197
+                <el-checkbox label="库存管理" >库存管理</el-checkbox>
198
+                <el-checkbox label="默认用药途径收费" >默认用药途径收费</el-checkbox>
199
+                <el-checkbox label="注射类" >注射类</el-checkbox>
200
+              </el-checkbox-group>
201
+            </el-form-item>
202
+            <el-form-item label="限制说明 : " prop="limit_remark" style="width:100%;">
203
+              <el-input type="form.restrictions" :rows="2" placeholder="请输入内容" v-model="form.limit_remark"></el-input>
204
+            </el-form-item>
205
+          </el-form>
206
+        </div>
207
+      </el-tab-pane>
208
+      <el-tab-pane label="扩展数据" name="second">
209
+        <el-form :model="form" label-width="120px"
210
+                 style="display: flex;flex-wrap: wrap;justify-content: space-between;">
211
+          <el-form-item label="默认给药途径:" prop="delivery_way">
212
+            <el-select v-model="form.delivery_way" style="width:160px;" placeholder="请选择">
213
+              <el-option
214
+                v-for="item, index in deliveryWayOptions"
215
+                :key="index"
216
+                :label="item.name"
217
+                :value="item.name">
218
+              </el-option>
219
+            </el-select>
220
+          </el-form-item>
221
+          <el-form-item label="默认执行频率:" prop="execution_frequency">
222
+            <el-select v-model="form.execution_frequency" style="width:160px;" placeholder="请选择">
223
+              <el-option
224
+                v-for="item,index in executionFrequencyOptions"
225
+                :key="index"
226
+                :label="item.name"
227
+                :value="item.name">
228
+              </el-option>
229
+            </el-select>
230
+          </el-form-item>
231
+          <el-form-item label="默认单次用量:" prop="single_dose">
232
+            <el-input v-model="form.single_dose" style="width:160px;" placeholder="" maxlength="30"></el-input>
233
+          </el-form-item>
234
+          <el-form-item label="默认开药数量:" prop="prescribing_number">
235
+            <el-input v-model="form.prescribing_number" style="width:160px;" placeholder=""
236
+                      maxlength="30"></el-input>
237
+          </el-form-item>
238
+          <el-form-item label="标签:" prop="label">
239
+            <el-select v-model="form.label" style="width:160px;" placeholder="请选择">
240
+              <el-option
241
+                v-for="item,index in getDictionaryDataConfig('system','sign')"
242
+                :key="index"
243
+                :label="item.name"
244
+                :value="item.id">
245
+              </el-option>
246
+            </el-select>
247
+          </el-form-item>
248
+          <el-form-item label="收费项目排序:" prop="sort">
249
+            <el-input v-model="form.sort" style="width:160px;" placeholder="" maxlength="30"></el-input>
250
+          </el-form-item>
251
+          <el-form-item label="是否常用医嘱:" prop="is_use_doctor_advice">
252
+            <el-select v-model="form.is_use_doctor_advice" style="width:160px;" placeholder="请选择">
253
+              <el-option
254
+                v-for="item,index in options"
255
+                :key="index"
256
+                :label="item.label"
257
+                :value="item.value">
258
+              </el-option>
259
+            </el-select>
260
+          </el-form-item>
261
+          <el-form-item label="是否默认:" prop="is_default">
262
+            <el-select v-model="form.is_default" style="width:160px;" placeholder="请选择">
263
+              <el-option
264
+                v-for="item,index in options"
265
+                :key="index"
266
+                :label="item.label"
267
+                :value="item.value">
268
+              </el-option>
269
+            </el-select>
270
+          </el-form-item>
271
+          <el-form-item label="是否收费预估项:" prop="is_charge_predict">
272
+            <el-select v-model="form.is_charge_predict" style="width:160px;" placeholder="请选择">
273
+              <el-option
274
+                v-for="item,index in options"
275
+                :key="index"
276
+                :label="item.label"
277
+                :value="item.value">
278
+              </el-option>
279
+            </el-select>
280
+          </el-form-item>
281
+          <el-form-item label="是否统计工作量:" prop="is_statistics_work">
282
+            <el-select v-model="form.is_statistics_work" style="width:160px;" placeholder="请选择">
283
+              <el-option
284
+                v-for="item,index in options"
285
+                :key="index"
286
+                :label="item.label"
287
+                :value="item.value">
288
+              </el-option>
289
+            </el-select>
290
+          </el-form-item>
291
+          <el-form-item label="是否收费常用项:" prop="is_charge_use">
292
+            <el-select v-model="form.is_charge_use" style="width:160px;" placeholder="请选择">
293
+              <el-option
294
+                v-for="item,index in options"
295
+                :key="index"
296
+                :label="item.label"
297
+                :value="item.value">
298
+              </el-option>
299
+            </el-select>
300
+          </el-form-item>
301
+          <el-form-item label="" style="visibility: hidden;">
302
+            <el-input style="width:160px;" placeholder="" maxlength="30"></el-input>
303
+          </el-form-item>
304
+        </el-form>
305
+      </el-tab-pane>
306
+    </el-tabs>
303 307
 
304 308
 
305
-        <div slot="footer" class="dialog-footer">
306
-            <el-button @click="hide">取 消</el-button>
307
-            <el-button type="primary" :loading="submitLoading" @click="submitAction()">保 存</el-button>
308
-        </div>
309
+    <span slot="footer" class="dialog-footer">
310
+    <el-button  @click="cancle('form')">取 消</el-button>
311
+    <el-button type="primary" @click="comfirm('form')">保 存</el-button>
312
+  </span>
309 313
   </el-dialog>
310 314
 </template>
311 315
 
312 316
 <script>
313
-export default {
314
-    data(){
315
-        return{
316
-            visible:false,
317
-            formTitle:'',
318
-            activeName:'first',
319
-            form:{
320
-                name:''
321
-            },
322
-            drugCategorys:[
323
-            {id:1,name:'中药'},
324
-            {id:2,name:'西药'},
325
-            {id:3,name:"草药"},
326
-            {id:4,name:"其他"}],
327
-            options: [],
328
-            value: '',
329
-            radio:'1',
330
-            form:{
331
-              drug_name:"",//药品名称
332
-              ping_yin:"",//拼音
333
-              five_input:"",//五笔输入法
334
-              drug_alias:"",//药品别名
335
-              pingyin_alias:"",//别名拼音
336
-              fiveinput_alias:"",//别名五笔  
337
-              drug_category:"",//药品类别
338
-              drug_rules:"",//药品规格
339
-              drug_type:"",//药品类型
340
-              stock_warn:"",//库存警戒
341
-              place_origin:"",//产地
342
-              drug_formulation:"",//药品剂型
343
-              medical_coverage:"",//医保等级
344
-              max_units:"",//最大单位
345
-              min_untis:"",//最小单位
346
-              unit_conversion:"",//单位换算
347
-              retail_price:"",//零售价
348
-              last_entry:"",//上次进价
349
-              drug_control:"",//开药控制
350
-              license_number:"",//批准文号
351
-              drug_class:"",//药物分类
352
-              drug_dose:"",//药品剂量
353
-              medical_number:"",//医保编号
354
-              vendor:"",//生产产商
355
-              pharmacological_classification:"",//药理分类
356
-              statistical_classification:"",//统计分类
357
-              standard_code:"",//本位码
358
-              special_disease_directory:"",//是否特病目录
359
-              recorded:"",//是否备案
360
-              agent:"",// 代理商
361
-              drug_status:"",// 状态
362
-              restrictions:"",//限制说明
317
+  import { getDictionaryDataConfig,getDataConfig } from "@/utils/data";
318
+  import {
319
+    getAdviceConfig,
320
+  } from '@/api/advice'
321
+  export default {
322
+    data() {
323
+      return {
324
+        visible: false,
325
+        formTitle: '',
326
+        activeName: 'first',
327
+        manufacturers:[],
328
+        drugCategorys: [
329
+          { id: 1, name: '中药' },
330
+          { id: 2, name: '西药' },
331
+          { id: 3, name: '草药' },
332
+          { id: 4, name: '其他' }],
333
+        options: [{
334
+          value: '1',
335
+          label: '是'
336
+        }, {
337
+          value: '2',
338
+          label: '否'
339
+        }],
340
+        deliveryWayOptions:[],
341
+        executionFrequencyOptions:[],
342
+        value: '',
343
+        radio: '1',
344
+        drug_status:[],
345
+        form: {
346
+          drug_name: '',//药品名称
347
+          pinyin: '',//拼音
348
+          wubi: '',//五笔输入法
349
+          drug_alias: '',//药品别名
350
+          drug_alias_pinyin: '',//别名拼音
351
+          drug_alias_wubi: '',//别名五笔
352
+          drug_category: '',//药品类别
353
+          drug_spec: '',//药品规格
354
+          drug_type: '',//药品类型
355
+          drug_stock_limit: '',//库存警戒
356
+          drug_origin_place: '',//产地
357
+          drug_dosage_form: '',//药品剂型
358
+          medical_insurance_level: '',//医保等级
359
+          max_unit: '',//最大单位
360
+          min_unit: '',//最小单位
361
+          unit_matrixing: '',//单位换算
362
+          retail_price: '',//零售价
363
+          last_price: '',//上次进价
364
+          drug_control: '',//开药控制
365
+          number: '',//批准文号
366
+          drug_classify: '',//药物分类
367
+          drug_dose: '',//药品剂量
368
+          drug_dose_unit:'',
369
+          medical_insurance_number: '',//医保编号
370
+          manufacturer:'', //生产产商
371
+          pharmacology_category: '',//药理分类
372
+          statistics_category: '',//统计分类
373
+          code: '',//本位码
374
+          is_special_diseases: '',//是否特病目录
375
+          is_record: '',//是否备案
376
+          agent: '',// 代理商
377
+          drug_status: '',// 状态
378
+          limit_remark: '',//限制说明
379
+          delivery_way: '',//默认给药途径
380
+          execution_frequency: '',//默认执行频率
381
+          single_dose: '',//默认单次用量
382
+          prescribing_number: '',//默认开药数量
383
+          label: '',//标签
384
+          sort: '',//收费项目排序
385
+          is_use_doctor_advice: '',//是否常用医嘱
386
+          is_default: '',//是否默认
387
+          is_charge_predict: '',//是否收费预估项
388
+          is_statistics_work: '',//是否统计工作量
389
+          is_charge_use: '',//是否收费常用项
390
+          drug_code:'',
391
+        },
363 392
 
364
-              default_delivery_route:"",//默认给药途径
365
-              default_frequency:"",//默认执行频率
366
-              default_single_dose:"",//默认单次用量
367
-              default_prescribing_quantity:"",//默认开药数量
368
-              label:"",//标签
369
-              ranking_charge_items:"",//收费项目排序
370
-              is_doctor_advice:"",//是否常用医嘱
371
-              is_default:"",//是否默认
372
-              is_charge_estimate:"",//是否收费预估项
373
-              statistical_workload:"",//是否统计工作量
374
-              is_common_charge:"",//是否收费常用项
375
-            },
376
-          rules: {
377
-            drug_name:[{ required: true, message: '请填写药品名称' }],
378
-            ping_yin:[{required:true,message:"请填写拼音"}],
379
-            five_input:[{required:true,message:"请填写五笔"}],
380
-            drug_category:[{required:true,message:"请填写药品类别"}],
381
-            drug_rules:[{required:true,message:"请填写药品规格"}], 
382
-            drug_type:[{required:true,message:"请填写药品类型"}],
383
-            stock_warn:[{required:true,message:"请填写库存警戒"}],
384
-            place_origin:[{required:true,message:"请填写产地"}],
385
-            drug_formulation:[{required:true,message:"请填写药品剂型"}],
386
-            medical_coverage:[{required:true,message:"请填写医保等级"}],
387
-            max_units:[{required:true,message:"请填写最大单位"}],
388
-            min_untis:[{required:true,message:"请填写最小单位"}],
389
-            unit_conversion:[{required:true,message:"请填写单位换算"}],
390
-            retail_price:[{required:true,message:"请填写零售价"}],
391
-            last_entry:[{required:true,message:"请填写上次进价"}],
392
-            drug_class:[{required:true,message:"请填写药物分类"}],
393
-            drug_dose:[{required:true,message:"请填写剂量"}],
394
-            vendor:[{required:true,message:"请填写生产产商"}]
395
-          },
393
+        rules: {
394
+          drug_name: [{ required: true, message: '请填写药品名称', trigger: 'blur'  }],
395
+          pinyin: [{ required: true, message: '请填写拼音' , trigger: 'blur' }],
396
+          wubi: [{ required: true, message: '请填写五笔' , trigger: 'blur' }],
397
+          drug_alias: [{ required: true, message: '请选择药品类别', trigger: 'change' }],
398
+          drug_spec: [{ required: true, message: '请填写药品规格',trigger: 'blur' }],
399
+          drug_type: [{ required: true, message: '请填写药品类型',trigger: 'blur' }],
400
+          drug_stock_limit: [{ required: true, message: '请填写库存警戒',trigger: 'blur'  }],
401
+          drug_origin_place: [{ required: true, message: '请填写产地',trigger: 'blur' }],
402
+          drug_dosage_form: [{ required: true, message: '请填写药品剂型',trigger: 'blur' }],
403
+          medical_insurance_level: [{ required: true, message: '请选择医保等级',trigger: 'change' }],
404
+          max_unit: [{ required: true, message: '请填写最大单位',trigger: 'change' }],
405
+          min_unit: [{ required: true, message: '请填写最小单位',trigger: 'change' }],
406
+          unit_matrixing: [{ required: true, message: '请填写单位换算',trigger: 'blur' }],
407
+          retail_price: [{ required: true, message: '请填写零售价',trigger: 'blur'  }],
408
+          last_price: [{ required: true, message: '请填写上次进价',trigger: 'blur'  }],
409
+          drug_classify: [{ required: true, message: '请选择药物分类',trigger: 'change'  }],
410
+          drug_dose: [{ required: true, message: '请填写剂量',trigger: 'blur'  }],
411
+          manufacturer: [{ required: true, message: '请选择生产产商',trigger: 'change'  }]
396 412
         }
413
+      }
397 414
     },
398
-    methods:{
399
-        _close: function(done) {
400
-            // this.clear()
401
-            done()
402
-        },
403
-        clear: function() {
404
-            this.form.id = 0;
405
-            this.form.name = "";
406
-            this.form.intro = "";
407
-        },
408
-        show(id) {
409
-            // this.clear()
410
-            this.visible = true
411
-            if(id == 0){
412
-                this.formTitle = '新增'
413
-            }else{
414
-                this.formTitle = '编辑'
415
+    props: {
416
+      manufacturers:{
417
+        type:Array
418
+      },
419
+      titles: {
420
+        type: String,
421
+        default: ''
422
+      },
423
+      formValue: {
424
+        type: Object
425
+      },
426
+      isCreated: {
427
+        type: Number,
428
+        default: 1
429
+      }
430
+
431
+    },
432
+    methods: {
433
+      cancle: function(formName) {
434
+        this.$emit('dialog-cancle', this.getValue())
435
+      },
436
+      comfirm: function(formName) {
437
+        this.$refs[formName].validate((valid) => {
438
+          console.log(valid)
439
+          if (valid) {
440
+            console.log( this.getValue())
441
+            this.$emit('dialog-comfirm', this.getValue())
442
+          }
443
+        })
444
+      },
445
+      getDictionaryDataConfig(module, filed_name) {
446
+        return getDictionaryDataConfig(module, filed_name)
447
+
448
+      },getDataConfig(module, filed_name){
449
+        return getDataConfig(module, filed_name)
450
+
451
+      },
452
+      _close: function(done) {
453
+        // this.clear()
454
+        done()
455
+      },
456
+      clear: function() {
457
+        this.form.id = 0
458
+        this.form.name = ''
459
+        this.form.intro = ''
460
+      },
461
+      show(id,obj) {
462
+        // this.clear()
463
+        this.visible = true
464
+        if (id == 0) {
465
+          this.formTitle = '新增'
466
+          this.form['id'] = 0
467
+          for(let key in obj){
468
+            this.form[key] = obj[key]
469
+          }
470
+
471
+        } else {
472
+          for(let key in obj){
473
+            this.form[key] = obj[key]
474
+          }
475
+
476
+          this.form.drug_classify = parseInt(this.form.drug_classify)
477
+          this.form.max_unit = parseInt(this.form.max_unit)
478
+          this.form.min_unit = parseInt(this.form.min_unit)
479
+
480
+          this.form['id'] = id
481
+
482
+          console.log(this.form.drug_status.length)
483
+          this.drug_status = []
484
+          if(this.form.drug_status.length > 0){
485
+            for (let i = 0; i <  this.form.drug_status.split(",").length; i++){
486
+                this.drug_status.push(this.form.drug_status.split(",")[i])
415 487
             }
416
-        },
417
-        hide() {
418
-            // this.clear()
419
-            this.visible = false
420
-        },
488
+            console.log(this.drug_status)
489
+          }
490
+
491
+          this.formTitle = '编辑'
492
+
493
+
494
+        }
495
+        this.getAdviceConfig()
496
+
497
+      },getAdviceConfig() {
498
+        getAdviceConfig().then(response => {
499
+          if (response.data.state == 1) {
500
+            this.deliveryWayOptions =
501
+              response.data.data.drugways === null
502
+                ? []
503
+                : response.data.data.drugways
504
+
505
+            this.executionFrequencyOptions =
506
+              response.data.data.efs === null ? [] : response.data.data.efs
507
+          }
508
+        })
509
+
510
+      }
511
+      ,
512
+      hide() {
513
+        // this.clear()
514
+        this.visible = false
515
+      },getValue: function() {
516
+        const form = {}
517
+        form['id'] = this.form.id
518
+        form['drug_name'] = this.form.drug_name
519
+        form['pinyin'] = this.form.pinyin
520
+        form['wubi'] = this.form.wubi
521
+        form['drug_alias'] = this.form.drug_alias
522
+        form['drug_alias_pinyin'] = this.form.drug_alias_pinyin
523
+        form['drug_alias_wubi'] = this.form.drug_alias_wubi
524
+        form['drug_category'] = this.form.drug_category
525
+        form['drug_spec'] = this.form.drug_spec
526
+        form['drug_type'] = this.form.drug_type
527
+        form['drug_stock_limit'] = this.form.drug_stock_limit
528
+        form['drug_origin_place'] = this.form.drug_origin_place
529
+        form['drug_dosage_form'] = this.form.drug_dosage_form
530
+        form['medical_insurance_level'] = this.form.medical_insurance_level
531
+        form['max_unit'] = this.form.max_unit
532
+        form['min_unit'] = this.form.min_unit
533
+        form['unit_matrixing'] = this.form.unit_matrixing
534
+        form['retail_price'] = this.form.retail_price
535
+        form['last_price'] = this.form.last_price
536
+        form['drug_control'] = this.form.drug_control
537
+        form['number'] = this.form.number
538
+        form['drug_dose'] = this.form.drug_dose
539
+        form['drug_dose_unit'] = this.form.drug_dose_unit
540
+        form['medical_insurance_number'] = this.form.medical_insurance_number
541
+        form['manufacturer'] = this.form.manufacturer
542
+        form['pharmacology_category'] = this.form.pharmacology_category
543
+        form['statistics_category'] = this.form.statistics_category
544
+        form['code'] = this.form.code
545
+        form['is_special_diseases'] = this.form.is_special_diseases
546
+        form['is_record'] = this.form.is_record
547
+        form['agent'] = this.form.agent
548
+        form['drug_status'] = this.drug_status.join(",")
549
+        form['limit_remark'] = this.form.limit_remark
550
+        form['delivery_way'] = this.form.delivery_way
551
+        form['execution_frequency'] = this.form.execution_frequency
552
+        form['single_dose'] = this.form.single_dose
553
+        form['prescribing_number'] = this.form.prescribing_number
554
+        form['label'] = this.form.label
555
+        form['sort'] = this.form.sort
556
+        form['is_use_doctor_advice'] = this.form.is_use_doctor_advice
557
+        form['is_default'] = this.form.is_default
558
+        form['is_charge_predict'] = this.form.is_charge_predict
559
+        form['is_statistics_work'] = this.form.is_statistics_work
560
+        form['is_charge_use'] = this.form.is_charge_use
561
+        form['drug_code'] = this.form.drug_code
562
+        form['drug_classify'] = this.form.drug_classify
563
+
564
+
565
+
566
+        return form
567
+      },
568
+    }, watch: {
569
+      visible(val) {
570
+        // this.form = this.formValue
571
+
572
+      }
421 573
     }
422
-}
574
+  }
423 575
 </script>

+ 701 - 97
src/xt_pages/data/components/consumables.vue Vedi File

@@ -1,108 +1,712 @@
1 1
 <template>
2
-    <div class="page_consumables">
3
-        <div style="display:flex;justify-content: space-between;width:100%;margin-bottom:20px;">
4
-            <div class="cell clearfix" style="margin-bottom:0;">
5
-                <el-input style="width: 180px;margin-right:10px;" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/>
6
-                <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search" @click="searchAction">搜索</el-button>
7
-                <label class="title"><span class="name">是否启用</span> : </label>
8
-                <el-select v-model="value" style="width:140px;margin-right:10px;" placeholder="请选择">
9
-                    <el-option
10
-                    v-for="item in options"
11
-                    :key="item.value"
12
-                    :label="item.label"
13
-                    :value="item.value">
14
-                    </el-option>
15
-                </el-select>
16
-                <label class="title"><span class="name">是否收费</span> : </label>
17
-                <el-select v-model="value" style="width:140px;margin-right:10px;" placeholder="请选择">
18
-                    <el-option
19
-                    v-for="item in options"
20
-                    :key="item.value"
21
-                    :label="item.label"
22
-                    :value="item.value">
23
-                    </el-option>
24
-                </el-select>
25
-                <span style="color: #909399;font-size:14px;">耗材种类 : &nbsp;</span>
26
-                <el-select v-model="value" style="width:140px;margin-right:10px;" placeholder="请选择">
27
-                    <el-option
28
-                    v-for="item in options"
29
-                    :key="item.value"
30
-                    :label="item.label"
31
-                    :value="item.value">
32
-                    </el-option>
33
-                </el-select>
34
-            </div>
35
-            <el-button type="primary" @click="openForm(0)">新增</el-button>
36
-        </div>
37
-        <el-table :data="tableData" border style="width: 100%" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}">
38
-            <el-table-column prop="date" label="自编码" width="80" align="center"></el-table-column>
39
-            <el-table-column prop="date" label="名称" align="center"></el-table-column>
40
-            <el-table-column prop="date" label="规格型号" align="center"></el-table-column>
41
-            <el-table-column prop="date" label="耗材种类" width="140" align="center"></el-table-column>
42
-            <el-table-column label="耗材编码" width="140" align="center"></el-table-column>
43
-            <el-table-column label="最小单位" width="60" align="center"></el-table-column>
44
-            <el-table-column label="零售价" width="60" align="center"></el-table-column>
45
-            <el-table-column label="状态" width="60" align="center"></el-table-column>
46
-            <el-table-column prop="date" label="操作" width="300" align="center">
47
-                <template slot-scope="scope">
48
-                    <el-button @click="openForm(scope.row)" type="primary" size="small">编辑</el-button>
49
-                    <el-button type="primary" size="small" @click="clickSelfPayment">自付比例</el-button>
50
-                    <el-button type="danger" size="small">删除</el-button>
51
-                </template>
52
-            </el-table-column>
53
-        </el-table>
54
-        <add-consumable ref="addConsumable"></add-consumable>
2
+  <div class="page_consumables">
3
+    <div style="display:flex;justify-content: space-between;width:100%;margin-bottom:20px;">
4
+      <div class="cell clearfix" style="margin-bottom:0;">
5
+        <el-input style="width: 180px;margin-right:10px;" @keyup.enter.native='searchAction' v-model.trim="search_input"
6
+                  class="filter-item"/>
7
+        <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search"
8
+                   @click="searchAction">搜索
9
+        </el-button>
10
+        <label class="title"><span class="name">是否启用</span> : </label>
11
+        <el-select v-model="is_use" style="width:140px;margin-right:10px;" placeholder="请选择">
12
+          <el-option
13
+            v-for="item in options"
14
+            :key="item.value"
15
+            :label="item.label"
16
+            :value="item.value">
17
+          </el-option>
18
+        </el-select>
19
+        <label class="title"><span class="name">是否收费</span> : </label>
20
+        <el-select v-model="is_charge" style="width:140px;margin-right:10px;" placeholder="请选择">
21
+          <el-option
22
+            v-for="item in options"
23
+            :key="item.value"
24
+            :label="item.label"
25
+            :value="item.value">
26
+          </el-option>
27
+        </el-select>
28
+        <span style="color: #909399;font-size:14px;">耗材种类 : &nbsp;</span>
29
+        <el-select v-model="good_kind" style="width:140px;margin-right:10px;" placeholder="请选择">
30
+          <el-option
31
+            v-for="item,index in  getDictionaryDataConfig('system','good_kind')"
32
+            :key="index"
33
+            :label="item.name"
34
+            :value="item.id">
35
+          </el-option>
36
+        </el-select>
37
+      </div>
38
+      <el-button type="primary" @click="openForm()">新增</el-button>
55 39
     </div>
40
+    <el-table
41
+      border style="width: 100%" :row-style="{ color: '#303133' }"
42
+      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}"
43
+      :data="goodInfo.goodInfoData"
44
+      v-loading="goodInfo.loading"
45
+    >
46
+      <el-table-column label="商品编码" align="center">
47
+        <template slot-scope="scope">
48
+          {{ scope.row.good_code }}
49
+        </template>
50
+      </el-table-column>
51
+      <el-table-column label="名称" align="center">
52
+        <template slot-scope="scope">
53
+          {{ scope.row.specification_name }}
54
+        </template>
55
+      </el-table-column>
56
+      <el-table-column prop="date" label="规格型号" align="center">
57
+
58
+      </el-table-column>
59
+      <el-table-column prop="date" label="耗材种类" width="140" align="center">
60
+
61
+      </el-table-column>
62
+      <el-table-column label="耗材编码" width="140" align="center">
63
+
64
+      </el-table-column>
65
+
66
+      <el-table-column label="最小单位" width="60" align="center">
67
+
68
+      </el-table-column>
69
+      <el-table-column label="零售价" width="60" align="center">
70
+
71
+      </el-table-column>
72
+      <el-table-column label="状态" width="60" align="center">
73
+
74
+      </el-table-column>
75
+
76
+      <el-table-column prop="date" label="操作" width="300" align="center">
77
+        <template slot-scope="scope">
78
+          <el-button @click="handleGoodInfoEdit(scope.$index, scope.row)" type="primary" size="small">编辑</el-button>
79
+          <!--<el-button type="primary" size="small" @click="clickSelfPayment">自付比例</el-button>-->
80
+          <el-button type="danger" size="small" @click="handleGoodInfoDelete(scope.$index, scope.row)">删除</el-button>
81
+        </template>
82
+      </el-table-column>
83
+    </el-table>
84
+
85
+    <el-pagination
86
+      @size-change="handleSizeChange"
87
+      @current-change="handleCurrentChange"
88
+      :page-sizes="[10, 50, 100]"
89
+      :page-size="10"
90
+      background
91
+      align="right"
92
+      style="margin-top:20px;"
93
+      layout="total, sizes, prev, pager, next, jumper"
94
+      :total="total"
95
+    >
96
+    </el-pagination>
97
+
98
+    <!--<add-consumable ref="addConsumable"></add-consumable>-->
99
+    <good-info-dailog ref="addConsumable"
100
+                      :titles="goodInfo.goodInfoDialog.goodInfoTitle"
101
+                      :formValue="goodInfo.goodInfoDialog.formValue"
102
+                      :visibility="goodInfo.goodInfoDialog.isVisibility"
103
+                      :isCreated="goodInfo.goodInfoDialog.isCreated"
104
+                      v-on:dialog-comfirm="goodInfoDialogComfirm"
105
+                      v-on:dialog-cancle="goodInfoDialogCancle"
106
+    ></good-info-dailog>
107
+  </div>
56 108
 </template>
57 109
 
58 110
 <script>
59
-import addConsumable from './addConsumable'
60
-export default {
61
-    components:{
62
-        addConsumable
111
+  import GoodInfoDailog from '../../stock/Dialog/goodInfoDailog'
112
+  import { getDictionaryDataConfig } from "@/utils/data";
113
+
114
+  import {
115
+    createGoodInfo,
116
+    deleteGoodInfo,
117
+    GetAllDeals,
118
+    GetAllGoodType,
119
+    GetAllManufacturer,
120
+    GetGoodInfo,
121
+    GetGoodInfoByGoodId,
122
+    getGoodInfoList,
123
+    modifyGoodInfo
124
+  } from '@/api/stock'
125
+  export default {
126
+    components: {
127
+      GoodInfoDailog,
63 128
     },
64
-    data(){
65
-        return{
66
-            search_input:'',
67
-            options: [{
68
-            value: '1',
69
-            label: '是'
70
-            }, {
71
-            value: '2',
72
-            label: '否'
73
-            },],
74
-            value: '',
75
-            tableData: [{
76
-            date: '2016-05-02',
77
-            name: '王小虎',
78
-            address: '上海市普陀区金沙江路 1518 弄'
79
-            }, {
80
-            date: '2016-05-04',
81
-            name: '王小虎',
82
-            address: '上海市普陀区金沙江路 1517 弄'
83
-            }, {
84
-            date: '2016-05-01',
85
-            name: '王小虎',
86
-            address: '上海市普陀区金沙江路 1519 弄'
87
-            }, {
88
-            date: '2016-05-03',
89
-            name: '王小虎',
90
-            address: '上海市普陀区金沙江路 1516 弄'
91
-            }]
92
-            
129
+    data() {
130
+      return {
131
+        good_kind:'',
132
+        is_use:'',
133
+        is_charge:'',
134
+        search_input: '',
135
+        options: [{
136
+          value: '1',
137
+          label: '是'
138
+        }, {
139
+          value: '2',
140
+          label: '否'
141
+        }],
142
+        value: '',
143
+
144
+        total: 0,
145
+        pageTotal: 0,
146
+        pageSelect: 0,
147
+        page: 1,
148
+        limit: 10,
149
+        keywords: '',
150
+        goodInfo: {
151
+          loading: false,
152
+          goodInfoData: [],
153
+          good_code: '',
154
+          editGoodId: '',
155
+          editGoodIndex: '',
156
+          goodInfoDialog: {
157
+            goodInfoTitle: '新增商品信息',
158
+            isCreated: 1, //1.创建 2.编辑 3.查看详情
159
+            formValue: {
160
+              good_id: '',
161
+              specification_name: '',
162
+              buy_price: '',
163
+              sell_price: '',
164
+              remark: '',
165
+              manufacturer: '',
166
+              good_type_id: '',
167
+              dealer: '',
168
+              expiry_date_warn_day_count: '',
169
+              stock_warn_count: '',
170
+              is_reuse: '2',
171
+              dealers: [],
172
+              manufacturers: [],
173
+              goodType: [],
174
+              goodUnit: [],
175
+              good_name:'',
176
+              pinyin:"",
177
+              wubi:"",
178
+              good_kind:'',
179
+              medical_insurance_level:'',
180
+              good_unit:'',
181
+              retail_price:'',
182
+              medical_insurance_number:'',
183
+              is_special_diseases:'',
184
+              is_record:'',
185
+              statistics_category:'',
186
+              agent:'',
187
+              good_status:'',
188
+              default_count:'',
189
+              sign:'',
190
+              is_default:'',
191
+              is_charge_use:'',
192
+              is_charge_predict:'',
193
+              is_statistics_work:'',
194
+              sort:'',
195
+              is_doctor_use:'',
196
+              good_number:'',
197
+
198
+            },
199
+
200
+            isVisibility: false
201
+          }
93 202
         }
203
+      }
94 204
     },
95
-    methods:{
96
-        searchAction(){},
97
-        clickSelfPayment(){
98
-            this.$refs.selfPayment.show();
99
-        },
100
-        clickMainTain(){
101
-            // this.$refs.maintain.show();
102
-        },
103
-        openForm(id){
104
-            this.$refs.addConsumable.show(id);
205
+    methods: {
206
+      getDictionaryDataConfig(module,filed_name){
207
+        return getDictionaryDataConfig(module,filed_name)
208
+
209
+      },
210
+      search: function() {
211
+        this.getList()
212
+      },
213
+      handleGoodInfoEdit: function(index, row) {
214
+        this.getAllDealer()
215
+        this.getAllManufacturer()
216
+        this.getAllGoodType()
217
+        this.goodInfo.editGoodId = row.id
218
+        this.goodInfo.editGoodIndex = index
219
+
220
+        let params = {
221
+          id: row.id
222
+        }
223
+        GetGoodInfo(params).then(response => {
224
+          if (response.data.state == 0) {
225
+            this.$message.error(response.data.msg)
226
+            return false
227
+          } else {
228
+
229
+            if (response.data.data.goodInfo.good_unit <= 0) {
230
+              this.goodInfo.goodInfoDialog.formValue.good_unit = ''
231
+            } else {
232
+              this.goodInfo.goodInfoDialog.formValue.good_unit =
233
+                response.data.data.goodInfo.good_unit
234
+            }
235
+
236
+            if (response.data.data.goodInfo.manufacturer <= 0) {
237
+              this.goodInfo.goodInfoDialog.formValue.manufacturer = ''
238
+            } else {
239
+              this.goodInfo.goodInfoDialog.formValue.manufacturer =
240
+                response.data.data.goodInfo.manufacturer
241
+            }
242
+
243
+            if (response.data.data.goodInfo.dealer <= 0) {
244
+              this.goodInfo.goodInfoDialog.formValue.dealer = ''
245
+            } else {
246
+              this.goodInfo.goodInfoDialog.formValue.dealer =
247
+                response.data.data.goodInfo.dealer
248
+            }
249
+
250
+            this.goodInfo.goodInfoDialog.formValue.specification_name =
251
+              response.data.data.goodInfo.specification_name
252
+            this.goodInfo.goodInfoDialog.formValue.buy_price =
253
+              response.data.data.goodInfo.buy_price
254
+            this.goodInfo.goodInfoDialog.formValue.sell_price =
255
+              response.data.data.goodInfo.sell_price
256
+            this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count =
257
+              response.data.data.goodInfo.expiry_date_warn_day_count
258
+            this.goodInfo.goodInfoDialog.formValue.stock_warn_count =
259
+              response.data.data.goodInfo.stock_warn_count
260
+            this.goodInfo.goodInfoDialog.formValue.is_reuse = response.data.data.goodInfo.is_reuse.toString()
261
+            this.goodInfo.goodInfoDialog.formValue.remark =
262
+              response.data.data.goodInfo.remark
263
+            this.goodInfo.goodInfoDialog.isCreated = 2
264
+            this.goodInfo.good_code = response.data.data.goodInfo.good_code
265
+            this.goodInfo.goodInfoDialog.formValue.good_type_id =
266
+              response.data.data.goodInfo.good_type_id
267
+
268
+
269
+
270
+
271
+            this.goodInfo.goodInfoDialog.formValue.good_name =
272
+              response.data.data.goodInfo.good_name
273
+
274
+
275
+            this.goodInfo.goodInfoDialog.formValue.pinyin =
276
+              response.data.data.goodInfo.pinyin
277
+
278
+            this.goodInfo.goodInfoDialog.formValue.wubi =
279
+              response.data.data.goodInfo.wubi
280
+
281
+
282
+
283
+            if (response.data.data.goodInfo.good_kind <= 0) {
284
+              this.goodInfo.goodInfoDialog.formValue.good_kind = ''
285
+            } else {
286
+              this.goodInfo.goodInfoDialog.formValue.good_kind =
287
+                response.data.data.goodInfo.good_kind
288
+            }
289
+
290
+
291
+
292
+            if (response.data.data.goodInfo.medical_insurance_level <= 0) {
293
+              this.goodInfo.goodInfoDialog.formValue.medical_insurance_level = ''
294
+            } else {
295
+              this.goodInfo.goodInfoDialog.formValue.medical_insurance_level =
296
+                response.data.data.goodInfo.medical_insurance_level
297
+            }
298
+
299
+
300
+            this.goodInfo.goodInfoDialog.formValue.retail_price =
301
+              response.data.data.goodInfo.retail_price
302
+
303
+
304
+            this.goodInfo.goodInfoDialog.formValue.medical_insurance_number =
305
+              response.data.data.goodInfo.medical_insurance_number
306
+
307
+
308
+            if (response.data.data.goodInfo.is_special_diseases <= 0) {
309
+              this.goodInfo.goodInfoDialog.formValue.is_special_diseases = ''
310
+            } else {
311
+              this.goodInfo.goodInfoDialog.formValue.is_special_diseases =
312
+                response.data.data.goodInfo.is_special_diseases.toString()
313
+            }
314
+
315
+            if (response.data.data.goodInfo.is_record <= 0) {
316
+              this.goodInfo.goodInfoDialog.formValue.is_record = ''
317
+            } else {
318
+              this.goodInfo.goodInfoDialog.formValue.is_record =
319
+                response.data.data.goodInfo.is_record.toString()
320
+            }
321
+
322
+            if (response.data.data.goodInfo.statistics_category <= 0) {
323
+              this.goodInfo.goodInfoDialog.formValue.statistics_category = ''
324
+            } else {
325
+              this.goodInfo.goodInfoDialog.formValue.statistics_category =
326
+                response.data.data.goodInfo.statistics_category
327
+            }
328
+
329
+
330
+            if (response.data.data.goodInfo.good_status <= 0) {
331
+              this.goodInfo.goodInfoDialog.formValue.good_status = ''
332
+            } else {
333
+              this.goodInfo.goodInfoDialog.formValue.good_status =
334
+                response.data.data.goodInfo.good_status
335
+            }
336
+
337
+
338
+            if (response.data.data.goodInfo.default_count <= 0) {
339
+              this.goodInfo.goodInfoDialog.formValue.default_count = ''
340
+            } else {
341
+              this.goodInfo.goodInfoDialog.formValue.default_count =
342
+                response.data.data.goodInfo.default_count
343
+            }
344
+
345
+
346
+
347
+
348
+            if (response.data.data.goodInfo.sign <= 0) {
349
+              this.goodInfo.goodInfoDialog.formValue.sign = ''
350
+            } else {
351
+              this.goodInfo.goodInfoDialog.formValue.sign =
352
+                response.data.data.goodInfo.sign
353
+            }
354
+
355
+
356
+
357
+            if (response.data.data.goodInfo.is_default <= 0) {
358
+              this.goodInfo.goodInfoDialog.formValue.is_default = ''
359
+            } else {
360
+              this.goodInfo.goodInfoDialog.formValue.is_default =
361
+                response.data.data.goodInfo.is_default.toString()
362
+            }
363
+
364
+            if (response.data.data.goodInfo.is_charge_use <= 0) {
365
+              this.goodInfo.goodInfoDialog.formValue.is_charge_use = ''
366
+            } else {
367
+              this.goodInfo.goodInfoDialog.formValue.is_charge_use =
368
+                response.data.data.goodInfo.is_charge_use.toString()
369
+            }
370
+
371
+
372
+            if (response.data.data.goodInfo.is_charge_predict <= 0) {
373
+              this.goodInfo.goodInfoDialog.formValue.is_charge_predict = ''
374
+            } else {
375
+              this.goodInfo.goodInfoDialog.formValue.is_charge_predict =
376
+                response.data.data.goodInfo.is_charge_predict.toString()
377
+            }
378
+
379
+
380
+            if (response.data.data.goodInfo.is_statistics_work <= 0) {
381
+              this.goodInfo.goodInfoDialog.formValue.is_statistics_work = ''
382
+            } else {
383
+              this.goodInfo.goodInfoDialog.formValue.is_statistics_work =
384
+                response.data.data.goodInfo.is_statistics_work.toString()
385
+            }
386
+
387
+
388
+            if (response.data.data.goodInfo.sort <= 0) {
389
+              this.goodInfo.goodInfoDialog.formValue.sort = ''
390
+            } else {
391
+              this.goodInfo.goodInfoDialog.formValue.sort =
392
+                response.data.data.goodInfo.sort.toString()
393
+            }
394
+
395
+
396
+            if (response.data.data.goodInfo.is_doctor_use <= 0) {
397
+              this.goodInfo.goodInfoDialog.formValue.is_doctor_use = ''
398
+            } else {
399
+              this.goodInfo.goodInfoDialog.formValue.is_doctor_use =
400
+                response.data.data.goodInfo.is_doctor_use.toString()
401
+            }
402
+
403
+            this.goodInfo.goodInfoDialog.formValue.agent =
404
+              response.data.data.goodInfo.agent
405
+
406
+            this.goodInfo.goodInfoDialog.formValue.good_number =
407
+              response.data.data.goodInfo.good_number
408
+
409
+
410
+
411
+            this.$refs.addConsumable.show()
412
+          }
413
+        })
414
+      },
415
+      handleGoodInfoDelete: function(index, row) {
416
+        this.$confirm('确认删除这条商品信息?', '删除商品信息', {
417
+          confirmButtonText: '确定',
418
+          cancelButtonText: '取消',
419
+          type: 'warning'
420
+        })
421
+          .then(() => {
422
+            let params = {
423
+              id: row.id
424
+            }
425
+
426
+            deleteGoodInfo(params).then(response => {
427
+              if (response.data.state == 0) {
428
+                this.$message.error(response.data.msg)
429
+                return false
430
+              } else {
431
+                this.goodInfo.goodInfoData.splice(index, 1)
432
+                this.$message.success('删除成功')
433
+              }
434
+            })
435
+          })
436
+          .catch(() => {
437
+          })
438
+      },
439
+      getList() {
440
+        this.goodInfo.loading = true
441
+        let params = {
442
+          page: this.page,
443
+          limit: this.limit,
444
+          keyword: this.keywords,
445
+          is_use:this.is_use,
446
+          good_kind:this.good_kind,
447
+          is_charge: this.is_charge,
448
+        }
449
+        getGoodInfoList(params).then(response => {
450
+          if (response.data.state == 0) {
451
+            this.goodInfo.loading = false
452
+            this.$message.error(response.data.msg)
453
+            return false
454
+          } else {
455
+            this.goodInfo.loading = false
456
+            this.total = response.data.data.total
457
+            this.goodInfo.goodInfoData = []
458
+            for (let i = 0; i < response.data.data.list.length; i++) {
459
+              this.goodInfo.goodInfoData.push(response.data.data.list[i])
460
+            }
461
+          }
462
+        })
463
+      },
464
+      tableRowClassName({ row, rowIndex }) {
465
+        //把每一行的索引放进row
466
+        row.index = rowIndex
467
+      },
468
+      onRowClick(row, event, column) {
469
+        this.goodInfo.goodInfoData = []
470
+        this.goodType.tableCurrentIndex = row.index
471
+        this.goodInfo.goodInfoDialog.formValue.good_id = row.id
472
+        let params = {
473
+          id: row.id
105 474
         }
475
+        this.goodInfo.loading = true
476
+        GetGoodInfoByGoodId(params).then(response => {
477
+          if (response.data.state == 0) {
478
+            this.goodInfo.loading = false
479
+            this.$message.error(response.data.msg)
480
+            return false
481
+          } else {
482
+            this.goodInfo.loading = false
483
+            for (let i = 0; i < response.data.data.list.length; i++) {
484
+              this.goodInfo.goodInfoData.push(response.data.data.list[i])
485
+            }
486
+          }
487
+        })
488
+      },
489
+      goodInfoDialogComfirm: function(val) {
490
+        if (val.isCreated == 2) {
491
+          //修改
492
+          val['id'] = this.goodInfo.editGoodId
493
+          val['good_code'] = this.goodInfo.good_code
494
+
495
+          modifyGoodInfo(val).then(response => {
496
+            if (response.data.state == 0) {
497
+              this.$message.error(response.data.msg)
498
+              return false
499
+            } else {
500
+              this.$refs.addConsumable.hide()
501
+
502
+              this.goodInfo.goodInfoData[
503
+                this.goodInfo.editGoodIndex
504
+                ].specification_name =
505
+                response.data.data.goodInfo.specification_name
506
+              this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].good_unit =
507
+                response.data.data.goodInfo.good_unit
508
+              this.goodInfo.goodInfoData[
509
+                this.goodInfo.editGoodIndex
510
+                ].buy_price = response.data.data.goodInfo.buy_price.toString()
511
+              this.goodInfo.goodInfoData[
512
+                this.goodInfo.editGoodIndex
513
+                ].sell_price = response.data.data.goodInfo.sell_price.toString()
514
+              this.goodInfo.goodInfoData[
515
+                this.goodInfo.editGoodIndex
516
+                ].expiry_date_warn_day_count = response.data.data.goodInfo.expiry_date_warn_day_count.toString()
517
+              this.goodInfo.goodInfoData[
518
+                this.goodInfo.editGoodIndex
519
+                ].stock_warn_count = response.data.data.goodInfo.stock_warn_count.toString()
520
+
521
+              this.$message.success('修改成功')
522
+            }
523
+          })
524
+        } else if (val.isCreated == 1) {
525
+          //新增
526
+          createGoodInfo(val).then(response => {
527
+            if (response.data.state == 0) {
528
+              this.$message.error(response.data.msg)
529
+              return false
530
+            } else {
531
+              this.$refs.addConsumable.hide()
532
+
533
+              this.goodInfo.goodInfoData.unshift(response.data.data.goodInfo)
534
+
535
+              this.$message.success('新增成功')
536
+            }
537
+          })
538
+        }
539
+      },
540
+      goodInfoDialogCancle: function() {
541
+        this.$refs.addConsumable.hide()
542
+      },
543
+      showInfoDialog: function() {
544
+        this.$refs.addConsumable.show()
545
+        this.getAllDealer()
546
+        this.getAllManufacturer()
547
+        this.goodInfo.goodInfoDialog.formValue.goodType = []
548
+        GetAllGoodType().then(response => {
549
+          if (response.data.state == 0) {
550
+            this.$message.error(response.data.msg)
551
+            return false
552
+          } else {
553
+            for (let i = 0; i < response.data.data.goodType.length; i++) {
554
+              if (response.data.data.goodType[i].type == 1) {
555
+                response.data.data.goodType[i].type_name = response.data.data.goodType[i].type_name + '(系统设定)'
556
+              }
557
+              this.goodInfo.goodInfoDialog.formValue.goodType.push(
558
+                response.data.data.goodType[i]
559
+              )
560
+            }
561
+            if (this.goodInfo.goodInfoDialog.formValue.goodType.length <= 0) {
562
+              this.$message.error('请先新增商品类型')
563
+              return
564
+            } else {
565
+              this.goodInfo.goodInfoDialog.isVisibility = true
566
+              this.goodInfo.goodInfoDialog.isCreated = 1
567
+            }
568
+          }
569
+        })
570
+        this.goodInfo.goodInfoDialog.formValue.good_id = ''
571
+        this.goodInfo.goodInfoDialog.formValue.specification_name = ''
572
+        this.goodInfo.goodInfoDialog.formValue.buy_price = ''
573
+        this.goodInfo.goodInfoDialog.formValue.sell_price = ''
574
+        this.goodInfo.goodInfoDialog.formValue.remark = ''
575
+        this.goodInfo.goodInfoDialog.formValue.manufacturer = ''
576
+        this.goodInfo.goodInfoDialog.formValue.good_type_id = ''
577
+        this.goodInfo.goodInfoDialog.formValue.dealer = ''
578
+        this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count = ''
579
+        this.goodInfo.goodInfoDialog.formValue.stock_warn_count = ''
580
+        this.goodInfo.goodInfoDialog.formValue.is_reuse = '2'
581
+      },
582
+      getAllDealer: function() {
583
+        this.goodInfo.goodInfoDialog.formValue.dealers = []
584
+        GetAllDeals().then(response => {
585
+          if (response.data.state == 0) {
586
+            this.$message.error(response.data.msg)
587
+            return false
588
+          } else {
589
+            for (let i = 0; i < response.data.data.dealer.length; i++) {
590
+              this.goodInfo.goodInfoDialog.formValue.dealers.push(
591
+                response.data.data.dealer[i]
592
+              )
593
+            }
594
+          }
595
+        })
596
+      },
597
+      getAllManufacturer: function() {
598
+        this.goodInfo.goodInfoDialog.formValue.manufacturers = []
599
+        GetAllManufacturer().then(response => {
600
+          if (response.data.state == 0) {
601
+            this.$message.error(response.data.msg)
602
+            return false
603
+          } else {
604
+            for (let i = 0; i < response.data.data.manufacturer.length; i++) {
605
+              this.goodInfo.goodInfoDialog.formValue.manufacturers.push(
606
+                response.data.data.manufacturer[i]
607
+              )
608
+            }
609
+          }
610
+        })
611
+      },
612
+      getAllGoodType: function() {
613
+        this.goodInfo.goodInfoDialog.formValue.goodType = []
614
+        GetAllGoodType().then(response => {
615
+          if (response.data.state == 0) {
616
+            this.$message.error(response.data.msg)
617
+            return false
618
+          } else {
619
+            for (let i = 0; i < response.data.data.goodType.length; i++) {
620
+              if (response.data.data.goodType[i].type == 1) {
621
+                response.data.data.goodType[i].type_name = response.data.data.goodType[i].type_name + '(系统设定)'
622
+              }
623
+              this.goodInfo.goodInfoDialog.formValue.goodType.push(
624
+                response.data.data.goodType[i]
625
+              )
626
+            }
627
+          }
628
+        })
629
+      },
630
+      handleSizeChange(val) {
631
+        this.limit = val
632
+        this.getList()
633
+      },
634
+      handleCurrentChange(val) {
635
+        this.page = val
636
+        this.getList()
637
+      },
638
+      searchAction() {
639
+      },clickSelfPayment(){
640
+
641
+      },
642
+      openForm() {
643
+
644
+        this.getAllDealer()
645
+        this.getAllManufacturer()
646
+        this.goodInfo.goodInfoDialog.formValue.goodType = []
647
+        GetAllGoodType().then(response => {
648
+          if (response.data.state == 0) {
649
+            this.$message.error(response.data.msg)
650
+            return false
651
+          } else {
652
+            for (let i = 0; i < response.data.data.goodType.length; i++) {
653
+              if (response.data.data.goodType[i].type == 1) {
654
+                response.data.data.goodType[i].type_name = response.data.data.goodType[i].type_name + '(系统设定)'
655
+              }
656
+              this.goodInfo.goodInfoDialog.formValue.goodType.push(
657
+                response.data.data.goodType[i]
658
+              )
659
+            }
660
+            if (this.goodInfo.goodInfoDialog.formValue.goodType.length <= 0) {
661
+              this.$message.error('请先新增商品类型')
662
+              return
663
+            } else {
664
+              this.goodInfo.goodInfoDialog.isVisibility = true
665
+              this.goodInfo.goodInfoDialog.isCreated = 1
666
+            }
667
+          }
668
+        })
669
+        this.goodInfo.goodInfoDialog.formValue.good_id = ''
670
+        this.goodInfo.goodInfoDialog.formValue.specification_name = ''
671
+        this.goodInfo.goodInfoDialog.formValue.buy_price = ''
672
+        this.goodInfo.goodInfoDialog.formValue.sell_price = ''
673
+        this.goodInfo.goodInfoDialog.formValue.remark = ''
674
+        this.goodInfo.goodInfoDialog.formValue.manufacturer = ''
675
+        this.goodInfo.goodInfoDialog.formValue.good_type_id = ''
676
+        this.goodInfo.goodInfoDialog.formValue.dealer = ''
677
+        this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count = ''
678
+        this.goodInfo.goodInfoDialog.formValue.stock_warn_count = ''
679
+        this.goodInfo.goodInfoDialog.formValue.is_reuse = '2'
680
+        this.goodInfo.goodInfoDialog.formValue.good_name = ''
681
+        this.goodInfo.goodInfoDialog.formValue.pinyin = ''
682
+        this.goodInfo.goodInfoDialog.formValue.wubi = ''
683
+        this.goodInfo.goodInfoDialog.formValue.good_kind = ''
684
+        this.goodInfo.goodInfoDialog.formValue.medical_insurance_level = ''
685
+        this.goodInfo.goodInfoDialog.formValue.retail_price = ''
686
+        this.goodInfo.goodInfoDialog.formValue.medical_insurance_number = ''
687
+        this.goodInfo.goodInfoDialog.formValue.is_special_diseases = ''
688
+        this.goodInfo.goodInfoDialog.formValue.is_record = ''
689
+        this.goodInfo.goodInfoDialog.formValue.statistics_category = ''
690
+        this.goodInfo.goodInfoDialog.formValue.good_status = ''
691
+        this.goodInfo.goodInfoDialog.formValue.default_count = ''
692
+        this.goodInfo.goodInfoDialog.formValue.sign = ''
693
+        this.goodInfo.goodInfoDialog.formValue.is_default = ''
694
+        this.goodInfo.goodInfoDialog.formValue.is_charge_use = ''
695
+        this.goodInfo.goodInfoDialog.formValue.is_charge_predict = ''
696
+        this.goodInfo.goodInfoDialog.formValue.is_statistics_work = ''
697
+        this.goodInfo.goodInfoDialog.formValue.sort = ''
698
+        this.goodInfo.goodInfoDialog.formValue.is_doctor_use = ''
699
+        this.goodInfo.goodInfoDialog.formValue.agent = ''
700
+        this.goodInfo.goodInfoDialog.formValue.good_number = ''
701
+
702
+        this.$refs.addConsumable.show()
703
+      }
704
+    }, created() {
705
+      this.getList()
706
+      this.getAllDealer()
707
+      this.getAllManufacturer()
708
+      this.getAllGoodType()
709
+      this.goodInfo.goodInfoDialog.formValue.goodUnit = this.$store.getters.good_unit
106 710
     }
107
-}
711
+  }
108 712
 </script>

+ 397 - 103
src/xt_pages/data/components/drugs.vue Vedi File

@@ -1,114 +1,408 @@
1 1
 <template>
2
-    <div class="page_drugs">
3
-        <div style="display:flex;justify-content: space-between;width:100%;margin-bottom:20px;">
4
-            <div class="cell clearfix" style="margin-bottom:0;">
5
-                <el-input style="width: 180px;margin-right:10px;" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/>
6
-                <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search" @click="searchAction">搜索</el-button>
7
-                <label class="title"><span class="name">是否启用</span> : </label>
8
-                <el-select v-model="value" style="width:140px;margin-right:10px;" placeholder="请选择">
9
-                    <el-option
10
-                    v-for="item in options"
11
-                    :key="item.value"
12
-                    :label="item.label"
13
-                    :value="item.value">
14
-                    </el-option>
15
-                </el-select>
16
-                <label class="title"><span class="name">是否收费</span> : </label>
17
-                <el-select v-model="value" style="width:140px;margin-right:10px;" placeholder="请选择">
18
-                    <el-option
19
-                    v-for="item in options"
20
-                    :key="item.value"
21
-                    :label="item.label"
22
-                    :value="item.value">
23
-                    </el-option>
24
-                </el-select>
25
-                <span style="color: #909399;font-size:14px;">是否注射类别 : &nbsp;</span>
26
-                <el-select v-model="value" style="width:140px;margin-right:10px;" placeholder="请选择">
27
-                    <el-option
28
-                    v-for="item in options"
29
-                    :key="item.value"
30
-                    :label="item.label"
31
-                    :value="item.value">
32
-                    </el-option>
33
-                </el-select>
34
-            </div>
35
-            <el-button type="primary" @click="openForm(0)">新增</el-button>
36
-        </div>
37
-        <el-table :data="tableData" border style="width: 100%" :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}">
38
-            <el-table-column prop="date" label="药品编码" width="80" align="center"></el-table-column>
39
-            <el-table-column prop="date" label="药品名称" align="center"></el-table-column>
40
-            <el-table-column prop="date" label="生产厂商" align="center"></el-table-column>
41
-            <el-table-column prop="date" label="规格" width="140" align="center"></el-table-column>
42
-            <el-table-column label="单位" width="60" align="center"></el-table-column>
43
-            <el-table-column label="单价" width="60" align="center"></el-table-column>
44
-            <el-table-column label="状态" width="60" align="center"></el-table-column>
45
-            <el-table-column prop="date" label="操作" width="400" align="center">
46
-                <template slot-scope="scope">
47
-                    <el-button @click="openForm(scope.row)" type="primary" size="small">编辑</el-button>
48
-                    <el-button type="primary" size="small" @click="clickSelfPayment">自付比例</el-button>
49
-                    <el-button type="primary" size="small" @click="clickMainTain">单位维护</el-button>
50
-                    <el-button type="danger" size="small">删除</el-button>
51
-                </template>
52
-            </el-table-column>
53
-        </el-table>
54
-        <self-payment ref='selfPayment'></self-payment>
55
-        <add-drugs ref='addDrugs'></add-drugs>
56
-        <!-- <maintain ref='maintain'></maintain> -->
2
+  <div class="page_drugs">
3
+    <div style="display:flex;justify-content: space-between;width:100%;margin-bottom:20px;">
4
+      <div class="cell clearfix" style="margin-bottom:0;">
5
+        <el-input style="width: 180px;margin-right:10px;" @keyup.enter.native='searchAction' v-model.trim="search_input"
6
+                  class="filter-item" v-model="keywords"/>
7
+        <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search"
8
+                   @click="searchAction">搜索
9
+        </el-button>
10
+        <label class="title"><span class="name">是否启用</span> : </label>
11
+        <el-select v-model="is_use" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeUser">
12
+          <el-option
13
+            v-for="item in options"
14
+            :key="item.value"
15
+            :label="item.label"
16
+            :value="item.value">
17
+          </el-option>
18
+        </el-select>
19
+        <label class="title"><span class="name">是否收费</span> : </label>
20
+        <el-select v-model="is_charge" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeCharge">
21
+          <el-option
22
+            v-for="item in options"
23
+            :key="item.value"
24
+            :label="item.label"
25
+            :value="item.value">
26
+          </el-option>
27
+        </el-select>
28
+        <span style="color: #909399;font-size:14px;">是否注射类别 : &nbsp;</span>
29
+        <el-select v-model="is_inject" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeInject">
30
+          <el-option
31
+            v-for="item in options"
32
+            :key="item.value"
33
+            :label="item.label"
34
+            :value="item.value">
35
+          </el-option>
36
+        </el-select>
37
+      </div>
38
+      <el-button type="primary" @click="openForm(0)">新增</el-button>
57 39
     </div>
40
+    <el-table :data="list" border style="width: 100%" :row-style="{ color: '#303133' }"
41
+              :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}">
42
+      <el-table-column prop="date" label="药品编码" width="80" align="center">
43
+        <template slot-scope="scope">
44
+          <div>{{scope.row.drug_code}}</div>
45
+        </template>
46
+      </el-table-column>
47
+      <el-table-column prop="date" label="药品名称" align="center">
48
+        <template slot-scope="scope">
49
+          <div>{{scope.row.drug_name}}</div>
50
+        </template>
51
+
52
+      </el-table-column>
53
+      <el-table-column prop="date" label="生产厂商" align="center">
54
+        <template slot-scope="scope">
55
+          <div>{{getName(scope.row.manufacturer)}}</div>
56
+        </template>
57
+      </el-table-column>
58
+      <el-table-column prop="date" label="规格" width="140" align="center">
59
+        <template slot-scope="scope">
60
+          <div>{{scope.row.drug_spec}}</div>
61
+        </template>
62
+      </el-table-column>
63
+      <el-table-column label="单位" width="60" align="center">
64
+
65
+        <template slot-scope="scope">
66
+          <div>{{scope.row.min_unit}}</div>
67
+        </template>
68
+
69
+      </el-table-column>
70
+      <el-table-column label="单价" width="60" align="center">
71
+        <template slot-scope="scope">
72
+          <!--<div>{{scope.row.drug_spec}}</div>-->
73
+        </template>
74
+      </el-table-column>
75
+      <el-table-column label="状态" width="60" align="center">
76
+        <template slot-scope="scope">
77
+          <div>{{scope.row.drug_status}}</div>
78
+        </template>
79
+      </el-table-column>
80
+      <el-table-column prop="date" label="操作" width="400" align="center">
81
+        <template slot-scope="scope">
82
+          <el-button @click="openForm(scope.row.id)" type="primary" size="small">编辑</el-button>
83
+          <!--<el-button type="primary" size="small" @click="clickSelfPayment">自付比例</el-button>-->
84
+          <!--<el-button type="primary" size="small" @click="clickMainTain">单位维护</el-button>-->
85
+          <!--<el-button type="danger" size="small">删除</el-button>-->
86
+        </template>
87
+      </el-table-column>
88
+    </el-table>
89
+    <self-payment ref='selfPayment'></self-payment>
90
+    <add-drugs ref='addDrugs'
91
+               :titles="title"
92
+               :formValue="formValue"
93
+               :isCreated="isCreated"
94
+               :manufacturers="manufacturers"
95
+               v-on:dialog-comfirm="goodInfoDialogComfirm"
96
+               v-on:dialog-cancle="goodInfoDialogCancle"
97
+
98
+    ></add-drugs>
99
+    <!-- <maintain ref='maintain'></maintain> -->
100
+  </div>
58 101
 </template>
59 102
 
60 103
 <script>
61
-import selfPayment from './selfPayment'
62
-import maintain from './maintain'
63
-import addDrugs from './addDrugs'
64
-export default {
65
-    components:{
66
-        selfPayment,
67
-        maintain,
68
-        addDrugs
69
-    },
70
-    data(){
71
-        return{
72
-            search_input:'',
73
-            options: [{
74
-            value: '1',
75
-            label: '是'
76
-            }, {
77
-            value: '2',
78
-            label: '否'
79
-            },],
80
-            value: '',
81
-            tableData: [{
82
-            date: '2016-05-02',
83
-            name: '王小虎',
84
-            address: '上海市普陀区金沙江路 1518 弄'
85
-            }, {
86
-            date: '2016-05-04',
87
-            name: '王小虎',
88
-            address: '上海市普陀区金沙江路 1517 弄'
89
-            }, {
90
-            date: '2016-05-01',
91
-            name: '王小虎',
92
-            address: '上海市普陀区金沙江路 1519 弄'
93
-            }, {
94
-            date: '2016-05-03',
95
-            name: '王小虎',
96
-            address: '上海市普陀区金沙江路 1516 弄'
97
-            }]
98
-            
99
-        }
104
+  import selfPayment from './selfPayment'
105
+  import maintain from './maintain'
106
+  import addDrugs from './addDrugs'
107
+  import {
108
+    GetAllManufacturer,
109
+  } from '@/api/stock'
110
+
111
+  import {
112
+    createBaseDrugLib,
113
+    getBaseDrugLib,
114
+    getBaseDrugLibList,
115
+    createMedicineInsurancePercent,
116
+    createDrugUnitSafeguard,
117
+    editBaseDrugLib
118
+  } from '@/api/data'
119
+
120
+
121
+  export default {
122
+    components: {
123
+      selfPayment,
124
+      maintain,
125
+      addDrugs
100 126
     },
101
-    methods:{
102
-        searchAction(){},
103
-        clickSelfPayment(){
104
-            this.$refs.selfPayment.show();
127
+    data() {
128
+      return {
129
+        page:0,
130
+        limit:10,
131
+        keywords:"",
132
+        is_use:'',
133
+        is_charge:'',
134
+        is_inject:'',
135
+        list:[],
136
+
137
+        isCreated:1,
138
+        manufacturers:[],
139
+        title: '',
140
+        formValue: {
141
+          drug_name: '',//药品名称
142
+          pinyin: '',//拼音
143
+          wubi: '',//五笔输入法
144
+          drug_alias: '',//药品别名
145
+          drug_alias_pinyin: '',//别名拼音
146
+          drug_alias_wubi: '',//别名五笔
147
+          drug_category: '',//药品类别
148
+          drug_spec: '',//药品规格
149
+          drug_type: '',//药品类型
150
+          drug_stock_limit: '',//库存警戒
151
+          drug_origin_place: '',//产地
152
+          drug_dosage_form: '',//药品剂型
153
+          medical_insurance_level: '',//医保等级
154
+          max_unit: '',//最大单位
155
+          min_unit: '',//最小单位
156
+          unit_matrixing: '',//单位换算
157
+          retail_price: '',//零售价
158
+          last_price: '',//上次进价
159
+          drug_control: '',//开药控制
160
+          number: '',//批准文号
161
+          drug_classify: '',//药物分类
162
+          drug_dose: '',//药品剂量
163
+          drug_dose_unit:'',
164
+          medical_insurance_number: '',//医保编号
165
+          manufacturer:'', //生产产商
166
+          pharmacology_category: '',//药理分类
167
+          statistics_category: '',//统计分类
168
+          code: '',//本位码
169
+          is_special_diseases: '',//是否特病目录
170
+          is_record: '',//是否备案
171
+          agent: '',// 代理商
172
+          drug_status: '',// 状态
173
+          limit_remark: '',//限制说明
174
+          delivery_way: '',//默认给药途径
175
+          execution_frequency: '',//默认执行频率
176
+          single_dose: '',//默认单次用量
177
+          prescribing_number: '',//默认开药数量
178
+          label: '',//标签
179
+          sort: '',//收费项目排序
180
+          is_use_doctor_advice: '',//是否常用医嘱
181
+          is_default: '',//是否默认
182
+          is_charge_predict: '',//是否收费预估项
183
+          is_statistics_work: '',//是否统计工作量
184
+          is_charge_use: '',//是否收费常用项
185
+          drug_code:"",
186
+
105 187
         },
106
-        clickMainTain(){
107
-            // this.$refs.maintain.show();
188
+        tempFormValue: {
189
+          drug_name: '',//药品名称
190
+          pinyin: '',//拼音
191
+          wubi: '',//五笔输入法
192
+          drug_alias: '',//药品别名
193
+          drug_alias_pinyin: '',//别名拼音
194
+          drug_alias_wubi: '',//别名五笔
195
+          drug_category: '',//药品类别
196
+          drug_spec: '',//药品规格
197
+          drug_type: '',//药品类型
198
+          drug_stock_limit: '',//库存警戒
199
+          drug_origin_place: '',//产地
200
+          drug_dosage_form: '',//药品剂型
201
+          medical_insurance_level: '',//医保等级
202
+          max_unit: '',//最大单位
203
+          min_unit: '',//最小单位
204
+          unit_matrixing: '',//单位换算
205
+          retail_price: '',//零售价
206
+          last_price: '',//上次进价
207
+          drug_control: '',//开药控制
208
+          number: '',//批准文号
209
+          drug_classify: '',//药物分类
210
+          drug_dose: '',//药品剂量
211
+          drug_dose_unit:'',
212
+          medical_insurance_number: '',//医保编号
213
+          manufacturer:'', //生产产商
214
+          pharmacology_category: '',//药理分类
215
+          statistics_category: '',//统计分类
216
+          code: '',//本位码
217
+          is_special_diseases: '',//是否特病目录
218
+          is_record: '',//是否备案
219
+          agent: '',// 代理商
220
+          drug_status: '',// 状态
221
+          limit_remark: '',//限制说明
222
+          delivery_way: '',//默认给药途径
223
+          execution_frequency: '',//默认执行频率
224
+          single_dose: '',//默认单次用量
225
+          prescribing_number: '',//默认开药数量
226
+          label: '',//标签
227
+          sort: '',//收费项目排序
228
+          is_use_doctor_advice: '',//是否常用医嘱
229
+          is_default: '',//是否默认
230
+          is_charge_predict: '',//是否收费预估项
231
+          is_statistics_work: '',//是否统计工作量
232
+          is_charge_use: '',//是否收费常用项
233
+          drug_code:"",
234
+
108 235
         },
109
-        openForm(id){
110
-            this.$refs.addDrugs.show(id);
236
+
237
+        current_id:0,
238
+
239
+        search_input: '',
240
+        options: [{
241
+          value: '1',
242
+          label: '是'
243
+        }, {
244
+          value: '2',
245
+          label: '否'
246
+        }],
247
+        value: '',
248
+        tableData: [{
249
+          date: '2016-05-02',
250
+          name: '王小虎',
251
+          address: '上海市普陀区金沙江路 1518 弄'
252
+        }, {
253
+          date: '2016-05-04',
254
+          name: '王小虎',
255
+          address: '上海市普陀区金沙江路 1517 弄'
256
+        }, {
257
+          date: '2016-05-01',
258
+          name: '王小虎',
259
+          address: '上海市普陀区金沙江路 1519 弄'
260
+        }, {
261
+          date: '2016-05-03',
262
+          name: '王小虎',
263
+          address: '上海市普陀区金沙江路 1516 弄'
264
+        }]
265
+
266
+      }
267
+    },
268
+    methods: {
269
+      changeInject(val){
270
+        this.getList()
271
+
272
+      },
273
+      changeCharge(val){
274
+        this.getList()
275
+
276
+      },
277
+      changeUser(val){
278
+        this.getList()
279
+
280
+
281
+      },
282
+      getName(id){
283
+
284
+      for (let i =0; i < this.manufacturers.length;i++){
285
+        if(this.manufacturers[i].id == id){
286
+          return this.manufacturers[i].manufacturer_name
111 287
         }
288
+        return ""
289
+      }
290
+
291
+      },
292
+      goodInfoDialogComfirm: function(val) {
293
+
294
+        if (val.id > 0) {
295
+          //修改
296
+          val['id'] = this.current_id
297
+          editBaseDrugLib(val).then(response => {
298
+            if (response.data.state == 0) {
299
+              this.$message.error(response.data.msg)
300
+              return false
301
+            } else {
302
+              this.$refs.addDrugs.hide()
303
+              this.getList()
304
+              this.$message.success('修改成功')
305
+            }
306
+          })
307
+        } else if (val.id == 0) {
308
+          //新增
309
+          createBaseDrugLib(val).then(response => {
310
+            if (response.data.state == 0) {
311
+              this.$message.error(response.data.msg)
312
+              return false
313
+            } else {
314
+              this.$refs.addDrugs.hide()
315
+              this.getList()
316
+              this.$message.success('新增成功')
317
+            }
318
+          })
319
+        }
320
+      },
321
+      goodInfoDialogCancle: function() {
322
+        this.$refs.addDrugs.hide()
323
+      },
324
+      getAllManufacturer: function() {
325
+        this.manufacturers = []
326
+        GetAllManufacturer().then(response => {
327
+          if (response.data.state == 0) {
328
+            this.$message.error(response.data.msg)
329
+            return false
330
+          } else {
331
+            for (let i = 0; i < response.data.data.manufacturer.length; i++) {
332
+              this.manufacturers.push(
333
+                response.data.data.manufacturer[i]
334
+              )
335
+            }
336
+          }
337
+        })
338
+      },
339
+      searchAction() {
340
+        this.getList()
341
+      },
342
+      clickSelfPayment() {
343
+        this.$refs.selfPayment.show()
344
+      },
345
+      clickMainTain() {
346
+        // this.$refs.maintain.show();
347
+      },
348
+      openForm(id) {
349
+        this.getAllManufacturer()
350
+        if (id > 0){
351
+          this.current_id = id
352
+          let params = {
353
+            id: this.current_id
354
+          }
355
+          getBaseDrugLib(params).then(response => {
356
+            if (response.data.state == 0) {
357
+              this.$message.error(response.data.msg)
358
+              return false
359
+            } else {
360
+              for(let key in response.data.data.drug){
361
+                this.formValue[key] = response.data.data.drug[key]
362
+              }
363
+              this.formValue.is_special_diseases = this.formValue.is_special_diseases.toString()
364
+              this.formValue.is_record = this.formValue.is_record.toString()
365
+              this.formValue.is_use_doctor_advice = this.formValue.is_use_doctor_advice.toString()
366
+              this.formValue.is_default = this.formValue.is_default.toString()
367
+              this.formValue.is_charge_predict = this.formValue.is_charge_predict.toString()
368
+              this.formValue.is_statistics_work = this.formValue.is_statistics_work.toString()
369
+              this.formValue.is_charge_use = this.formValue.is_charge_use.toString()
370
+              this.$refs.addDrugs.show(id,this.formValue)
371
+
372
+            }
373
+          })
374
+        }else{
375
+          for(let key in this.tempFormValue){
376
+            this.formValue[key] = this.tempFormValue[key]
377
+          }
378
+          this.$refs.addDrugs.show(0,this.formValue)
379
+        }
380
+      },  getList() {
381
+        let params = {
382
+          page: this.page,
383
+          limit: this.limit,
384
+          keyword: this.keywords,
385
+          is_use:this.is_use,
386
+          is_charge:this.is_charge,
387
+          is_inject:this.is_inject
388
+        }
389
+        getBaseDrugLibList(params).then(response => {
390
+          if (response.data.state == 0) {
391
+            this.$message.error(response.data.msg)
392
+            return false
393
+          } else {
394
+            this.total = response.data.data.total
395
+            this.list = []
396
+            for (let i = 0; i < response.data.data.list.length; i++) {
397
+              this.list.push(response.data.data.list[i])
398
+            }
399
+          }
400
+        })
401
+      },
402
+
403
+    },created() {
404
+      this.getList()
405
+      this.getAllManufacturer()
112 406
     }
113
-}
407
+  }
114 408
 </script>

+ 59 - 57
src/xt_pages/data/specialDictionary.vue Vedi File

@@ -1,67 +1,69 @@
1 1
 <template>
2
-    <div class="main-contain">
3
-        <div class="position">
4
-            <bread-crumb :crumbs="crumbs"></bread-crumb>
5
-        </div>
6
-        <div class="app-container">
7
-            <el-tabs v-model="activeName" @tab-click="handleClick">
8
-                <el-tab-pane label="药品" name="1">
9
-                    <drugs></drugs>
10
-                </el-tab-pane>
11
-                <el-tab-pane label="耗材" name="2">
12
-                    <consumables></consumables>
13
-                </el-tab-pane>
14
-                <!--<el-tab-pane label="项目" name="3">-->
15
-                    <!--<project></project>-->
16
-                <!--</el-tab-pane>-->
17
-                <!--<el-tab-pane label="检验检查项目" name="4">-->
18
-                    <!--<inspection></inspection>-->
19
-                <!--</el-tab-pane>-->
20
-                <el-tab-pane label="生产厂商" name="5">
21
-                    <!--<manufacturer></manufacturer>-->
22
-                  <manufacturer> </manufacturer>
23
-                </el-tab-pane>
24
-                <el-tab-pane label="供应商" name="6">
25
-                    <!--<supplier></supplier>-->
26
-                  <dealer></dealer>
27
-                </el-tab-pane>
28
-                <el-tab-pane label="配置项字典" name="7">
29
-                    <configure></configure>
30
-                </el-tab-pane>
31
-            </el-tabs>
32
-        </div>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
33 5
     </div>
6
+    <div class="app-container">
7
+      <el-tabs v-model="activeName" @tab-click="handleClick">
8
+        <el-tab-pane label="药品" name="1">
9
+          <drugs></drugs>
10
+        </el-tab-pane>
11
+        <el-tab-pane label="耗材" name="2">
12
+          <consumables></consumables>
13
+        </el-tab-pane>
14
+        <!--<el-tab-pane label="项目" name="3">-->
15
+        <!--<project></project>-->
16
+        <!--</el-tab-pane>-->
17
+        <!--<el-tab-pane label="检验检查项目" name="4">-->
18
+        <!--<inspection></inspection>-->
19
+        <!--</el-tab-pane>-->
20
+        <el-tab-pane label="生产厂商" name="5">
21
+          <!--<manufacturer></manufacturer>-->
22
+          <manufacturer></manufacturer>
23
+        </el-tab-pane>
24
+        <el-tab-pane label="供应商" name="6">
25
+          <!--<supplier></supplier>-->
26
+          <dealer></dealer>
27
+        </el-tab-pane>
28
+        <el-tab-pane label="配置项字典" name="7">
29
+          <configure></configure>
30
+        </el-tab-pane>
31
+      </el-tabs>
32
+    </div>
33
+  </div>
34 34
 </template>
35 35
 
36 36
 
37 37
 <script>
38
-import BreadCrumb from "@/xt_pages/components/bread-crumb";
39
-import drugs from './components/drugs'
40
-import consumables from './components/consumables'
41
-import project from './components/project'
42
-import inspection from './components/inspection'
43
-import manufacturer from '../stock/config/manufacturer'
44
-import configure from './compone,nts/configure'
45
-import Dealer from '../stock/config/dealer'
46
-export default {
47
-    components:{
38
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
39
+  import drugs from './components/drugs'
40
+  import consumables from './components/consumables'
41
+  import project from './components/project'
42
+  import inspection from './components/inspection'
43
+  import manufacturer from '../stock/config/manufacturer'
44
+  import configure from './components/configure'
45
+  import Dealer from '../stock/config/dealer'
46
+
47
+  export default {
48
+    name: 'specialDictionary',
49
+    components: {
48 50
       Dealer,
49
-        BreadCrumb,
50
-        drugs,
51
-        consumables,
52
-        project,
53
-        inspection,
54
-        manufacturer,
55
-        configure
51
+      BreadCrumb,
52
+      drugs,
53
+      consumables,
54
+      project,
55
+      inspection,
56
+      manufacturer,
57
+      configure
56 58
     },
57
-    data(){
58
-        return{
59
-            crumbs: [
60
-                { path: false, name: "管理中心" },
61
-                { path: "/data/specialDictionary", name: "专项字典" }
62
-            ],
63
-            activeName: "1"
64
-        }
59
+    data() {
60
+      return {
61
+        crumbs: [
62
+          { path: false, name: '管理中心' },
63
+          { path: '/data/specialDictionary', name: '专项字典' }
64
+        ],
65
+        activeName: '1'
66
+      }
65 67
     }
66
-}
68
+  }
67 69
 </script>

+ 317 - 123
src/xt_pages/stock/Dialog/goodInfoDailog.vue Vedi File

@@ -1,133 +1,248 @@
1 1
 <template>
2
-  <el-dialog width="854px" :title="titles" :visible.sync="visibility" :close-on-click-modal="isClose"
2
+  <el-dialog width="854px"
3
+             :title="titles"
4
+             :visible.sync="visible"
5
+             :close-on-click-modal="isClose"
3 6
              :close-on-press-escape="isClose">
4 7
 
5
-    <el-form class="demo-form-inline" style="height: 300px"
6
-             :rules="rules" :model="form" ref="form"
7
-             label-width="140px">
8
-      <el-col :span="size">
9
-        <el-form-item label="物品类型:" prop="good_id">
10
-          <el-select v-model="form.good_id" placeholder="请选择"
11
-          >
12
-            <el-option
13
-              v-for="item in form.goodType"
14
-              :key="item.id"
15
-              :label="item.type_name"
16
-              :value="item.id">
17
-            </el-option>
18
-          </el-select>
19
-        </el-form-item>
20
-      </el-col>
21
-
22
-      <el-col :span="size">
23
-        <el-form-item label="规格名称:" prop="specification_name">
24
-          <el-input v-model="form.specification_name"></el-input>
25
-        </el-form-item>
26
-      </el-col>
27
-
28
-
29
-      <el-col :span="size">
30
-        <el-form-item label="单位:" prop="good_unit">
31
-
32
-          <el-select v-model="good_unit" @change="changeSelected" placeholder="请选择">
33
-            <el-option
34
-              v-for="item in form.goodUnit"
35
-              :key="item.id"
36
-              :label="item.name"
37
-              :value="item.id">
38
-            </el-option>
39
-          </el-select>
40
-
41
-        </el-form-item>
42
-      </el-col>
43
-
44
-      <el-col :span="size">
45
-        <el-form-item label="生产厂家:" prop="dealer">
46
-          <el-select v-model="form.manufacturer" placeholder="请选择">
47
-            <el-option
48
-              v-for="item in form.manufacturers"
49
-              :key="item.id"
50
-              :label="item.manufacturer_name"
51
-              :value="item.id">
52
-            </el-option>
53
-          </el-select>
54
-        </el-form-item>
55
-      </el-col>
56
-
57
-      <el-col :span="size">
58
-        <el-form-item label="经销商:" prop="manufacturer">
59
-          <el-select v-model="form.dealer" placeholder="请选择">
60
-            <el-option
61
-              v-for="item in form.dealers"
62
-              :key="item.id"
63
-              :label="item.dealer_name"
64
-              :value="item.id">
65
-            </el-option>
66
-          </el-select>
67
-        </el-form-item>
68
-      </el-col>
69
-
70
-
71
-      <el-col :span="size">
72
-        <el-form-item label="进货价:" prop="buy_price">
73
-          <el-input type="number" v-model="form.buy_price"></el-input>
74
-        </el-form-item>
75
-      </el-col>
76
-
77
-      <el-col :span="size">
78
-        <el-form-item label="出货价:" prop="sell_price">
79
-          <el-input type="number" v-model="form.sell_price"></el-input>
80
-        </el-form-item>
81
-      </el-col>
82
-
83
-      <el-col :span="size">
84
-        <el-form-item label="有效期预警天数:" prop="expiry_date_warn_day_count">
85
-          <el-input type="number" v-model="form.expiry_date_warn_day_count"></el-input>
86
-        </el-form-item>
87
-      </el-col>
88
-
89
-      <el-col :span="size">
90
-        <el-form-item label="库存预警数量:" prop="stock_warn_count">
91
-          <el-input type="number" v-model="form.stock_warn_count"></el-input>
92
-        </el-form-item>
93
-      </el-col>
94
-
95
-
96
-      <el-col :span="size">
97
-        <el-form-item label="是否可复用:" prop="is_reuse">
98
-          <el-radio v-model="form.is_reuse" label="1">可以</el-radio>
99
-          <el-radio v-model="form.is_reuse" label="2">不可以</el-radio>
100
-        </el-form-item>
101
-      </el-col>
102
-
103
-
104
-      <el-col>
105
-        <el-form-item label="备注 : " prop="remark">
106
-          <el-input type="textarea" :row="5" v-model="form.remark"
107
-                    placeholder="请输入内容">
108
-          </el-input>
109
-        </el-form-item>
110
-      </el-col>
111
-
112
-    </el-form>
8
+    <el-tabs v-model="activeName" >
9
+      <el-tab-pane label="基础数据" name="first">
10
+        <div>
11
+          <!--:rules="rules"-->
12
+          <el-form :model="form"  ref="form" :rules="rules" label-width="100px" style="display: flex;flex-wrap: wrap;justify-content: space-between;">
13
+            <el-form-item label="耗材名称 : " prop="good_name" style="width:100%">
14
+              <el-input v-model="form.good_name" placeholder="" maxlength="30"></el-input>
15
+            </el-form-item>
16
+            <el-form-item label="拼音 : " prop="pinyin" style="width:50%">
17
+              <el-input v-model="form.pinyin" placeholder="" maxlength="30"></el-input>
18
+            </el-form-item>
19
+            <el-form-item label="五笔 : " prop="wubi" style="width:50%">
20
+              <el-input v-model="form.wubi" placeholder="" maxlength="30"></el-input>
21
+            </el-form-item>
22
+            <el-form-item label="耗材种类 : " prop="good_kind">
23
+              <el-select v-model="form.good_kind" style="width:160px;" placeholder="请选择">
24
+                <el-option
25
+                  v-for="item,index in getDictionaryDataConfig('system','good_kind')"
26
+                  :key="index"
27
+                  :label="item.name"
28
+                  :value="item.id">
29
+                </el-option>
30
+              </el-select>
31
+            </el-form-item>
32
+            <el-form-item label="耗材类型 : " prop="good_type_id">
33
+              <el-select v-model="form.good_type_id" style="width:160px;" placeholder="请选择">
34
+                <el-option
35
+                  v-for="item,index in form.goodType"
36
+                  :key="index"
37
+                  :label="item.type_name"
38
+                  :value="item.id">
39
+                </el-option>
40
+              </el-select>
41
+            </el-form-item>
42
+            <el-form-item label="医保等级 : " prop="medical_insurance_level">
43
+              <el-select v-model="form.medical_insurance_level" style="width:160px;" placeholder="请选择">
44
+                <el-option
45
+                  v-for="item, index in getDictionaryDataConfig('system','medical_insurance_level')"
46
+                  :key="index"
47
+                  :label="item.name"
48
+                  :value="item.id">
49
+                </el-option>
50
+              </el-select>
51
+            </el-form-item>
52
+            <el-form-item label="规格型号 : " prop="specification_name" style="width:100%">
53
+              <el-input v-model="form.specification_name" placeholder="" maxlength="30"></el-input>
54
+            </el-form-item>
55
+            <el-form-item label="生产厂商 : " prop="manufacturer"  style="width:100%">
56
+              <el-select v-model="form.manufacturer" style="width:100%" placeholder="请选择">
57
+                <el-option
58
+                  v-for="item,index in form.manufacturers"
59
+                  :key="index"
60
+                  :label="item.manufacturer_name"
61
+                  :value="item.id">
62
+                </el-option>
63
+              </el-select>
64
+            </el-form-item>
65
+            <el-form-item label="单位 : " prop="good_unit">
66
+              <el-select v-model="form.good_unit" style="width:160px;" placeholder="请选择">
67
+                <el-option
68
+                  v-for="item,index in form.goodUnit"
69
+                  :key="index"
70
+                  :label="item.name"
71
+                  :value="item.id">
72
+                </el-option>
73
+              </el-select>
74
+            </el-form-item>
75
+            <el-form-item label="零价 : " prop="retail_price">
76
+              <el-input v-model="form.retail_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
77
+            </el-form-item>
78
+            <el-form-item label="最新进价 : " prop="buy_price">
79
+              <el-input v-model="form.buy_price" style="width:160px;" placeholder="" maxlength="30"></el-input>
80
+            </el-form-item>
81
+            <el-form-item label="库存警戒 : " prop="stock_warn_count">
82
+              <el-input v-model="form.stock_warn_count" style="width:160px;" placeholder="" maxlength="30"></el-input>
83
+            </el-form-item>
84
+            <el-form-item label="医保编码 : " prop="medical_insurance_number">
85
+              <el-input v-model="form.medical_insurance_number" style="width:160px;" placeholder="" maxlength="30"></el-input>
86
+            </el-form-item>
87
+            <el-form-item label="是否特病目录:" prop="is_special_diseases">
88
+              <el-select v-model="form.is_special_diseases" style="width:160px;" placeholder="请选择">
89
+                <el-option
90
+                  v-for="item in options"
91
+                  :key="item.value"
92
+                  :label="item.label"
93
+                  :value="item.value">
94
+                </el-option>
95
+              </el-select>
96
+            </el-form-item>
97
+            <el-form-item label="是否备案:" prop="is_record">
98
+              <el-select v-model="form.is_record" style="width:160px;" placeholder="请选择">
99
+                <el-option
100
+                  v-for="item in options"
101
+                  :key="item.value"
102
+                  :label="item.label"
103
+                  :value="item.value">
104
+                </el-option>
105
+              </el-select>
106
+            </el-form-item>
107
+            <el-form-item label="统计分类:" prop="statistics_category">
108
+              <el-select v-model="form.statistics_category" style="width:160px;" placeholder="请选择">
109
+                <el-option
110
+                  v-for="item,index in getDictionaryDataConfig('system','statistics_category')"
111
+                  :key="index"
112
+                  :label="item.name"
113
+                  :value="item.id">
114
+                </el-option>
115
+              </el-select>
116
+            </el-form-item>
117
+            <!--<el-form-item label="代理商 : " prop="name" style="visibility: hidden;">-->
118
+              <!--<el-input style="width:160px;" v-model="form.agent" placeholder="" maxlength="30"></el-input>-->
119
+            <!--</el-form-item>-->
120
+
121
+
122
+
123
+            <el-form-item label="状态 : " prop="good_status">
124
+              <el-radio-group v-model="form.good_status">
125
+                <el-radio :label="1">停用</el-radio>
126
+                <el-radio :label="2">收费</el-radio>
127
+              </el-radio-group>
128
+            </el-form-item>
129
+            <el-form-item label="备注 : " prop="name" style="width:100%;">
130
+              <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="form.remark"></el-input>
131
+            </el-form-item>
132
+          </el-form>
133
+        </div>
134
+      </el-tab-pane>
135
+      <el-tab-pane label="扩展数据" name="second">
136
+        <el-form :model="form"    label-width="120px" style="display: flex;flex-wrap: wrap;justify-content: space-between;">
137
+          <el-form-item label="默认使用数量:" prop="name">
138
+            <el-input v-model="form.default_count" style="width:160px;" placeholder="" maxlength="30"></el-input>
139
+          </el-form-item>
140
+          <el-form-item label="标签:" prop="sign">
141
+            <el-select v-model="form.sign" style="width:160px;" placeholder="请选择">
142
+              <el-option
143
+                v-for="item,index in getDictionaryDataConfig('system','sign')"
144
+                :key="index"
145
+                :label="item.name"
146
+                :value="item.id">
147
+              </el-option>
148
+            </el-select>
149
+          </el-form-item>
150
+          <el-form-item label="是否默认:" prop="is_default">
151
+            <el-select v-model="form.is_default" style="width:160px;" placeholder="请选择">
152
+              <el-option
153
+                v-for="item in options"
154
+                :key="item.value"
155
+                :label="item.label"
156
+                :value="item.value">
157
+              </el-option>
158
+            </el-select>
159
+          </el-form-item>
160
+          <el-form-item label="是否收费常用项:" prop="is_charge_use">
161
+            <el-select v-model="form.is_charge_use" style="width:160px;" placeholder="请选择">
162
+              <el-option
163
+                v-for="item in options"
164
+                :key="item.value"
165
+                :label="item.label"
166
+                :value="item.value">
167
+              </el-option>
168
+            </el-select>
169
+          </el-form-item>
170
+          <el-form-item label="是否收费预估项:" prop="is_charge_predict">
171
+            <el-select v-model="form.is_charge_predict" style="width:160px;" placeholder="请选择">
172
+              <el-option
173
+                v-for="item in options"
174
+                :key="item.value"
175
+                :label="item.label"
176
+                :value="item.value">
177
+              </el-option>
178
+            </el-select>
179
+          </el-form-item>
180
+          <el-form-item label="是否统计工作量:" prop="is_statistics_work">
181
+            <el-select v-model="form.is_statistics_work" style="width:160px;" placeholder="请选择">
182
+              <el-option
183
+                v-for="item in options"
184
+                :key="item.value"
185
+                :label="item.label"
186
+                :value="item.value">
187
+              </el-option>
188
+            </el-select>
189
+          </el-form-item>
190
+          <el-form-item label="收费项目排序:" prop="sort">
191
+            <el-input v-model="form.sort" style="width:160px;" placeholder="" maxlength="30"></el-input>
192
+          </el-form-item>
193
+          <el-form-item label="是否常用医嘱:" prop="is_doctor_use">
194
+            <el-select v-model="form.is_doctor_use" style="width:160px;" placeholder="请选择">
195
+              <el-option
196
+                v-for="item in options"
197
+                :key="item.value"
198
+                :label="item.label"
199
+                :value="item.value">
200
+              </el-option>
201
+            </el-select>
202
+          </el-form-item>
203
+          <el-form-item label="代理商:" prop="agent">
204
+            <el-input v-model="form.agent" style="width:160px;" placeholder="" maxlength="30"></el-input>
205
+          </el-form-item>
206
+          <!--<el-form-item label="耗材编码:" prop="name">-->
207
+          <!--<el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>-->
208
+          <!--</el-form-item>-->
209
+          <el-form-item label="耗材编号:" prop="good_number">
210
+            <el-input v-model="form.good_number" style="width:160px;" placeholder="" maxlength="30"></el-input>
211
+          </el-form-item>
212
+
213
+        </el-form>
214
+      </el-tab-pane>
215
+    </el-tabs>
113 216
 
114 217
 
115 218
 
116 219
 
117 220
     <span slot="footer" class="dialog-footer">
118
-    <el-button v-if="isCreated == 3" @click="cancle('form')">取 消</el-button>
119
-    <el-button v-if="isCreated != 3 " @click="cancle('form')">取 消</el-button>
120
-    <el-button v-if="isCreated != 3" type="primary" @click="comfirm('form')">保 存</el-button>
221
+    <el-button  @click="cancle('form')">取 消</el-button>
222
+    <el-button type="primary" @click="comfirm('form')">保 存</el-button>
121 223
   </span>
122 224
   </el-dialog>
123 225
 
124 226
 </template>
125 227
 
228
+
126 229
 <script>
230
+  import { getDictionaryDataConfig } from "@/utils/data";
231
+
127 232
   export default {
128 233
     name: 'goodInfoDailog',
129 234
     data() {
130 235
       return {
236
+        visible:false,
237
+        formTitle:'',
238
+        activeName:'first',
239
+        options: [{
240
+          value: '1',
241
+          label: '是'
242
+        }, {
243
+          value: '2',
244
+          label: '否'
245
+        }],
131 246
         good_unit: '',
132 247
         isClose: false,
133 248
         size: 11,
@@ -139,20 +254,69 @@
139 254
           sell_price: '',
140 255
           remark: '',
141 256
           manufacturer: '',
257
+          good_type_id: '',
142 258
           dealer: '',
143 259
           expiry_date_warn_day_count: '',
144 260
           stock_warn_count: '',
145
-          is_reuse: '2'
261
+          is_reuse: '2',
262
+          good_name:'',
263
+          pinyin:"",
264
+          wubi:"",
265
+          good_kind:'',
266
+          medical_insurance_level:'',
267
+          good_unit:'',
268
+          retail_price:'',
269
+          medical_insurance_number:'',
270
+          is_special_diseases:'',
271
+          is_record:'',
272
+          statistics_category:'',
273
+          agent:'',
274
+          good_status:'',
275
+          default_count:'',
276
+          sign:'',
277
+          is_default:'',
278
+          is_charge_use:'',
279
+          is_charge_predict:'',
280
+          is_statistics_work:'',
281
+          sort:'',
282
+          is_doctor_use:'',
283
+          good_number:'',
146 284
         },
147 285
 
148 286
         rules: {
149 287
           specification_name: [
150
-            { required: true, message: '请输入规格名称', trigger: 'blur' }
288
+            { required: true, message: '请输入规格型号', trigger: 'blur' }
151 289
           ],
152
-          good_id: [
290
+          good_type_id: [
153 291
             { required: true, message: '请选择商品类型', trigger: 'change' }
292
+          ],
293
+          good_name: [
294
+            { required: true, message: '请输入耗材名称', trigger: 'blur' }
295
+          ],
296
+          pinyin: [
297
+            { required: true, message: '请输入拼音', trigger: 'blur' }
298
+          ],
299
+          wubi: [
300
+            { required: true, message: '请输入五笔', trigger: 'blur' }
301
+          ],
302
+          good_kind: [
303
+            { required: true, message: '请选择耗材种类', trigger: 'change' }
304
+          ],
305
+          medical_insurance_level: [
306
+            { required: true, message: '请输入医保等级', trigger: 'blur' }
307
+          ],
308
+          manufacturer:[
309
+            { required: true, message: '请选择生产厂商', trigger: 'blur' }
310
+          ],good_unit:[
311
+            { required: true, message: '请选择单位', trigger: 'blur' }
312
+          ],retail_price:[
313
+            { required: true, message: '请输入零价', trigger: 'blur' }
314
+          ],stock_warn_count:[
315
+            { required: true, message: '请输入库存警戒', trigger: 'blur' }
154 316
           ]
155 317
 
318
+
319
+
156 320
         }
157 321
       }
158 322
     },
@@ -173,11 +337,16 @@
173 337
 
174 338
     },
175 339
     methods: {
176
-      show:function(){
177
-        this.visibility = true
340
+      getDictionaryDataConfig(module,filed_name){
341
+       return getDictionaryDataConfig(module,filed_name)
342
+
343
+      },
344
+      show() {
345
+        this.visible = true
346
+        console.log(this.getDictionaryDataConfig("system","drug_type"))
178 347
 
179
-      },hide:function(){
180
-        this.visibility = false
348
+      },  hide() {
349
+        this.visible = false
181 350
       },
182 351
       cancle: function(formName) {
183 352
         this.$emit('dialog-cancle', this.getValue())
@@ -192,7 +361,7 @@
192 361
       getValue: function() {
193 362
         const form = {}
194 363
         form['specification_name'] = this.form.specification_name
195
-        form['good_unit'] = this.good_unit
364
+        form['good_unit'] = this.form.good_unit
196 365
         form['buy_price'] = this.form.buy_price
197 366
         form['sell_price'] = this.form.sell_price
198 367
         form['remark'] = this.form.remark
@@ -202,16 +371,41 @@
202 371
         form['stock_warn_count'] = this.form.stock_warn_count
203 372
         form['is_reuse'] = this.form.is_reuse
204 373
         form['isCreated'] = this.isCreated
205
-        form['good_id'] = this.form.good_id
374
+        form['good_id'] = this.form.good_type_id
375
+        form['good_name'] = this.form.good_name
376
+        form['pinyin'] = this.form.pinyin
377
+        form['wubi'] = this.form.wubi
378
+        form['good_kind'] = this.form.good_kind
379
+        form['medical_insurance_level'] = this.form.medical_insurance_level
380
+        form['manufacturer'] = this.form.manufacturer
381
+        form['retail_price'] = this.form.retail_price
382
+        form['medical_insurance_number'] = this.form.medical_insurance_number
383
+        form['is_special_diseases'] = this.form.is_special_diseases
384
+        form['is_record'] = this.form.is_record
385
+        form['statistics_category'] = this.form.statistics_category
386
+        form['good_status'] = this.form.good_status
387
+        form['default_count'] = this.form.default_count
388
+        form['sign'] = this.form.sign
389
+        form['is_default'] = this.form.is_default
390
+        form['is_charge_use'] = this.form.is_charge_use
391
+        form['is_charge_predict'] = this.form.is_charge_predict
392
+        form['is_statistics_work'] = this.form.is_statistics_work
393
+        form['sort'] = this.form.sort
394
+        form['is_doctor_use'] = this.form.is_doctor_use
395
+        form['agent'] = this.form.agent
396
+        form['good_number'] = this.form.good_number
397
+
398
+
399
+
400
+
206 401
         return form
207 402
       }, changeSelected: function(val) {
208 403
         console.log(val)
209 404
       }
210 405
     },
211 406
     watch: {
212
-      visibility(val) {
407
+      visible(val) {
213 408
         this.form = this.formValue
214
-        console.log(this.form)
215 409
         this.good_unit = this.formValue.good_unit
216 410
         if (this.isCreated == 1) {
217 411
           this.good_unit = ''

+ 174 - 1
src/xt_pages/stock/config/goodInfo.vue Vedi File

@@ -187,7 +187,30 @@
187 187
               dealers: [],
188 188
               manufacturers: [],
189 189
               goodType: [],
190
-              goodUnit: []
190
+              goodUnit: [],
191
+              good_name:'',
192
+              pinyin:"",
193
+              wubi:"",
194
+              good_kind:'',
195
+              medical_insurance_level:'',
196
+              good_unit:'',
197
+              retail_price:'',
198
+              medical_insurance_number:'',
199
+              is_special_diseases:'',
200
+              is_record:'',
201
+              statistics_category:'',
202
+              agent:'',
203
+              good_status:'',
204
+              default_count:'',
205
+              sign:'',
206
+              is_default:'',
207
+              is_charge_use:'',
208
+              is_charge_predict:'',
209
+              is_statistics_work:'',
210
+              sort:'',
211
+              is_use_doctor_advice:'',
212
+              good_number:'',
213
+
191 214
             },
192 215
 
193 216
             isVisibility: false
@@ -237,6 +260,10 @@
237 260
                 response.data.data.goodInfo.dealer
238 261
             }
239 262
 
263
+
264
+
265
+
266
+
240 267
             this.goodInfo.goodInfoDialog.formValue.specification_name =
241 268
               response.data.data.goodInfo.specification_name
242 269
             this.goodInfo.goodInfoDialog.formValue.buy_price =
@@ -254,6 +281,152 @@
254 281
             this.goodInfo.good_code = response.data.data.goodInfo.good_code
255 282
             this.goodInfo.goodInfoDialog.formValue.good_id =
256 283
               response.data.data.goodInfo.good_type_id
284
+
285
+
286
+            this.goodInfo.goodInfoDialog.formValue.good_name =
287
+              response.data.data.goodInfo.good_name
288
+
289
+
290
+            this.goodInfo.goodInfoDialog.formValue.pinyin =
291
+              response.data.data.goodInfo.pinyin
292
+
293
+            this.goodInfo.goodInfoDialog.formValue.wubi =
294
+              response.data.data.goodInfo.wubi
295
+
296
+
297
+
298
+            if (response.data.data.goodInfo.good_kind <= 0) {
299
+              this.goodInfo.goodInfoDialog.formValue.good_kind = ''
300
+            } else {
301
+              this.goodInfo.goodInfoDialog.formValue.good_kind =
302
+                response.data.data.goodInfo.good_kind
303
+            }
304
+
305
+
306
+
307
+            if (response.data.data.goodInfo.medical_insurance_level <= 0) {
308
+              this.goodInfo.goodInfoDialog.formValue.medical_insurance_level = ''
309
+            } else {
310
+              this.goodInfo.goodInfoDialog.formValue.medical_insurance_level =
311
+                response.data.data.goodInfo.medical_insurance_level
312
+            }
313
+
314
+
315
+              this.goodInfo.goodInfoDialog.formValue.retail_price =
316
+                response.data.data.goodInfo.retail_price
317
+
318
+
319
+              this.goodInfo.goodInfoDialog.formValue.medical_insurance_number =
320
+                response.data.data.goodInfo.medical_insurance_number
321
+
322
+
323
+            if (response.data.data.goodInfo.is_special_diseases <= 0) {
324
+              this.goodInfo.goodInfoDialog.formValue.is_special_diseases = ''
325
+            } else {
326
+              this.goodInfo.goodInfoDialog.formValue.is_special_diseases =
327
+                response.data.data.goodInfo.is_special_diseases
328
+            }
329
+
330
+            if (response.data.data.goodInfo.is_record <= 0) {
331
+              this.goodInfo.goodInfoDialog.formValue.is_record = ''
332
+            } else {
333
+              this.goodInfo.goodInfoDialog.formValue.is_record =
334
+                response.data.data.goodInfo.is_record
335
+            }
336
+
337
+
338
+            if (response.data.data.goodInfo.statistics_category <= 0) {
339
+              this.goodInfo.goodInfoDialog.formValue.statistics_category = ''
340
+            } else {
341
+              this.goodInfo.goodInfoDialog.formValue.statistics_category =
342
+                response.data.data.goodInfo.is_special_diseases
343
+            }
344
+
345
+
346
+            if (response.data.data.goodInfo.good_status <= 0) {
347
+              this.goodInfo.goodInfoDialog.formValue.good_status = ''
348
+            } else {
349
+              this.goodInfo.goodInfoDialog.formValue.good_status =
350
+                response.data.data.goodInfo.good_status
351
+            }
352
+
353
+
354
+            if (response.data.data.goodInfo.default_count <= 0) {
355
+              this.goodInfo.goodInfoDialog.formValue.default_count = ''
356
+            } else {
357
+              this.goodInfo.goodInfoDialog.formValue.default_count =
358
+                response.data.data.goodInfo.default_count
359
+            }
360
+
361
+
362
+
363
+
364
+            if (response.data.data.goodInfo.sign <= 0) {
365
+              this.goodInfo.goodInfoDialog.formValue.sign = ''
366
+            } else {
367
+              this.goodInfo.goodInfoDialog.formValue.sign =
368
+                response.data.data.goodInfo.sign
369
+            }
370
+
371
+
372
+
373
+            if (response.data.data.goodInfo.is_defalut <= 0) {
374
+              this.goodInfo.goodInfoDialog.formValue.is_defalut = ''
375
+            } else {
376
+              this.goodInfo.goodInfoDialog.formValue.is_defalut =
377
+                response.data.data.goodInfo.is_defalut
378
+            }
379
+
380
+            if (response.data.data.goodInfo.is_charge_use <= 0) {
381
+              this.goodInfo.goodInfoDialog.formValue.is_charge_use = ''
382
+            } else {
383
+              this.goodInfo.goodInfoDialog.formValue.is_charge_use =
384
+                response.data.data.goodInfo.is_charge_use
385
+            }
386
+
387
+
388
+            if (response.data.data.goodInfo.is_charge_predict <= 0) {
389
+              this.goodInfo.goodInfoDialog.formValue.is_charge_predict = ''
390
+            } else {
391
+              this.goodInfo.goodInfoDialog.formValue.is_charge_predict =
392
+                response.data.data.goodInfo.is_charge_predict
393
+            }
394
+
395
+
396
+            if (response.data.data.goodInfo.is_statistics_work <= 0) {
397
+              this.goodInfo.goodInfoDialog.formValue.is_statistics_work = ''
398
+            } else {
399
+              this.goodInfo.goodInfoDialog.formValue.is_statistics_work =
400
+                response.data.data.goodInfo.is_statistics_work
401
+            }
402
+
403
+
404
+            if (response.data.data.goodInfo.sort <= 0) {
405
+              this.goodInfo.goodInfoDialog.formValue.sort = ''
406
+            } else {
407
+              this.goodInfo.goodInfoDialog.formValue.sort =
408
+                response.data.data.goodInfo.sort
409
+            }
410
+
411
+
412
+            if (response.data.data.goodInfo.is_doctor_use <= 0) {
413
+              this.goodInfo.goodInfoDialog.formValue.is_doctor_use = ''
414
+            } else {
415
+              this.goodInfo.goodInfoDialog.formValue.is_doctor_use =
416
+                response.data.data.goodInfo.is_doctor_use
417
+            }
418
+
419
+
420
+            this.goodInfo.goodInfoDialog.formValue.agent =
421
+              response.data.data.goodInfo.agent
422
+
423
+
424
+
425
+            this.goodInfo.goodInfoDialog.formValue.good_number =
426
+              response.data.data.goodInfo.agent
427
+
428
+
429
+
257 430
             this.$refs.dialog.show()
258 431
           }
259 432
         })

+ 23 - 0
src/xt_pages/stock/drugs/cancelDrugStockDetail.vue Vedi File

@@ -0,0 +1,23 @@
1
+<template>
2
+  <cancel-stock-order-detail v-if="isEdit == 0"   v-on:edit-record="isEdit = 1"></cancel-stock-order-detail>
3
+  <cancel-stock-order-edit v-else></cancel-stock-order-edit>
4
+</template>
5
+
6
+<script>
7
+  import CancelStockOrderDetail from './cancelDrugStockOrderDetail'
8
+  import CancelStockOrderEdit from './cancelDrugStockOrderEdit'
9
+  export default {
10
+    name: 'cancelStockDetail',
11
+    components: { CancelStockOrderEdit, CancelStockOrderDetail },
12
+    data() {
13
+      return {
14
+        isEdit: 0
15
+      }
16
+    },
17
+  }
18
+
19
+</script>
20
+
21
+<style scoped>
22
+
23
+</style>

+ 533 - 0
src/xt_pages/stock/drugs/cancelDrugStockOrder.vue Vedi File

@@ -0,0 +1,533 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <!--<bread-crumb :crumbs="crumbs"></bread-crumb>-->
5
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
6
+      <el-button
7
+        size="small"
8
+        @click="AddNewOrder"
9
+        class="filter-item"
10
+        style="float:right;"
11
+        type="primary"
12
+        icon="el-icon-circle-plus-outline"
13
+        >新增
14
+      </el-button>
15
+    </div>
16
+
17
+    <div class="app-container">
18
+      <div class="cell clearfix">
19
+        <el-input
20
+          size="small"
21
+          style="width: 400px;"
22
+          class="filter-item"
23
+          v-model.trim="searchKey"
24
+          placeholder="单据编码/制单人/厂商"
25
+        />
26
+        <el-button
27
+          size="small"
28
+          class="filter-item"
29
+          type="primary"
30
+          icon="el-icon-search"
31
+          @click="search"
32
+          >搜索</el-button
33
+        >
34
+      </div>
35
+
36
+      <div class="cell clearfix">
37
+        <label class="title"><span class="name">退库时间</span> : </label>
38
+        <el-date-picker
39
+          size="small"
40
+          v-model="start_time"
41
+          prefix-icon="el-icon-date"
42
+          :editable="false"
43
+          style="width: 196px;"
44
+          type="date"
45
+          placeholder="选择日期时间"
46
+          align="right"
47
+          format="yyyy-MM-dd"
48
+          value-format="yyyy-MM-dd"
49
+          @change="startTimeChange"
50
+        ></el-date-picker>
51
+        <span class="cellLine"> - </span>
52
+        <el-date-picker
53
+          size="small"
54
+          v-model="end_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="endTimeChange"
64
+        ></el-date-picker>
65
+      </div>
66
+
67
+      <div class="filter-container" style="margin-top: 10px">
68
+        <el-checkbox
69
+          style="width: 70px"
70
+          v-model="checked"
71
+          @change="changeAllSelected"
72
+          >全选</el-checkbox
73
+        >
74
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
75
+          >删除</el-button
76
+        >
77
+      </div>
78
+
79
+      <el-row :gutter="12" style="margin-top: 10px">
80
+        <el-table
81
+          :data="cancelStockDate"
82
+          :class="signAndWeighBoxPatients"
83
+          border
84
+          highlight-current-row
85
+          ref="multipleTable"
86
+          @selection-change="select"
87
+          :row-style="{ color: '#303133' }"
88
+          :header-cell-style="{
89
+            backgroundColor: 'rgb(245, 247, 250)',
90
+            color: '#606266'
91
+          }"
92
+        >
93
+          <el-table-column type="selection" width="55"> </el-table-column>
94
+
95
+          <el-table-column label="单据日期" align="center">
96
+            <template slot-scope="scope">
97
+              {{ scope.row.return_time | parseTime("{y}-{m}-{d}") }}
98
+            </template>
99
+          </el-table-column>
100
+
101
+          <el-table-column label="单据编号" align="center">
102
+            <template slot-scope="scope">
103
+              {{ scope.row.order_number }}
104
+            </template>
105
+          </el-table-column>
106
+
107
+          <el-table-column label="制单人" align="center">
108
+            <template slot-scope="scope">
109
+              {{ getXuserName(scope.row.creater) }}
110
+            </template>
111
+          </el-table-column>
112
+
113
+          <el-table-column label="厂家" align="center">
114
+            <template slot-scope="scope">
115
+              {{ getManufactuerName(scope.row.manufacturer) }}
116
+            </template>
117
+          </el-table-column>
118
+
119
+          <el-table-column label="经销商" align="center">
120
+            <template slot-scope="scope">
121
+              {{ getDealerName(scope.row.dealer) }}
122
+            </template>
123
+          </el-table-column>
124
+
125
+          <el-table-column label="操作" align="center">
126
+            <template slot-scope="scope">
127
+              <el-tooltip
128
+                class="item"
129
+                effect="dark"
130
+                content="编辑"
131
+                placement="top"
132
+              >
133
+                <el-button
134
+                  size="mini"
135
+                  type="primary"
136
+                  icon="el-icon-edit-outline"
137
+                  @click="handleEdit(scope.$index, scope.row)"
138
+                >
139
+                </el-button>
140
+              </el-tooltip>
141
+              <el-tooltip
142
+                class="item"
143
+                effect="dark"
144
+                content="删除"
145
+                placement="top"
146
+              >
147
+                <el-button
148
+                  size="mini"
149
+                  type="danger"
150
+                  icon="el-icon-delete"
151
+                  @click="handleDelete(scope.$index, scope.row)"
152
+                >
153
+                </el-button>
154
+              </el-tooltip>
155
+            </template>
156
+          </el-table-column>
157
+        </el-table>
158
+
159
+        <el-pagination
160
+          @size-change="handleSizeChange"
161
+          @current-change="handleCurrentChange"
162
+          :page-sizes="[10, 50, 100]"
163
+          :page-size="10"
164
+          background
165
+          style="margin-top:20px;float: right"
166
+          layout="total, sizes, prev, pager, next, jumper"
167
+          :total="total"
168
+        >
169
+        </el-pagination>
170
+      </el-row>
171
+    </div>
172
+  </div>
173
+</template>
174
+
175
+<script>
176
+import { uParseTime } from "@/utils/tools";
177
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
178
+import {
179
+  deleteDrugCancelStock,
180
+  GetAllConfig,
181
+  getDrugCancelStockList
182
+} from "@/api/drug/drug_stock";
183
+import BreadCrumb from '../../components/bread-crumb'
184
+// import BreadCrumb from "../components/bread-crumb";
185
+
186
+export default {
187
+  name: "salesReturnOrder",
188
+  components: { BreadCrumb  },
189
+  created() {
190
+    var nowDate = new Date();
191
+    var nowYear = nowDate.getFullYear();
192
+    var nowMonth = nowDate.getMonth() + 1;
193
+    var nowDay = nowDate.getDate();
194
+    this.end_time =
195
+      nowYear +
196
+      "-" +
197
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
198
+      "-" +
199
+      (nowDay < 10 ? "0" + nowDay : nowDay);
200
+    nowDate.setMonth(nowDate.getMonth() - 1);
201
+    nowYear = nowDate.getFullYear();
202
+    nowMonth = nowDate.getMonth() + 1;
203
+    nowDay = nowDate.getDate();
204
+    this.start_time =
205
+      nowYear +
206
+      "-" +
207
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
208
+      "-" +
209
+      (nowDay < 10 ? "0" + nowDay : nowDay);
210
+
211
+    this.GetCancelStock();
212
+    this.GetConfigInfo();
213
+    this.fetchAllAdminUsers();
214
+  },
215
+  data() {
216
+    return {
217
+      crumbs: [
218
+        { path: false, name: "库存管理" },
219
+        { path: false, name: "出库退库单" }
220
+      ],
221
+      searchKey: "",
222
+      type: 1,
223
+      page: 1,
224
+      limit: 10,
225
+      checked: false,
226
+      total: 0,
227
+      pageTotal: 0,
228
+      pageSelect: 0,
229
+      adminUserOptions: [],
230
+      multipleSelection: [],
231
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
232
+      start_time: "",
233
+      cancelStockDate: [],
234
+      end_time: "",
235
+      goodType: [],
236
+      goodInfo: [],
237
+      manufacturer: [],
238
+      selectedTableData: [],
239
+      dealer: []
240
+    };
241
+  },
242
+  methods: {
243
+    search: function() {
244
+      const Params = {
245
+        page: this.page,
246
+        limit: this.limit,
247
+        start_time: this.start_time,
248
+        end_time: this.end_time,
249
+        type: this.type,
250
+        keywords: this.searchKey
251
+      };
252
+      this.cancelStockDate = [];
253
+      getDrugCancelStockList(Params).then(response => {
254
+        if (response.data.state == 0) {
255
+          this.$message.error(response.data.msg);
256
+          return false;
257
+        } else {
258
+          this.total = response.data.data.total;
259
+          for (let i = 0; i < response.data.data.list.length; i++) {
260
+            this.cancelStockDate.push(response.data.data.list[i]);
261
+          }
262
+        }
263
+      });
264
+    },
265
+    AddNewOrder: function() {
266
+      this.$router.push({
267
+        name: "cancelStockOrderAdd",
268
+        query: { type: this.type }
269
+      });
270
+    },
271
+    GetCancelStock: function() {
272
+      const Params = {
273
+        page: this.page,
274
+        limit: this.limit,
275
+        start_time: this.start_time,
276
+        end_time: this.end_time,
277
+        type: this.type
278
+      };
279
+      this.cancelStockDate = [];
280
+      getDrugCancelStockList(Params).then(response => {
281
+        if (response.data.state == 0) {
282
+          this.$message.error(response.data.msg);
283
+          return false;
284
+        } else {
285
+          this.total = response.data.data.total;
286
+          for (let i = 0; i < response.data.data.list.length; i++) {
287
+            this.cancelStockDate.push(response.data.data.list[i]);
288
+          }
289
+        }
290
+      });
291
+    },
292
+    getXuserName(id) {
293
+      if (id <= 0) {
294
+        return "";
295
+      }
296
+      var name = "";
297
+      if (
298
+        this.adminUserOptions == null ||
299
+        typeof this.adminUserOptions.length === "undefined"
300
+      ) {
301
+        return name;
302
+      }
303
+      var leng = this.adminUserOptions.length;
304
+      if (leng == 0) {
305
+        return name;
306
+      }
307
+      for (let index = 0; index < leng; index++) {
308
+        if (this.adminUserOptions[index].id == id) {
309
+          name = this.adminUserOptions[index].name;
310
+          break;
311
+        }
312
+      }
313
+      return name;
314
+    },
315
+    fetchAllAdminUsers() {
316
+      fetchAllAdminUsers().then(response => {
317
+        console.log(response);
318
+        if (response.data.state == 1) {
319
+          this.adminUserOptions = response.data.data.users;
320
+          var alen = this.adminUserOptions.length;
321
+          for (let index = 0; index < alen; index++) {
322
+            if (this.adminUserOptions[index].user_type == 2) {
323
+              // this.doctorOptions.push(this.adminUserOptions[index]);
324
+            }
325
+          }
326
+        }
327
+      });
328
+    },
329
+    handleSelectionChange: function(val) {
330
+      this.multipleSelection = val;
331
+    },
332
+    handleSizeChange(val) {
333
+      this.limit = val;
334
+      this.GetCancelStock();
335
+    },
336
+    handleCurrentChange(val) {
337
+      this.page = val;
338
+      this.GetCancelStock();
339
+    },
340
+    startTimeChange(val) {
341
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
342
+      if (time > 0) {
343
+        this.$message.error("结束时间不能小于开始时间");
344
+        this.start_time = "";
345
+      } else {
346
+        this.GetCancelStock();
347
+      }
348
+      this.GetCancelStock();
349
+    },
350
+    endTimeChange(val) {
351
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
352
+      if (time < 0) {
353
+        this.$message.error("结束时间不能小于开始时间");
354
+        this.end_time = "";
355
+      } else {
356
+        this.GetCancelStock();
357
+      }
358
+    },
359
+    getTimestamp(time) {
360
+      // 把时间日期转成时间戳
361
+      return new Date(time).getTime() / 1000;
362
+    },
363
+    calculate: function(val) {
364
+      return Math.round(parseFloat(val) * 100) / 100;
365
+    },
366
+    GetConfigInfo: function() {
367
+      GetAllConfig().then(response => {
368
+        if (response.data.state == 0) {
369
+          this.$message.error(response.data.msg);
370
+          return false;
371
+        } else {
372
+          this.manufacturer = response.data.data.manufacturer;
373
+          this.dealer = response.data.data.dealer;
374
+        }
375
+      });
376
+    },
377
+    getManufactuerName: function(manufacturer_id) {
378
+      for (let i = 0; i < this.manufacturer.length; i++) {
379
+        if (this.manufacturer[i].id == manufacturer_id) {
380
+          return this.manufacturer[i].manufacturer_name;
381
+        }
382
+      }
383
+    },
384
+    getDealerName: function(dealer_id) {
385
+      for (let i = 0; i < this.dealer.length; i++) {
386
+        if (this.dealer[i].id == dealer_id) {
387
+          return this.dealer[i].dealer_name;
388
+        }
389
+      }
390
+    },
391
+    handleEdit: function(index, row) {
392
+      this.$router.push({
393
+        name: "cancelStockDetail",
394
+        query: { id: row.id, type: this.type }
395
+      });
396
+    },
397
+    handleDelete: function(index, row) {
398
+      const ids = [];
399
+      ids.push(row.id);
400
+      const idStr = ids.join(",");
401
+
402
+      const params = {
403
+        ids: idStr
404
+      };
405
+
406
+      this.$confirm("确认删除出库退库单记录?", "删除出库退库单记录", {
407
+        confirmButtonText: "确定",
408
+        cancelButtonText: "取消",
409
+        type: "warning"
410
+      })
411
+        .then(() => {
412
+          deleteDrugCancelStock(params).then(response => {
413
+            if (response.data.state == 0) {
414
+              this.$message.error(response.data.msg);
415
+              return false;
416
+            } else {
417
+              this.$notify({
418
+                title: "成功",
419
+                message: "删除成功",
420
+                type: "success",
421
+                duration: 2000
422
+              });
423
+              for (let i = 0; i < ids.length; i++) {
424
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
425
+                  if (ids[i] == this.cancelStockDate[y].id) {
426
+                    this.cancelStockDate.splice(y, 1);
427
+                  }
428
+                }
429
+              }
430
+            }
431
+          });
432
+        })
433
+        .catch(() => {});
434
+    },
435
+    changeAllSelected: function(val) {
436
+      if (val) {
437
+        this.$refs.multipleTable.toggleAllSelection();
438
+      } else {
439
+        this.$refs.multipleTable.clearSelection();
440
+      }
441
+    },
442
+    select(selection) {
443
+      this.selectedTableData = selection;
444
+    },
445
+    batchDelete() {
446
+      if (this.selectedTableData.length <= 0) {
447
+        this.$message.error("请选择要删除的记录");
448
+        return;
449
+      }
450
+      const ids = [];
451
+      for (let i = 0; i < this.selectedTableData.length; i++) {
452
+        ids.push(this.selectedTableData[i].id);
453
+      }
454
+      const idStr = ids.join(",");
455
+      const params = {
456
+        ids: idStr
457
+      };
458
+      this.$confirm("确认删除出库退库单记录?", "删除出库退库单记录", {
459
+        confirmButtonText: "确定",
460
+        cancelButtonText: "取消",
461
+        type: "warning"
462
+      })
463
+        .then(() => {
464
+          deleteDrugCancelStock(params).then(response => {
465
+            if (response.data.state == 0) {
466
+              this.$message.error(response.data.msg);
467
+              return false;
468
+            } else {
469
+              this.$notify({
470
+                title: "成功",
471
+                message: "删除成功",
472
+                type: "success",
473
+                duration: 2000
474
+              });
475
+
476
+              for (let i = 0; i < ids.length; i++) {
477
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
478
+                  if (ids[i] == this.cancelStockDate[y].id) {
479
+                    this.cancelStockDate.splice(y, 1);
480
+                  }
481
+                }
482
+              }
483
+            }
484
+          });
485
+        })
486
+        .catch(() => {});
487
+    }
488
+  }
489
+};
490
+</script>
491
+
492
+<style rel="stylesheet/css" lang="scss" scoped>
493
+.information {
494
+  border: 1px #dcdfe6 solid;
495
+  padding: 30px 20px 30px 20px;
496
+
497
+  .border {
498
+    border-bottom: 1px #dcdfe6 solid;
499
+    margin: 0px 0 20px 0;
500
+  }
501
+}
502
+
503
+.edit_separater {
504
+  border-top: 1px solid rgb(233, 233, 233);
505
+  margin-top: 15px;
506
+  margin-bottom: 15px;
507
+}
508
+</style>
509
+
510
+<style>
511
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
512
+  font-size: 12px;
513
+}
514
+
515
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
516
+  background: #6fb5fa;
517
+}
518
+
519
+.count {
520
+  color: #bd2c00;
521
+}
522
+.el-table td,
523
+.el-table th.is-leaf,
524
+.el-table--border,
525
+.el-table--group {
526
+  border-color: #d0d3da;
527
+}
528
+.el-table--border::after,
529
+.el-table--group::after,
530
+.el-table::before {
531
+  background-color: #d0d3da;
532
+}
533
+</style>

+ 531 - 0
src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue Vedi File

@@ -0,0 +1,531 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb
5
+        v-if="this.$route.query.type == 1"
6
+        :crumbs="crumbs"
7
+      ></bread-crumb>
8
+      <bread-crumb
9
+        v-if="this.$route.query.type == 2"
10
+        :crumbs="crumbs2"
11
+      ></bread-crumb>
12
+
13
+      <div style="float:right;">
14
+        <el-button size="small" @click="back()" class="filter-item"
15
+          >取 消</el-button
16
+        >
17
+        <el-button
18
+          size="small"
19
+          type="primary"
20
+          @click="submit()"
21
+          class="filter-item"
22
+          >保 存</el-button
23
+        >
24
+      </div>
25
+    </div>
26
+
27
+    <div class="app-container">
28
+
29
+      <!--<stock-in-dialog-->
30
+        <!--ref="dialog"-->
31
+        <!--:propForm="propForm"-->
32
+        <!--:visibility="isVisibility"-->
33
+        <!--v-on:dialog-comfirm="comfirm"-->
34
+        <!--v-on:dialog-cancle="cancle"-->
35
+      <!--&gt;</stock-in-dialog>-->
36
+      <drugs-stock-dialog
37
+        ref="dialog"
38
+        :propForm="propForm"
39
+        :visibility="isVisibility"
40
+        v-on:dialog-comfirm="comfirm"
41
+        v-on:dialog-cancle="cancle"
42
+      >
43
+
44
+      </drugs-stock-dialog>
45
+
46
+      <div class="filter-container">
47
+        <div class="cell clearfix">
48
+          <label class="title"><span class="name">退库时间</span> : </label>
49
+
50
+          <el-date-picker
51
+            size="small"
52
+            v-model="return_time"
53
+            prefix-icon="el-icon-date"
54
+            :editable="false"
55
+            style="width: 196px;"
56
+            type="date"
57
+            placeholder="选择日期时间"
58
+            align="right"
59
+            format="yyyy-MM-dd"
60
+            value-format="yyyy-MM-dd"
61
+          ></el-date-picker>
62
+        </div>
63
+
64
+        <div class="cell clearfix">
65
+          <label class="title"><span class="name">经销商</span> : </label>
66
+          <el-select
67
+            size="small"
68
+            v-model="form.dealer"
69
+            clearable
70
+            placeholder="请选择经销商"
71
+            @change="changeDealer"
72
+          >
73
+            <el-option
74
+              v-for="(option, index) in dealer"
75
+              :key="index"
76
+              :label="option.dealer_name"
77
+              :value="option.id"
78
+            >
79
+            </el-option>
80
+          </el-select>
81
+        </div>
82
+
83
+        <div class="cell clearfix">
84
+          <label class="title"><span class="name">厂商</span> : </label>
85
+          <el-select
86
+            size="small"
87
+            v-model="form.manufacturer"
88
+            clearable
89
+            placeholder="请选择厂商"
90
+            @change="changeManufacturer"
91
+          >
92
+            <el-option
93
+              v-for="(option, index) in manufacturer"
94
+              :key="index"
95
+              :label="option.manufacturer_name"
96
+              :value="option.id"
97
+            >
98
+            </el-option>
99
+          </el-select>
100
+        </div>
101
+      </div>
102
+
103
+      <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
104
+        <el-table
105
+          :data="recordInfo.recordData"
106
+          :class="signAndWeighBoxPatients"
107
+          style="width: 100%"
108
+          border
109
+          max-height="450"
110
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
111
+        >
112
+          <el-table-column min-width="35" align="center">
113
+            <template slot="header" slot-scope="scope">
114
+              <span>商品类型<span style="color: red">*</span></span>
115
+            </template>
116
+
117
+            <template slot-scope="scope">
118
+              <!--<span @click="showDialog(scope.$index, scope.row)" v-if="scope.row.good_type_id == 0" style="color:#c5c8cf">请输入类型</span>-->
119
+              <!--<span @click="showDialog(scope.$index, scope.row)" v-if="scope.row.good_type_id != 0">{{typeName(scope.row.good_type_id)}}</span>-->
120
+
121
+              <el-form-item style="padding-top: 15px">
122
+                <el-input
123
+                  placeholder="请输入商品类型"
124
+                  v-model="scope.row.good_type_id"
125
+                  :value="typeName(scope.row.good_type_id)"
126
+                  @focus="showDialog(scope.$index, scope.row)"
127
+                ></el-input>
128
+              </el-form-item>
129
+            </template>
130
+          </el-table-column>
131
+          <el-table-column min-width="35" align="center">
132
+            <template slot="header" slot-scope="scope">
133
+              <span>规格名称<span style="color: red">*</span></span>
134
+            </template>
135
+            <template slot-scope="scope">
136
+              <el-form-item style="padding-top: 15px">
137
+                <el-input
138
+                  placeholder="请输入规格名称"
139
+                  v-model="scope.row.good_id"
140
+                  :value="specificationName(scope.row.good_id)"
141
+                  @focus="showDialog(scope.$index, scope.row)"
142
+                ></el-input>
143
+              </el-form-item>
144
+            </template>
145
+          </el-table-column>
146
+
147
+          <el-table-column min-width="23" align="center">
148
+            <template slot="header" slot-scope="scope">
149
+              <span>退库数量<span style="color: red">*</span></span>
150
+            </template>
151
+            <template slot-scope="scope">
152
+              <el-form-item
153
+                :prop="'recordData.' + scope.$index + '.return_count'"
154
+                :rules="tableRules.return_count"
155
+                style="padding-top: 17px"
156
+              >
157
+                <el-input
158
+                  placeholder="请输入退库数量"
159
+                  type="number"
160
+                  v-model="scope.row.return_count"
161
+                ></el-input>
162
+              </el-form-item>
163
+            </template>
164
+          </el-table-column>
165
+          <el-table-column label="操作" align="center" min-width="20">
166
+            <template slot-scope="scope">
167
+              <el-tooltip
168
+                class="item"
169
+                effect="dark"
170
+                content="新增"
171
+                placement="top"
172
+              >
173
+                <el-button
174
+                  size="mini"
175
+                  type="primary"
176
+                  icon="el-icon-circle-plus-outline"
177
+                  @click="handleEdit(scope.$index, scope.row)"
178
+                >
179
+                </el-button>
180
+              </el-tooltip>
181
+              <el-tooltip
182
+                class="item"
183
+                effect="dark"
184
+                content="删除"
185
+                placement="top"
186
+              >
187
+                <el-button
188
+                  size="mini"
189
+                  type="danger"
190
+                  icon="el-icon-delete"
191
+                  @click="handleDelete(scope.$index, scope.row)"
192
+                >
193
+                </el-button>
194
+              </el-tooltip>
195
+            </template>
196
+          </el-table-column>
197
+        </el-table>
198
+      </el-form>
199
+    </div>
200
+  </div>
201
+</template>
202
+
203
+<script>
204
+import { uParseTime } from "@/utils/tools";
205
+import {  postDrugCancelStock,GetAllConfig,GetAllDrugInfoByID } from "@/api/drug/drug_stock";
206
+import BreadCrumb from "../../components/bread-crumb";
207
+import DrugsStockDialog from './drugsStockDialog/index'
208
+
209
+export default {
210
+  components: { DrugsStockDialog, BreadCrumb },
211
+  name: "salesReturnOrderAdd",
212
+
213
+  data() {
214
+    return {
215
+      crumbs: [
216
+        { path: false, name: "库存管理" },
217
+        { path: false, name: "耗材退库单" },
218
+        { path: false, name: "新增退库单" }
219
+      ],
220
+      crumbs2: [
221
+        { path: false, name: "库存管理" },
222
+        { path: false, name: "其他退库单" },
223
+        { path: false, name: "新增退库单" }
224
+      ],
225
+
226
+      type: this.$route.query.type,
227
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
228
+      return_time: "",
229
+      currentIndex: 0,
230
+      recordInfo: {
231
+        recordData: []
232
+      },
233
+      tableRules: {
234
+        return_count: [
235
+          { required: true, message: "数量不能为空", trigge: "blur" }
236
+        ]
237
+      },
238
+      ruleForm: {
239
+        manufacturer: [
240
+          { required: true, message: "请选择厂商", trigger: "change" }
241
+        ]
242
+      },
243
+      // prop
244
+      isVisibility: false,
245
+      propForm: {
246
+        goods: [],
247
+        goodType: [],
248
+        goodInfo: [],
249
+        goodUnit: [],
250
+        manufacturer: 0,
251
+        dealer: 0
252
+      },
253
+      form: {
254
+        manufacturer: 0,
255
+        dealer: 0
256
+      },
257
+      warehouseOutInfoList: [],
258
+      manufacturer: [],
259
+      dealer: [],
260
+      goodType: [],
261
+      goodInfo:[],
262
+    };
263
+  },
264
+  methods: {
265
+    comfirm: function(val) {
266
+      this.propForm.goodType = []
267
+      this.propForm.goods = []
268
+
269
+      this.$refs.dialog.hide()
270
+      if (val.selectedGoodInfo.length > 0) {
271
+        for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
272
+          if (i == 0) {
273
+            this.recordInfo.recordData[this.currentIndex].good_type_id = val.selectedGoodInfo[i].good_type_id
274
+            this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
275
+
276
+          } else {
277
+            const tempForm = {}
278
+            tempForm['drug_id'] = val.selectedGoodInfo[i].id
279
+            tempForm["return_count"] = "";
280
+            this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
281
+          }
282
+        }
283
+      }
284
+      this.currentIndex = -1
285
+
286
+    },
287
+
288
+    cancle: function() {
289
+      this.$refs.dialog.hide();
290
+    },
291
+    GetConfigInfo: function() {
292
+      const loading = this.$loading({
293
+        lock: true,
294
+        text: 'Loading',
295
+        spinner: 'el-icon-loading',
296
+        background: 'rgba(0, 0, 0, 0.7)'
297
+      })
298
+
299
+      GetAllConfig().then(response => {
300
+        if (response.data.state == 0) {
301
+          this.$message.error(response.data.msg)
302
+          return false
303
+        } else {
304
+          this.manufacturer = response.data.data.manufacturer;
305
+          this.dealer = response.data.data.dealer;
306
+          for(let i = 0; i<  response.data.data.drugs.length;i++){
307
+            this.goodType.push(response.data.data.drugs[i])
308
+            if(response.data.data.drugs[i].drug_specs != null) {
309
+              for (let b = 0; b < response.data.data.drugs[i].drug_specs.length; b++) {
310
+                this.goodInfo.push(response.data.data.drugs[i].drug_specs[b])
311
+              }
312
+            }
313
+          }
314
+          this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
315
+          this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
316
+
317
+          this.form.manufacturer = 0
318
+          this.form.dealer = 0
319
+        }
320
+        loading.close()
321
+      })
322
+
323
+    },
324
+
325
+    typeName: function(good_type_id) {
326
+      let name = "";
327
+      for (let i = 0; i < this.goodInfo.length; i++) {
328
+        if (this.goodInfo[i].id == drug_id) {
329
+          name = this.goodInfo[i].drug_name;
330
+
331
+        }
332
+      }
333
+      return name;
334
+    },
335
+    specificationName: function(good_info_id) {
336
+      let name = "";
337
+      for (let i = 0; i < this.goodInfo.length; i++) {
338
+        if (this.goodInfo[i].id == drug_id) {
339
+          name = this.goodInfo[i].drug_spec;
340
+        }
341
+      }
342
+      return name;
343
+    },
344
+    handleEdit: function(index, row) {
345
+      const tempObj = {};
346
+      tempObj["drug_id"] = 0;
347
+      tempObj["return_count"] = "";
348
+      this.recordInfo.recordData.push(tempObj);
349
+    },
350
+    handleDelete: function(index, row) {
351
+      if (this.recordInfo.recordData.length <= 1) {
352
+        this.$message.error("只有一条记录的时候无法删除");
353
+        return;
354
+      } else {
355
+        this.recordInfo.recordData.splice(index, 1);
356
+      }
357
+    },
358
+    calculate: function(val) {
359
+      if (val == 0) {
360
+        return "";
361
+      }
362
+
363
+      return Math.round(parseFloat(val) * 100) / 100;
364
+    },
365
+    getTime(val, temp) {
366
+      if (val != 0) {
367
+        return uParseTime(val, temp);
368
+      } else {
369
+        return "";
370
+      }
371
+    },
372
+    showDialog(index, row) {
373
+      const loading = this.$loading({
374
+        lock: true,
375
+        text: 'Loading',
376
+        spinner: 'el-icon-loading',
377
+        background: 'rgba(0, 0, 0, 0.7)'
378
+      })
379
+      this.currentIndex = index
380
+      this.isVisibility = true
381
+      const params = {
382
+        manufacturer_id: this.form.manufacturer,
383
+        dealer_id: this.form.dealer
384
+      }
385
+      GetAllDrugInfoByID(params).then(response => {
386
+          if (response.data.state == 0) {
387
+            this.$message.error(response.data.msg)
388
+            return false
389
+            loading.close()
390
+
391
+          } else {
392
+            loading.close()
393
+
394
+            if (response.data.data.drugs.length <= 0) {
395
+              this.$message.error('该厂商或经销商没有药品信息')
396
+              return
397
+            }
398
+            this.$refs.dialog.show()
399
+            for (let i = 0; i < response.data.data.drugs.length; i++) {
400
+              this.propForm.goods.push(
401
+                response.data.data.drugs[i]
402
+              );
403
+            }
404
+            const obj = {};
405
+            this.propForm.goods = this.propForm.goods.reduce(
406
+              (cur, next) => {
407
+                obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
408
+                return cur;
409
+              },
410
+              []
411
+            ); // 设置cur默认类型为数组,并且初始值为空的数组
412
+          }
413
+
414
+        for (let i = 0; i < this.propForm.goods.length; i++) {
415
+          for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
416
+            var respObj = this.propForm.goods[i].drug_specs[a];
417
+            respObj["isSelected"] = false;
418
+          }
419
+        }
420
+        }
421
+      )
422
+    },
423
+
424
+    back() {
425
+      this.$router.go(-1);
426
+    },
427
+    submit() {
428
+      this.$refs["tableForm"].validate(valid => {
429
+        if (valid) {
430
+          const array = this.recordInfo.recordData;
431
+          let total = 0;
432
+          for (let i = 0; i < array.length; i++) {
433
+
434
+            if (array[i].drug_id == 0) {
435
+              this.$message.error("药品名称或者药品规格名称不能为空");
436
+              return;
437
+            }
438
+            total = total + array[i].price * array[i].return_count;
439
+          }
440
+
441
+          if (this.recordInfo.recordData.length <= 0) {
442
+            this.$message.success("请添加退库商品");
443
+            return;
444
+          }
445
+
446
+          const params = {
447
+            cancelStock: this.recordInfo.recordData
448
+          };
449
+          postDrugCancelStock(
450
+            params,
451
+            this.return_time,
452
+            this.form.manufacturer,
453
+            this.form.dealer,
454
+            this.type
455
+          ).then(response => {
456
+            if (response.data.state == 0) {
457
+              this.$message.error(response.data.msg);
458
+              return false;
459
+            } else {
460
+              this.$notify({
461
+                title: "成功",
462
+                message: "退库成功",
463
+                type: "success",
464
+                duration: 2000
465
+              });
466
+              this.recordInfo.recordData = [];
467
+              this.$router.back(-1);
468
+            }
469
+          });
470
+        } else {
471
+          return false;
472
+        }
473
+      });
474
+    },
475
+    changeManufacturer(val) {
476
+      this.propForm.manufacturer = val;
477
+    },
478
+    changeDealer(val) {
479
+      this.propForm.dealer = val;
480
+    }
481
+  },
482
+  created() {
483
+    var nowDate = new Date();
484
+    var nowYear = nowDate.getFullYear();
485
+    var nowMonth = nowDate.getMonth() + 1;
486
+    var nowDay = nowDate.getDate();
487
+    this.return_time =
488
+      nowYear +
489
+      "-" +
490
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
491
+      "-" +
492
+      (nowDay < 10 ? "0" + nowDay : nowDay);
493
+
494
+    const tempObj = {};
495
+    tempObj["good_type_id"] = 0;
496
+    tempObj["good_id"] = 0;
497
+    tempObj["return_count"] = "";
498
+    this.recordInfo.recordData.push(tempObj);
499
+    this.GetConfigInfo();
500
+    this.propForm.goodUnit = this.$store.getters.good_unit;
501
+  }
502
+};
503
+</script>
504
+
505
+<style rel="stylesheet/css" lang="scss" scoped>
506
+.information {
507
+  border: 1px #dcdfe6 solid;
508
+  padding: 30px 20px 30px 20px;
509
+
510
+  .border {
511
+    border-bottom: 1px #dcdfe6 solid;
512
+    margin: 0px 0 20px 0;
513
+  }
514
+}
515
+
516
+.edit_separater {
517
+  border-top: 1px solid rgb(233, 233, 233);
518
+  margin-top: 15px;
519
+  margin-bottom: 15px;
520
+}
521
+</style>
522
+
523
+<style>
524
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
525
+  font-size: 12px;
526
+}
527
+
528
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
529
+  background: #6fb5fa;
530
+}
531
+</style>

+ 249 - 0
src/xt_pages/stock/drugs/cancelDrugStockOrderDetail.vue Vedi File

@@ -0,0 +1,249 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+
5
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
6
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
7
+
8
+    </div>
9
+  <div class="app-container">
10
+
11
+    <div class="filter-container">
12
+      <span style="font-size: 20px;color: #606266">退库单详情</span>
13
+      <el-row style="float:right;">
14
+        <span style="color: #606266">{{CancelStockInfo.cancelStock.order_number}}</span>
15
+      </el-row>
16
+    </div>
17
+
18
+
19
+
20
+    <div class="cell clearfix">
21
+      <span style="width: 300px;color: #606266">单据日期:  {{CancelStockInfo.cancelStock.return_time | parseTime('{y}-{m}-{d}')}} </span>
22
+      <span style="width: 300px;color: #606266">厂商 {{getManufactuerName(CancelStockInfo.cancelStock.manufacturer)}}</span>
23
+      <span style="width: 300px;color: #606266">经销商 {{getDealerName(CancelStockInfo.cancelStock.dealer)}}</span>
24
+    </div>
25
+
26
+    <div class="filter-container" style="margin-top: 10px">
27
+      <el-button size="small" icon="el-icon-edit" @click="editRecord">编辑</el-button>
28
+      <el-button size="small" icon="el-icon-delete" @click="deleteRecord">删除</el-button>
29
+    </div>
30
+
31
+    <el-row :gutter="12" style="margin-top: 10px">
32
+      <el-table :data="CancelStockInfo.cancelStockInfoData" :class="signAndWeighBoxPatients" style="width: 100%" border
33
+                :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
34
+      >
35
+        <el-table-column min-width="35" align="center">
36
+          <template slot="header" slot-scope="scope">
37
+            <span>药品名称</span>
38
+          </template>
39
+
40
+          <template slot-scope="scope">
41
+              <span v-if="scope.row.drug_id != 0">{{
42
+                scope.row.drug.drug_name
43
+              }}</span>
44
+          </template>
45
+        </el-table-column>
46
+        <el-table-column min-width="35" align="center">
47
+          <template slot="header" slot-scope="scope">
48
+            <span>规格名称</span>
49
+          </template>
50
+          <template slot-scope="scope">
51
+              <span v-if="scope.row.drug_id != 0">{{
52
+                scope.row.drug?scope.row.drug.drug_spec:''
53
+              }}</span>
54
+          </template>
55
+        </el-table-column>
56
+
57
+        <el-table-column min-width="23" align="center">
58
+          <template slot="header" slot-scope="scope">
59
+            <span>退库数量</span>
60
+          </template>
61
+          <template slot-scope="scope">
62
+            <span>{{scope.row.count}}</span>
63
+
64
+          </template>
65
+        </el-table-column>
66
+
67
+
68
+      </el-table>
69
+    </el-row>
70
+  </div>
71
+  </div>
72
+
73
+</template>
74
+
75
+<script>
76
+  import { uParseTime } from '@/utils/tools'
77
+  import { GetAllConfig, getDrugCancelStockInfo, deleteDrugCancelStock } from '@/api/drug/drug_stock'
78
+  import BreadCrumb from '../../components/bread-crumb'
79
+
80
+  export default {
81
+    name: 'cancelStockOrderDetail',
82
+    components: { BreadCrumb },
83
+    created() {
84
+      const order_id = this.$route.query.id
85
+      this.GetConfigInfo()
86
+      this.GetOrderDetail(order_id)
87
+    },
88
+    data() {
89
+      return {
90
+        crumbs: [
91
+          { path: false, name: '库存管理' },
92
+          { path: false, name: '耗材退库单' },
93
+          { path: false, name: '退库单详情' }
94
+        ],
95
+        crumbs2: [
96
+          { path: false, name: '库存管理' },
97
+          { path: false, name: '其他退库单' },
98
+          { path: false, name: '退库单详情' }
99
+        ],
100
+        isEdit: 0,
101
+        checked: false,
102
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
103
+        goodType: [],
104
+        goodInfo: [],
105
+        manufacturer: [],
106
+        dealer: [],
107
+
108
+        CancelStockInfo: {
109
+          loading: false,
110
+          cancelStockInfoData: [],
111
+          cancelStock: {}
112
+        }
113
+      }
114
+    },
115
+    methods: {
116
+      getSpecificationName: function(id) {
117
+        let name = ''
118
+        for (let i = 0; i < this.goodInfo.length; i++) {
119
+          if (this.goodInfo[i].id == id) {
120
+            name = this.goodInfo[i].specification_name
121
+          }
122
+        }
123
+        return name
124
+      }, getTypeName: function(id) {
125
+        let name = ''
126
+        for (let i = 0; i < this.goodType.length; i++) {
127
+          if (this.goodType[i].id == id) {
128
+            name = this.goodType[i].type_name
129
+          }
130
+        }
131
+        return name
132
+      }, GetConfigInfo: function() {
133
+        GetAllConfig().then(response => {
134
+          if (response.data.state == 0) {
135
+            this.$message.error(response.data.msg)
136
+            return false
137
+          } else {
138
+            this.manufacturer = response.data.data.manufacturer
139
+            this.dealer = response.data.data.dealer
140
+            this.goodInfo = response.data.data.goodInfo
141
+            this.goodType = response.data.data.goodType
142
+          }
143
+        })
144
+      }, getManufactuerName: function(manufacturer_id) {
145
+        for (let i = 0; i < this.manufacturer.length; i++) {
146
+          if (this.manufacturer[i].id == manufacturer_id) {
147
+            return this.manufacturer[i].manufacturer_name
148
+          }
149
+        }
150
+      }, getDealerName: function(dealer_id) {
151
+        for (let i = 0; i < this.dealer.length; i++) {
152
+          if (this.dealer[i].id == dealer_id) {
153
+            return this.dealer[i].dealer_name
154
+          }
155
+        }
156
+      }, calculate: function(val) {
157
+        if (val == 0) {
158
+          return ''
159
+        }
160
+        return Math.round(parseFloat(val) * 100) / 100
161
+      }, GetOrderDetail: function(order_id) {
162
+        const params = {
163
+          'id': order_id
164
+        }
165
+        getDrugCancelStockInfo(params).then(response => {
166
+          if (response.data.state == 0) {
167
+            this.$message.error(response.data.msg)
168
+            return false
169
+          } else {
170
+            for (let i = 0; i < response.data.data.list.length; i++) {
171
+              this.CancelStockInfo.cancelStockInfoData.push(response.data.data.list[i])
172
+            }
173
+            this.CancelStockInfo.cancelStock = response.data.data.info
174
+          }
175
+        })
176
+      }, deleteRecord: function() {
177
+        const ids = []
178
+        ids.push(this.CancelStockInfo.cancelStock.id)
179
+        const idStr = ids.join(',')
180
+
181
+        const params = {
182
+          ids: idStr
183
+        }
184
+
185
+        this.$confirm('确认删除退货单?', '删除退货单记录', {
186
+          confirmButtonText: '确定',
187
+          cancelButtonText: '取消',
188
+          type: 'warning'
189
+        }).then(() => {
190
+          deleteDrugCancelStock(params).then(response => {
191
+            if (response.data.state == 0) {
192
+              this.$message.error(response.data.msg)
193
+              return false
194
+            } else {
195
+              this.$notify({
196
+                title: '成功',
197
+                message: '删除成功',
198
+                type: 'success',
199
+                duration: 2000
200
+              })
201
+
202
+              this.$router.back(-1)
203
+            }
204
+          })
205
+        }).catch(() => {
206
+        })
207
+      }, editRecord: function() {
208
+        this.$emit('edit-record')
209
+      }
210
+    }
211
+  }
212
+</script>
213
+
214
+<style rel="stylesheet/css" lang="scss" scoped>
215
+  .information {
216
+    border: 1px #dcdfe6 solid;
217
+    padding: 30px 20px 30px 20px;
218
+
219
+  .border {
220
+    border-bottom: 1px #dcdfe6 solid;
221
+    margin: 0px 0 20px 0;
222
+  }
223
+
224
+  }
225
+
226
+
227
+  .edit_separater {
228
+    border-top: 1px solid rgb(233, 233, 233);
229
+    margin-top: 15px;
230
+    margin-bottom: 15px;
231
+  }
232
+
233
+</style>
234
+
235
+<style>
236
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
237
+    font-size: 12px;
238
+  }
239
+
240
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
241
+    background: #6fb5fa;
242
+  }
243
+
244
+  .count {
245
+    color: #bd2c00;
246
+
247
+  }
248
+
249
+</style>

+ 478 - 0
src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue Vedi File

@@ -0,0 +1,478 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
6
+      <div style="float:right;">
7
+        <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
8
+        <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
9
+      </div>
10
+    </div>
11
+    <div class="app-container">
12
+      <!--<stock-in-dialog-->
13
+        <!--ref="dialog" :propForm="propForm"-->
14
+        <!--:visibility="isVisibility"-->
15
+        <!--v-on:dialog-comfirm="comfirm"-->
16
+        <!--v-on:dialog-cancle="cancle"-->
17
+      <!--&gt;</stock-in-dialog>-->
18
+      <drugs-stock-dialog
19
+        ref="dialog" :propForm="propForm"
20
+        :visibility="isVisibility"
21
+        v-on:dialog-comfirm="comfirm"
22
+        v-on:dialog-cancle="cancle"
23
+      >
24
+      </drugs-stock-dialog>
25
+      <div class="cell clearfix">
26
+
27
+        <label class="title"><span class="name">退库时间</span> : </label>
28
+        <el-date-picker size="small" v-model="return_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
29
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
30
+                        value-format="yyyy-MM-dd"></el-date-picker>
31
+      </div>
32
+
33
+      <div class="cell clearfix">
34
+        <label class="title"><span class="name">经销商</span> : </label>
35
+        <el-select   size="small"  v-model="form.dealer" clearable  placeholder="请选择经销商"  @change="changeDealer">
36
+          <el-option
37
+            v-for="(option, index) in dealer"
38
+            :key="index"
39
+            :label="option.dealer_name"
40
+            :value="option.id">
41
+          </el-option>
42
+        </el-select>
43
+      </div>
44
+
45
+      <div class="cell clearfix">
46
+        <label class="title"><span class="name">厂商</span> : </label>
47
+        <el-select  size="small"   v-model="form.manufacturer" clearable  placeholder="请选择厂商" @change="changeManufacturer">
48
+          <el-option
49
+            v-for="(option, index) in manufacturer"
50
+            :key="index"
51
+            :label="option.manufacturer_name"
52
+            :value="option.id">
53
+          </el-option>
54
+        </el-select>
55
+      </div>
56
+
57
+
58
+
59
+
60
+
61
+
62
+      <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
63
+        <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
64
+                  max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
65
+        >
66
+
67
+
68
+          <el-table-column min-width="35" align="center">
69
+
70
+            <template slot="header" slot-scope="scope">
71
+              <span>商品类型<span style="color: red">*</span></span>
72
+            </template>
73
+
74
+            <template slot-scope="scope">
75
+              <el-form-item style="padding-top: 15px">
76
+                <el-input placeholder="请输入药品类型" v-model="scope.row.good_type_id"
77
+                          :value="typeName(scope.row.good_type_id)"
78
+                          @focus="showDialog(scope.$index, scope.row)"></el-input>
79
+              </el-form-item>
80
+            </template>
81
+          </el-table-column>
82
+          <el-table-column min-width="35" align="center">
83
+            <template slot="header" slot-scope="scope">
84
+              <span>规格名称<span style="color: red">*</span></span>
85
+            </template>
86
+            <template slot-scope="scope">
87
+
88
+              <el-form-item style="padding-top: 15px">
89
+                <el-input placeholder="请输入药品规格名称" v-model="scope.row.good_id"
90
+                          :value="specificationName(scope.row.good_id)"
91
+                          @focus="showDialog(scope.$index, scope.row)"></el-input>
92
+              </el-form-item>
93
+
94
+            </template>
95
+          </el-table-column>
96
+
97
+
98
+          <el-table-column min-width="23" align="center">
99
+            <template slot="header" slot-scope="scope">
100
+              <span>退库数量<span style="color: red">*</span></span>
101
+            </template>
102
+            <template slot-scope="scope">
103
+              <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
104
+                            style="padding-top: 17px">
105
+                <el-input type="number" v-model="scope.row.count"></el-input>
106
+              </el-form-item>
107
+            </template>
108
+          </el-table-column>
109
+
110
+          <el-table-column label="操作" align="center" min-width="20">
111
+            <template slot-scope="scope">
112
+              <el-tooltip class="item" effect="dark" content="新增" placement="top">
113
+
114
+                <el-button
115
+                  size="mini"
116
+                  type="primary"
117
+                  icon="el-icon-circle-plus-outline"
118
+                  @click="handleEdit(scope.$index, scope.row)">
119
+                </el-button>
120
+              </el-tooltip>
121
+              <el-tooltip class="item" effect="dark" content="删除" placement="top">
122
+
123
+                <el-button
124
+                  size="mini"
125
+                  type="danger"
126
+                  icon="el-icon-delete"
127
+                  @click="handleDelete(scope.$index, scope.row)">
128
+                </el-button>
129
+              </el-tooltip>
130
+
131
+            </template>
132
+          </el-table-column>
133
+
134
+
135
+        </el-table>
136
+      </el-form>
137
+
138
+    </div>
139
+  </div>
140
+
141
+</template>
142
+
143
+<script>
144
+  import { uParseTime } from '@/utils/tools'
145
+
146
+  import { deleteDrugCancelStockInfo, editDrugCancelStockInfo, getDrugCancelStockConfig, getDrugCancelStockInfo,GetAllDrugInfoByID,GetAllConfig  } from '@/api/drug/drug_stock'
147
+  import BreadCrumb from '../../components/bread-crumb'
148
+  import DrugsStockDialog from './drugsStockDialog/index'
149
+
150
+  export default {
151
+    components: { DrugsStockDialog, BreadCrumb },
152
+    name: 'cancelStockOrderEdit',
153
+
154
+    data() {
155
+      return {
156
+        crumbs: [
157
+          { path: false, name: '库存管理' },
158
+          { path: false, name: '耗材退库单' },
159
+          { path: false, name: '编辑退库单' }
160
+        ],
161
+
162
+        crumbs2: [
163
+          { path: false, name: '库存管理' },
164
+          { path: false, name: '其他退库单' },
165
+          { path: false, name: '编辑退库单' }
166
+        ],
167
+
168
+
169
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
170
+        warehousing_time: '',
171
+        adminUserOptions: null,
172
+        currentIndex: 0,
173
+        return_time: '',
174
+        recordInfo: {
175
+          recordData: [],
176
+          stock_in_code: '',
177
+          current_index: ''
178
+
179
+        },
180
+        tableRules: {
181
+          count: [
182
+            { required: true, message: '数量不能为空', trigge: 'blur' }
183
+          ]
184
+
185
+        },
186
+        ruleForm: {
187
+          manufacturer: [
188
+            { required: true, message: '请选择厂商', trigger: 'change' }
189
+          ]
190
+
191
+        },
192
+
193
+        // prop
194
+        isVisibility: false,
195
+        propForm: {
196
+          goods: [],
197
+          goodType: [],
198
+          goodInfo: [],
199
+          goodUnit: [],
200
+          manufacturer: 0,
201
+          dealer: 0
202
+        },
203
+
204
+        form: {
205
+          manufacturer: '',
206
+          dealer: ''
207
+        },
208
+        warehouseOutInfoList:[],
209
+        cancelStock: {},
210
+        manufacturer: [],
211
+        dealer: [],
212
+        goodType: [],
213
+        goodInfo:[],
214
+      }
215
+    },
216
+    methods: {
217
+      comfirm: function(val) {
218
+        this.$refs.dialog.hide()
219
+
220
+        if (val.selectedGoodInfo.length > 0) {
221
+          for (let i = val.selectedGoodInfo.length - 1; ; i--) {
222
+            if (i == 0) {
223
+              this.recordInfo.recordData[this.currentIndex].drug_id = val.selectedGoodInfo[i].id
224
+            } else {
225
+              const tempForm = {}
226
+              tempForm['id'] = 0
227
+              tempForm['drug_id'] = val.selectedGoodInfo[i].id
228
+              tempForm['count'] = ''
229
+              this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
230
+            }
231
+          }
232
+        }
233
+
234
+        this.currentIndex = -1
235
+      }, cancle: function() {
236
+        this.$refs.dialog.hide()
237
+      },
238
+      GetConfigInfo: function() {
239
+        const loading = this.$loading({
240
+          lock: true,
241
+          text: 'Loading',
242
+          spinner: 'el-icon-loading',
243
+          background: 'rgba(0, 0, 0, 0.7)'
244
+        })
245
+
246
+        GetAllConfig().then(response => {
247
+          if (response.data.state == 0) {
248
+            this.$message.error(response.data.msg)
249
+            return false
250
+          } else {
251
+            this.manufacturer = response.data.data.manufacturer;
252
+            this.dealer = response.data.data.dealer;
253
+            for(let i = 0; i<  response.data.data.drugs.length;i++){
254
+              this.goodType.push(response.data.data.drugs[i])
255
+              if(response.data.data.drugs[i].drug_specs != null) {
256
+                for (let b = 0; b < response.data.data.drugs[i].drug_specs.length; b++) {
257
+                  this.goodInfo.push(response.data.data.drugs[i].drug_specs[b])
258
+                }
259
+              }
260
+            }
261
+            this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
262
+            this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
263
+          }
264
+          loading.close()
265
+        })
266
+
267
+      },
268
+
269
+      typeName: function(good_type_id) {
270
+        let name = "";
271
+        for (let i = 0; i < this.goodInfo.length; i++) {
272
+          if (this.goodInfo[i].id == drug_id) {
273
+            name = this.goodInfo[i].drug_name;
274
+
275
+          }
276
+        }
277
+        return name;
278
+      },  specificationName: function(good_info_id) {
279
+        console.log(this.goodInfo)
280
+        let name = "";
281
+        for (let i = 0; i < this.goodInfo.length; i++) {
282
+          if (this.goodInfo[i].id == drug_id) {
283
+            name = this.goodInfo[i].drug_spec;
284
+          }
285
+        }
286
+        return name;
287
+      }, handleEdit: function(index, row) {
288
+        const tempObj = {}
289
+        tempObj['id'] = 0
290
+        tempObj['drug_id'] = 0
291
+        tempObj['count'] = ''
292
+        this.recordInfo.recordData.push(tempObj)
293
+      }, handleDelete: function(index, row) {
294
+        if (row.id == 0) {
295
+          this.recordInfo.recordData.splice(index, 1)
296
+        } else {
297
+          const params = {
298
+            id: row.id
299
+          }
300
+          this.$confirm('确认删除该退库商品信息记录?', '删除退库商品信息记录', {
301
+            confirmButtonText: '确定',
302
+            cancelButtonText: '取消',
303
+            type: 'warning'
304
+          }).then(() => {
305
+            deleteDrugCancelStockInfo(params).then(response => {
306
+              if (response.data.state == 0) {
307
+                this.$message.error(response.data.msg)
308
+                return false
309
+              } else {
310
+                this.$message.success('删除成功')
311
+                this.recordInfo.recordData.splice(index, 1)
312
+              }
313
+            })
314
+          }).catch(() => {
315
+          })
316
+        }
317
+      }, getTime(val, temp) {
318
+        if (val != 0) {
319
+          return uParseTime(val, temp)
320
+        } else {
321
+          return ''
322
+        }
323
+      },
324
+      showDialog(index, row) {
325
+        const loading = this.$loading({
326
+          lock: true,
327
+          text: 'Loading',
328
+          spinner: 'el-icon-loading',
329
+          background: 'rgba(0, 0, 0, 0.7)'
330
+        })
331
+        this.currentIndex = index
332
+        this.isVisibility = true
333
+        const params = {
334
+          manufacturer_id: this.form.manufacturer,
335
+          dealer_id: this.form.dealer
336
+        }
337
+        GetAllDrugInfoByID(params).then(response => {
338
+            if (response.data.state == 0) {
339
+              this.$message.error(response.data.msg)
340
+              return false
341
+              loading.close()
342
+
343
+            } else {
344
+              loading.close()
345
+              if (response.data.data.drugs.length <= 0) {
346
+                this.$message.error("该厂商或经销商没有药品信息");
347
+                return;
348
+              }
349
+              this.$refs.dialog.show();
350
+              for (let i = 0; i < response.data.data.drugs.length; i++) {
351
+                this.propForm.goods.push(
352
+                  response.data.data.drugs[i]
353
+                );
354
+              }
355
+              const obj = {};
356
+              this.propForm.goods = this.propForm.goods.reduce(
357
+                (cur, next) => {
358
+                  obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
359
+                  return cur;
360
+                },
361
+                []
362
+              ); // 设置cur默认类型为数组,并且初始值为空的数组
363
+            }
364
+          for (let i = 0; i < this.propForm.goods.length; i++) {
365
+            for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
366
+              var respObj = this.propForm.goods[i].drug_specs[a];
367
+              respObj["isSelected"] = false;
368
+            }
369
+          }
370
+          loading.close();
371
+          }
372
+        )
373
+      },
374
+
375
+      back() {
376
+        this.$router.go(-1)
377
+      }, submit() {
378
+        this.$refs['tableForm'].validate((valid) => {
379
+          if (valid) {
380
+            const array = this.recordInfo.recordData
381
+            for (let i = 0; i < array.length; i++) {
382
+              if (array[i].drug_id == 0) {
383
+                this.$message.error('药品名称或者药品规格名称不能为空')
384
+                return
385
+              }
386
+            }
387
+
388
+            const params = {
389
+              'cancelStock': this.recordInfo.recordData
390
+            }
391
+            editDrugCancelStockInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer).then(response => {
392
+              if (response.data.state == 0) {
393
+                this.$message.error(response.data.msg)
394
+                return false
395
+              } else {
396
+                this.$message.success('退库成功')
397
+
398
+                this.$router.back(-1)
399
+              }
400
+            })
401
+          } else {
402
+            return false
403
+          }
404
+        })
405
+      }, GetOrderDetail: function(order_id) {
406
+        const params = {
407
+          'id': order_id
408
+        }
409
+        getDrugCancelStockInfo(params).then(response => {
410
+          if (response.data.state == 0) {
411
+            this.$message.error(response.data.msg)
412
+            return false
413
+          } else {
414
+            for (let i = 0; i < response.data.data.list.length; i++) {
415
+              response.data.data.list[i].count = response.data.data.list[i].count.toString()
416
+              this.recordInfo.recordData.push(response.data.data.list[i])
417
+            }
418
+            this.cancelStock = response.data.data.info
419
+            this.return_time = this.getTime(this.cancelStock.return_time, '{y}-{m}-{d}')
420
+            this.form.manufacturer = this.cancelStock.manufacturer
421
+            this.form.dealer = this.cancelStock.dealer
422
+          }
423
+          if (this.recordInfo.recordData.length == 0) {
424
+            const tempObj = {}
425
+            tempObj['id'] = 0
426
+            tempObj['drug_id'] = 0
427
+            tempObj['count'] = ''
428
+            this.recordInfo.recordData.push(tempObj)
429
+          }
430
+        })
431
+      },changeManufacturer(val) {
432
+        this.propForm.manufacturer = val
433
+      },changeDealer(val){
434
+        this.propForm.dealer = val
435
+      }
436
+    },
437
+    created() {
438
+      this.GetConfigInfo()
439
+      this.propForm.goodUnit = this.$store.getters.good_unit
440
+      const order_id = this.$route.query.id
441
+      this.GetOrderDetail(order_id)
442
+    }
443
+
444
+  }
445
+</script>
446
+
447
+<style rel="stylesheet/css" lang="scss" scoped>
448
+  .information {
449
+    border: 1px #dcdfe6 solid;
450
+    padding: 30px 20px 30px 20px;
451
+
452
+  .border {
453
+    border-bottom: 1px #dcdfe6 solid;
454
+    margin: 0px 0 20px 0;
455
+  }
456
+
457
+  }
458
+
459
+
460
+
461
+  .edit_separater {
462
+    border-top: 1px solid rgb(233, 233, 233);
463
+    margin-top: 15px;
464
+    margin-bottom: 15px;
465
+  }
466
+
467
+</style>
468
+
469
+<style>
470
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
471
+    font-size: 12px;
472
+  }
473
+
474
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
475
+    background: #6fb5fa;
476
+  }
477
+
478
+</style>

+ 340 - 0
src/xt_pages/stock/drugs/drguStockQuery.vue Vedi File

@@ -0,0 +1,340 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+    </div>
6
+    <div class="app-container ">
7
+      <div class="cell clearfix">
8
+        <el-input
9
+          size="small"
10
+          style="width: 400px;"
11
+          class="filter-item"
12
+          v-model.trim="keywords"
13
+          placeholder="商品编码/商品名称/规格名称"
14
+        />
15
+        <el-button
16
+          size="small"
17
+          class="filter-item"
18
+          type="primary"
19
+          icon="el-icon-search"
20
+          @click="search"
21
+          >搜索</el-button
22
+        >
23
+      </div>
24
+
25
+      <el-table
26
+        :row-style="{ color: '#303133' }"
27
+        :header-cell-style="{
28
+          backgroundColor: 'rgb(245, 247, 250)',
29
+          color: '#606266'
30
+        }"
31
+        :data="WarehouseInfo.warehouseInfoDate"
32
+        :class="signAndWeighBoxPatients"
33
+        border
34
+        v-loading="WarehouseInfo.loading"
35
+      >
36
+        <el-table-column label="商品编码" align="center">
37
+          <template slot-scope="scope">
38
+            {{ scope.row.good_code }}
39
+          </template>
40
+        </el-table-column>
41
+        <el-table-column label="商品类型" align="center">
42
+          <template slot-scope="scope">
43
+            <span>{{ scope.row.type.type_name }}</span>
44
+          </template>
45
+        </el-table-column>
46
+        <el-table-column label="规格名称" align="center">
47
+          <template slot-scope="scope">
48
+            <span>{{ scope.row.specification_name }}</span>
49
+          </template>
50
+        </el-table-column>
51
+        <el-table-column label="入库数量" align="center">
52
+          <template slot-scope="scope">
53
+            <span
54
+              @click="showStockInDetailDialog(scope.row.good_id)"
55
+              >{{ stockInCount(scope.row) }}</span
56
+            >
57
+          </template>
58
+        </el-table-column>
59
+        <el-table-column label="入库退货" align="center">
60
+          <template slot-scope="scope">
61
+            <span
62
+              @click="showSaleReturnDetailDialog(scope.row)"
63
+              >{{ salesReturnCount(scope.row) }}</span
64
+            >
65
+          </template>
66
+        </el-table-column>
67
+        <el-table-column label="实际入库" align="center">
68
+          <template slot-scope="scope">
69
+            {{ stockInCount(scope.row) - salesReturnCount(scope.row) }}
70
+          </template>
71
+        </el-table-column>
72
+        <el-table-column label="出库数量" align="center">
73
+          <template slot-scope="scope">
74
+            <span
75
+              @click="showStockOutDetailDialog(scope.row.good_id)"
76
+              >{{ stockOutCount(scope.row) }}</span
77
+            >
78
+          </template>
79
+        </el-table-column>
80
+        <el-table-column label="出库退库" align="center">
81
+          <template slot-scope="scope">
82
+            <span
83
+              @click="showCancelStockDetailDialog(scope.row)"
84
+              >{{ cancelStockCount(scope.row) }}</span
85
+            >
86
+          </template>
87
+        </el-table-column>
88
+        <el-table-column label="实际出库" align="center">
89
+          <template slot-scope="scope">
90
+            {{ stockOutCount(scope.row) - cancelStockCount(scope.row) }}
91
+          </template>
92
+        </el-table-column>
93
+
94
+        <el-table-column label="剩余库存" align="center">
95
+          <template slot-scope="scope">
96
+            <span>{{
97
+              stockInCount(scope.row) -
98
+                salesReturnCount(scope.row) -
99
+                stockOutCount(scope.row) +
100
+                cancelStockCount(scope.row)
101
+            }}</span>
102
+          </template>
103
+        </el-table-column>
104
+      </el-table>
105
+      <el-pagination
106
+        @size-change="handleSizeChange"
107
+        @current-change="handleCurrentChange"
108
+        :page-sizes="[10, 50, 100]"
109
+        :page-size="10"
110
+        background
111
+        align="right"
112
+        style="margin-top:20px;"
113
+        layout="total, sizes, prev, pager, next, jumper"
114
+        :total="total"
115
+      >
116
+      </el-pagination>
117
+    </div>
118
+  </div>
119
+</template>
120
+
121
+<script>
122
+import { uParseTime } from "@/utils/tools";
123
+import BreadCrumb from "@/xt_pages/components/bread-crumb";
124
+import {
125
+  GetAllGoodInfo,
126
+  GetAllGoodType,
127
+  getAllStockQueryList
128
+} from "@/api/stock";
129
+
130
+export default {
131
+  name: "stockIn",
132
+  created() {
133
+    this.GetAllStockQuery();
134
+    this.GetAllGoodInfo();
135
+    this.GetAllGoodType();
136
+  },
137
+  components: {
138
+    BreadCrumb
139
+  },
140
+  data() {
141
+    return {
142
+      crumbs: [
143
+        { path: false, name: "库存管理" },
144
+        { path: "/stock/query", name: "库存查询" }
145
+      ],
146
+      keywords: "",
147
+      total: 0,
148
+      multipleSelection: [],
149
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
150
+      start_time: "",
151
+      end_time: "",
152
+      page: 1,
153
+      limit: 10,
154
+      goodType: [],
155
+      goodInfo: [],
156
+      WarehouseInfo: {
157
+        loading: false,
158
+        warehouseInfoDate: []
159
+      }
160
+    };
161
+  },
162
+  methods: {
163
+    GetAllStockQuery: function() {
164
+      console.log(this.keywords);
165
+      const Params = {
166
+        page: this.page,
167
+        limit: this.limit,
168
+        keyword: this.keywords
169
+      };
170
+      this.WarehouseInfo.loading = true;
171
+      this.WarehouseInfo.warehouseInfoDate = [];
172
+      getAllStockQueryList(Params).then(response => {
173
+        if (response.data.state == 0) {
174
+          this.WarehouseInfo.loading = false;
175
+          this.$message.error(response.data.msg);
176
+          return false;
177
+        } else {
178
+          this.WarehouseInfo.loading = false;
179
+          this.total = response.data.data.total;
180
+          for (let i = 0; i < response.data.data.list.length; i++) {
181
+
182
+              this.WarehouseInfo.warehouseInfoDate.push(
183
+                response.data.data.list[i]
184
+              );
185
+          }
186
+        }
187
+      });
188
+    },
189
+    getSpecificationName: function(id) {
190
+      let name = "";
191
+      for (let i = 0; i < this.goodInfo.length; i++) {
192
+        if (this.goodInfo[i].id == id) {
193
+          name = this.goodInfo[i].specification_name;
194
+        }
195
+      }
196
+      return name;
197
+    },
198
+    getTypeName: function(id) {
199
+      let name = "";
200
+      for (let i = 0; i < this.goodType.length; i++) {
201
+        if (this.goodType[i].id == id) {
202
+          name = this.goodType[i].type_name;
203
+        }
204
+      }
205
+      return name;
206
+    },
207
+    GetAllGoodType: function() {
208
+      GetAllGoodType().then(response => {
209
+        if (response.data.state == 0) {
210
+          this.$message.error(response.data.msg);
211
+          return false;
212
+        } else {
213
+          for (let i = 0; i < response.data.data.goodType.length; i++) {
214
+            this.goodType.push(response.data.data.goodType[i]);
215
+          }
216
+        }
217
+      });
218
+    },
219
+    GetAllGoodInfo: function() {
220
+      GetAllGoodInfo().then(response => {
221
+        if (response.data.state == 0) {
222
+          this.$message.error(response.data.msg);
223
+          return false;
224
+        } else {
225
+          for (let i = 0; i < response.data.data.goodInfo.length; i++) {
226
+            this.goodInfo.push(response.data.data.goodInfo[i]);
227
+          }
228
+        }
229
+      });
230
+    },
231
+    handleBack: function() {
232
+      this.$router.go(-1);
233
+    },
234
+    handleSizeChange(val) {
235
+      this.limit = val;
236
+      this.GetAllStockQuery();
237
+    },
238
+    handleCurrentChange(val) {
239
+      this.page = val;
240
+      this.GetAllStockQuery();
241
+    },
242
+    calculate: function(val) {
243
+      return Math.round(parseFloat(val) * 100) / 100;
244
+    },
245
+    startTimeChange: function() {
246
+      this.GetAllStockQuery();
247
+    },
248
+    endTimeChange: function() {
249
+      this.GetAllStockQuery();
250
+    },
251
+    stockInCount: function(row) {
252
+      let total = 0;
253
+      for (let i = 0; i < row.query_warehousing_info.length; i++) {
254
+        total = total + row.query_warehousing_info[i].warehousing_count;
255
+      }
256
+      return total;
257
+    },
258
+    salesReturnCount: function(row) {
259
+      let total = 0;
260
+      for (let i = 0; i < row.query_sales_return_info.length; i++) {
261
+        total = total + row.query_sales_return_info[i].count;
262
+      }
263
+      return total;
264
+    },
265
+    stockOutCount: function(row) {
266
+      let total = 0;
267
+      for (let i = 0; i < row.query_warehouseout_info.length; i++) {
268
+        total = total + row.query_warehouseout_info[i].count;
269
+      }
270
+      return total;
271
+    },
272
+    cancelStockCount: function(row) {
273
+      let total = 0;
274
+      for (let i = 0; i < row.query_cancel_stock_info.length; i++) {
275
+        total = total + row.query_cancel_stock_info[i].count;
276
+      }
277
+      return total;
278
+    },
279
+    showStockInDetailDialog: function(val) {},
280
+    showSaleReturnDetailDialog: function() {},
281
+    showStockOutDetailDialog: function() {},
282
+    showCancelStockDetailDialog: function() {},
283
+    search: function() {
284
+      this.GetAllStockQuery();
285
+    }
286
+  }
287
+};
288
+</script>
289
+
290
+<style rel="stylesheet/css" lang="scss" scoped>
291
+.information {
292
+  border: 1px #dcdfe6 solid;
293
+  padding: 30px 20px 30px 20px;
294
+
295
+  .border {
296
+    border-bottom: 1px #dcdfe6 solid;
297
+    margin: 0px 0 20px 0;
298
+  }
299
+}
300
+
301
+.title {
302
+  background: #409eff;
303
+  height: 44px;
304
+  line-height: 44px;
305
+  padding: 0 0 0 10px;
306
+  color: #fff;
307
+  margin: 0 0 10px 0;
308
+}
309
+
310
+.edit_separater {
311
+  border-top: 1px solid rgb(233, 233, 233);
312
+  margin-top: 15px;
313
+  margin-bottom: 15px;
314
+}
315
+</style>
316
+
317
+<style>
318
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
319
+  font-size: 12px;
320
+}
321
+
322
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
323
+  background: #6fb5fa;
324
+}
325
+
326
+.count {
327
+  color: #bd2c00;
328
+}
329
+.el-table td,
330
+.el-table th.is-leaf,
331
+.el-table--border,
332
+.el-table--group {
333
+  border-color: #d0d3da;
334
+}
335
+.el-table--border::after,
336
+.el-table--group::after,
337
+.el-table::before {
338
+  background-color: #d0d3da;
339
+}
340
+</style>

+ 24 - 0
src/xt_pages/stock/drugs/drugSalesReturnDetail.vue Vedi File

@@ -0,0 +1,24 @@
1
+<template>
2
+  <sales-return-order-detail v-if="isEdit == 0"   v-on:edit-record="isEdit = 1"></sales-return-order-detail>
3
+  <sales-return-edit v-else></sales-return-edit>
4
+</template>
5
+
6
+<script>
7
+  import SalesReturnEdit from './drugSalesReturnEdit'
8
+  import SalesReturnOrderDetail from './drugSalesReturnOrderDetail'
9
+  export default {
10
+    name: 'stockInDeatail',
11
+    components: { SalesReturnOrderDetail, SalesReturnEdit },
12
+    data() {
13
+      return {
14
+        isEdit: 0
15
+      }
16
+    }
17
+
18
+  }
19
+
20
+</script>
21
+
22
+<style scoped>
23
+
24
+</style>

+ 486 - 0
src/xt_pages/stock/drugs/drugSalesReturnEdit.vue Vedi File

@@ -0,0 +1,486 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+      <div style="float:right;">
6
+        <el-button size="small"  @click="back()" class="filter-item"   >取 消</el-button>
7
+        <el-button size="small"  type="primary" @click="submit()" class="filter-item" >保 存</el-button>
8
+      </div>
9
+    </div>
10
+
11
+  <div class="app-container">
12
+
13
+    <!--<sales-return-dialog ref="dialog" :propForm="propForm"-->
14
+                     <!--:visibility="isVisibility"-->
15
+                     <!--v-on:dialog-comfirm="comfirm"-->
16
+                     <!--v-on:dialog-cancle="cancle"></sales-return-dialog>-->
17
+    <!--<stock-in-dialog-->
18
+      <!--ref="dialog"-->
19
+      <!--:propForm="propForm"-->
20
+      <!--:visibility="isVisibility"-->
21
+      <!--v-on:dialog-comfirm="comfirm"-->
22
+      <!--v-on:dialog-cancle="cancle"-->
23
+    <!--&gt;</stock-in-dialog>-->
24
+
25
+    <drugs-stock-dialog
26
+      ref="dialog"
27
+      :propForm="propForm"
28
+      :visibility="isVisibility"
29
+      v-on:dialog-comfirm="comfirm"
30
+      v-on:dialog-cancle="cancle"
31
+    ></drugs-stock-dialog>
32
+
33
+    <div class="cell clearfix">
34
+            <label class="title"><span class="name">退货时间</span> : </label>
35
+            <el-date-picker size="small" v-model="return_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
36
+                            type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
37
+                            value-format="yyyy-MM-dd"></el-date-picker>
38
+    </div>
39
+
40
+
41
+    <div class="cell clearfix">
42
+      <label class="title"><span class="name">经销商</span> : </label>
43
+      <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
44
+        <el-option
45
+          v-for="(option, index) in dealer"
46
+          :key="index"
47
+          :label="option.dealer_name"
48
+          :value="option.id">
49
+        </el-option>
50
+      </el-select>
51
+    </div>
52
+
53
+
54
+    <div class="cell clearfix">
55
+      <label class="title"><span class="name">厂商</span> : </label>
56
+
57
+      <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商" @change="changeManufacturer">
58
+        <el-option
59
+          v-for="(option, index) in manufacturer"
60
+          :key="index"
61
+          :label="option.manufacturer_name"
62
+          :value="option.id">
63
+        </el-option>
64
+      </el-select>
65
+    </div>
66
+
67
+
68
+
69
+
70
+    <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
71
+          <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
72
+                    max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
73
+          >
74
+
75
+
76
+
77
+            <el-table-column align="center" width="200">
78
+              <template slot="header" slot-scope="scope">
79
+                <span>药品名称<span style="color: red">*</span></span>
80
+              </template>
81
+
82
+              <template slot-scope="scope">
83
+                <el-form-item style="padding-top: 15px">
84
+                  <el-input
85
+                    placeholder="请输入药品名称"
86
+                    v-model="scope.row.drug_id"
87
+                    :value="typeName(scope.row.drug_id)"
88
+                    @focus="showDialog(scope.$index, scope.row)"
89
+                  ></el-input>
90
+                </el-form-item>
91
+              </template>
92
+            </el-table-column>
93
+            <el-table-column align="center" width="200">
94
+              <template slot="header" slot-scope="scope">
95
+                <span>规格名称<span style="color: red">*</span></span>
96
+              </template>
97
+              <template slot-scope="scope">
98
+                <el-form-item style="padding-top: 15px">
99
+                  <el-input
100
+                    placeholder="请输入规格名称"
101
+                    v-model="scope.row.drug_id"
102
+                    :value="specificationName(scope.row.drug_id)"
103
+                    @focus="showDialog(scope.$index, scope.row)"
104
+                  ></el-input>
105
+                </el-form-item>
106
+              </template>
107
+            </el-table-column>
108
+
109
+
110
+            <el-table-column min-width="23" align="center">
111
+              <template slot="header" slot-scope="scope">
112
+                <span>退货数量<span style="color: red">*</span></span>
113
+              </template>
114
+              <template slot-scope="scope">
115
+                <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
116
+                              style="padding-top: 17px">
117
+                  <el-input  placeholder="请输入退货数量" type="number" v-model="scope.row.count"></el-input>
118
+                </el-form-item>
119
+              </template>
120
+            </el-table-column>
121
+
122
+            <el-table-column label="操作" align="center" min-width="20">
123
+              <template slot-scope="scope">
124
+                <el-tooltip class="item" effect="dark" content="新增" placement="top">
125
+
126
+                  <el-button
127
+                    size="mini"
128
+                    type="primary"
129
+                    icon="el-icon-circle-plus-outline"
130
+                    @click="handleEdit(scope.$index, scope.row)">
131
+                  </el-button>
132
+                </el-tooltip>
133
+                <el-tooltip class="item" effect="dark" content="删除" placement="top">
134
+
135
+                  <el-button
136
+                    size="mini"
137
+                    type="danger"
138
+                    icon="el-icon-delete"
139
+                    @click="handleDelete(scope.$index, scope.row)">
140
+                  </el-button>
141
+                </el-tooltip>
142
+
143
+              </template>
144
+            </el-table-column>
145
+
146
+
147
+          </el-table>
148
+        </el-form>
149
+  </div>
150
+  </div>
151
+
152
+</template>
153
+
154
+<script>
155
+  import { uParseTime } from '@/utils/tools'
156
+
157
+  import {
158
+    GetAllConfig,
159
+    deleteDrugSalesReturnInfo,
160
+    getDrugReturnList,
161
+    getDrugSalesReturnConfig,
162
+    editDrugSalesReturnInfo,
163
+    GetAllDrugInfoByID
164
+  } from '@/api/drug/drug_stock'
165
+  import BreadCrumb from '../../components/bread-crumb'
166
+  // import StockInDialog from './Dialog/stockInDialog'
167
+  import DrugsStockDialog from './drugsStockDialog/index'
168
+
169
+  export default {
170
+    components: { DrugsStockDialog, BreadCrumb },
171
+    name: 'salesReturnEdit',
172
+
173
+    data() {
174
+      return {
175
+        crumbs: [
176
+          { path: false, name: '库存管理' },
177
+          { path: '/stock/return', name: '退货单' },
178
+          { path: '/stock/in/detail', name: '编辑退货单' }
179
+        ],
180
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
181
+        warehousing_time: '',
182
+        adminUserOptions: null,
183
+        currentIndex: 0,
184
+        return_time: '',
185
+        recordInfo: {
186
+          recordData: [],
187
+          stock_in_code: '',
188
+          current_index: ''
189
+
190
+        },
191
+        tableRules: {
192
+          count: [
193
+            { required: true, message: '数量不能为空', trigge: 'blur' }
194
+          ]
195
+
196
+        },
197
+
198
+
199
+        // prop
200
+        isVisibility: false,
201
+        propForm: {
202
+          goods:[],
203
+          goodType: [],
204
+          goodInfo: [],
205
+          goodUnit: [],
206
+          title: '入库',
207
+          manufacturer:0,
208
+          dealer:0,
209
+        },
210
+
211
+        form: {
212
+          manufacturer: 0,
213
+          dealer: 0,
214
+        },
215
+        warehouseInfoList:[],
216
+        salesReturn: {},
217
+        manufacturer: [],
218
+        dealer: [],
219
+        goodType: [],
220
+        goodInfo:[]
221
+      }
222
+    },
223
+    methods: {
224
+      comfirm: function(val) {
225
+        this.$refs.dialog.hide()
226
+        if (val.selectedGoodInfo.length > 0) {
227
+          for (let i = val.selectedGoodInfo.length -1; i >= 0 ; i--) {
228
+            if (i == 0) {
229
+              this.recordInfo.recordData[this.currentIndex].drug_id = val.selectedGoodInfo[i].id
230
+            } else {
231
+              const tempForm = {}
232
+              tempForm['id'] = 0
233
+              tempForm['drug_id'] = val.selectedGoodInfo[i].id
234
+              tempForm['return_count'] = ''
235
+              tempForm['price'] = ''
236
+              this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
237
+            }
238
+          }
239
+        }
240
+        this.propForm.goodType = []
241
+        this.currentIndex = -1
242
+      }, cancle: function() {
243
+        this.$refs.dialog.hide()
244
+
245
+      },
246
+      GetConfigInfo: function() {
247
+        const loading = this.$loading({
248
+          lock: true,
249
+          text: "Loading",
250
+          spinner: "el-icon-loading",
251
+          background: "rgba(0, 0, 0, 0.7)"
252
+        });
253
+        GetAllConfig().then(response => {
254
+          if (response.data.state == 0) {
255
+            this.$message.error(response.data.msg);
256
+            return false;
257
+          } else {
258
+            this.manufacturer = response.data.data.manufacturer;
259
+            this.dealer = response.data.data.dealer;
260
+            for(let i = 0; i<  response.data.data.drugs.length;i++){
261
+              this.goodType.push(response.data.data.drugs[i])
262
+              if(response.data.data.drugs[i].drug_specs != null) {
263
+                for (let b = 0; b < response.data.data.drugs[i].drug_specs.length; b++) {
264
+                  this.goodInfo.push(response.data.data.drugs[i].drug_specs[b])
265
+                }
266
+              }
267
+            }
268
+            this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
269
+            this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
270
+          }
271
+          loading.close();
272
+        });
273
+      },
274
+      typeName: function(drug_id) {
275
+        let name = "";
276
+        for (let i = 0; i < this.goodInfo.length; i++) {
277
+          if (this.goodInfo[i].id == drug_id) {
278
+            name = this.goodInfo[i].drug_name;
279
+
280
+          }
281
+        }
282
+        return name;
283
+      },
284
+      specificationName: function(drug_id) {
285
+        console.log(this.goodInfo)
286
+        let name = "";
287
+        for (let i = 0; i < this.goodInfo.length; i++) {
288
+          if (this.goodInfo[i].id == drug_id) {
289
+            name = this.goodInfo[i].drug_spec;
290
+          }
291
+        }
292
+        return name;
293
+      }, handleEdit: function(index, row) {
294
+        const tempObj = {}
295
+        tempObj['id'] = 0
296
+        tempObj['drug_id'] = 0
297
+        tempObj['count'] = ''
298
+        this.recordInfo.recordData.push(tempObj)
299
+      }, handleDelete: function(index, row) {
300
+        console.log(row.id)
301
+        if (row.id == undefined || row.id == 0) {
302
+          this.recordInfo.recordData.splice(index, 1)
303
+        } else {
304
+          const params = {
305
+            id: row.id
306
+          }
307
+          this.$confirm('确认删除该退货商品信息记录?', '删除退货商品信息记录', {
308
+            confirmButtonText: '确定',
309
+            cancelButtonText: '取消',
310
+            type: 'warning'
311
+          }).then(() => {
312
+            deleteDrugSalesReturnInfo(params).then(response => {
313
+              if (response.data.state == 0) {
314
+                this.$message.error(response.data.msg)
315
+                return false
316
+              } else {
317
+                this.$message.success('删除成功')
318
+                this.recordInfo.recordData.splice(index, 1)
319
+              }
320
+            })
321
+          }).catch(() => {
322
+          })
323
+        }
324
+      }, getTime(val, temp) {
325
+        if (val != 0) {
326
+          return uParseTime(val, temp)
327
+        } else {
328
+          return ''
329
+        }
330
+      },
331
+      showDialog(index, row) {
332
+        this.currentIndex = index;
333
+        const loading = this.$loading({
334
+          lock: true,
335
+          text: "Loading",
336
+          spinner: "el-icon-loading",
337
+          background: "rgba(0, 0, 0, 0.7)"
338
+        });
339
+
340
+        const params = {
341
+          manufacturer_id: this.form.manufacturer,
342
+          dealer_id: this.form.dealer
343
+        };
344
+        GetAllDrugInfoByID(params).then(response => {
345
+          if (response.data.state == 0) {
346
+            this.$message.error(response.data.msg);
347
+            return false;
348
+          } else {
349
+            if (response.data.data.drugs.length <= 0) {
350
+              this.$message.error("该厂商或经销商没有药品信息");
351
+              return;
352
+            }
353
+            this.$refs.dialog.show();
354
+            for (let i = 0; i < response.data.data.drugs.length; i++) {
355
+              this.propForm.goods.push(
356
+                response.data.data.drugs[i]
357
+              );
358
+            }
359
+            const obj = {};
360
+            this.propForm.goods = this.propForm.goods.reduce(
361
+              (cur, next) => {
362
+                obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
363
+                return cur;
364
+              },
365
+              []
366
+            ); // 设置cur默认类型为数组,并且初始值为空的数组
367
+          }
368
+
369
+
370
+          for (let i = 0; i < this.propForm.goods.length; i++) {
371
+            for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
372
+              var respObj = this.propForm.goods[i].drug_specs[a];
373
+              respObj["isSelected"] = false;
374
+            }
375
+          }
376
+          loading.close();
377
+        });
378
+      },
379
+      back() {
380
+        this.$router.go(-1)
381
+      }, submit() {
382
+        this.$refs['tableForm'].validate((valid) => {
383
+          if (valid) {
384
+            const array = this.recordInfo.recordData
385
+            for (let i = 0; i < array.length; i++) {
386
+
387
+              if (array[i].drug_id == 0) {
388
+                this.$message.error('药品名称或者药品规格名称不能为空')
389
+                return
390
+              }
391
+            }
392
+
393
+            const params = {
394
+              'salesReturn': this.recordInfo.recordData
395
+            }
396
+            editDrugSalesReturnInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer).then(response => {
397
+              if (response.data.state == 0) {
398
+                this.$message.error(response.data.msg)
399
+                return false
400
+              } else {
401
+                this.$message.success('退货成功')
402
+
403
+                this.$router.back(-1)
404
+              }
405
+            })
406
+          } else {
407
+            return false
408
+          }
409
+        })
410
+      }, GetOrderDetail: function(order_id) {
411
+        const params = {
412
+          'id': order_id
413
+        }
414
+        getDrugReturnList(params).then(response => {
415
+          if (response.data.state == 0) {
416
+            this.$message.error(response.data.msg)
417
+            return false
418
+          } else {
419
+            for (let i = 0; i < response.data.data.list.length; i++) {
420
+              response.data.data.list[i].count = response.data.data.list[i].count.toString()
421
+              this.recordInfo.recordData.push(response.data.data.list[i])
422
+            }
423
+            this.salesReturn = response.data.data.salesReturn
424
+            this.return_time = this.getTime(this.salesReturn.return_time, '{y}-{m}-{d}')
425
+            this.form.manufacturer = this.salesReturn.manufacturer
426
+            this.form.dealer = this.salesReturn.dealer
427
+          }
428
+
429
+          if (this.recordInfo.recordData.length == 0) {
430
+            const tempObj = {}
431
+            tempObj['id'] = 0
432
+            tempObj['drug_id'] = 0
433
+            tempObj['count'] = ''
434
+            this.recordInfo.recordData.push(tempObj)
435
+          }
436
+        })
437
+      },changeManufacturer(val) {
438
+        this.propForm.manufacturer = val
439
+        console.log(val)
440
+      },changeDealer(val){
441
+        this.propForm.dealer = val
442
+        console.log(val)
443
+      }
444
+    },
445
+    created() {
446
+      this.GetConfigInfo()
447
+      this.propForm.goodUnit = this.$store.getters.good_unit
448
+      const order_id = this.$route.query.id
449
+      this.GetOrderDetail(order_id)
450
+    }
451
+
452
+  }
453
+</script>
454
+
455
+<style rel="stylesheet/css" lang="scss" scoped>
456
+  .information {
457
+    border: 1px #dcdfe6 solid;
458
+    padding: 30px 20px 30px 20px;
459
+
460
+  .border {
461
+    border-bottom: 1px #dcdfe6 solid;
462
+    margin: 0px 0 20px 0;
463
+  }
464
+
465
+  }
466
+
467
+
468
+
469
+  .edit_separater {
470
+    border-top: 1px solid rgb(233, 233, 233);
471
+    margin-top: 15px;
472
+    margin-bottom: 15px;
473
+  }
474
+
475
+</style>
476
+
477
+<style>
478
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
479
+    font-size: 12px;
480
+  }
481
+
482
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
483
+    background: #6fb5fa;
484
+  }
485
+
486
+</style>

+ 533 - 0
src/xt_pages/stock/drugs/drugSalesReturnOrder.vue Vedi File

@@ -0,0 +1,533 @@
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="AddNewOrder"
8
+        class="filter-item"
9
+        style="float:right;"
10
+        type="primary"
11
+        icon="el-icon-circle-plus-outline"
12
+        >新增
13
+      </el-button>
14
+    </div>
15
+
16
+    <div class="app-container">
17
+      <div class="cell clearfix">
18
+        <el-input
19
+          style="width: 400px;"
20
+          class="filter-item"
21
+          v-model.trim="searchKey"
22
+          placeholder="单据编码/制单人/厂商"
23
+        />
24
+        <el-button
25
+          class="filter-item"
26
+          type="primary"
27
+          icon="el-icon-search"
28
+          @click="search"
29
+          >搜索</el-button
30
+        >
31
+      </div>
32
+
33
+      <div class="cell clearfix">
34
+        <label class="title"><span class="name">退货时间</span> : </label>
35
+        <el-date-picker
36
+          size="small"
37
+          v-model="start_time"
38
+          prefix-icon="el-icon-date"
39
+          :editable="false"
40
+          style="width: 196px;"
41
+          type="date"
42
+          placeholder="选择日期时间"
43
+          align="right"
44
+          format="yyyy-MM-dd"
45
+          value-format="yyyy-MM-dd"
46
+          @change="startTimeChange"
47
+        ></el-date-picker>
48
+        <span class="cellLine"> - </span>
49
+        <el-date-picker
50
+          size="small"
51
+          v-model="end_time"
52
+          prefix-icon="el-icon-date"
53
+          :editable="false"
54
+          style="width: 196px;"
55
+          type="date"
56
+          placeholder="选择日期时间"
57
+          align="right"
58
+          format="yyyy-MM-dd"
59
+          value-format="yyyy-MM-dd"
60
+          @change="endTimeChange"
61
+        ></el-date-picker>
62
+      </div>
63
+
64
+      <div class="cell clearfix" style="margin-top: 10px">
65
+        <el-checkbox
66
+          style="width: 70px"
67
+          v-model="checked"
68
+          @change="changeAllSelected"
69
+          >全选</el-checkbox
70
+        >
71
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
72
+          >删除</el-button
73
+        >
74
+      </div>
75
+
76
+      <el-table
77
+        :data="saleReturnDate"
78
+        :class="signAndWeighBoxPatients"
79
+        style="width: 100%"
80
+        border
81
+        highlight-current-row
82
+        ref="multipleTable"
83
+        @selection-change="select"
84
+        :row-style="{ color: '#303133' }"
85
+        :header-cell-style="{
86
+          backgroundColor: 'rgb(245, 247, 250)',
87
+          color: '#606266'
88
+        }"
89
+      >
90
+        <el-table-column type="selection" width="55"> </el-table-column>
91
+
92
+        <el-table-column label="单据日期" align="center">
93
+          <template slot-scope="scope">
94
+            {{ scope.row.opera_time | parseTime("{y}-{m}-{d}") }}
95
+          </template>
96
+        </el-table-column>
97
+
98
+        <el-table-column label="单据编号" align="center">
99
+          <template slot-scope="scope">
100
+            {{ scope.row.order_number }}
101
+          </template>
102
+        </el-table-column>
103
+
104
+        <el-table-column label="制单人" align="center">
105
+          <template slot-scope="scope">
106
+            {{ getXuserName(scope.row.creater) }}
107
+          </template>
108
+        </el-table-column>
109
+        <el-table-column label="厂家" align="center">
110
+          <template slot-scope="scope">
111
+            {{scope.row.manufacturers ? scope.row.manufacturers.manufacturer_name:''}}
112
+          </template>
113
+        </el-table-column>
114
+
115
+        <el-table-column label="经销商" align="center">
116
+          <template slot-scope="scope">
117
+            {{scope.row.dealers ? scope.row.dealers.dealer_name:''}}
118
+          </template>
119
+        </el-table-column>
120
+
121
+        <el-table-column label="操作" align="center">
122
+          <template slot-scope="scope">
123
+            <el-tooltip
124
+              class="item"
125
+              effect="dark"
126
+              content="编辑"
127
+              placement="top"
128
+            >
129
+              <el-button
130
+                size="mini"
131
+                type="primary"
132
+                icon="el-icon-edit-outline"
133
+                @click="handleEdit(scope.$index, scope.row)"
134
+              >
135
+              </el-button>
136
+            </el-tooltip>
137
+            <el-tooltip
138
+              class="item"
139
+              effect="dark"
140
+              content="删除"
141
+              placement="top"
142
+            >
143
+              <el-button
144
+                size="mini"
145
+                type="danger"
146
+                icon="el-icon-delete"
147
+                @click="handleDelete(scope.$index, scope.row)"
148
+              >
149
+              </el-button>
150
+            </el-tooltip>
151
+          </template>
152
+        </el-table-column>
153
+      </el-table>
154
+
155
+      <el-pagination
156
+        @size-change="handleSizeChange"
157
+        @current-change="handleCurrentChange"
158
+        :page-sizes="[10, 50, 100]"
159
+        :page-size="10"
160
+        background
161
+        style="margin-top:20px;float: right"
162
+        layout="total, sizes, prev, pager, next, jumper"
163
+        :total="total"
164
+      >
165
+      </el-pagination>
166
+    </div>
167
+  </div>
168
+</template>
169
+
170
+<script>
171
+import { uParseTime } from "@/utils/tools";
172
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
173
+import {
174
+  deleteDrugSalesReturn,
175
+  GetAllConfig,
176
+  getDrugSalesReturnList,
177
+  getDrugWarehouseInfoList,
178
+  getDrugWarehouseList
179
+} from "@/api/drug/drug_stock";
180
+import BreadCrumb from "../../components/bread-crumb";
181
+
182
+export default {
183
+  name: "salesReturnOrder",
184
+  components: { BreadCrumb },
185
+  created() {
186
+    var nowDate = new Date();
187
+    var nowYear = nowDate.getFullYear();
188
+    var nowMonth = nowDate.getMonth() + 1;
189
+    var nowDay = nowDate.getDate();
190
+    this.end_time =
191
+      nowYear +
192
+      "-" +
193
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
194
+      "-" +
195
+      (nowDay < 10 ? "0" + nowDay : nowDay);
196
+    nowDate.setMonth(nowDate.getMonth() - 1);
197
+    nowYear = nowDate.getFullYear();
198
+    nowMonth = nowDate.getMonth() + 1;
199
+    nowDay = nowDate.getDate();
200
+    this.start_time =
201
+      nowYear +
202
+      "-" +
203
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
204
+      "-" +
205
+      (nowDay < 10 ? "0" + nowDay : nowDay);
206
+
207
+    this.GetSalesReturn();
208
+    this.GetConfigInfo();
209
+    this.fetchAllAdminUsers();
210
+  },
211
+  data() {
212
+    return {
213
+      searchKey: "",
214
+      crumbs: [
215
+        { path: false, name: "库存管理" },
216
+        { path: false, name: "退货单" }
217
+      ],
218
+      type: 1,
219
+      page: 1,
220
+      limit: 10,
221
+      checked: false,
222
+      total: 0,
223
+      pageTotal: 0,
224
+      pageSelect: 0,
225
+      adminUserOptions: [],
226
+      multipleSelection: [],
227
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
228
+      start_time: "",
229
+      saleReturnDate: [],
230
+      end_time: "",
231
+      goodType: [],
232
+      goodInfo: [],
233
+      manufacturer: [],
234
+      selectedTableData: [],
235
+      dealer: []
236
+    };
237
+  },
238
+  methods: {
239
+    search: function() {
240
+      const Params = {
241
+        page: this.page,
242
+        limit: this.limit,
243
+        start_time: this.start_time,
244
+        end_time: this.end_time,
245
+        type: this.type,
246
+        keywords: this.searchKey
247
+      };
248
+      this.saleReturnDate = [];
249
+      getDrugSalesReturnList(Params).then(response => {
250
+        if (response.data.state == 0) {
251
+          this.$message.error(response.data.msg);
252
+          return false;
253
+        } else {
254
+          this.total = response.data.data.total;
255
+          for (let i = 0; i < response.data.data.list.length; i++) {
256
+            this.saleReturnDate.push(response.data.data.list[i]);
257
+          }
258
+        }
259
+      });
260
+    },
261
+    AddNewOrder: function() {
262
+      this.$router.push({
263
+        name: "salesReturnOrderAdd",
264
+        query: { type: this.type }
265
+      });
266
+    },
267
+    GetSalesReturn: function() {
268
+      const Params = {
269
+        page: this.page,
270
+        limit: this.limit,
271
+        start_time: this.start_time,
272
+        end_time: this.end_time,
273
+        type: this.type
274
+      };
275
+      this.saleReturnDate = [];
276
+      getDrugSalesReturnList(Params).then(response => {
277
+        if (response.data.state == 0) {
278
+          this.$message.error(response.data.msg);
279
+          return false;
280
+        } else {
281
+          this.total = response.data.data.total;
282
+          for (let i = 0; i < response.data.data.list.length; i++) {
283
+            this.saleReturnDate.push(response.data.data.list[i]);
284
+          }
285
+        }
286
+      });
287
+    },
288
+    getXuserName(id) {
289
+      if (id <= 0) {
290
+        return "";
291
+      }
292
+      var name = "";
293
+      if (
294
+        this.adminUserOptions == null ||
295
+        typeof this.adminUserOptions.length === "undefined"
296
+      ) {
297
+        return name;
298
+      }
299
+      var leng = this.adminUserOptions.length;
300
+      if (leng == 0) {
301
+        return name;
302
+      }
303
+      for (let index = 0; index < leng; index++) {
304
+        if (this.adminUserOptions[index].id == id) {
305
+          name = this.adminUserOptions[index].name;
306
+          break;
307
+        }
308
+      }
309
+      return name;
310
+    },
311
+    fetchAllAdminUsers() {
312
+      fetchAllAdminUsers().then(response => {
313
+        console.log(response);
314
+        if (response.data.state == 1) {
315
+          this.adminUserOptions = response.data.data.users;
316
+          var alen = this.adminUserOptions.length;
317
+          for (let index = 0; index < alen; index++) {
318
+            if (this.adminUserOptions[index].user_type == 2) {
319
+              // this.doctorOptions.push(this.adminUserOptions[index]);
320
+            }
321
+          }
322
+        }
323
+      });
324
+    },
325
+    handleSelectionChange: function(val) {
326
+      this.multipleSelection = val;
327
+    },
328
+    handleSizeChange(val) {
329
+      this.limit = val;
330
+      this.GetSalesReturn();
331
+    },
332
+    handleCurrentChange(val) {
333
+      this.page = val;
334
+      this.GetSalesReturn();
335
+    },
336
+    startTimeChange(val) {
337
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
338
+      if (time > 0) {
339
+        this.$message.error("结束时间不能小于开始时间");
340
+        this.start_time = "";
341
+      } else {
342
+        this.GetSalesReturn();
343
+      }
344
+      this.GetSalesReturn();
345
+    },
346
+    endTimeChange(val) {
347
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
348
+      if (time < 0) {
349
+        this.$message.error("结束时间不能小于开始时间");
350
+        this.end_time = "";
351
+      } else {
352
+        this.GetWarehouse();
353
+      }
354
+      this.GetSalesReturn();
355
+    },
356
+    getTimestamp(time) {
357
+      // 把时间日期转成时间戳
358
+      return new Date(time).getTime() / 1000;
359
+    },
360
+    calculate: function(val) {
361
+      return Math.round(parseFloat(val) * 100) / 100;
362
+    },
363
+    GetConfigInfo: function() {
364
+      GetAllConfig().then(response => {
365
+        if (response.data.state == 0) {
366
+          this.$message.error(response.data.msg);
367
+          return false;
368
+        } else {
369
+          this.manufacturer = response.data.data.manufacturer;
370
+          this.dealer = response.data.data.dealer;
371
+        }
372
+      });
373
+    },
374
+    getManufactuerName: function(manufacturer_id) {
375
+      for (let i = 0; i < this.manufacturer.length; i++) {
376
+        if (this.manufacturer[i].id == manufacturer_id) {
377
+          return this.manufacturer[i].manufacturer_name;
378
+        }
379
+      }
380
+    },
381
+    getDealerName: function(dealer_id) {
382
+      for (let i = 0; i < this.dealer.length; i++) {
383
+        if (this.dealer[i].id == dealer_id) {
384
+          return this.dealer[i].dealer_name;
385
+        }
386
+      }
387
+    },
388
+    handleEdit: function(index, row) {
389
+      this.$router.push({
390
+        name: "salesReturnDetail",
391
+        query: { id: row.id, type: this.type }
392
+      });
393
+    },
394
+    handleDelete: function(index, row) {
395
+      const ids = [];
396
+      ids.push(row.id);
397
+      const idStr = ids.join(",");
398
+
399
+      const params = {
400
+        ids: idStr
401
+      };
402
+
403
+      this.$confirm("确认删除退货单记录?", "删除退货单记录", {
404
+        confirmButtonText: "确定",
405
+        cancelButtonText: "取消",
406
+        type: "warning"
407
+      })
408
+        .then(() => {
409
+          deleteDrugSalesReturn(params).then(response => {
410
+            if (response.data.state == 0) {
411
+              this.$message.error(response.data.msg);
412
+              return false;
413
+            } else {
414
+              this.$notify({
415
+                title: "成功",
416
+                message: "删除成功",
417
+                type: "success",
418
+                duration: 2000
419
+              });
420
+              for (let i = 0; i < ids.length; i++) {
421
+                for (let y = 0; y < this.saleReturnDate.length; y++) {
422
+                  if (ids[i] == this.saleReturnDate[y].id) {
423
+                    this.saleReturnDate.splice(y, 1);
424
+                  }
425
+                }
426
+              }
427
+            }
428
+          });
429
+        })
430
+        .catch(() => {});
431
+    },
432
+    changeAllSelected: function(val) {
433
+      if (val) {
434
+        this.$refs.multipleTable.toggleAllSelection();
435
+      } else {
436
+        this.$refs.multipleTable.clearSelection();
437
+      }
438
+    },
439
+    select(selection) {
440
+      this.selectedTableData = selection;
441
+    },
442
+    batchDelete() {
443
+      if (this.selectedTableData.length <= 0) {
444
+        this.$message.error("请选择要删除的记录");
445
+        return;
446
+      }
447
+      const ids = [];
448
+      for (let i = 0; i < this.selectedTableData.length; i++) {
449
+        ids.push(this.selectedTableData[i].id);
450
+      }
451
+      const idStr = ids.join(",");
452
+      const params = {
453
+        ids: idStr
454
+      };
455
+      this.$confirm("确认删除退货单记录?", "删除退货单记录", {
456
+        confirmButtonText: "确定",
457
+        cancelButtonText: "取消",
458
+        type: "warning"
459
+      })
460
+        .then(() => {
461
+          deleteDrugSalesReturn(params).then(response => {
462
+            if (response.data.state == 0) {
463
+              this.$message.error(response.data.msg);
464
+              return false;
465
+            } else {
466
+              this.$notify({
467
+                title: "成功",
468
+                message: "删除成功",
469
+                type: "success",
470
+                duration: 2000
471
+              });
472
+
473
+              for (let i = 0; i < ids.length; i++) {
474
+                for (let y = 0; y < this.saleReturnDate.length; y++) {
475
+                  if (ids[i] == this.saleReturnDate[y].id) {
476
+                    this.saleReturnDate.splice(y, 1);
477
+                  }
478
+                }
479
+              }
480
+            }
481
+          });
482
+        })
483
+        .catch(() => {});
484
+    }
485
+  }
486
+};
487
+</script>
488
+
489
+<style rel="stylesheet/css" lang="scss" scoped>
490
+.information {
491
+  border: 1px #dcdfe6 solid;
492
+  padding: 30px 20px 30px 20px;
493
+
494
+  .border {
495
+    border-bottom: 1px #dcdfe6 solid;
496
+    margin: 0px 0 20px 0;
497
+  }
498
+}
499
+
500
+.edit_separater {
501
+  border-top: 1px solid rgb(233, 233, 233);
502
+  margin-top: 15px;
503
+  margin-bottom: 15px;
504
+}
505
+.cell {
506
+  text-align: center;
507
+}
508
+</style>
509
+
510
+<style>
511
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
512
+  font-size: 12px;
513
+}
514
+
515
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
516
+  background: #6fb5fa;
517
+}
518
+
519
+.count {
520
+  color: #bd2c00;
521
+}
522
+.el-table td,
523
+.el-table th.is-leaf,
524
+.el-table--border,
525
+.el-table--group {
526
+  border-color: #d0d3da;
527
+}
528
+.el-table--border::after,
529
+.el-table--group::after,
530
+.el-table::before {
531
+  background-color: #d0d3da;
532
+}
533
+</style>

+ 452 - 0
src/xt_pages/stock/drugs/drugSalesReturnOrderAdd.vue Vedi File

@@ -0,0 +1,452 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
6
+
7
+
8
+      <div style="float:right;">
9
+        <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
10
+        <el-button size="small" type="primary" @click="submit()" class="filter-item">保 存</el-button>
11
+      </div>
12
+    </div>
13
+
14
+    <div class="app-container">
15
+      <!--<stock-in-dialog-->
16
+        <!--ref="dialog" :propForm="propForm"-->
17
+        <!--:visibility="isVisibility"-->
18
+        <!--v-on:dialog-comfirm="comfirm"-->
19
+        <!--v-on:dialog-cancle="cancle"-->
20
+      <!--&gt;</stock-in-dialog>-->
21
+      <drugs-stock-dialog
22
+        ref="dialog" :propForm="propForm"
23
+        :visibility="isVisibility"
24
+        v-on:dialog-comfirm="comfirm"
25
+        v-on:dialog-cancle="cancle"
26
+      ></drugs-stock-dialog>
27
+      <div class="cell clearfix">
28
+        <label class="title"><span class="name">退货时间</span> : </label>
29
+        <el-date-picker size="small" v-model="return_time" prefix-icon="el-icon-date" :editable="false"
30
+                        style="width: 196px;"
31
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
32
+                        value-format="yyyy-MM-dd"></el-date-picker>
33
+      </div>
34
+
35
+      <div class="cell clearfix">
36
+        <label class="title"><span class="name">经销商</span> : </label>
37
+        <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
38
+          <el-option
39
+            v-for="(option, index) in dealer"
40
+            :key="index"
41
+            :label="option.dealer_name"
42
+            :value="option.id">
43
+          </el-option>
44
+        </el-select>
45
+      </div>
46
+
47
+      <div class="cell clearfix">
48
+        <label class="title"><span class="name">厂商</span> : </label>
49
+
50
+        <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商" @change="changeManufacturer">
51
+          <el-option
52
+            v-for="(option, index) in manufacturer"
53
+            :key="index"
54
+            :label="option.manufacturer_name"
55
+            :value="option.id">
56
+          </el-option>
57
+        </el-select>
58
+      </div>
59
+
60
+
61
+      <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
62
+        <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
63
+                  max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
64
+        >
65
+
66
+
67
+          <el-table-column align="center" width="200">
68
+            <template slot="header" slot-scope="scope">
69
+              <span>药品名称<span style="color: red">*</span></span>
70
+            </template>
71
+
72
+            <template slot-scope="scope">
73
+              <el-form-item style="padding-top: 15px">
74
+                <el-input
75
+                  placeholder="请输入药品名称"
76
+                  v-model="scope.row.drug_id"
77
+                  :value="typeName(scope.row.drug_id)"
78
+                  @focus="showDialog(scope.$index, scope.row)"
79
+                ></el-input>
80
+              </el-form-item>
81
+            </template>
82
+          </el-table-column>
83
+          <el-table-column align="center" width="200">
84
+            <template slot="header" slot-scope="scope">
85
+              <span>规格名称<span style="color: red">*</span></span>
86
+            </template>
87
+            <template slot-scope="scope">
88
+              <el-form-item style="padding-top: 15px">
89
+                <el-input
90
+                  placeholder="请输入规格名称"
91
+                  v-model="scope.row.drug_id"
92
+                  :value="specificationName(scope.row.drug_id)"
93
+                  @focus="showDialog(scope.$index, scope.row)"
94
+                ></el-input>
95
+              </el-form-item>
96
+            </template>
97
+          </el-table-column>
98
+
99
+          <el-table-column min-width="23" align="center">
100
+            <template slot="header" slot-scope="scope">
101
+              <span>退货数量<span style="color: red">*</span></span>
102
+            </template>
103
+            <template slot-scope="scope">
104
+              <el-form-item :prop="'recordData.' + scope.$index + '.return_count'" :rules='tableRules.return_count'
105
+                            style="padding-top: 17px">
106
+                <el-input placeholder="请输入退货数量" type="number" v-model="scope.row.return_count"></el-input>
107
+              </el-form-item>
108
+            </template>
109
+          </el-table-column>
110
+
111
+          <el-table-column label="操作" align="center" min-width="20">
112
+            <template slot-scope="scope">
113
+              <el-tooltip class="item" effect="dark" content="新增" placement="top">
114
+
115
+                <el-button
116
+                  size="mini"
117
+                  type="primary"
118
+                  icon="el-icon-circle-plus-outline"
119
+                  @click="handleEdit(scope.$index, scope.row)">
120
+                </el-button>
121
+              </el-tooltip>
122
+              <el-tooltip class="item" effect="dark" content="删除" placement="top">
123
+
124
+                <el-button
125
+                  size="mini"
126
+                  type="danger"
127
+                  icon="el-icon-delete"
128
+                  @click="handleDelete(scope.$index, scope.row)">
129
+                </el-button>
130
+              </el-tooltip>
131
+
132
+            </template>
133
+          </el-table-column>
134
+
135
+
136
+        </el-table>
137
+      </el-form>
138
+
139
+    </div>
140
+  </div>
141
+
142
+</template>
143
+
144
+<script>
145
+  import { uParseTime } from '@/utils/tools'
146
+  import { getDrugSalesReturnConfig, postDrugSalesReturn,GetAllDrugInfoByID,GetAllConfig } from '@/api/drug/drug_stock'
147
+  import BreadCrumb from '../../components/bread-crumb'
148
+  import DrugsStockDialog from './drugsStockDialog/index'
149
+
150
+  export default {
151
+    components: { DrugsStockDialog, BreadCrumb },
152
+    name: 'salesReturnOrderAdd',
153
+
154
+    data() {
155
+      return {
156
+        crumbs: [
157
+          { path: false, name: '库存管理' },
158
+          { path: false, name: '耗材退货单' },
159
+          { path: false, name: '新增退货单' }
160
+        ],
161
+        crumbs2: [
162
+          { path: false, name: '库存管理' },
163
+          { path: false, name: '其他退货单' },
164
+          { path: false, name: '新增退货单' }
165
+        ],
166
+
167
+        type: this.$route.query.type,
168
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
169
+        return_time: '',
170
+        currentIndex: 0,
171
+        recordInfo: {
172
+          recordData: []
173
+        },
174
+        tableRules: {
175
+          price: [
176
+            { required: true, message: '单价不能为空', trigger: 'blur' }
177
+          ],
178
+          return_count: [
179
+            { required: true, message: '数量不能为空', trigge: 'blur' }
180
+          ]
181
+        },
182
+
183
+        // prop
184
+        isVisibility: false,
185
+        propForm: {
186
+          goods:[],
187
+          goodType: [],
188
+          goodInfo: [],
189
+          goodUnit: [],
190
+          manufacturer: 0,
191
+          dealer: 0
192
+        },
193
+        form: {
194
+          manufacturer: 0,
195
+          dealer: 0
196
+        },
197
+        warehouseInfoList: [],
198
+        manufacturer: [],
199
+        dealer: [],
200
+        goodType: [],
201
+        goodInfo:[]
202
+
203
+      }
204
+    },
205
+    methods: {
206
+      comfirm: function(val) {
207
+        this.$refs.dialog.hide()
208
+        if (val.selectedGoodInfo.length > 0) {
209
+          for (let i = val.selectedGoodInfo.length -1; i >= 0 ; i--) {
210
+              if (i == 0) {
211
+                this.recordInfo.recordData[this.currentIndex].good_type_id = val.selectedGoodInfo[i].good_type_id
212
+                this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
213
+              } else {
214
+                const tempForm = {}
215
+                tempForm['drug_id'] = val.selectedGoodInfo[i].id
216
+                tempForm['return_count'] = ''
217
+                tempForm['price'] = ''
218
+                this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
219
+              }
220
+          }
221
+        }
222
+        this.propForm.goodType = []
223
+        this.currentIndex = -1
224
+      }, cancle: function() {
225
+        this.$refs.dialog.hide()
226
+        this.propForm.goodType = []
227
+
228
+      },
229
+      GetConfigInfo: function() {
230
+        const loading = this.$loading({
231
+          lock: true,
232
+          text: 'Loading',
233
+          spinner: 'el-icon-loading',
234
+          background: 'rgba(0, 0, 0, 0.7)'
235
+        })
236
+
237
+        GetAllConfig().then(response => {
238
+          if (response.data.state == 0) {
239
+            this.$message.error(response.data.msg)
240
+            return false
241
+          } else {
242
+            this.manufacturer = response.data.data.manufacturer;
243
+            this.dealer = response.data.data.dealer;
244
+            for(let i = 0; i<  response.data.data.drugs.length;i++){
245
+              this.goodType.push(response.data.data.drugs[i])
246
+              if(response.data.data.drugs[i].drug_specs != null) {
247
+                for (let b = 0; b < response.data.data.drugs[i].drug_specs.length; b++) {
248
+                  this.goodInfo.push(response.data.data.drugs[i].drug_specs[b])
249
+                }
250
+              }
251
+            }
252
+            this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
253
+            this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
254
+
255
+            this.form.manufacturer = 0
256
+            this.form.dealer = 0
257
+          }
258
+          loading.close()
259
+
260
+        })
261
+
262
+      },
263
+       typeName: function(drug_id) {
264
+        let name = "";
265
+        for (let i = 0; i < this.goodInfo.length; i++) {
266
+          if (this.goodInfo[i].id == drug_id) {
267
+            name = this.goodInfo[i].drug_name;
268
+
269
+          }
270
+        }
271
+        return name;
272
+      }, specificationName: function(drug_id) {
273
+        let name = "";
274
+        for (let i = 0; i < this.goodInfo.length; i++) {
275
+          if (this.goodInfo[i].id == drug_id) {
276
+            name = this.goodInfo[i].drug_spec;
277
+          }
278
+        }
279
+        return name;
280
+      }, handleDelete: function(index, row) {
281
+        if (this.recordInfo.recordData.length <= 1) {
282
+          this.$message.error('只有一条记录的时候无法删除')
283
+          return
284
+        } else {
285
+          this.recordInfo.recordData.splice(index, 1)
286
+        }
287
+      }, calculate: function(val) {
288
+        if (val == 0) {
289
+          return ''
290
+        }
291
+
292
+        return Math.round(parseFloat(val) * 100) / 100
293
+      }, getTime(val, temp) {
294
+        if (val != 0) {
295
+          return uParseTime(val, temp)
296
+        } else {
297
+          return ''
298
+        }
299
+      },
300
+      showDialog(index, row) {
301
+        const loading = this.$loading({
302
+          lock: true,
303
+          text: 'Loading',
304
+          spinner: 'el-icon-loading',
305
+          background: 'rgba(0, 0, 0, 0.7)'
306
+        })
307
+        this.currentIndex = index
308
+        this.isVisibility = true
309
+        const params = {
310
+          manufacturer_id: this.form.manufacturer,
311
+          dealer_id: this.form.dealer
312
+        }
313
+        GetAllDrugInfoByID(params).then(response => {
314
+            if (response.data.state == 0) {
315
+              this.$message.error(response.data.msg)
316
+              return false
317
+              loading.close()
318
+
319
+            } else {
320
+              loading.close()
321
+
322
+              if (response.data.data.drugs.length <= 0) {
323
+                this.$message.error('该厂商或经销商没有药品信息')
324
+                return
325
+              }
326
+              this.$refs.dialog.show()
327
+              for (let i = 0; i < response.data.data.drugs.length; i++) {
328
+                this.propForm.goods.push(
329
+                  response.data.data.drugs[i]
330
+                );
331
+              }
332
+              const obj = {};
333
+              this.propForm.goods = this.propForm.goods.reduce(
334
+                (cur, next) => {
335
+                  obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
336
+                  return cur;
337
+                },
338
+                []
339
+              ); // 设置cur默认类型为数组,并且初始值为空的数组
340
+            }
341
+
342
+          for (let i = 0; i < this.propForm.goods.length; i++) {
343
+            for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
344
+              var respObj = this.propForm.goods[i].drug_specs[a];
345
+              respObj["isSelected"] = false;
346
+            }
347
+          }
348
+          }
349
+        )
350
+      },
351
+
352
+      back() {
353
+        this.$router.go(-1)
354
+      }, submit() {
355
+        this.$refs['tableForm'].validate((valid) => {
356
+          if (valid) {
357
+            const array = this.recordInfo.recordData
358
+            let total = 0
359
+            for (let i = 0; i < array.length; i++) {
360
+              if (array[i].drug_id == 0) {
361
+                this.$message.error('药品名称或者药品规格名称不能为空')
362
+                return
363
+              }
364
+
365
+              total = total + array[i].price * array[i].return_count
366
+            }
367
+
368
+            if(this.recordInfo.recordData.length <= 0){
369
+              this.$message.success('请添加退货商品')
370
+              return
371
+            }
372
+
373
+            const params = {
374
+              'salesReturn': this.recordInfo.recordData
375
+            }
376
+            postDrugSalesReturn(params, this.return_time, total, this.form.dealer, this.form.manufacturer, this.type).then(response => {
377
+              if (response.data.state == 0) {
378
+                this.$message.error(response.data.msg)
379
+                return false
380
+              } else {
381
+                this.$message.success('退货成功')
382
+
383
+                this.recordInfo.recordData = []
384
+                this.$router.back(-1)
385
+              }
386
+            })
387
+          } else {
388
+            return false
389
+          }
390
+        })
391
+      }, changeManufacturer(val) {
392
+        this.propForm.manufacturer = val
393
+        console.log(val)
394
+      }, changeDealer(val) {
395
+        this.propForm.dealer = val
396
+        console.log(val)
397
+      }
398
+    },
399
+    created() {
400
+      var nowDate = new Date()
401
+      var nowYear = nowDate.getFullYear()
402
+      var nowMonth = nowDate.getMonth() + 1
403
+      var nowDay = nowDate.getDate()
404
+      this.return_time =
405
+        nowYear +
406
+        '-' +
407
+        (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
408
+        '-' +
409
+        (nowDay < 10 ? '0' + nowDay : nowDay)
410
+      const tempObj = {}
411
+      tempObj['drug_id'] = 0
412
+      tempObj['return_count'] = ''
413
+      tempObj['price'] = ''
414
+      this.recordInfo.recordData.push(tempObj)
415
+      console.log(this.recordInfo.recordData)
416
+      this.GetConfigInfo()
417
+      this.propForm.goodUnit = this.$store.getters.good_unit
418
+    }
419
+
420
+  }
421
+</script>
422
+
423
+<style rel="stylesheet/css" lang="scss" scoped>
424
+  .information {
425
+    border: 1px #dcdfe6 solid;
426
+    padding: 30px 20px 30px 20px;
427
+
428
+  .border {
429
+    border-bottom: 1px #dcdfe6 solid;
430
+    margin: 0px 0 20px 0;
431
+  }
432
+
433
+  }
434
+
435
+  .edit_separater {
436
+    border-top: 1px solid rgb(233, 233, 233);
437
+    margin-top: 15px;
438
+    margin-bottom: 15px;
439
+  }
440
+
441
+</style>
442
+
443
+<style>
444
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
445
+    font-size: 12px;
446
+  }
447
+
448
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
449
+    background: #6fb5fa;
450
+  }
451
+
452
+</style>

+ 224 - 0
src/xt_pages/stock/drugs/drugSalesReturnOrderDetail.vue Vedi File

@@ -0,0 +1,224 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
6
+    </div>
7
+
8
+    <div class="app-container">
9
+
10
+      <div class="filter-container">
11
+        <span style="font-size: 18px;color: #606266">退货单详情</span>
12
+        <el-row style="float:right;color: #606266">
13
+          <span style="color: #606266">{{ReturnInfo.salesReturn.order_number}}</span>
14
+        </el-row>
15
+      </div>
16
+
17
+
18
+      <div class="cell clearfix">
19
+        <span style="width: 300px;color: #606266">单据日期:  {{ReturnInfo.salesReturn.return_time | parseTime('{y}-{m}-{d}')}} </span>
20
+        <span style="width: 300px;color: #606266"
21
+        >厂商:
22
+          {{ ReturnInfo.salesReturn.manufacturers? ReturnInfo.salesReturn.manufacturers.manufacturer_name:'' }}</span
23
+        >
24
+        <span style="width: 300px;color: #606266"
25
+        >经销商: {{ ReturnInfo.salesReturn.dealers? ReturnInfo.salesReturn.dealers.dealer_name:''}}</span
26
+        >
27
+      </div>
28
+
29
+      <div class="filter-container" style="margin-top: 10px">
30
+        <el-button size="small" icon="el-icon-edit" @click="editRecord">编辑</el-button>
31
+        <el-button size="small" icon="el-icon-delete" @click="deleteRecord">删除</el-button>
32
+      </div>
33
+
34
+      <el-row :gutter="12" style="margin-top: 10px">
35
+        <el-table :data="ReturnInfo.returnInfoData" :class="signAndWeighBoxPatients" style="width: 100%" border
36
+                  :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
37
+        >
38
+          <el-table-column min-width="35" align="center">
39
+            <template slot="header" slot-scope="scope">
40
+              <span>药品名称</span>
41
+            </template>
42
+
43
+            <template slot-scope="scope">
44
+              <span v-if="scope.row.drug_id != 0">{{
45
+                scope.row.drug.drug_name
46
+              }}</span>
47
+            </template>
48
+          </el-table-column>
49
+          <el-table-column min-width="35" align="center">
50
+            <template slot="header" slot-scope="scope">
51
+              <span>规格名称</span>
52
+            </template>
53
+            <template slot-scope="scope">
54
+              <span v-if="scope.row.drug_id != 0">{{
55
+                scope.row.drug?scope.row.drug.drug_spec:''
56
+              }}</span>
57
+            </template>
58
+          </el-table-column>
59
+
60
+          <el-table-column min-width="23" align="center">
61
+            <template slot="header" slot-scope="scope">
62
+              <span>退货数量</span>
63
+            </template>
64
+            <template slot-scope="scope">
65
+              <span>{{scope.row.count}}</span>
66
+
67
+            </template>
68
+          </el-table-column>
69
+
70
+
71
+        </el-table>
72
+      </el-row>
73
+    </div>
74
+  </div>
75
+
76
+</template>
77
+
78
+<script>
79
+  import { uParseTime } from '@/utils/tools'
80
+  import { deleteDrugSalesReturn, GetAllConfig, getDrugReturnList } from "@/api/drug/drug_stock";
81
+  import BreadCrumb from '../../components/bread-crumb'
82
+
83
+  export default {
84
+    name: 'stockInOrderDetail',
85
+    components: { BreadCrumb },
86
+    created() {
87
+      const order_id = this.$route.query.id
88
+      this.GetConfigInfo()
89
+      this.GetOrderDetail(order_id)
90
+    },
91
+    data() {
92
+      return {
93
+        crumbs: [
94
+          { path: false, name: '库存管理' },
95
+          { path: false, name: '耗材退货单' },
96
+          { path: false, name: '退货单详情' }
97
+        ],
98
+        crumbs2: [
99
+          { path: false, name: '库存管理' },
100
+          { path: false, name: '其他退货单' },
101
+          { path: false, name: '退货单详情' }
102
+        ],
103
+        isEdit: 0,
104
+        checked: false,
105
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
106
+        goodType: [],
107
+        goodInfo: [],
108
+        manufacturer: [],
109
+        dealer: [],
110
+
111
+        ReturnInfo: {
112
+          loading: false,
113
+          returnInfoData: [],
114
+          salesReturn: {}
115
+        }
116
+      }
117
+    },
118
+    methods: {
119
+      GetConfigInfo: function() {
120
+        GetAllConfig().then(response => {
121
+          if (response.data.state == 0) {
122
+            this.$message.error(response.data.msg)
123
+            return false
124
+          } else {
125
+            this.manufacturer = response.data.data.manufacturer
126
+            this.dealer = response.data.data.dealer
127
+            this.goodInfo = response.data.data.goodInfo
128
+            this.goodType = response.data.data.goodType
129
+          }
130
+        })
131
+      }, calculate: function(val) {
132
+        if (val == 0) {
133
+          return ''
134
+        }
135
+        return Math.round(parseFloat(val) * 100) / 100
136
+      }, GetOrderDetail: function(order_id) {
137
+        const params = {
138
+          'id': order_id
139
+        }
140
+        getDrugReturnList(params).then(response => {
141
+          if (response.data.state == 0) {
142
+            this.$message.error(response.data.msg)
143
+            return false
144
+          } else {
145
+            for (let i = 0; i < response.data.data.list.length; i++) {
146
+              this.ReturnInfo.returnInfoData.push(response.data.data.list[i])
147
+            }
148
+            this.ReturnInfo.salesReturn = response.data.data.salesReturn
149
+          }
150
+        })
151
+      }, deleteRecord: function() {
152
+        const ids = []
153
+        ids.push(this.ReturnInfo.salesReturn.id)
154
+        const idStr = ids.join(',')
155
+
156
+        const params = {
157
+          ids: idStr
158
+        }
159
+
160
+        this.$confirm('确认删除退货单?', '删除退货单记录', {
161
+          confirmButtonText: '确定',
162
+          cancelButtonText: '取消',
163
+          type: 'warning'
164
+        }).then(() => {
165
+          deleteDrugSalesReturn(params).then(response => {
166
+            if (response.data.state == 0) {
167
+              this.$message.error(response.data.msg)
168
+              return false
169
+            } else {
170
+              this.$notify({
171
+                title: '成功',
172
+                message: '删除成功',
173
+                type: 'success',
174
+                duration: 2000
175
+              })
176
+
177
+              this.$router.back(-1)
178
+            }
179
+          })
180
+        }).catch(() => {
181
+        })
182
+      }, editRecord: function() {
183
+        this.$emit('edit-record')
184
+      }
185
+    }
186
+  }
187
+</script>
188
+
189
+<style rel="stylesheet/css" lang="scss" scoped>
190
+  .information {
191
+    border: 1px #dcdfe6 solid;
192
+    padding: 30px 20px 30px 20px;
193
+
194
+  .border {
195
+    border-bottom: 1px #dcdfe6 solid;
196
+    margin: 0px 0 20px 0;
197
+  }
198
+
199
+  }
200
+
201
+
202
+  .edit_separater {
203
+    border-top: 1px solid rgb(233, 233, 233);
204
+    margin-top: 15px;
205
+    margin-bottom: 15px;
206
+  }
207
+
208
+</style>
209
+
210
+<style>
211
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
212
+    font-size: 12px;
213
+  }
214
+
215
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
216
+    background: #6fb5fa;
217
+  }
218
+
219
+  .count {
220
+    color: #bd2c00;
221
+
222
+  }
223
+
224
+</style>

+ 520 - 0
src/xt_pages/stock/drugs/drugStockDetail.vue Vedi File

@@ -0,0 +1,520 @@
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="AddNewOrder"
8
+        class="filter-item"
9
+        style="float:right;"
10
+        type="primary"
11
+        icon="el-icon-circle-plus-outline"
12
+        >新增
13
+      </el-button>
14
+    </div>
15
+
16
+    <div class="app-container">
17
+      <div class="cell clearfix">
18
+        <el-input
19
+          size="small"
20
+          style="width: 400px;"
21
+          class="filter-item"
22
+          v-model.trim="searchKey"
23
+          placeholder="单据编码/制单人/厂商"
24
+        />
25
+        <el-button
26
+          size="small"
27
+          class="filter-item"
28
+          type="primary"
29
+          icon="el-icon-search"
30
+          @click="search"
31
+          >搜索</el-button
32
+        >
33
+      </div>
34
+
35
+      <div class="cell clearfix">
36
+        <label class="title"><span class="name">日期查询</span> : </label>
37
+        <el-date-picker
38
+          v-model="start_time"
39
+          prefix-icon="el-icon-date"
40
+          :editable="false"
41
+          style="width: 196px;"
42
+          type="date"
43
+          placeholder="选择日期时间"
44
+          align="right"
45
+          format="yyyy-MM-dd"
46
+          value-format="yyyy-MM-dd"
47
+          @change="startTimeChange"
48
+        ></el-date-picker>
49
+        <span class="cellLine"> - </span>
50
+        <el-date-picker
51
+          v-model="end_time"
52
+          prefix-icon="el-icon-date"
53
+          :editable="false"
54
+          style="width: 196px;"
55
+          type="date"
56
+          placeholder="选择日期时间"
57
+          align="right"
58
+          format="yyyy-MM-dd"
59
+          value-format="yyyy-MM-dd"
60
+          @change="endTimeChange"
61
+        ></el-date-picker>
62
+      </div>
63
+
64
+      <div class="filter-container" style="margin-top: 10px">
65
+        <el-checkbox
66
+          style="width: 30px"
67
+          v-model="checked"
68
+          @change="changeAllSelected"
69
+          >全选</el-checkbox
70
+        >
71
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
72
+          >删除</el-button
73
+        >
74
+      </div>
75
+
76
+      <el-row :gutter="12" style="margin-top: 10px">
77
+        <el-table
78
+          :data="cancelStockDate"
79
+          :class="signAndWeighBoxPatients"
80
+          border
81
+          highlight-current-row
82
+          ref="multipleTable"
83
+          @selection-change="select"
84
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
85
+        >
86
+          <el-table-column label="单据编号" align="center">
87
+            <template slot-scope="scope">
88
+              {{ scope.row.warehousing_order }}
89
+            </template>
90
+          </el-table-column>
91
+
92
+          <el-table-column label="商品类型" align="center">
93
+            <template slot-scope="scope">
94
+              {{ specificationName(scope.row.good_id) }}
95
+            </template>
96
+          </el-table-column>
97
+
98
+          <el-table-column label="单据类型" align="center">
99
+            <template slot-scope="scope">
100
+              {{ getTypeName(scope.row) }}
101
+            </template>
102
+          </el-table-column>
103
+
104
+          <el-table-column label="操作时间" align="center">
105
+            <template slot-scope="scope">
106
+              {{ scope.row.warehousing_time | parseTime("{y}-{m}-{d}") }}
107
+            </template>
108
+          </el-table-column>
109
+          <el-table-column label="制单人" align="center">
110
+            <template slot-scope="scope">
111
+              {{ getXuserName(scope.row.creater) }}
112
+            </template>
113
+          </el-table-column>
114
+          <el-table-column label="单价" align="center">
115
+            <template slot-scope="scope">
116
+              {{ scope.row.price }}
117
+            </template>
118
+          </el-table-column>
119
+          <el-table-column label="数量" align="center">
120
+            <template slot-scope="scope">
121
+              {{ scope.row.warehousing_count }}
122
+            </template>
123
+          </el-table-column>
124
+          <el-table-column label="总价" align="center">
125
+            <template slot-scope="scope">
126
+              {{ scope.row.price * scope.row.warehousing_count }}
127
+            </template>
128
+          </el-table-column>
129
+        </el-table>
130
+
131
+        <el-pagination
132
+          @size-change="handleSizeChange"
133
+          @current-change="handleCurrentChange"
134
+          :page-sizes="[7]"
135
+          :page-size="7"
136
+          background
137
+          style="margin-top:20px;float: right"
138
+          layout="total, sizes, prev, pager, next, jumper"
139
+          :total="total"
140
+        >
141
+        </el-pagination>
142
+      </el-row>
143
+    </div>
144
+  </div>
145
+</template>
146
+
147
+<script>
148
+import { uParseTime } from "@/utils/tools";
149
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
150
+import { deleteCancelStock, GetAllConfig, getStockDetail } from "@/api/stock";
151
+import BreadCrumb from "../components/bread-crumb";
152
+
153
+export default {
154
+  name: "salesReturnOrder",
155
+  components: { BreadCrumb },
156
+  created() {
157
+    var year = new Date().getFullYear();
158
+    var month = new Date().getMonth() + 1;
159
+    var day = new Date().getDate();
160
+    if (parseInt(month) < 10) {
161
+      month = "0" + month;
162
+    }
163
+    if (parseInt(day) < 10) {
164
+      day = "0" + day;
165
+    }
166
+    const endTime = year + "-" + month + "-" + day;
167
+    this.end_time = endTime;
168
+
169
+    var year = new Date().getFullYear();
170
+    var month = new Date().getMonth();
171
+    var day = new Date().getDate();
172
+    if (parseInt(month) < 10) {
173
+      month = "0" + month;
174
+    }
175
+    if (parseInt(day) < 10) {
176
+      day = "0" + day;
177
+    }
178
+    const startTime = year + "-" + month + "-" + day;
179
+    this.start_time = startTime;
180
+    this.GetCancelStock();
181
+    this.GetConfigInfo();
182
+    this.fetchAllAdminUsers();
183
+  },
184
+  data() {
185
+    return {
186
+      crumbs: [
187
+        { path: false, name: "库存管理" },
188
+        { path: "/stock/detail", name: "出入库明细查询" }
189
+      ],
190
+      searchKey: "",
191
+      type: 1,
192
+      page: 1,
193
+      limit: 7,
194
+      checked: false,
195
+      total: 0,
196
+      pageTotal: 0,
197
+      pageSelect: 0,
198
+      adminUserOptions: [],
199
+      multipleSelection: [],
200
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
201
+      start_time: "",
202
+      cancelStockDate: [],
203
+      end_time: "",
204
+      goodType: [],
205
+      goodInfo: [],
206
+      manufacturer: [],
207
+      selectedTableData: [],
208
+      dealer: []
209
+    };
210
+  },
211
+  methods: {
212
+    getTypeName: function(row) {
213
+      let name = "";
214
+      let name2 = "";
215
+      if (row.type == 1) {
216
+        name = "耗材";
217
+      } else if (row.type == 2) {
218
+        name = "其他";
219
+      }
220
+      if (row.types == 1) {
221
+        name2 = "入库单";
222
+      } else if (row.types == 2) {
223
+        name2 = "出库单";
224
+      } else if (row.types == 3) {
225
+        name2 = "退货单";
226
+      } else if (row.types == 4) {
227
+        name2 = "退库单";
228
+      }
229
+      return name + name2;
230
+    },
231
+    specificationName: function(good_info_id) {
232
+      let name = "";
233
+      for (let i = 0; i < this.goodInfo.length; i++) {
234
+        if (this.goodInfo[i].id == good_info_id) {
235
+          name = this.goodInfo[i].specification_name;
236
+        }
237
+      }
238
+      return name;
239
+    },
240
+    search: function() {
241
+      const Params = {
242
+        page: this.page,
243
+        limit: this.limit,
244
+        start_time: this.start_time,
245
+        end_time: this.end_time,
246
+        type: this.type,
247
+        keywords: this.searchKey
248
+      };
249
+      this.cancelStockDate = [];
250
+      getStockDetail(Params).then(response => {
251
+        if (response.data.state == 0) {
252
+          this.$message.error(response.data.msg);
253
+          return false;
254
+        } else {
255
+          this.total = response.data.data.total;
256
+          for (let i = 0; i < response.data.data.list.length; i++) {
257
+            this.cancelStockDate.push(response.data.data.list[i]);
258
+          }
259
+        }
260
+      });
261
+    },
262
+    AddNewOrder: function() {
263
+      this.$router.push({
264
+        name: "cancelStockOrderAdd",
265
+        query: { type: this.type }
266
+      });
267
+    },
268
+    GetCancelStock: function() {
269
+      const Params = {
270
+        page: this.page,
271
+        limit: this.limit,
272
+        start_time: this.start_time,
273
+        end_time: this.end_time,
274
+        type: this.type
275
+      };
276
+      this.cancelStockDate = [];
277
+      getStockDetail(Params).then(response => {
278
+        if (response.data.state == 0) {
279
+          this.$message.error(response.data.msg);
280
+          return false;
281
+        } else {
282
+          this.total = response.data.data.total;
283
+          for (let i = 0; i < response.data.data.list.length; i++) {
284
+            this.cancelStockDate.push(response.data.data.list[i]);
285
+          }
286
+        }
287
+      });
288
+    },
289
+    getXuserName(id) {
290
+      if (id <= 0) {
291
+        return "";
292
+      }
293
+      var name = "";
294
+      if (
295
+        this.adminUserOptions == null ||
296
+        typeof this.adminUserOptions.length === "undefined"
297
+      ) {
298
+        return name;
299
+      }
300
+      var leng = this.adminUserOptions.length;
301
+      if (leng == 0) {
302
+        return name;
303
+      }
304
+      for (let index = 0; index < leng; index++) {
305
+        if (this.adminUserOptions[index].id == id) {
306
+          name = this.adminUserOptions[index].name;
307
+          break;
308
+        }
309
+      }
310
+      return name;
311
+    },
312
+    fetchAllAdminUsers() {
313
+      fetchAllAdminUsers().then(response => {
314
+        console.log(response);
315
+        if (response.data.state == 1) {
316
+          this.adminUserOptions = response.data.data.users;
317
+          var alen = this.adminUserOptions.length;
318
+          for (let index = 0; index < alen; index++) {
319
+            if (this.adminUserOptions[index].user_type == 2) {
320
+              // this.doctorOptions.push(this.adminUserOptions[index]);
321
+            }
322
+          }
323
+        }
324
+      });
325
+    },
326
+    handleSelectionChange: function(val) {
327
+      this.multipleSelection = val;
328
+    },
329
+    handleSizeChange(val) {
330
+      this.limit = val;
331
+      this.GetWarehouse();
332
+    },
333
+    handleCurrentChange(val) {
334
+      this.page = val;
335
+      this.GetWarehouse();
336
+    },
337
+    startTimeChange(val) {
338
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
339
+      console.log("time是-----", time);
340
+      if (time > 0) {
341
+        this.$message.error("结束时间不能小于开始时间");
342
+        this.start_time = "";
343
+      } else {
344
+        this.GetWarehouse();
345
+      }
346
+    },
347
+    endTimeChange(val) {
348
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
349
+      if (time < 0) {
350
+        this.$message.error("结束时间不能小于开始时间");
351
+        this.end_time = "";
352
+      } else {
353
+        this.GetWarehouse();
354
+      }
355
+    },
356
+    getTimestamp(time) {
357
+      // 把时间日期转成时间戳
358
+      return new Date(time).getTime() / 1000;
359
+    },
360
+    calculate: function(val) {
361
+      return Math.round(parseFloat(val) * 100) / 100;
362
+    },
363
+    GetConfigInfo: function() {
364
+      GetAllConfig().then(response => {
365
+        if (response.data.state == 0) {
366
+          this.$message.error(response.data.msg);
367
+          return false;
368
+        } else {
369
+          this.manufacturer = response.data.data.manufacturer;
370
+          this.dealer = response.data.data.dealer;
371
+          this.goodInfo = response.data.data.goodInfo;
372
+        }
373
+      });
374
+    },
375
+    getManufactuerName: function(manufacturer_id) {
376
+      for (let i = 0; i < this.manufacturer.length; i++) {
377
+        if (this.manufacturer[i].id == manufacturer_id) {
378
+          return this.manufacturer[i].manufacturer_name;
379
+        }
380
+      }
381
+    },
382
+    getDealerName: function(dealer_id) {
383
+      for (let i = 0; i < this.dealer.length; i++) {
384
+        if (this.dealer[i].id == dealer_id) {
385
+          return this.dealer[i].dealer_name;
386
+        }
387
+      }
388
+    },
389
+    handleEdit: function(index, row) {
390
+      this.$router.push({
391
+        name: "cancelStockDetail",
392
+        query: { id: row.id, type: this.type }
393
+      });
394
+    },
395
+    handleDelete: function(index, row) {
396
+      const ids = [];
397
+      ids.push(row.id);
398
+      const idStr = ids.join(",");
399
+
400
+      const params = {
401
+        ids: idStr
402
+      };
403
+
404
+      this.$confirm("确认删除出库退库单记录?", "删除出库退库单记录", {
405
+        confirmButtonText: "确定",
406
+        cancelButtonText: "取消",
407
+        type: "warning"
408
+      })
409
+        .then(() => {
410
+          deleteCancelStock(params).then(response => {
411
+            if (response.data.state == 0) {
412
+              this.$message.error(response.data.msg);
413
+              return false;
414
+            } else {
415
+              this.$notify({
416
+                title: "成功",
417
+                message: "删除成功",
418
+                type: "success",
419
+                duration: 2000
420
+              });
421
+              for (let i = 0; i < ids.length; i++) {
422
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
423
+                  if (ids[i] == this.cancelStockDate[y].id) {
424
+                    this.cancelStockDate.splice(y, 1);
425
+                  }
426
+                }
427
+              }
428
+            }
429
+          });
430
+        })
431
+        .catch(() => {});
432
+    },
433
+    changeAllSelected: function(val) {
434
+      if (val) {
435
+        this.$refs.multipleTable.toggleAllSelection();
436
+      } else {
437
+        this.$refs.multipleTable.clearSelection();
438
+      }
439
+    },
440
+    select(selection) {
441
+      this.selectedTableData = selection;
442
+    },
443
+    batchDelete() {
444
+      if (this.selectedTableData.length <= 0) {
445
+        this.$message.error("请选择要删除的记录");
446
+        return;
447
+      }
448
+      const ids = [];
449
+      for (let i = 0; i < this.selectedTableData.length; i++) {
450
+        ids.push(this.selectedTableData[i].id);
451
+      }
452
+      const idStr = ids.join(",");
453
+      const params = {
454
+        ids: idStr
455
+      };
456
+      this.$confirm("确认删除出库退库单记录?", "删除出库退库单记录", {
457
+        confirmButtonText: "确定",
458
+        cancelButtonText: "取消",
459
+        type: "warning"
460
+      })
461
+        .then(() => {
462
+          deleteCancelStock(params).then(response => {
463
+            if (response.data.state == 0) {
464
+              this.$message.error(response.data.msg);
465
+              return false;
466
+            } else {
467
+              this.$notify({
468
+                title: "成功",
469
+                message: "删除成功",
470
+                type: "success",
471
+                duration: 2000
472
+              });
473
+
474
+              for (let i = 0; i < ids.length; i++) {
475
+                for (let y = 0; y < this.cancelStockDate.length; y++) {
476
+                  if (ids[i] == this.cancelStockDate[y].id) {
477
+                    this.cancelStockDate.splice(y, 1);
478
+                  }
479
+                }
480
+              }
481
+            }
482
+          });
483
+        })
484
+        .catch(() => {});
485
+    }
486
+  }
487
+};
488
+</script>
489
+
490
+<style rel="stylesheet/css" lang="scss" scoped>
491
+.information {
492
+  border: 1px #dcdfe6 solid;
493
+  padding: 30px 20px 30px 20px;
494
+
495
+  .border {
496
+    border-bottom: 1px #dcdfe6 solid;
497
+    margin: 0px 0 20px 0;
498
+  }
499
+}
500
+
501
+.edit_separater {
502
+  border-top: 1px solid rgb(233, 233, 233);
503
+  margin-top: 15px;
504
+  margin-bottom: 15px;
505
+}
506
+</style>
507
+
508
+<style>
509
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
510
+  font-size: 12px;
511
+}
512
+
513
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
514
+  background: #6fb5fa;
515
+}
516
+
517
+.count {
518
+  color: #bd2c00;
519
+}
520
+</style>

+ 69 - 0
src/xt_pages/stock/drugs/drugStockDetailIndex.vue Vedi File

@@ -0,0 +1,69 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+    </div>
6
+    <div class="app-container">
7
+      <div class="service-box">
8
+        <el-tabs v-model="activeName">
9
+          <el-tab-pane label="入库明细" name="first">
10
+            <stock-in-detail></stock-in-detail>
11
+          </el-tab-pane>
12
+          <el-tab-pane label="退货明细">
13
+            <sales-return-detail></sales-return-detail>
14
+
15
+          </el-tab-pane>
16
+          <el-tab-pane label="出库明细">
17
+            <stock-out-detail></stock-out-detail>
18
+
19
+          </el-tab-pane>
20
+          <el-tab-pane label="退库明细">
21
+           <cancel-stock-detail></cancel-stock-detail>
22
+          </el-tab-pane>
23
+
24
+        </el-tabs>
25
+      </div>
26
+    </div>
27
+  </div>
28
+</template>
29
+
30
+<script>
31
+
32
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
33
+  import StockInDetail from './detail/stockInDetail'
34
+  import StockOutDetail from './detail/stockOutDetail'
35
+  import SalesReturnDetail from './detail/salesReturnDetail'
36
+  import CancelStockDetail from './detail/cancelStockDetail'
37
+
38
+  export default {
39
+    name: 'stockDetailIndex',
40
+    components: {
41
+      CancelStockDetail,
42
+      SalesReturnDetail,
43
+      StockOutDetail,
44
+      StockInDetail,
45
+      BreadCrumb
46
+    },
47
+    data() {
48
+      return {
49
+        crumbs: [
50
+          { path: false, name: '库存管理' },
51
+          { path: '/stock/detail', name: '出入库明细查询' }
52
+        ],
53
+        activeName: 'first'
54
+
55
+      }
56
+    },
57
+    methods: {
58
+      handleClick(tab, event) {
59
+        console.log(tab, event, this.activeName)
60
+      }
61
+    }
62
+  }
63
+</script>
64
+
65
+
66
+
67
+
68
+
69
+

+ 24 - 0
src/xt_pages/stock/drugs/drugStockInDetail.vue Vedi File

@@ -0,0 +1,24 @@
1
+<template>
2
+  <stock-in-order-detail v-if="isEdit == 0"   v-on:edit-record="isEdit = 1"></stock-in-order-detail>
3
+  <stock-in-order-edit v-else></stock-in-order-edit>
4
+</template>
5
+
6
+<script>
7
+  import StockInOrderDetail from './drugStockInOrderDetail'
8
+  import StockInOrderEdit from './drugStockInOrderEdit'
9
+  export default {
10
+    name: 'stockInDeatail',
11
+    components: { StockInOrderEdit, StockInOrderDetail },
12
+    data() {
13
+      return {
14
+        isEdit: 0
15
+      }
16
+  }
17
+
18
+  }
19
+
20
+</script>
21
+
22
+<style scoped>
23
+
24
+</style>

+ 553 - 0
src/xt_pages/stock/drugs/drugStockInOrder.vue Vedi File

@@ -0,0 +1,553 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <!--<bread-crumb :crumbs='crumbs'></bread-crumb>-->
5
+      <bread-crumb :crumbs="crumbs"></bread-crumb>
6
+      <el-button
7
+        size="small"
8
+        @click="handleWarehouse"
9
+        class="filter-item"
10
+        style="float:right;"
11
+        type="primary"
12
+        icon="el-icon-circle-plus-outline"
13
+        >新增</el-button
14
+      >
15
+    </div>
16
+
17
+    <div class="app-container">
18
+      <div class="cell clearfix">
19
+        <el-input
20
+          size="small"
21
+          style="width: 400px;"
22
+          v-model.trim="searchKey"
23
+          class="filter-item"
24
+          placeholder="单据编码/制单人/厂商"
25
+        />
26
+        <el-button
27
+          size="small"
28
+          class="filter-item"
29
+          type="primary"
30
+          icon="el-icon-search"
31
+          @click="search"
32
+          >搜索</el-button
33
+        >
34
+      </div>
35
+
36
+      <div class="cell clearfix">
37
+        <label class="title"><span class="name">入库时间</span> : </label>
38
+        <el-date-picker
39
+          size="small"
40
+          v-model="start_time"
41
+          prefix-icon="el-icon-date"
42
+          :editable="false"
43
+          style="width: 196px;"
44
+          type="date"
45
+          placeholder="选择日期时间"
46
+          align="right"
47
+          format="yyyy-MM-dd"
48
+          value-format="yyyy-MM-dd"
49
+          @change="startTimeChange"
50
+        ></el-date-picker>
51
+        <span class="cellLine"> - </span>
52
+        <el-date-picker
53
+          size="small"
54
+          v-model="end_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="endTimeChange"
64
+        ></el-date-picker>
65
+      </div>
66
+
67
+      <div class="cell clearfix">
68
+        <el-checkbox
69
+          style="width: 70px"
70
+          v-model="checked"
71
+          @change="changeAllSelected"
72
+          >全选</el-checkbox
73
+        >
74
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
75
+          >删除</el-button
76
+        >
77
+      </div>
78
+
79
+      <el-table
80
+        :data="Warehouse.warehouseDate"
81
+        :class="signAndWeighBoxPatients"
82
+        style="width: 100%"
83
+        border
84
+        highlight-current-row
85
+        v-loading="Warehouse.loading"
86
+        ref="multipleTable"
87
+        @selection-change="select"
88
+        :row-style="{ color: '#303133' }"
89
+        :header-cell-style="{
90
+          backgroundColor: 'rgb(245, 247, 250)',
91
+          color: '#606266'
92
+        }"
93
+      >
94
+        <el-table-column align="center" type="selection" width="55">
95
+        </el-table-column>
96
+
97
+        <el-table-column label="单据日期" align="center">
98
+          <template slot-scope="scope">
99
+            {{ scope.row.warehousing_time | parseTime("{y}-{m}-{d}") }}
100
+          </template>
101
+        </el-table-column>
102
+
103
+        <el-table-column label="单据编号" align="center">
104
+          <template slot-scope="scope">
105
+            {{ scope.row.warehousing_order }}
106
+          </template>
107
+        </el-table-column>
108
+
109
+        <el-table-column label="制单人" align="center">
110
+          <template slot-scope="scope">
111
+            {{ getXuserName(scope.row.creater) }}
112
+          </template>
113
+        </el-table-column>
114
+
115
+        <el-table-column label="厂家" align="center">
116
+          <template slot-scope="scope">
117
+            {{scope.row.manufacturers ? scope.row.manufacturers.manufacturer_name:''}}
118
+          </template>
119
+        </el-table-column>
120
+
121
+        <el-table-column label="经销商" align="center">
122
+          <template slot-scope="scope">
123
+            {{scope.row.dealers ? scope.row.dealers.dealer_name:''}}
124
+          </template>
125
+        </el-table-column>
126
+
127
+        <el-table-column label="操作" align="center">
128
+          <template slot-scope="scope">
129
+            <el-tooltip
130
+              class="item"
131
+              effect="dark"
132
+              content="编辑"
133
+              placement="top"
134
+            >
135
+              <el-button
136
+                size="small"
137
+                type="primary"
138
+                icon="el-icon-edit-outline"
139
+                @click="handleEdit(scope.$index, scope.row)"
140
+              >
141
+              </el-button>
142
+            </el-tooltip>
143
+            <el-tooltip
144
+              class="item"
145
+              effect="dark"
146
+              content="删除"
147
+              placement="top"
148
+            >
149
+              <el-button
150
+                size="small"
151
+                type="danger"
152
+                icon="el-icon-delete"
153
+                @click="handleDelete(scope.$index, scope.row)"
154
+              >
155
+              </el-button>
156
+            </el-tooltip>
157
+          </template>
158
+        </el-table-column>
159
+      </el-table>
160
+
161
+      <el-pagination
162
+        @size-change="handleSizeChange"
163
+        @current-change="handleCurrentChange"
164
+        :page-sizes="[10, 50, 100]"
165
+        :page-size="10"
166
+        background
167
+        style="margin-top:20px;float: right"
168
+        layout="total, sizes, prev, pager, next, jumper"
169
+        :total="total"
170
+      >
171
+      </el-pagination>
172
+    </div>
173
+  </div>
174
+</template>
175
+
176
+<script>
177
+import { uParseTime } from "@/utils/tools";
178
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
179
+import {
180
+  deleteDrugWarehouseInfo,
181
+  GetAllConfig,
182
+  getDrugWarehouseInfoList,
183
+  getDrugWarehouseList
184
+} from "@/api/drug/drug_stock";
185
+import BreadCrumb from "../../components/bread-crumb";
186
+
187
+export default {
188
+  name: "drugStockInOrder",
189
+  components: { BreadCrumb },
190
+  created() {
191
+    var nowDate = new Date();
192
+    var nowYear = nowDate.getFullYear();
193
+    var nowMonth = nowDate.getMonth() + 1;
194
+    var nowDay = nowDate.getDate();
195
+    this.end_time =
196
+      nowYear +
197
+      "-" +
198
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
199
+      "-" +
200
+      (nowDay < 10 ? "0" + nowDay : nowDay);
201
+    nowDate.setMonth(nowDate.getMonth() - 1);
202
+    nowYear = nowDate.getFullYear();
203
+    nowMonth = nowDate.getMonth() + 1;
204
+    nowDay = nowDate.getDate();
205
+    this.start_time =
206
+      nowYear +
207
+      "-" +
208
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
209
+      "-" +
210
+      (nowDay < 10 ? "0" + nowDay : nowDay);
211
+
212
+    this.GetWarehouse();
213
+    this.GetConfigInfo();
214
+    this.fetchAllAdminUsers();
215
+  },
216
+  data() {
217
+    return {
218
+      crumbs: [
219
+        { path: false, name: "库存管理" },
220
+        { path: false, name: "入库单" }
221
+      ],
222
+      searchKey: "",
223
+      type: 1,
224
+      page: 1,
225
+      limit: 10,
226
+      checked: false,
227
+      total: 0,
228
+      pageTotal: 0,
229
+      pageSelect: 0,
230
+      adminUserOptions: [],
231
+      multipleSelection: [],
232
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
233
+      start_time: "",
234
+      end_time: "",
235
+      selectedTableData: [],
236
+      Warehouse: {
237
+        loading: false,
238
+        warehouseDate: [],
239
+        tableCurrentIndex: ""
240
+      },
241
+
242
+      WarehouseInfo: {
243
+        loading: false,
244
+        warehouseInfoDate: []
245
+      },
246
+      startTime: ""
247
+    };
248
+  },
249
+  methods: {
250
+    search: function() {
251
+      const Params = {
252
+        page: this.page,
253
+        limit: this.limit,
254
+        start_time: this.start_time,
255
+        end_time: this.end_time,
256
+        type: this.type,
257
+        keywords: this.searchKey
258
+      };
259
+      this.Warehouse.warehouseDate = [];
260
+      getDrugWarehouseList(Params).then(response => {
261
+        if (response.data.state == 0) {
262
+          this.Warehouse.loading = false;
263
+          this.$message.error(response.data.msg);
264
+          return false;
265
+        } else {
266
+          this.Warehouse.loading = false;
267
+          this.total = response.data.data.total;
268
+          for (let i = 0; i < response.data.data.list.length; i++) {
269
+            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
270
+          }
271
+        }
272
+      });
273
+    },
274
+    GetWarehouse: function() {
275
+      const Params = {
276
+        page: this.page,
277
+        limit: this.limit,
278
+        start_time: this.start_time,
279
+        end_time: this.end_time,
280
+        type: this.type
281
+      };
282
+      this.Warehouse.warehouseDate = [];
283
+      getDrugWarehouseList(Params).then(response => {
284
+        if (response.data.state == 0) {
285
+          this.Warehouse.loading = false;
286
+          this.$message.error(response.data.msg);
287
+          return false;
288
+        } else {
289
+          this.Warehouse.loading = false;
290
+          this.total = response.data.data.total;
291
+          for (let i = 0; i < response.data.data.list.length; i++) {
292
+            this.Warehouse.warehouseDate.push(response.data.data.list[i]);
293
+          }
294
+        }
295
+      });
296
+    },
297
+    tableRowClassName({ row, rowIndex }) {
298
+      // 把每一行的索引放进row
299
+      row.index = rowIndex;
300
+    },
301
+    onRowClick(row, event, column) {
302
+      this.WarehouseInfo.warehouseInfoDate = [];
303
+      this.Warehouse.tableCurrentIndex = row.index;
304
+      const params = {
305
+        id: row.id
306
+      };
307
+      this.WarehouseInfo.loading = true;
308
+      getDrugWarehouseInfoList(params).then(response => {
309
+        if (response.data.state == 0) {
310
+          this.WarehouseInfo.loading = false;
311
+          this.$message.error(response.data.msg);
312
+          return false;
313
+        } else {
314
+          this.WarehouseInfo.loading = false;
315
+          for (let i = 0; i < response.data.data.info.length; i++) {
316
+            this.WarehouseInfo.warehouseInfoDate.push(
317
+              response.data.data.info[i]
318
+            );
319
+          }
320
+        }
321
+      });
322
+    },
323
+    getXuserName(id) {
324
+      if (id <= 0) {
325
+        return "";
326
+      }
327
+      var name = "";
328
+      if (
329
+        this.adminUserOptions == null ||
330
+        typeof this.adminUserOptions.length === "undefined"
331
+      ) {
332
+        return name;
333
+      }
334
+      var leng = this.adminUserOptions.length;
335
+      if (leng == 0) {
336
+        return name;
337
+      }
338
+      for (let index = 0; index < leng; index++) {
339
+        if (this.adminUserOptions[index].id == id) {
340
+          name = this.adminUserOptions[index].name;
341
+          break;
342
+        }
343
+      }
344
+      return name;
345
+    },
346
+    fetchAllDoctorAndNurse() {
347
+      fetchAllDoctorAndNurse().then(response => {
348
+        if (response.data.state == 1) {
349
+          this.doctorOptions = response.data.data.doctors;
350
+        }
351
+      });
352
+    },
353
+    fetchAllAdminUsers() {
354
+      fetchAllAdminUsers().then(response => {
355
+        console.log(response);
356
+        if (response.data.state == 1) {
357
+          this.adminUserOptions = response.data.data.users;
358
+          var alen = this.adminUserOptions.length;
359
+          for (let index = 0; index < alen; index++) {
360
+            if (this.adminUserOptions[index].user_type == 2) {
361
+              // this.doctorOptions.push(this.adminUserOptions[index]);
362
+            }
363
+          }
364
+        }
365
+      });
366
+    },
367
+    clicks: function() {
368
+      console.log(this.WarehouseInfo.warehouseInfoDate);
369
+    },
370
+    handleWarehouse: function() {
371
+      this.$router.push({ path: "/drugstock/in/add", query: { type: this.type } });
372
+    },
373
+    handleSelectionChange: function(val) {
374
+      this.multipleSelection = val;
375
+    },
376
+    handleSizeChange(val) {
377
+      this.limit = val;
378
+      this.GetWarehouse();
379
+    },
380
+    handleCurrentChange(val) {
381
+      this.page = val;
382
+      this.GetWarehouse();
383
+    },
384
+    startTimeChange(val) {
385
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
386
+      if (time > 0) {
387
+        this.$message.error("结束时间不能小于开始时间");
388
+        this.start_time = "";
389
+      } else {
390
+        this.startTime = this.getTimestamp(val);
391
+        this.GetWarehouse();
392
+      }
393
+    },
394
+    endTimeChange(val) {
395
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
396
+      if (time < 0) {
397
+        this.$message.error("结束时间不能小于开始时间");
398
+        this.end_time = "";
399
+      } else {
400
+        this.GetWarehouse();
401
+      }
402
+    },
403
+    getTimestamp(time) {
404
+      // 把时间日期转成时间戳
405
+      return new Date(time).getTime() / 1000;
406
+    },
407
+    calculate: function(val) {
408
+      return Math.round(parseFloat(val) * 100) / 100;
409
+    },
410
+
411
+    handleEdit: function(index, row) {
412
+      this.$router.push({
413
+        name: "drugStockInDetail",
414
+        query: { id: row.id, type: this.type }
415
+      });
416
+    },
417
+    handleDelete: function(index, row) {
418
+      const ids = [];
419
+      ids.push(row.id);
420
+      const idStr = ids.join(",");
421
+
422
+      const params = {
423
+        ids: idStr
424
+      };
425
+
426
+      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
427
+        confirmButtonText: "确定",
428
+        cancelButtonText: "取消",
429
+        type: "warning"
430
+      })
431
+        .then(() => {
432
+          deleteDrugWarehouseInfo(params).then(response => {
433
+            if (response.data.state == 0) {
434
+              this.$message.error(response.data.msg);
435
+              return false;
436
+            } else {
437
+              this.$notify({
438
+                title: "成功",
439
+                message: "删除成功",
440
+                type: "success",
441
+                duration: 2000
442
+              });
443
+              for (let i = 0; i < ids.length; i++) {
444
+                for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
445
+                  if (ids[i] == this.Warehouse.warehouseDate[y].id) {
446
+                    this.Warehouse.warehouseDate.splice(y, 1);
447
+                  }
448
+                }
449
+              }
450
+            }
451
+          });
452
+        })
453
+        .catch(() => {});
454
+    },
455
+    changeAllSelected: function(val) {
456
+      if (val) {
457
+        this.$refs.multipleTable.toggleAllSelection();
458
+      } else {
459
+        this.$refs.multipleTable.clearSelection();
460
+      }
461
+    },
462
+    select(selection) {
463
+      this.selectedTableData = selection;
464
+    },
465
+    batchDelete() {
466
+      if (this.selectedTableData.length <= 0) {
467
+        this.$message.error("请选择要删除的记录");
468
+        return;
469
+      }
470
+      const ids = [];
471
+      for (let i = 0; i < this.selectedTableData.length; i++) {
472
+        ids.push(this.selectedTableData[i].id);
473
+      }
474
+      const idStr = ids.join(",");
475
+      const params = {
476
+        ids: idStr
477
+      };
478
+      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
479
+        confirmButtonText: "确定",
480
+        cancelButtonText: "取消",
481
+        type: "warning"
482
+      })
483
+        .then(() => {
484
+          deleteDrugWarehouseInfo(params).then(response => {
485
+            if (response.data.state == 0) {
486
+              this.$message.error(response.data.msg);
487
+              return false;
488
+            } else {
489
+              this.$notify({
490
+                title: "成功",
491
+                message: "删除成功",
492
+                type: "success",
493
+                duration: 2000
494
+              });
495
+
496
+              for (let i = 0; i < ids.length; i++) {
497
+                for (let y = 0; y < this.Warehouse.warehouseDate.length; y++) {
498
+                  if (ids[i] == this.Warehouse.warehouseDate[y].id) {
499
+                    this.Warehouse.warehouseDate.splice(y, 1);
500
+                  }
501
+                }
502
+              }
503
+            }
504
+          });
505
+        })
506
+        .catch(() => {});
507
+    }
508
+  }
509
+};
510
+</script>
511
+
512
+<style rel="stylesheet/css" lang="scss" scoped>
513
+.information {
514
+  border: 1px #dcdfe6 solid;
515
+  padding: 30px 20px 30px 20px;
516
+
517
+  .border {
518
+    border-bottom: 1px #dcdfe6 solid;
519
+    margin: 0px 0 20px 0;
520
+  }
521
+}
522
+
523
+.edit_separater {
524
+  border-top: 1px solid rgb(233, 233, 233);
525
+  margin-top: 15px;
526
+  margin-bottom: 15px;
527
+}
528
+</style>
529
+
530
+<style>
531
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
532
+  font-size: 12px;
533
+}
534
+
535
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
536
+  background: #6fb5fa;
537
+}
538
+
539
+.count {
540
+  color: #bd2c00;
541
+}
542
+.el-table td,
543
+.el-table th.is-leaf,
544
+.el-table--border,
545
+.el-table--group {
546
+  border-color: #d0d3da;
547
+}
548
+.el-table--border::after,
549
+.el-table--group::after,
550
+.el-table::before {
551
+  background-color: #d0d3da;
552
+}
553
+</style>

+ 705 - 0
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue Vedi File

@@ -0,0 +1,705 @@
1
+<template>
2
+
3
+  <div class="main-contain">
4
+    <div class="position">
5
+      <bread-crumb v-if="type == 1" :crumbs='crumbs'></bread-crumb>
6
+      <bread-crumb v-if="type == 2" :crumbs='crumbs2'></bread-crumb>
7
+
8
+      <div style="float:right;">
9
+        <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
10
+        <el-button size="small" type="primary" @click="submit()" class="filter-item">保 存</el-button>
11
+      </div>
12
+    </div>
13
+    <div class="app-container">
14
+
15
+      <!--<stock-in-dialog ref="dialog" :propForm="propForm"-->
16
+                       <!--:visibility="isVisibility"-->
17
+                       <!--v-on:dialog-comfirm="comfirm"-->
18
+                       <!--v-on:dialog-cancle="cancle"></stock-in-dialog>-->
19
+      <drugs-stock-dialog
20
+        ref="dialog"
21
+        :propForm="propForm"
22
+        :visibility="isVisibility"
23
+        v-on:dialog-comfirm="comfirm"
24
+        v-on:dialog-cancle="cancle"
25
+      ></drugs-stock-dialog>
26
+
27
+
28
+      <div class="cell clearfix">
29
+        <label class="title"><span class="name">入库时间</span> : </label>
30
+        <el-date-picker size="small" v-model="warehousing_time" prefix-icon="el-icon-date" :editable="false"
31
+                        style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
32
+                        value-format="yyyy-MM-dd"></el-date-picker>
33
+      </div>
34
+
35
+      <div class="cell clearfix">
36
+        <label class="title"><span class="name">经销商</span> : </label>
37
+        <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
38
+          <el-option
39
+            v-for="(option, index) in dealer"
40
+            :key="index"
41
+            :label="option.dealer_name"
42
+            :value="option.id">
43
+          </el-option>
44
+        </el-select>
45
+      </div>
46
+
47
+      <div class="cell clearfix">
48
+        <label class="title"><span class="name">厂商</span> : </label>
49
+
50
+        <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商"
51
+                   @change="changeManufacturer">
52
+          <el-option
53
+            v-for="(option, index) in manufacturer"
54
+            :key="index"
55
+            :label="option.manufacturer_name"
56
+            :value="option.id">
57
+          </el-option>
58
+        </el-select>
59
+      </div>
60
+
61
+      <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
62
+        <el-table
63
+          id="oictable"
64
+          :data="recordInfo.recordData"
65
+          :class="signAndWeighBoxPatients"
66
+          style="width: 100%"
67
+          border
68
+          max-height="450"
69
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
70
+        >
71
+          <el-table-column align="center" width="200">
72
+            <template slot="header" slot-scope="scope">
73
+              <span>药品名称<span style="color: red">*</span></span>
74
+            </template>
75
+
76
+            <template slot-scope="scope">
77
+              <el-form-item style="padding-top: 15px">
78
+                <el-input
79
+                  placeholder="请输入药品名称"
80
+                  v-model="scope.row.drug_id"
81
+                  :value="typeName(scope.row.drug_id)"
82
+                  @focus="showDialog(scope.$index, scope.row)"
83
+                ></el-input>
84
+              </el-form-item>
85
+            </template>
86
+          </el-table-column>
87
+          <el-table-column align="center" width="200">
88
+            <template slot="header" slot-scope="scope">
89
+              <span>规格名称<span style="color: red">*</span></span>
90
+            </template>
91
+            <template slot-scope="scope">
92
+              <el-form-item style="padding-top: 15px">
93
+                <el-input
94
+                  placeholder="请输入规格名称"
95
+                  v-model="scope.row.drug_id"
96
+                  :value="specificationName(scope.row.drug_id)"
97
+                  @focus="showDialog(scope.$index, scope.row)"
98
+                ></el-input>
99
+              </el-form-item>
100
+            </template>
101
+          </el-table-column>
102
+
103
+          <el-table-column align="center" width="150">
104
+            <template slot="header" slot-scope="scope">
105
+              <span>进价<span style="color: red">*</span></span>
106
+            </template>
107
+            <template slot-scope="scope">
108
+              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
109
+              <el-form-item
110
+                :prop="'recordData.' + scope.$index + '.price'"
111
+                :rules="tableRules.price"
112
+                style="padding-top: 17px"
113
+              >
114
+                <el-input
115
+                  placeholder="请输入单价"
116
+                  type="number"
117
+                  v-model="scope.row.price"
118
+                ></el-input>
119
+              </el-form-item>
120
+            </template>
121
+          </el-table-column>
122
+
123
+          <el-table-column align="center" width="180">
124
+            <template slot="header" slot-scope="scope">
125
+              <span>入库数量<span style="color: red">*</span></span>
126
+            </template>
127
+            <template slot-scope="scope">
128
+              <!--{{scope.row.warehousing_count}}-->
129
+              <!--<el-input type="number" v-model="scope.row.warehousing_count"   @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
130
+
131
+              <el-form-item
132
+                :prop="'recordData.' + scope.$index + '.warehousing_count'"
133
+                :rules="tableRules.warehousing_count"
134
+                style="padding-top: 17px"
135
+              >
136
+                <el-input
137
+                  placeholder="请输入入库数量"
138
+                  type="number"
139
+                  v-model="scope.row.warehousing_count"
140
+                ></el-input>
141
+              </el-form-item>
142
+            </template>
143
+          </el-table-column>
144
+          <el-table-column label="进价总价" align="center" width="150">
145
+            <template slot-scope="scope">
146
+              {{ calculate(scope.row.price * scope.row.warehousing_count) }}
147
+            </template>
148
+          </el-table-column>
149
+
150
+          <el-table-column label="零价" align="center" width="150">
151
+            <template slot-scope="scope">
152
+              <!--{{ // calculate(scope.row.price * scope.row.warehousing_count) }}-->
153
+            </template>
154
+          </el-table-column>
155
+
156
+          <el-table-column label="零价总价" align="center" width="150">
157
+            <template slot-scope="scope">
158
+              <!--{{ calculate(scope.row.price * scope.row.warehousing_count) }}-->
159
+            </template>
160
+          </el-table-column>
161
+          <el-table-column align="center" width="150">
162
+            <template slot="header" slot-scope="scope">
163
+              <span>批号</span>
164
+            </template>
165
+            <template slot-scope="scope">
166
+              <el-form-item>
167
+                <el-input
168
+                  placeholder="请输入批号"
169
+                  v-model="scope.row.number"
170
+                ></el-input>
171
+              </el-form-item>
172
+            </template>
173
+          </el-table-column>
174
+
175
+          <el-table-column label="生产日期" width="250" align="center">
176
+            <template slot-scope="scope">
177
+              <!--{{scope.row.product_date | parseTime("{y}-{m}-{d}")}}-->
178
+              <el-date-picker
179
+                prefix-icon="el-icon-date"
180
+                style="width: 145px"
181
+                v-model="scope.row.product_date"
182
+                type="date"
183
+                placeholder="选择日期时间"
184
+                format="yyyy-MM-dd"
185
+                value-format="yyyy-MM-dd"
186
+              ></el-date-picker>
187
+            </template>
188
+          </el-table-column>
189
+          <el-table-column label="有效日期" width="250" align="center">
190
+            <template slot-scope="scope">
191
+              <!--{{ scope.row.expiry_date | parseTime("{y}-{m}-{d}")}}-->
192
+              <el-date-picker
193
+                prefix-icon="el-icon-date"
194
+                style="width: 145px"
195
+                v-model="scope.row.expiry_date"
196
+                type="date"
197
+                placeholder="选择日期时间"
198
+                format="yyyy-MM-dd"
199
+                value-format="yyyy-MM-dd"
200
+              ></el-date-picker>
201
+            </template>
202
+          </el-table-column>
203
+          <el-table-column label="备注" width="150" align="center">
204
+            <template slot-scope="scope">
205
+              <el-input v-model="scope.row.remark"></el-input>
206
+            </template>
207
+          </el-table-column>
208
+
209
+          <el-table-column
210
+            label="操作"
211
+            fixed="right"
212
+            align="center"
213
+            width="150"
214
+          >
215
+            <template slot-scope="scope">
216
+              <el-tooltip
217
+                class="item"
218
+                effect="dark"
219
+                content="新增"
220
+                placement="top"
221
+              >
222
+                <el-button
223
+                  size="mini"
224
+                  type="primary"
225
+                  icon="el-icon-circle-plus-outline"
226
+                  @click="handleEdit(scope.$index, scope.row)"
227
+                >
228
+                </el-button>
229
+              </el-tooltip>
230
+              <el-tooltip
231
+                class="item"
232
+                effect="dark"
233
+                content="删除"
234
+                placement="top"
235
+              >
236
+                <el-button
237
+                  size="mini"
238
+                  type="danger"
239
+                  icon="el-icon-delete"
240
+                  @click="handleDelete(scope.$index, scope.row)"
241
+                >
242
+                </el-button>
243
+              </el-tooltip>
244
+            </template>
245
+          </el-table-column>
246
+        </el-table>
247
+      </el-form>
248
+
249
+
250
+    </div>
251
+  </div>
252
+
253
+</template>
254
+
255
+<script>
256
+  import { uParseTime } from '@/utils/tools'
257
+
258
+  import {
259
+    GetAllConfig,
260
+    GetAllDrugInfoByID,
261
+    postDrugWarehouse
262
+  } from "@/api/drug/drug_stock";
263
+  import BreadCrumb from '../../components/bread-crumb'
264
+  import DrugsStockDialog from './drugsStockDialog/index'
265
+
266
+  export default {
267
+    components: { DrugsStockDialog, BreadCrumb },
268
+    name: 'stockIn',
269
+
270
+    data() {
271
+      var checkGoodId = (rule, value, callback) => {
272
+        setTimeout(() => {
273
+          if (value == '' || value == 0) {
274
+            return callback(new Error('规格名称不能为空'))
275
+          }
276
+        }, 2000)
277
+      }
278
+
279
+      return {
280
+        crumbs: [
281
+          { path: false, name: '库存管理' },
282
+          { path: false, name: '耗材入库单' },
283
+          { path: false, name: '新增入库单' }
284
+        ],
285
+        crumbs2: [
286
+          { path: false, name: '库存管理' },
287
+          { path: false, name: '其他入库单' },
288
+          { path: false, name: '新增入库单' }
289
+        ],
290
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
291
+        warehousing_time: '',
292
+        adminUserOptions: null,
293
+        currentIndex: 0,
294
+
295
+        recordInfo: {
296
+          recordData: [],
297
+          stock_in_code: '',
298
+          current_index: ''
299
+
300
+        },
301
+        tableRules: {
302
+          price: [
303
+            { required: true, message: '单价不能为空', trigger: 'blur' }
304
+          ],
305
+          warehousing_count: [
306
+            { required: true, message: '数量不能为空', trigge: 'blur' }
307
+          ],
308
+
309
+          good_id: [
310
+            { validator: checkGoodId, trigger: 'blur' }
311
+          ]
312
+
313
+        },
314
+        type: this.$route.query.type,
315
+        total: '',
316
+        product_date: '',
317
+        expiry_date: '',
318
+        numbers: '',
319
+
320
+        // prop
321
+        isVisibility: false,
322
+        propForm: {
323
+          goods: [],
324
+          goodType: [],
325
+          goodInfo: [],
326
+          goodUnit: [],
327
+          title: '入库',
328
+          formValue: {
329
+            good_type_id: '',
330
+            good_id: '',
331
+            number: '',
332
+            product_date: '',
333
+            expiry_date: '',
334
+            warehousing_count: '',
335
+            price: '',
336
+            remark: '',
337
+            dealer: '',
338
+            manufacturer: ''
339
+
340
+          },
341
+          isCreated: 1
342
+
343
+        },
344
+        form: {
345
+          manufacturer: '',
346
+          dealer: ''
347
+        },
348
+
349
+        formValue: {
350
+          good_type_id: '',
351
+          good_id: '',
352
+          number: '',
353
+          product_date: '',
354
+          expiry_date: '',
355
+          warehousing_count: '',
356
+          price: '',
357
+          remark: '',
358
+          dealer: '',
359
+          manufacturer: ''
360
+
361
+        },
362
+
363
+        manufacturer: [],
364
+        dealer: [],
365
+        goodType: [],
366
+        goodInfo:[]
367
+      }
368
+    },
369
+    methods: {
370
+      handleSave: function() {
371
+        if (this.recordInfo.recordData.length <= 0) {
372
+          this.$message.error('请添加入库信息')
373
+          return
374
+        }
375
+        sessionStorage.removeItem('warehousing_orders')
376
+        this.$router.back(-1)
377
+      }, handleCancle: function() {
378
+        this.$confirm('是否放弃编辑返回上一页?', '放弃编辑', {
379
+          confirmButtonText: '确定',
380
+          cancelButtonText: '取消',
381
+          type: 'warning'
382
+        }).then(() => {
383
+          sessionStorage.removeItem('warehousing_orders')
384
+          this.$router.back(-1)
385
+        }).catch(() => {
386
+
387
+        })
388
+      }, handleCreate: function() {
389
+
390
+        this.propForm.formValue = {}
391
+        this.propForm.isCreated = 1
392
+        this.isVisibility = true
393
+      }, comfirm: function(val) {
394
+
395
+        this.$refs.dialog.hide()
396
+        if (val.selectedGoodInfo.length > 0) {
397
+          for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
398
+            if (i == 0) {
399
+              this.recordInfo.recordData[this.currentIndex].drug_id = val.selectedGoodInfo[i].id
400
+
401
+            } else {
402
+              const tempForm = {}
403
+              tempForm["id"] = 0;
404
+              tempForm['drug_id'] = val.selectedGoodInfo[i].id
405
+              tempForm['number'] = ''
406
+              tempForm['product_date'] = ''
407
+              tempForm['expiry_date'] = ''
408
+              tempForm['warehousing_count'] = ''
409
+              tempForm['price'] = ''
410
+              tempForm['remark'] = ''
411
+              tempForm['dealer'] = ''
412
+              tempForm['manufacturer'] = ''
413
+              this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
414
+            }
415
+          }
416
+        }
417
+
418
+        this.currentIndex = -1
419
+      }, cancle: function() {
420
+        this.$refs.dialog.hide()
421
+      },  GetConfigInfo: function() {
422
+        const loading = this.$loading({
423
+          lock: true,
424
+          text: 'Loading',
425
+          spinner: 'el-icon-loading',
426
+          background: 'rgba(0, 0, 0, 0.7)'
427
+        })
428
+
429
+        GetAllConfig().then(response => {
430
+          if (response.data.state == 0) {
431
+            this.$message.error(response.data.msg)
432
+            return false
433
+          } else {
434
+            this.manufacturer = response.data.data.manufacturer;
435
+            this.dealer = response.data.data.dealer;
436
+            for(let i = 0; i<  response.data.data.drugs.length;i++){
437
+              this.goodType.push(response.data.data.drugs[i])
438
+              if(response.data.data.drugs[i].drug_specs != null) {
439
+                for (let b = 0; b < response.data.data.drugs[i].drug_specs.length; b++) {
440
+                  this.goodInfo.push(response.data.data.drugs[i].drug_specs[b])
441
+                }
442
+              }
443
+            }
444
+            this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
445
+            this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
446
+
447
+            this.form.manufacturer = 0
448
+            this.form.dealer = 0
449
+          }
450
+          loading.close()
451
+
452
+        })
453
+      }, typeName: function(drug_id) {
454
+        let name = "";
455
+        for (let i = 0; i < this.goodInfo.length; i++) {
456
+          if (this.goodInfo[i].id == drug_id) {
457
+            name = this.goodInfo[i].drug_name;
458
+
459
+          }
460
+        }
461
+        return name;
462
+      }, specificationName: function(drug_id) {
463
+        let name = "";
464
+        for (let i = 0; i < this.goodInfo.length; i++) {
465
+          if (this.goodInfo[i].id == drug_id) {
466
+            name = this.goodInfo[i].drug_spec;
467
+          }
468
+        }
469
+        return name;
470
+      }, handleEdit: function(index, row) {
471
+        const tempObj = {}
472
+        tempObj['drug_id'] = 0
473
+        tempObj['number'] = ''
474
+        tempObj['product_date'] = ''
475
+        tempObj['expiry_date'] = ''
476
+        tempObj['warehousing_count'] = ''
477
+        tempObj['price'] = ''
478
+        tempObj['remark'] = ''
479
+        tempObj['dealer'] = ''
480
+        tempObj['manufacturer'] = ''
481
+        this.recordInfo.recordData.push(tempObj)
482
+      }, handleDelete: function(index, row) {
483
+        if (this.recordInfo.recordData.length <= 1) {
484
+          this.$message.error('只有一条记录的时候无法删除')
485
+          return
486
+        } else {
487
+          this.recordInfo.recordData.splice(index, 1)
488
+        }
489
+      }, calculate: function(val) {
490
+        if (val == 0) {
491
+          return ''
492
+        }
493
+        return Math.round(parseFloat(val) * 100) / 100
494
+      },
495
+      // GetWarehouseInfoByOrdeNumber: function() {
496
+      //   const params = {
497
+      //     'warehousing_order': sessionStorage.getItem('warehousing_orders')
498
+      //   }
499
+      //   this.recordInfo.recordData = []
500
+      //   getWarehouseInfoByOrdeNumber(params).then(response => {
501
+      //     if (response.data.state != 0) {
502
+      //       for (let i = 0; i < response.data.data.info.length; i++) {
503
+      //         this.recordInfo.recordData.push(response.data.data.info[i])
504
+      //       }
505
+      //     }
506
+      //   })
507
+      // },
508
+      getTime(val, temp) {
509
+        if (val != 0) {
510
+          return uParseTime(val, temp)
511
+        } else {
512
+          return ''
513
+        }
514
+      },
515
+      showDialog(index, row) {
516
+        const loading = this.$loading({
517
+          lock: true,
518
+          text: 'Loading',
519
+          spinner: 'el-icon-loading',
520
+          background: 'rgba(0, 0, 0, 0.7)'
521
+        })
522
+        this.currentIndex = index
523
+        this.isVisibility = true
524
+        const params = {
525
+          manufacturer_id: this.form.manufacturer,
526
+          dealer_id: this.form.dealer
527
+        }
528
+        GetAllDrugInfoByID(params).then(response => {
529
+            if (response.data.state == 0) {
530
+              this.$message.error(response.data.msg)
531
+              return false
532
+              loading.close()
533
+
534
+            } else {
535
+              loading.close()
536
+
537
+              if (response.data.data.drugs.length <= 0) {
538
+                this.$message.error('该厂商或经销商没有药品信息')
539
+                return
540
+              }
541
+              this.$refs.dialog.show()
542
+              for (let i = 0; i < response.data.data.drugs.length; i++) {
543
+                this.propForm.goods.push(
544
+                  response.data.data.drugs[i]
545
+                );
546
+              }
547
+              const obj = {};
548
+              this.propForm.goods = this.propForm.goods.reduce(
549
+                (cur, next) => {
550
+                  obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
551
+                  return cur;
552
+                },
553
+                []
554
+              ); // 设置cur默认类型为数组,并且初始值为空的数组
555
+            }
556
+
557
+            for (let i = 0; i < this.propForm.goods.length; i++) {
558
+              for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
559
+                var respObj = this.propForm.goods[i].drug_specs[a];
560
+                respObj["isSelected"] = false;
561
+              }
562
+            }
563
+          }
564
+        )
565
+      },
566
+      getSummaries(param) {
567
+        const { columns, data } = param
568
+        const sums = []
569
+        columns.forEach((column, index) => {
570
+          if (index === 0) {
571
+            sums[index] = '总价'
572
+            return
573
+          }
574
+          const values = data.map(item => Number(item[column.property]))
575
+          if (!values.every(value => isNaN(value))) {
576
+            sums[index] = values.reduce((prev, curr) => {
577
+              const value = Number(curr)
578
+              if (!isNaN(value)) {
579
+                return prev + curr
580
+              } else {
581
+                return prev
582
+              }
583
+            }, 0)
584
+            sums[index] += ' 元'
585
+          } else {
586
+            sums[index] = 'N/A'
587
+          }
588
+        })
589
+
590
+        return sums
591
+      }
592
+      ,
593
+      back() {
594
+        this.$router.go(-1)
595
+      }
596
+      ,
597
+      submit() {
598
+        this.$refs['tableForm'].validate((valid) => {
599
+          if (valid) {
600
+            const array = this.recordInfo.recordData
601
+            for (let i = 0; i < array.length; i++) {
602
+
603
+              if (array[i].drug_id == 0) {
604
+                this.$message.error('药品名称或者药品规格名称不能为空')
605
+                return
606
+              }
607
+            }
608
+
609
+            if(this.recordInfo.recordData.length <= 0){
610
+              this.$message.success('请添加入库商品')
611
+              return
612
+            }
613
+
614
+            const params = {
615
+              'stockIn': this.recordInfo.recordData
616
+            }
617
+            postDrugWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type).then(response => {
618
+              if (response.data.state == 0) {
619
+                this.$message.error(response.data.msg)
620
+                return false
621
+              } else {
622
+                this.$message.success('入库成功')
623
+
624
+                this.$router.back(-1)
625
+              }
626
+            })
627
+          } else {
628
+            return false
629
+          }
630
+        })
631
+      }
632
+      ,
633
+      changeManufacturer(val) {
634
+
635
+      }, changeDealer(val) {
636
+
637
+      }
638
+    }
639
+    ,
640
+    created() {
641
+      var nowDate = new Date()
642
+      var nowYear = nowDate.getFullYear()
643
+      var nowMonth = nowDate.getMonth() + 1
644
+      var nowDay = nowDate.getDate()
645
+      this.warehousing_time =
646
+        nowYear +
647
+        '-' +
648
+        (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
649
+        '-' +
650
+        (nowDay < 10 ? '0' + nowDay : nowDay)
651
+      const tempObj = {}
652
+      tempObj['drug_id'] = 0
653
+      tempObj['number'] = ''
654
+      tempObj['product_date'] = ''
655
+      tempObj['expiry_date'] = ''
656
+      tempObj['warehousing_count'] = ''
657
+      tempObj['price'] = ''
658
+      tempObj['remark'] = ''
659
+      tempObj['dealer'] = ''
660
+      tempObj['manufacturer'] = ''
661
+
662
+      this.recordInfo.recordData.push(tempObj)
663
+      this.GetConfigInfo()
664
+      this.propForm.goodUnit = this.$store.getters.good_unit
665
+    }
666
+
667
+  }
668
+</script>
669
+
670
+<style>
671
+  #oictable ::-webkit-scrollbar {
672
+    height: 15px;
673
+  }
674
+</style>
675
+
676
+<style rel="stylesheet/css" lang="scss" scoped>
677
+  .information {
678
+    border: 1px #dcdfe6 solid;
679
+    padding: 30px 20px 30px 20px;
680
+
681
+  .border {
682
+    border-bottom: 1px #dcdfe6 solid;
683
+    margin: 0px 0 20px 0;
684
+  }
685
+
686
+  }
687
+
688
+  .edit_separater {
689
+    border-top: 1px solid rgb(233, 233, 233);
690
+    margin-top: 15px;
691
+    margin-bottom: 15px;
692
+  }
693
+
694
+</style>
695
+
696
+<style>
697
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
698
+    font-size: 12px;
699
+  }
700
+
701
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
702
+    background: #6fb5fa;
703
+  }
704
+
705
+</style>

+ 281 - 0
src/xt_pages/stock/drugs/drugStockInOrderDetail.vue Vedi File

@@ -0,0 +1,281 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb
5
+        v-if="this.$route.query.type == 1"
6
+        :crumbs="crumbs"
7
+      ></bread-crumb>
8
+      <bread-crumb
9
+        v-if="this.$route.query.type == 2"
10
+        :crumbs="crumbs2"
11
+      ></bread-crumb>
12
+    </div>
13
+    <div class="app-container">
14
+      <div class="filter-container">
15
+        <span style="font-size: 18px;color: #606266">入库单详情</span>
16
+        <el-row style="float:right;">
17
+          <span style="color: #606266"
18
+            >入库单号: {{ WarehouseInfo.warehouse.warehousing_order }}</span
19
+          >
20
+        </el-row>
21
+      </div>
22
+
23
+      <div class="cell clearfix">
24
+        <span style="width: 300px;color: #606266"
25
+          >单据日期:
26
+          {{
27
+            WarehouseInfo.warehouse.warehousing_time | parseTime("{y}-{m}-{d}")
28
+          }}</span
29
+        >
30
+        <span style="width: 300px;color: #606266"
31
+          >厂商:
32
+          {{ WarehouseInfo.warehouse.manufacturers?  WarehouseInfo.warehouse.manufacturers.manufacturer_name:'' }}</span
33
+        >
34
+        <span style="width: 300px;color: #606266"
35
+          >经销商: {{ WarehouseInfo.warehouse.dealers?WarehouseInfo.warehouse.dealers.dealer_name:''}}</span
36
+        >
37
+      </div>
38
+
39
+      <div class="cell clearfix" style="margin-top: 10px">
40
+        <el-button size="small" icon="el-icon-edit" @click="editRecord"
41
+          >编辑</el-button
42
+        >
43
+        <el-button size="small" icon="el-icon-delete" @click="deleteRecord"
44
+          >删除</el-button
45
+        >
46
+      </div>
47
+
48
+      <el-row :gutter="12" style="margin-top: 10px">
49
+        <el-table
50
+          :data="WarehouseInfo.warehouseInfoDate"
51
+          :class="signAndWeighBoxPatients"
52
+          style="width: 100%"
53
+          border
54
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
55
+        >
56
+          <el-table-column min-width="35" align="center">
57
+            <template slot="header" slot-scope="scope">
58
+              <span>药品名称</span>
59
+            </template>
60
+
61
+            <template slot-scope="scope">
62
+              <span v-if="scope.row.drug_id != 0">{{
63
+                scope.row.drug.drug_name
64
+              }}</span>
65
+            </template>
66
+          </el-table-column>
67
+          <el-table-column min-width="35" align="center">
68
+            <template slot="header" slot-scope="scope">
69
+              <span>规格名称</span>
70
+            </template>
71
+            <template slot-scope="scope">
72
+              <span v-if="scope.row.drug_id != 0">{{
73
+                scope.row.drug?scope.row.drug.drug_spec:''
74
+              }}</span>
75
+            </template>
76
+          </el-table-column>
77
+
78
+          <el-table-column min-width="23" align="center">
79
+            <template slot="header" slot-scope="scope">
80
+              <span>单价</span>
81
+            </template>
82
+            <template slot-scope="scope">
83
+              <span>{{ scope.row.price }}</span>
84
+            </template>
85
+          </el-table-column>
86
+
87
+          <el-table-column min-width="23" align="center">
88
+            <template slot="header" slot-scope="scope">
89
+              <span>入库数量</span>
90
+            </template>
91
+            <template slot-scope="scope">
92
+              <span>{{ scope.row.warehousing_count }}</span>
93
+            </template>
94
+          </el-table-column>
95
+
96
+          <el-table-column label="总价" min-width="20" align="center">
97
+            <template slot-scope="scope">
98
+              {{ calculate(scope.row.price * scope.row.warehousing_count) }}
99
+            </template>
100
+          </el-table-column>
101
+
102
+          <el-table-column align="center" min-width="25">
103
+            <template slot="header" slot-scope="scope">
104
+              <span>批号</span>
105
+            </template>
106
+            <template slot-scope="scope">
107
+              <span>{{ scope.row.number }}</span>
108
+            </template>
109
+          </el-table-column>
110
+          <el-table-column label="生产日期" min-width="40" align="center">
111
+            <template v-if="scope.row.product_date != 0" slot-scope="scope">
112
+              {{ scope.row.product_date | parseTime("{y}-{m}-{d}") }}
113
+            </template>
114
+          </el-table-column>
115
+          <el-table-column label="有效日期" min-width="40" align="center">
116
+            <template v-if="scope.row.expiry_date != 0" slot-scope="scope">
117
+              {{ scope.row.expiry_date | parseTime("{y}-{m}-{d}") }}
118
+            </template>
119
+          </el-table-column>
120
+          <el-table-column label="备注" min-width="20" align="center">
121
+            <template slot-scope="scope">
122
+              <el-popover placement="top-start" width="250" trigger="hover">
123
+                <div>{{ scope.row.remark }}</div>
124
+                <span slot="reference" v-if="scope.row.remark.length > 20">{{
125
+                  scope.row.remark.substr(0, 20) + "..."
126
+                }}</span>
127
+                <span slot="reference" v-else>{{ scope.row.remark }}</span>
128
+              </el-popover>
129
+            </template>
130
+          </el-table-column>
131
+        </el-table>
132
+      </el-row>
133
+    </div>
134
+  </div>
135
+</template>
136
+
137
+<script>
138
+import { uParseTime } from "@/utils/tools";
139
+import {
140
+  GetAllConfig,
141
+  getDrugWarehouseInfoList,
142
+  deleteDrugWarehouseInfo
143
+} from "@/api/drug/drug_stock";
144
+import BreadCrumb from "../../components/bread-crumb";
145
+
146
+export default {
147
+  name: "stockInOrderDetail",
148
+  components: { BreadCrumb },
149
+  created() {
150
+    const order_id = this.$route.query.id;
151
+    this.GetOrderDetail(order_id);
152
+  },
153
+  data() {
154
+    return {
155
+      crumbs: [
156
+        { path: false, name: "库存管理" },
157
+        { path: false, name: "耗材入库单" },
158
+        { path: false, name: "入库单详情" }
159
+      ],
160
+      crumbs2: [
161
+        { path: false, name: "库存管理" },
162
+        { path: false, name: "其他入库单" },
163
+        { path: false, name: "入库单详情" }
164
+      ],
165
+      isEdit: 0,
166
+      checked: false,
167
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
168
+      goodType: [],
169
+      goodInfo: [],
170
+      manufacturer: [],
171
+      dealer: [],
172
+      Warehouse: {
173
+        loading: false,
174
+        warehouseDate: [],
175
+        tableCurrentIndex: ""
176
+      },
177
+
178
+      WarehouseInfo: {
179
+        loading: false,
180
+        warehouseInfoDate: [],
181
+        warehouse: {}
182
+      }
183
+    };
184
+  },
185
+  methods: {
186
+
187
+    calculate: function(val) {
188
+      if (val == 0) {
189
+        return "";
190
+      }
191
+      return Math.round(parseFloat(val) * 100) / 100;
192
+    },
193
+    GetOrderDetail: function(order_id) {
194
+      const params = {
195
+        id: order_id
196
+      };
197
+      getDrugWarehouseInfoList(params).then(response => {
198
+        if (response.data.state == 0) {
199
+          this.$message.error(response.data.msg);
200
+          return false;
201
+        } else {
202
+          for (let i = 0; i < response.data.data.info.length; i++) {
203
+            this.WarehouseInfo.warehouseInfoDate.push(
204
+              response.data.data.info[i]
205
+            );
206
+          }
207
+          this.WarehouseInfo.warehouse = response.data.data.warehousing;
208
+        }
209
+      });
210
+    },
211
+    deleteRecord: function() {
212
+      const ids = [];
213
+      ids.push(this.WarehouseInfo.warehouse.id);
214
+      const idStr = ids.join(",");
215
+
216
+      const params = {
217
+        ids: idStr
218
+      };
219
+
220
+      this.$confirm("确认删除入库单记录?", "删除入库单记录", {
221
+        confirmButtonText: "确定",
222
+        cancelButtonText: "取消",
223
+        type: "warning"
224
+      })
225
+        .then(() => {
226
+          deleteDrugWarehouseInfo(params).then(response => {
227
+            if (response.data.state == 0) {
228
+              this.$message.error(response.data.msg);
229
+              return false;
230
+            } else {
231
+              this.$notify({
232
+                title: "成功",
233
+                message: "删除成功",
234
+                type: "success",
235
+                duration: 2000
236
+              });
237
+
238
+              this.$router.back(-1);
239
+            }
240
+          });
241
+        })
242
+        .catch(() => {});
243
+    },
244
+    editRecord: function() {
245
+      this.$emit("edit-record");
246
+    }
247
+  }
248
+};
249
+</script>
250
+
251
+<style rel="stylesheet/css" lang="scss" scoped>
252
+.information {
253
+  border: 1px #dcdfe6 solid;
254
+  padding: 30px 20px 30px 20px;
255
+
256
+  .border {
257
+    border-bottom: 1px #dcdfe6 solid;
258
+    margin: 0px 0 20px 0;
259
+  }
260
+}
261
+
262
+.edit_separater {
263
+  border-top: 1px solid rgb(233, 233, 233);
264
+  margin-top: 15px;
265
+  margin-bottom: 15px;
266
+}
267
+</style>
268
+
269
+<style>
270
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
271
+  font-size: 12px;
272
+}
273
+
274
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
275
+  background: #6fb5fa;
276
+}
277
+
278
+.count {
279
+  color: #bd2c00;
280
+}
281
+</style>

+ 703 - 0
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue Vedi File

@@ -0,0 +1,703 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb
5
+        v-if="this.$route.query.type == 1"
6
+        :crumbs="crumbs"
7
+      ></bread-crumb>
8
+      <bread-crumb
9
+        v-if="this.$route.query.type == 2"
10
+        :crumbs="crumbs2"
11
+      ></bread-crumb>
12
+
13
+      <div style="float:right;">
14
+        <el-button size="small" @click="back()" class="filter-item"
15
+          >取 消</el-button
16
+        >
17
+        <el-button
18
+          size="small"
19
+          type="primary"
20
+          @click="submit()"
21
+          class="filter-item"
22
+          >保 存</el-button
23
+        >
24
+      </div>
25
+    </div>
26
+
27
+    <div class="app-container">
28
+      <!--<stock-in-dialog-->
29
+        <!--ref="dialog"-->
30
+        <!--:propForm="propForm"-->
31
+        <!--:visibility="isVisibility"-->
32
+        <!--v-on:dialog-comfirm="comfirm"-->
33
+        <!--v-on:dialog-cancle="cancle"-->
34
+      <!--&gt;</stock-in-dialog>-->
35
+      <drugs-stock-dialog
36
+        ref="dialog"
37
+        :propForm="propForm"
38
+        :visibility="isVisibility"
39
+        v-on:dialog-comfirm="comfirm"
40
+        v-on:dialog-cancle="cancle"
41
+      >
42
+      </drugs-stock-dialog>
43
+
44
+      <div class="cell clearfix">
45
+        <label class="title"><span class="name">入库时间</span> : </label>
46
+        <el-date-picker
47
+          size="small"
48
+          v-model="warehousing_time"
49
+          prefix-icon="el-icon-date"
50
+          :editable="false"
51
+          style="width: 196px;"
52
+          type="date"
53
+          placeholder="选择日期时间"
54
+          align="right"
55
+          format="yyyy-MM-dd"
56
+          value-format="yyyy-MM-dd"
57
+        >
58
+        </el-date-picker>
59
+      </div>
60
+
61
+      <div class="cell clearfix">
62
+        <label class="title"><span class="name">经销商</span> : </label>
63
+        <el-select
64
+          size="small"
65
+          v-model="form.dealer"
66
+          clearable
67
+          placeholder="请选择经销商"
68
+        >
69
+          <el-option
70
+            v-for="(option, index) in dealer"
71
+            :key="index"
72
+            :label="option.dealer_name"
73
+            :value="option.id"
74
+          >
75
+          </el-option>
76
+        </el-select>
77
+      </div>
78
+
79
+      <div class="cell clearfix">
80
+        <label class="title"><span class="name">厂商</span> : </label>
81
+
82
+        <el-select
83
+          size="small"
84
+          v-model="form.manufacturer"
85
+          clearable
86
+          placeholder="请选择厂商"
87
+        >
88
+          <el-option
89
+            v-for="(option, index) in manufacturer"
90
+            :key="index"
91
+            :label="option.manufacturer_name"
92
+            :value="option.id"
93
+          >
94
+          </el-option>
95
+        </el-select>
96
+      </div>
97
+
98
+      <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
99
+        <el-table
100
+          id="oictable"
101
+          :data="recordInfo.recordData"
102
+          :class="signAndWeighBoxPatients"
103
+          style="width: 100%"
104
+          border
105
+          max-height="450"
106
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
107
+        >
108
+          <el-table-column align="center" width="200">
109
+            <template slot="header" slot-scope="scope">
110
+              <span>药品名称<span style="color: red">*</span></span>
111
+            </template>
112
+
113
+            <template slot-scope="scope">
114
+              <el-form-item style="padding-top: 15px">
115
+                <el-input
116
+                  placeholder="请输入药品名称"
117
+                  v-model="scope.row.drug_id"
118
+                  :value="typeName(scope.row.drug_id)"
119
+                  @focus="showDialog(scope.$index, scope.row)"
120
+                ></el-input>
121
+              </el-form-item>
122
+            </template>
123
+          </el-table-column>
124
+          <el-table-column align="center" width="200">
125
+            <template slot="header" slot-scope="scope">
126
+              <span>规格名称<span style="color: red">*</span></span>
127
+            </template>
128
+            <template slot-scope="scope">
129
+              <el-form-item style="padding-top: 15px">
130
+                <el-input
131
+                  placeholder="请输入规格名称"
132
+                  v-model="scope.row.drug_id"
133
+                  :value="specificationName(scope.row.drug_id)"
134
+                  @focus="showDialog(scope.$index, scope.row)"
135
+                ></el-input>
136
+              </el-form-item>
137
+            </template>
138
+          </el-table-column>
139
+
140
+          <el-table-column align="center" width="150">
141
+            <template slot="header" slot-scope="scope">
142
+              <span>进价<span style="color: red">*</span></span>
143
+            </template>
144
+            <template slot-scope="scope">
145
+              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
146
+              <el-form-item
147
+                :prop="'recordData.' + scope.$index + '.price'"
148
+                :rules="tableRules.price"
149
+                style="padding-top: 17px"
150
+              >
151
+                <el-input
152
+                  placeholder="请输入单价"
153
+                  type="number"
154
+                  v-model="scope.row.price"
155
+                ></el-input>
156
+              </el-form-item>
157
+            </template>
158
+          </el-table-column>
159
+
160
+          <el-table-column align="center" width="180">
161
+            <template slot="header" slot-scope="scope">
162
+              <span>入库数量<span style="color: red">*</span></span>
163
+            </template>
164
+            <template slot-scope="scope">
165
+              <!--{{scope.row.warehousing_count}}-->
166
+              <!--<el-input type="number" v-model="scope.row.warehousing_count"   @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
167
+
168
+              <el-form-item
169
+                :prop="'recordData.' + scope.$index + '.warehousing_count'"
170
+                :rules="tableRules.warehousing_count"
171
+                style="padding-top: 17px"
172
+              >
173
+                <el-input
174
+                  placeholder="请输入入库数量"
175
+                  type="number"
176
+                  v-model="scope.row.warehousing_count"
177
+                ></el-input>
178
+              </el-form-item>
179
+            </template>
180
+          </el-table-column>
181
+          <el-table-column label="进价总价" align="center" width="150">
182
+            <template slot-scope="scope">
183
+              {{ calculate(scope.row.price * scope.row.warehousing_count) }}
184
+            </template>
185
+          </el-table-column>
186
+
187
+          <el-table-column label="零价" align="center" width="150">
188
+            <template slot-scope="scope">
189
+              <!--{{ // calculate(scope.row.price * scope.row.warehousing_count) }}-->
190
+            </template>
191
+          </el-table-column>
192
+
193
+          <el-table-column label="零价总价" align="center" width="150">
194
+            <template slot-scope="scope">
195
+              <!--{{ calculate(scope.row.price * scope.row.warehousing_count) }}-->
196
+            </template>
197
+          </el-table-column>
198
+          <el-table-column align="center" width="150">
199
+            <template slot="header" slot-scope="scope">
200
+              <span>批号</span>
201
+            </template>
202
+            <template slot-scope="scope">
203
+              <el-form-item>
204
+                <el-input
205
+                  placeholder="请输入批号"
206
+                  v-model="scope.row.number"
207
+                ></el-input>
208
+              </el-form-item>
209
+            </template>
210
+          </el-table-column>
211
+
212
+          <el-table-column label="生产日期" width="250" align="center">
213
+            <template slot-scope="scope">
214
+              <!--{{scope.row.product_date | parseTime("{y}-{m}-{d}")}}-->
215
+              <el-date-picker
216
+                prefix-icon="el-icon-date"
217
+                style="width: 145px"
218
+                v-model="scope.row.product_date"
219
+                type="date"
220
+                placeholder="选择日期时间"
221
+                format="yyyy-MM-dd"
222
+                value-format="yyyy-MM-dd"
223
+              ></el-date-picker>
224
+            </template>
225
+          </el-table-column>
226
+          <el-table-column label="有效日期" width="250" align="center">
227
+            <template slot-scope="scope">
228
+              <!--{{ scope.row.expiry_date | parseTime("{y}-{m}-{d}")}}-->
229
+              <el-date-picker
230
+                prefix-icon="el-icon-date"
231
+                style="width: 145px"
232
+                v-model="scope.row.expiry_date"
233
+                type="date"
234
+                placeholder="选择日期时间"
235
+                format="yyyy-MM-dd"
236
+                value-format="yyyy-MM-dd"
237
+              ></el-date-picker>
238
+            </template>
239
+          </el-table-column>
240
+          <el-table-column label="备注" width="150" align="center">
241
+            <template slot-scope="scope">
242
+              <el-input v-model="scope.row.remark"></el-input>
243
+            </template>
244
+          </el-table-column>
245
+
246
+          <el-table-column
247
+            label="操作"
248
+            fixed="right"
249
+            align="center"
250
+            width="150"
251
+          >
252
+            <template slot-scope="scope">
253
+              <el-tooltip
254
+                class="item"
255
+                effect="dark"
256
+                content="新增"
257
+                placement="top"
258
+              >
259
+                <el-button
260
+                  size="mini"
261
+                  type="primary"
262
+                  icon="el-icon-circle-plus-outline"
263
+                  @click="handleEdit(scope.$index, scope.row)"
264
+                >
265
+                </el-button>
266
+              </el-tooltip>
267
+              <el-tooltip
268
+                class="item"
269
+                effect="dark"
270
+                content="删除"
271
+                placement="top"
272
+              >
273
+                <el-button
274
+                  size="mini"
275
+                  type="danger"
276
+                  icon="el-icon-delete"
277
+                  @click="handleDelete(scope.$index, scope.row)"
278
+                >
279
+                </el-button>
280
+              </el-tooltip>
281
+            </template>
282
+          </el-table-column>
283
+        </el-table>
284
+      </el-form>
285
+    </div>
286
+  </div>
287
+</template>
288
+
289
+<script>
290
+// import stockInDialog from "./Dialog/stockInDialog";
291
+import { uParseTime } from "@/utils/tools";
292
+
293
+import {
294
+  GetAllConfig,
295
+  GetAllDrugInfoByID,
296
+  getDrugWarehouseInfoList,
297
+  modifyDrugWarehouseInfo,
298
+  deleteDrugWarehouseInfo,
299
+  DeleteDrugWarehouseInfoItem,
300
+  EditDrugWarehouse
301
+} from "@/api/drug/drug_stock";
302
+import BreadCrumb from "../../components/bread-crumb";
303
+import DrugsStockDialog from './drugsStockDialog/index'
304
+
305
+export default {
306
+  components: { DrugsStockDialog, BreadCrumb },
307
+  name: "stockIn",
308
+
309
+  data() {
310
+    var checkGoodId = (rule, value, callback) => {
311
+      setTimeout(() => {
312
+        if (value == "" || value == 0) {
313
+          return callback(new Error("规格名称不能为空"));
314
+        }
315
+      }, 2000);
316
+    };
317
+
318
+    return {
319
+      crumbs: [
320
+        { path: false, name: "库存管理" },
321
+        { path: false, name: "耗材入库单" },
322
+        { path: false, name: "编辑入库单" }
323
+      ],
324
+      crumbs2: [
325
+        { path: false, name: "库存管理" },
326
+        { path: false, name: "其他入库单" },
327
+        { path: false, name: "编辑入库单" }
328
+      ],
329
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
330
+      warehousing_time: "",
331
+      adminUserOptions: null,
332
+      currentIndex: 0,
333
+
334
+      recordInfo: {
335
+        recordData: [],
336
+        stock_in_code: "",
337
+        current_index: ""
338
+      },
339
+      tableRules: {
340
+        price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
341
+        warehousing_count: [
342
+          { required: true, message: "数量不能为空", trigge: "blur" }
343
+        ],
344
+
345
+        good_id: [{ validator: checkGoodId, trigger: "blur" }]
346
+      },
347
+
348
+      total: "",
349
+      product_date: "",
350
+      expiry_date: "",
351
+      numbers: "",
352
+      // prop
353
+      isVisibility: false,
354
+      propForm: {
355
+        goods: [],
356
+        goodType: [],
357
+        goodInfo: [],
358
+        goodUnit: [],
359
+        title: "入库",
360
+        isCreated: 1
361
+      },
362
+
363
+      form: {
364
+        manufacturer: "",
365
+        dealer: ""
366
+      },
367
+      warehouse: {},
368
+      manufacturer: [],
369
+      dealer: [],
370
+      goodType: [],
371
+      goodInfo:[],
372
+    };
373
+  },
374
+  methods: {
375
+    comfirm: function(val) {
376
+      this.$refs.dialog.hide();
377
+      console.log(val)
378
+      if (val.selectedGoodInfo.length > 0) {
379
+        for (let i = val.selectedGoodInfo.length - 1; i >= 0 ; i--) {
380
+          if (i == 0) {
381
+            this.recordInfo.recordData[this.currentIndex].drug_id =
382
+              val.selectedGoodInfo[i].id;
383
+          } else {
384
+
385
+            const tempForm = {};
386
+            tempForm["id"] = 0;
387
+            tempForm["drug_id"] = val.selectedGoodInfo[i].id;
388
+            tempForm["number"] = "";
389
+            tempForm["product_date"] = "";
390
+            tempForm["expiry_date"] = "";
391
+            tempForm["warehousing_count"] = "";
392
+            tempForm["price"] = "";
393
+            tempForm["remark"] = "";
394
+            tempForm["dealer"] = "";
395
+            tempForm["manufacturer"] = "";
396
+            this.recordInfo.recordData.splice(
397
+              this.currentIndex + 1,
398
+              0,
399
+              tempForm
400
+            );
401
+          }
402
+        }
403
+      }
404
+
405
+      console.log( this.recordInfo.recordData)
406
+
407
+      this.currentIndex = -1;
408
+    },
409
+    cancle: function() {
410
+      this.$refs.dialog.hide();
411
+      this.propForm.goods = [];
412
+
413
+      this.propForm.goodType = [];
414
+    },
415
+    GetConfigInfo: function() {
416
+      const loading = this.$loading({
417
+        lock: true,
418
+        text: "Loading",
419
+        spinner: "el-icon-loading",
420
+        background: "rgba(0, 0, 0, 0.7)"
421
+      });
422
+      GetAllConfig().then(response => {
423
+        if (response.data.state == 0) {
424
+          this.$message.error(response.data.msg);
425
+          return false;
426
+        } else {
427
+          this.manufacturer = response.data.data.manufacturer;
428
+          this.dealer = response.data.data.dealer;
429
+          for(let i = 0; i<  response.data.data.drugs.length;i++){
430
+            this.goodType.push(response.data.data.drugs[i])
431
+            if(response.data.data.drugs[i].drug_specs != null) {
432
+              for (let b = 0; b < response.data.data.drugs[i].drug_specs.length; b++) {
433
+                this.goodInfo.push(response.data.data.drugs[i].drug_specs[b])
434
+              }
435
+            }
436
+          }
437
+          this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
438
+          this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
439
+        }
440
+        loading.close();
441
+      });
442
+    },
443
+    typeName: function(drug_id) {
444
+      let name = "";
445
+      for (let i = 0; i < this.goodInfo.length; i++) {
446
+        if (this.goodInfo[i].id == drug_id) {
447
+          name = this.goodInfo[i].drug_name;
448
+
449
+        }
450
+      }
451
+      return name;
452
+    },
453
+    specificationName: function(drug_id) {
454
+      console.log(this.goodInfo)
455
+      let name = "";
456
+      for (let i = 0; i < this.goodInfo.length; i++) {
457
+        if (this.goodInfo[i].id == drug_id) {
458
+          name = this.goodInfo[i].drug_spec;
459
+        }
460
+      }
461
+      return name;
462
+    },
463
+    handleEdit: function(index, row) {
464
+      const tempObj = {};
465
+      tempObj["id"] = 0;
466
+      tempObj["drug_id"] = 0;
467
+      tempObj["number"] = "";
468
+      tempObj["product_date"] = "";
469
+      tempObj["expiry_date"] = "";
470
+      tempObj["warehousing_count"] = "";
471
+      tempObj["price"] = "";
472
+      tempObj["remark"] = "";
473
+      tempObj["dealer"] = "";
474
+      tempObj["manufacturer"] = "";
475
+      this.recordInfo.recordData.push(tempObj);
476
+    },
477
+    handleDelete: function(index, row) {
478
+      if (row.id == 0) {
479
+        this.recordInfo.recordData.splice(index, 1);
480
+      } else {
481
+        const params = {
482
+          id: row.id
483
+        };
484
+        this.$confirm("确认删除该入库商品信息记录?", "删除入库商品信息记录", {
485
+          confirmButtonText: "确定",
486
+          cancelButtonText: "取消",
487
+          type: "warning"
488
+        })
489
+          .then(() => {
490
+            DeleteDrugWarehouseInfoItem(params).then(response => {
491
+              if (response.data.state == 0) {
492
+                this.$message.error(response.data.msg);
493
+                return false;
494
+              } else {
495
+                this.$message.success("删除成功");
496
+
497
+                this.recordInfo.recordData.splice(index, 1);
498
+              }
499
+            });
500
+          })
501
+          .catch(() => {});
502
+      }
503
+    },
504
+    calculate: function(val) {
505
+      if (val == 0) {
506
+        return "";
507
+      }
508
+      return Math.round(parseFloat(val) * 100) / 100;
509
+    },
510
+    getTime(val, temp) {
511
+      if (val != 0) {
512
+        return uParseTime(val, temp);
513
+      } else {
514
+        return "";
515
+      }
516
+    },
517
+    showDialog(index, row) {
518
+      this.currentIndex = index;
519
+      const loading = this.$loading({
520
+        lock: true,
521
+        text: "Loading",
522
+        spinner: "el-icon-loading",
523
+        background: "rgba(0, 0, 0, 0.7)"
524
+      });
525
+
526
+      const params = {
527
+        manufacturer_id: this.form.manufacturer,
528
+        dealer_id: this.form.dealer
529
+      };
530
+      GetAllDrugInfoByID(params).then(response => {
531
+        if (response.data.state == 0) {
532
+          this.$message.error(response.data.msg);
533
+          return false;
534
+        } else {
535
+          if (response.data.data.drugs.length <= 0) {
536
+            this.$message.error("该厂商或经销商没有药品信息");
537
+            loading.close();
538
+
539
+            return;
540
+          }
541
+          this.$refs.dialog.show();
542
+          for (let i = 0; i < response.data.data.drugs.length; i++) {
543
+            this.propForm.goods.push(
544
+              response.data.data.drugs[i]
545
+            );
546
+          }
547
+          const obj = {};
548
+          this.propForm.goods = this.propForm.goods.reduce(
549
+            (cur, next) => {
550
+              obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
551
+              return cur;
552
+            },
553
+            []
554
+          ); // 设置cur默认类型为数组,并且初始值为空的数组
555
+        }
556
+
557
+        for (let i = 0; i < this.propForm.goods.length; i++) {
558
+          for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
559
+            var respObj = this.propForm.goods[i].drug_specs[a];
560
+            respObj["isSelected"] = false;
561
+          }
562
+        }
563
+        loading.close();
564
+      });
565
+    },
566
+    back() {
567
+      this.$router.go(-1);
568
+    },
569
+    submit() {
570
+      this.$refs["tableForm"].validate(valid => {
571
+        if (valid) {
572
+          const array = this.recordInfo.recordData;
573
+          for (let i = 0; i < array.length; i++) {
574
+            if (array[i].drug_id == 0) {
575
+              this.$message.error("药品名称或者药品规格名称不能为空");
576
+              return;
577
+            }
578
+          }
579
+          const params = {
580
+            stockIn: this.recordInfo.recordData
581
+          };
582
+
583
+          EditDrugWarehouse(
584
+            params,
585
+            this.warehousing_time,
586
+            this.$route.query.id,
587
+            this.$route.query.type,
588
+            this.form.manufacturer,
589
+            this.form.dealer
590
+          ).then(response => {
591
+            if (response.data.state == 0) {
592
+              this.$message.error(response.data.msg);
593
+              return false;
594
+            } else {
595
+              this.$message.success("入库成功");
596
+
597
+              this.$router.back(-1);
598
+            }
599
+          });
600
+        } else {
601
+          return false;
602
+        }
603
+      });
604
+    },
605
+    GetOrderDetail: function(order_id) {
606
+      const params = {
607
+        id: order_id
608
+      };
609
+      getDrugWarehouseInfoList(params).then(response => {
610
+        if (response.data.state == 0) {
611
+          this.$message.error(response.data.msg);
612
+          return false;
613
+        } else {
614
+          for (let i = 0; i < response.data.data.info.length; i++) {
615
+            response.data.data.info[i].product_date = this.getTime(
616
+              response.data.data.info[i].product_date,
617
+              "{y}-{m}-{d}"
618
+            );
619
+            response.data.data.info[i].expiry_date = this.getTime(
620
+              response.data.data.info[i].expiry_date,
621
+              "{y}-{m}-{d}"
622
+            );
623
+            response.data.data.info[i].price = response.data.data.info[
624
+              i
625
+            ].price.toString();
626
+            response.data.data.info[
627
+              i
628
+            ].warehousing_count = response.data.data.info[
629
+              i
630
+            ].warehousing_count.toString();
631
+
632
+            this.recordInfo.recordData.push(response.data.data.info[i]);
633
+          }
634
+
635
+          this.warehouse = response.data.data.warehousing;
636
+          this.form.manufacturer = this.warehouse.manufacturer;
637
+          this.form.dealer = this.warehouse.dealer;
638
+
639
+          this.warehousing_time = this.getTime(
640
+            this.warehouse.warehousing_time,
641
+            "{y}-{m}-{d}"
642
+          );
643
+
644
+          if (this.recordInfo.recordData.length == 0) {
645
+            const tempObj = {};
646
+            tempObj["id"] = 0;
647
+            tempObj["drug_id"] = 0;
648
+            tempObj["number"] = "";
649
+            tempObj["product_date"] = "";
650
+            tempObj["expiry_date"] = "";
651
+            tempObj["warehousing_count"] = "";
652
+            tempObj["price"] = "";
653
+            tempObj["remark"] = "";
654
+            tempObj["dealer"] = "";
655
+            tempObj["manufacturer"] = "";
656
+            this.recordInfo.recordData.push(tempObj);
657
+          }
658
+        }
659
+      });
660
+    }
661
+
662
+  },
663
+  created() {
664
+    this.GetConfigInfo();
665
+    this.propForm.goodUnit = this.$store.getters.good_unit;
666
+    const order_id = this.$route.query.id;
667
+    this.GetOrderDetail(order_id);
668
+  }
669
+};
670
+</script>
671
+<style>
672
+#oictable ::-webkit-scrollbar {
673
+  height: 15px;
674
+}
675
+</style>
676
+
677
+<style rel="stylesheet/css" lang="scss" scoped>
678
+.information {
679
+  border: 1px #dcdfe6 solid;
680
+  padding: 30px 20px 30px 20px;
681
+
682
+  .border {
683
+    border-bottom: 1px #dcdfe6 solid;
684
+    margin: 0px 0 20px 0;
685
+  }
686
+}
687
+
688
+.edit_separater {
689
+  border-top: 1px solid rgb(233, 233, 233);
690
+  margin-top: 15px;
691
+  margin-bottom: 15px;
692
+}
693
+</style>
694
+
695
+<style>
696
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
697
+  font-size: 12px;
698
+}
699
+
700
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
701
+  background: #6fb5fa;
702
+}
703
+</style>

+ 24 - 0
src/xt_pages/stock/drugs/drugStockOutDetail.vue Vedi File

@@ -0,0 +1,24 @@
1
+<template>
2
+  <stock-out-order-detail v-if="isEdit == 0"   v-on:edit-record="isEdit = 1"></stock-out-order-detail>
3
+  <stock-out-edit v-else></stock-out-edit>
4
+</template>
5
+
6
+<script>
7
+  import StockOutOrderDetail from './drugStockOutOrderDetail'
8
+  import StockOutEdit from './drugStockOutOrderEdit'
9
+  export default {
10
+    name: 'stockInDeatail',
11
+    components: { StockOutEdit, StockOutOrderDetail},
12
+    data() {
13
+      return {
14
+        isEdit: 0
15
+      }
16
+    }
17
+
18
+  }
19
+
20
+</script>
21
+
22
+<style scoped>
23
+
24
+</style>

+ 539 - 0
src/xt_pages/stock/drugs/drugStockOutOrder.vue Vedi File

@@ -0,0 +1,539 @@
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="AddNewOrder"
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
+    <div class="app-container">
16
+      <div class="cell clearfix">
17
+        <el-input
18
+          size="small"
19
+          style="width: 400px;"
20
+          class="filter-item"
21
+          v-model.trim="searchKey"
22
+          placeholder="单据编码/制单人/厂商"
23
+        />
24
+        <el-button
25
+          size="small"
26
+          class="filter-item"
27
+          type="primary"
28
+          icon="el-icon-search"
29
+          @click="search"
30
+          >搜索</el-button
31
+        >
32
+      </div>
33
+
34
+      <div class="cell clearfix">
35
+        <label class="title"><span class="name">出库时间</span> : </label>
36
+        <el-date-picker
37
+          size="small"
38
+          v-model="start_time"
39
+          prefix-icon="el-icon-date"
40
+          :editable="false"
41
+          style="width: 196px;"
42
+          type="date"
43
+          placeholder="选择日期时间"
44
+          align="right"
45
+          format="yyyy-MM-dd"
46
+          value-format="yyyy-MM-dd"
47
+          @change="startTimeChange"
48
+        ></el-date-picker>
49
+        <span class="cellLine"> - </span>
50
+        <el-date-picker
51
+          size="small"
52
+          v-model="end_time"
53
+          prefix-icon="el-icon-date"
54
+          :editable="false"
55
+          style="width: 196px;"
56
+          type="date"
57
+          placeholder="选择日期时间"
58
+          align="right"
59
+          format="yyyy-MM-dd"
60
+          value-format="yyyy-MM-dd"
61
+          @change="endTimeChange"
62
+        ></el-date-picker>
63
+      </div>
64
+
65
+      <div class="cell clearfix">
66
+        <el-checkbox
67
+          style="width: 70px"
68
+          v-model="checked"
69
+          @change="changeAllSelected"
70
+          >全选</el-checkbox
71
+        >
72
+        <el-button size="small" icon="el-icon-delete" @click="batchDelete"
73
+          >删除</el-button
74
+        >
75
+      </div>
76
+
77
+      <el-table
78
+        :data="warehouseOutDate"
79
+        :class="signAndWeighBoxPatients"
80
+        style="width: 100%"
81
+        border
82
+        highlight-current-row
83
+        ref="multipleTable"
84
+        @selection-change="select"
85
+        :row-style="{ color: '#303133' }"
86
+        :header-cell-style="{
87
+          backgroundColor: 'rgb(245, 247, 250)',
88
+          color: '#606266'
89
+        }"
90
+      >
91
+        <el-table-column type="selection" width="55" align="center"> </el-table-column>
92
+
93
+        <el-table-column label="单据日期" align="center">
94
+          <template slot-scope="scope">
95
+            {{ scope.row.warehouse_out_time | parseTime("{y}-{m}-{d}") }}
96
+          </template>
97
+        </el-table-column>
98
+
99
+        <el-table-column label="单据编号" align="center">
100
+          <template slot-scope="scope">
101
+            {{ scope.row.warehouse_out_order_number }}
102
+          </template>
103
+        </el-table-column>
104
+
105
+        <el-table-column label="制单人" align="center">
106
+          <template slot-scope="scope">
107
+            {{ getXuserName(scope.row.creater) }}
108
+          </template>
109
+        </el-table-column>
110
+
111
+        <el-table-column label="厂家" align="center">
112
+          <template slot-scope="scope">
113
+            {{scope.row.manufacturers ? scope.row.manufacturers.manufacturer_name:''}}
114
+          </template>
115
+        </el-table-column>
116
+
117
+        <el-table-column label="经销商" align="center">
118
+          <template slot-scope="scope">
119
+            {{scope.row.dealers ? scope.row.dealers.dealer_name:''}}
120
+          </template>
121
+        </el-table-column>
122
+
123
+        <el-table-column label="操作" align="center">
124
+          <template slot-scope="scope">
125
+            <el-tooltip
126
+              class="item"
127
+              effect="dark"
128
+              content="编辑"
129
+              placement="top"
130
+            >
131
+              <el-button
132
+                size="mini"
133
+                type="primary"
134
+                icon="el-icon-edit-outline"
135
+                @click="handleEdit(scope.$index, scope.row)"
136
+              >
137
+              </el-button>
138
+            </el-tooltip>
139
+            <el-tooltip
140
+              class="item"
141
+              effect="dark"
142
+              content="删除"
143
+              placement="top"
144
+            >
145
+              <el-button
146
+                size="mini"
147
+                type="danger"
148
+                :disabled="scope.row.is_sys == 1"
149
+                icon="el-icon-delete"
150
+                @click="handleDelete(scope.$index, scope.row)"
151
+              >
152
+              </el-button>
153
+            </el-tooltip>
154
+          </template>
155
+        </el-table-column>
156
+      </el-table>
157
+      <el-pagination
158
+        @size-change="handleSizeChange"
159
+        @current-change="handleCurrentChange"
160
+        :page-sizes="[10, 50, 100]"
161
+        :page-size="10"
162
+        background
163
+        style="margin-top:20px;float: right"
164
+        layout="total, sizes, prev, pager, next, jumper"
165
+        :total="total"
166
+      >
167
+      </el-pagination>
168
+    </div>
169
+  </div>
170
+</template>
171
+
172
+<script>
173
+import { uParseTime } from "@/utils/tools";
174
+import { fetchAllAdminUsers, fetchAllDoctorAndNurse } from "@/api/doctor";
175
+
176
+import {
177
+  deleteDrugWarehouseOut,
178
+  GetAllConfig,
179
+  getDrugWarehouseOutList
180
+} from "@/api/drug/drug_stock";
181
+import BreadCrumb from "../../components/bread-crumb";
182
+
183
+export default {
184
+  name: "salesReturnOrder",
185
+  components: { BreadCrumb },
186
+  created() {
187
+    var nowDate = new Date();
188
+    var nowYear = nowDate.getFullYear();
189
+    var nowMonth = nowDate.getMonth() + 1;
190
+    var nowDay = nowDate.getDate();
191
+    this.end_time =
192
+      nowYear +
193
+      "-" +
194
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
195
+      "-" +
196
+      (nowDay < 10 ? "0" + nowDay : nowDay);
197
+    nowDate.setMonth(nowDate.getMonth() - 1);
198
+    nowYear = nowDate.getFullYear();
199
+    nowMonth = nowDate.getMonth() + 1;
200
+    nowDay = nowDate.getDate();
201
+    this.start_time =
202
+      nowYear +
203
+      "-" +
204
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
205
+      "-" +
206
+      (nowDay < 10 ? "0" + nowDay : nowDay);
207
+    this.GetWarehouseOut();
208
+    this.GetConfigInfo();
209
+    this.fetchAllAdminUsers();
210
+  },
211
+  data() {
212
+    return {
213
+      searchKey: "",
214
+      crumbs: [
215
+        { path: false, name: "库存管理" },
216
+        { path: false, name: "出库单" }
217
+      ],
218
+      page: 1,
219
+      limit: 10,
220
+      checked: false,
221
+      total: 0,
222
+      pageTotal: 0,
223
+      pageSelect: 0,
224
+      adminUserOptions: [],
225
+      multipleSelection: [],
226
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
227
+      start_time: "",
228
+      warehouseOutDate: [],
229
+      end_time: "",
230
+      goodType: [],
231
+      goodInfo: [],
232
+      manufacturer: [],
233
+      selectedTableData: [],
234
+      dealer: [],
235
+      type: 1
236
+    };
237
+  },
238
+  methods: {
239
+    search: function() {
240
+      const Params = {
241
+        page: this.page,
242
+        limit: this.limit,
243
+        start_time: this.start_time,
244
+        end_time: this.end_time,
245
+        type: this.type,
246
+        keywords: this.searchKey
247
+      };
248
+      this.warehouseOutDate = [];
249
+      getDrugWarehouseOutList(Params).then(response => {
250
+        if (response.data.state == 0) {
251
+          this.$message.error(response.data.msg);
252
+          return false;
253
+        } else {
254
+          this.total = response.data.data.total;
255
+          for (let i = 0; i < response.data.data.list.length; i++) {
256
+            this.warehouseOutDate.push(response.data.data.list[i]);
257
+          }
258
+        }
259
+      });
260
+    },
261
+    AddNewOrder: function() {
262
+      this.$router.push({
263
+        name: "drugStockOutOrderAdd",
264
+        query: { type: this.type }
265
+      });
266
+    },
267
+     GetWarehouseOut: function() {
268
+      const Params = {
269
+        page: this.page,
270
+        limit: this.limit,
271
+        start_time: this.start_time,
272
+        end_time: this.end_time,
273
+        type: this.type
274
+      };
275
+      this.warehouseOutDate = [];
276
+      getDrugWarehouseOutList(Params).then(response => {
277
+        if (response.data.state == 0) {
278
+          this.$message.error(response.data.msg);
279
+          return false;
280
+        } else {
281
+          this.total = response.data.data.total;
282
+          for (let i = 0; i < response.data.data.list.length; i++) {
283
+            this.warehouseOutDate.push(response.data.data.list[i]);
284
+          }
285
+        }
286
+      });
287
+    },
288
+    getXuserName(id) {
289
+      if (id <= 0) {
290
+        return "";
291
+      }
292
+      var name = "";
293
+      if (
294
+        this.adminUserOptions == null ||
295
+        typeof this.adminUserOptions.length === "undefined"
296
+      ) {
297
+        return name;
298
+      }
299
+      var leng = this.adminUserOptions.length;
300
+      if (leng == 0) {
301
+        return name;
302
+      }
303
+      for (let index = 0; index < leng; index++) {
304
+        if (this.adminUserOptions[index].id == id) {
305
+          name = this.adminUserOptions[index].name;
306
+          break;
307
+        }
308
+      }
309
+      return name;
310
+    },
311
+    fetchAllAdminUsers() {
312
+      fetchAllAdminUsers().then(response => {
313
+        console.log(response);
314
+        if (response.data.state == 1) {
315
+          this.adminUserOptions = response.data.data.users;
316
+          var alen = this.adminUserOptions.length;
317
+          for (let index = 0; index < alen; index++) {
318
+            if (this.adminUserOptions[index].user_type == 2) {
319
+              // this.doctorOptions.push(this.adminUserOptions[index]);
320
+            }
321
+          }
322
+        }
323
+      });
324
+    },
325
+    handleSelectionChange: function(val) {
326
+      this.multipleSelection = val;
327
+    },
328
+    handleSizeChange(val) {
329
+      this.limit = val;
330
+      this.GetWarehouseOut();
331
+    },
332
+    handleCurrentChange(val) {
333
+      this.page = val;
334
+      this.GetWarehouseOut();
335
+    },
336
+    startTimeChange(val) {
337
+      var time = this.getTimestamp(val) - this.getTimestamp(this.end_time);
338
+      if (time > 0) {
339
+        this.$message.error("结束时间不能小于开始时间");
340
+        this.start_time = "";
341
+      } else {
342
+        this.GetWarehouseOut();
343
+      }
344
+      this.GetWarehouseOut();
345
+    },
346
+    endTimeChange(val) {
347
+      var time = this.getTimestamp(val) - this.getTimestamp(this.start_time);
348
+      if (time < 0) {
349
+        this.$message.error("结束时间不能小于开始时间");
350
+        this.end_time = "";
351
+      } else {
352
+        this.GetWarehouseOut();
353
+      }
354
+    },
355
+    getTimestamp(time) {
356
+      // 把时间日期转成时间戳
357
+      return new Date(time).getTime() / 1000;
358
+    },
359
+    calculate: function(val) {
360
+      return Math.round(parseFloat(val) * 100) / 100;
361
+    },
362
+    GetConfigInfo: function() {
363
+      GetAllConfig().then(response => {
364
+        if (response.data.state == 0) {
365
+          this.$message.error(response.data.msg);
366
+          return false;
367
+        } else {
368
+          this.manufacturer = response.data.data.manufacturer;
369
+          this.dealer = response.data.data.dealer;
370
+        }
371
+      });
372
+    },
373
+
374
+    handleEdit: function(index, row) {
375
+      this.$router.push({
376
+        name: "stockOutDetail",
377
+        query: { id: row.id, type: this.type }
378
+      });
379
+    },
380
+    handleDelete: function(index, row) {
381
+      const ids = [];
382
+      ids.push(row.id);
383
+      const idStr = ids.join(",");
384
+
385
+      const params = {
386
+        ids: idStr
387
+      };
388
+
389
+      this.$confirm("确认删除出库单记录?", "删除出库单记录", {
390
+        confirmButtonText: "确定",
391
+        cancelButtonText: "取消",
392
+        type: "warning"
393
+      })
394
+        .then(() => {
395
+          deleteDrugWarehouseOut(params).then(response => {
396
+            if (response.data.state == 0) {
397
+              this.$message.error(response.data.msg);
398
+              return false;
399
+            } else {
400
+              this.$notify({
401
+                title: "成功",
402
+                message: "删除成功",
403
+                type: "success",
404
+                duration: 2000
405
+              });
406
+              for (let i = 0; i < ids.length; i++) {
407
+                for (let y = 0; y < this.warehouseOutDate.length; y++) {
408
+                  if (ids[i] == this.warehouseOutDate[y].id) {
409
+                    this.warehouseOutDate.splice(y, 1);
410
+                  }
411
+                }
412
+              }
413
+            }
414
+          });
415
+        })
416
+        .catch(() => {});
417
+    },
418
+    changeAllSelected: function(val) {
419
+      if (val) {
420
+        this.$refs.multipleTable.toggleAllSelection();
421
+      } else {
422
+        this.$refs.multipleTable.clearSelection();
423
+      }
424
+    },
425
+    select(selection) {
426
+      this.selectedTableData = selection;
427
+    },
428
+    batchDelete() {
429
+      if (this.selectedTableData.length <= 0) {
430
+        this.$message.error("请选择要删除的记录");
431
+        return;
432
+      }
433
+      const ids = [];
434
+      for (let i = 0; i < this.selectedTableData.length; i++) {
435
+        ids.push(this.selectedTableData[i].id);
436
+      }
437
+      const idStr = ids.join(",");
438
+      const params = {
439
+        ids: idStr
440
+      };
441
+      this.$confirm("确认删除退货单记录?", "删除退货单记录", {
442
+        confirmButtonText: "确定",
443
+        cancelButtonText: "取消",
444
+        type: "warning"
445
+      })
446
+        .then(() => {
447
+          deleteDrugWarehouseOut(params).then(response => {
448
+            if (response.data.state == 0) {
449
+              this.$message.error(response.data.msg);
450
+              return false;
451
+            } else {
452
+              this.$notify({
453
+                title: "成功",
454
+                message: "删除成功",
455
+                type: "success",
456
+                duration: 2000
457
+              });
458
+
459
+              for (let i = 0; i < ids.length; i++) {
460
+                for (let y = 0; y < this.warehouseOutDate.length; y++) {
461
+                  if (ids[i] == this.warehouseOutDate[y].id) {
462
+                    this.warehouseOutDate.splice(y, 1);
463
+                  }
464
+                }
465
+              }
466
+            }
467
+          });
468
+        })
469
+        .catch(() => {});
470
+    }
471
+  }
472
+};
473
+</script>
474
+
475
+<style rel="stylesheet/scss" lang="scss">
476
+.app-container {
477
+  // margin: 20px;
478
+  font-size: 15px;
479
+  .filter-container {
480
+    padding-bottom: 5px;
481
+  }
482
+  .search-component {
483
+    width: 500px;
484
+    .searchBox {
485
+      width: 300px;
486
+      height: 36px;
487
+      line-height: 36px;
488
+      padding-left: 15px;
489
+      border: 1px #dcdfe6 solid;
490
+      border-right: none;
491
+      outline: none;
492
+      float: left;
493
+      border-radius: 6px 0 0 6px;
494
+      font-size: 14px;
495
+      color: #333;
496
+      background: #fff;
497
+      box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
498
+    }
499
+    .searchBtn {
500
+      background-color: #409eff;
501
+      color: #fff;
502
+      font-size: 15px;
503
+      text-align: center;
504
+      height: 36px;
505
+      line-height: 36px;
506
+      float: left;
507
+      outline: none;
508
+      width: 70px;
509
+      border: none;
510
+      border-radius: 0 6px 6px 0;
511
+      font-family: "Microsoft Yahei";
512
+      cursor: pointer;
513
+    }
514
+  }
515
+
516
+  .amount {
517
+    font-weight: normal;
518
+    padding: 10px 0 0 0;
519
+    color: #606266;
520
+    font-size: 14px;
521
+    span {
522
+      color: #ef2525;
523
+      font-family: "Arial";
524
+      padding: 0 2px;
525
+    }
526
+  }
527
+}
528
+.el-table td,
529
+.el-table th.is-leaf,
530
+.el-table--border,
531
+.el-table--group {
532
+  border-color: #d0d3da;
533
+}
534
+.el-table--border::after,
535
+.el-table--group::after,
536
+.el-table::before {
537
+  background-color: #d0d3da;
538
+}
539
+</style>

+ 593 - 0
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue Vedi File

@@ -0,0 +1,593 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb
5
+        v-if="this.$route.query.type == 1"
6
+        :crumbs="crumbs"
7
+      ></bread-crumb>
8
+      <bread-crumb
9
+        v-if="this.$route.query.type == 2"
10
+        :crumbs="crumbs2"
11
+      ></bread-crumb>
12
+
13
+      <div style="float:right;">
14
+        <el-button size="small" @click="back()" class="filter-item"
15
+          >取 消</el-button
16
+        >
17
+        <el-button
18
+          size="small"
19
+          type="primary"
20
+          @click="submit()"
21
+          class="filter-item"
22
+          >保 存</el-button
23
+        >
24
+      </div>
25
+    </div>
26
+
27
+    <div class="app-container">
28
+    <!---->
29
+      <!--<stock-in-dialog-->
30
+        <!--ref="dialog" :propForm="propForm"-->
31
+        <!--:visibility="isVisibility"-->
32
+        <!--v-on:dialog-comfirm="comfirm"-->
33
+        <!--v-on:dialog-cancle="cancle"-->
34
+      <!--&gt;</stock-in-dialog>-->
35
+
36
+      <drugs-stock-dialog
37
+        ref="dialog" :propForm="propForm"
38
+        :visibility="isVisibility"
39
+        v-on:dialog-comfirm="comfirm"
40
+        v-on:dialog-cancle="cancle"
41
+      ></drugs-stock-dialog>
42
+
43
+
44
+      <div class="cell clearfix">
45
+        <label class="title"><span class="name">出库时间</span> : </label>
46
+        <el-date-picker
47
+          size="small"
48
+          v-model="warehouse_out_time"
49
+          prefix-icon="el-icon-date"
50
+          :editable="false"
51
+          style="width: 196px;"
52
+          type="date"
53
+          placeholder="选择日期时间"
54
+          align="right"
55
+          format="yyyy-MM-dd"
56
+          value-format="yyyy-MM-dd"
57
+        ></el-date-picker>
58
+      </div>
59
+
60
+      <div class="cell clearfix">
61
+        <label class="title"><span class="name">经销商</span> : </label>
62
+        <el-select
63
+          size="small"
64
+          v-model="form.dealer"
65
+          clearable
66
+          placeholder="请选择经销商"
67
+          @change="changeDealer"
68
+        >
69
+          <el-option
70
+            v-for="(option, index) in dealer"
71
+            :key="index"
72
+            :label="option.dealer_name"
73
+            :value="option.id"
74
+          >
75
+          </el-option>
76
+        </el-select>
77
+      </div>
78
+
79
+      <div class="cell clearfix">
80
+        <label class="title"><span class="name">厂商</span> : </label>
81
+        <el-select
82
+          size="small"
83
+          v-model="form.manufacturer"
84
+          clearable
85
+          placeholder="请选择厂商"
86
+          @change="changeManufacturer"
87
+        >
88
+          <el-option
89
+            v-for="(option, index) in manufacturer"
90
+            :key="index"
91
+            :label="option.manufacturer_name"
92
+            :value="option.id"
93
+          >
94
+          </el-option>
95
+        </el-select>
96
+      </div>
97
+
98
+      <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
99
+        <el-table
100
+          :data="recordInfo.recordData"
101
+          :class="signAndWeighBoxPatients"
102
+          style="width: 100%"
103
+          border
104
+          max-height="450"
105
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
106
+        >
107
+          <el-table-column align="center" width="200">
108
+            <template slot="header" slot-scope="scope">
109
+              <span>药品名称<span style="color: red">*</span></span>
110
+            </template>
111
+
112
+            <template slot-scope="scope">
113
+              <el-form-item style="padding-top: 15px">
114
+                <el-input
115
+                  placeholder="请输入药品名称"
116
+                  v-model="scope.row.drug_id"
117
+                  :value="typeName(scope.row.drug_id)"
118
+                  @focus="showDialog(scope.$index, scope.row)"
119
+                ></el-input>
120
+              </el-form-item>
121
+            </template>
122
+          </el-table-column>
123
+          <el-table-column align="center" width="200">
124
+            <template slot="header" slot-scope="scope">
125
+              <span>规格名称<span style="color: red">*</span></span>
126
+            </template>
127
+            <template slot-scope="scope">
128
+              <el-form-item style="padding-top: 15px">
129
+                <el-input
130
+                  placeholder="请输入规格名称"
131
+                  v-model="scope.row.drug_id"
132
+                  :value="specificationName(scope.row.drug_id)"
133
+                  @focus="showDialog(scope.$index, scope.row)"
134
+                ></el-input>
135
+              </el-form-item>
136
+            </template>
137
+          </el-table-column>
138
+
139
+          <el-table-column min-width="23" align="center">
140
+            <template slot="header" slot-scope="scope">
141
+              <span>单价<span style="color: red">*</span></span>
142
+            </template>
143
+            <template slot-scope="scope">
144
+              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
145
+              <el-form-item
146
+                :prop="'recordData.' + scope.$index + '.price'"
147
+                :rules="tableRules.price"
148
+                style="padding-top: 17px"
149
+              >
150
+                <el-input
151
+                  placeholder="请输入单价"
152
+                  type="number"
153
+                  v-model="scope.row.price"
154
+                ></el-input>
155
+              </el-form-item>
156
+            </template>
157
+          </el-table-column>
158
+
159
+          <el-table-column min-width="23" align="center">
160
+            <template slot="header" slot-scope="scope">
161
+              <span>出库数量<span style="color: red">*</span></span>
162
+            </template>
163
+            <template slot-scope="scope">
164
+              <el-form-item
165
+                :prop="'recordData.' + scope.$index + '.count'"
166
+                :rules="tableRules.count"
167
+                style="padding-top: 17px"
168
+              >
169
+                <el-input
170
+                  placeholder="请输入出库数量"
171
+                  type="number"
172
+                  v-model="scope.row.count"
173
+                ></el-input>
174
+              </el-form-item>
175
+            </template>
176
+          </el-table-column>
177
+
178
+          <el-table-column label="总价" min-width="20" align="center">
179
+            <template slot-scope="scope">
180
+              {{ calculate(scope.row.price * scope.row.count) }}
181
+            </template>
182
+          </el-table-column>
183
+          <el-table-column label="备注" min-width="20" align="center">
184
+            <template slot-scope="scope">
185
+              <el-input v-model="scope.row.remark"></el-input>
186
+            </template>
187
+          </el-table-column>
188
+
189
+          <el-table-column label="操作" align="center" min-width="20">
190
+            <template slot-scope="scope">
191
+              <el-tooltip
192
+                class="item"
193
+                effect="dark"
194
+                content="新增"
195
+                placement="top"
196
+              >
197
+                <el-button
198
+                  size="mini"
199
+                  type="primary"
200
+                  icon="el-icon-circle-plus-outline"
201
+                  @click="handleEdit(scope.$index, scope.row)"
202
+                >
203
+                </el-button>
204
+              </el-tooltip>
205
+              <el-tooltip
206
+                class="item"
207
+                effect="dark"
208
+                content="删除"
209
+                placement="top"
210
+              >
211
+                <el-button
212
+                  size="mini"
213
+                  type="danger"
214
+                  icon="el-icon-delete"
215
+                  @click="handleDelete(scope.$index, scope.row)"
216
+                >
217
+                </el-button>
218
+              </el-tooltip>
219
+            </template>
220
+          </el-table-column>
221
+        </el-table>
222
+      </el-form>
223
+    </div>
224
+  </div>
225
+</template>
226
+
227
+<script>
228
+import { uParseTime } from "@/utils/tools";
229
+import {  postDrugWarehouseOut,GetAllConfig,GetAllDrugInfoByID } from "@/api/drug/drug_stock";
230
+
231
+import BreadCrumb from "../../components/bread-crumb";
232
+import DrugsStockDialog from './drugsStockDialog/index'
233
+
234
+export default {
235
+  components: { DrugsStockDialog,   BreadCrumb },
236
+  name: "salesReturnOrderAdd",
237
+
238
+  data() {
239
+    return {
240
+      crumbs: [
241
+        { path: false, name: "库存管理" },
242
+        { path: false, name: "耗材出库单" },
243
+        { path: false, name: "新增出库单" }
244
+      ],
245
+      crumbs2: [
246
+        { path: false, name: "库存管理" },
247
+        { path: false, name: "其他出库单" },
248
+        { path: false, name: "新增出库单" }
249
+      ],
250
+      type: this.$route.query.type,
251
+      signAndWeighBoxPatients: "sign-and-weigh-box-patients",
252
+      warehouse_out_time: "",
253
+      currentIndex: 0,
254
+      recordInfo: {
255
+        recordData: []
256
+      },
257
+      tableRules: {
258
+        price: [{ required: true, message: "单价不能为空", trigger: "blur" }],
259
+        count: [{ required: true, message: "数量不能为空", trigge: "blur" }]
260
+      },
261
+      ruleForm: {
262
+        manufacturer: [
263
+          { required: true, message: "请选择厂商", trigger: "change" }
264
+        ]
265
+      },
266
+      // prop
267
+      isVisibility: false,
268
+      propForm: {
269
+        goods: [],
270
+        goodType: [],
271
+        goodInfo: [],
272
+        goodUnit: [],
273
+        manufacturer: 0,
274
+        dealer: 0
275
+      },
276
+      form: {
277
+        manufacturer: 0,
278
+        dealer: 0
279
+      },
280
+      warehouseInfoList: [],
281
+      manufacturer: [],
282
+      dealer: [],
283
+      goodType: [],
284
+      goodInfo:[]
285
+    };
286
+  },
287
+  methods: {
288
+    comfirm: function(val) {
289
+      this.propForm.goodType = []
290
+      this.propForm.goods = []
291
+
292
+      this.$refs.dialog.hide()
293
+
294
+      if (val.selectedGoodInfo.length > 0) {
295
+        for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
296
+          if (i == 0) {
297
+            this.recordInfo.recordData[this.currentIndex].drug_id = val.selectedGoodInfo[i].id
298
+
299
+          } else {
300
+            const tempForm = {}
301
+            tempForm['drug_id'] = val.selectedGoodInfo[i].id
302
+            tempForm['count'] = ''
303
+            tempForm['price'] = ''
304
+            tempForm['remark'] = ''
305
+            this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
306
+          }
307
+        }
308
+      }
309
+
310
+      this.currentIndex = -1
311
+
312
+      // this.$refs.dialog.hide();
313
+      // this.propForm.goodType = [];
314
+      // if (val.selectedGoodInfo.length > 0) {
315
+      //   for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
316
+      //     if (i == 0) {
317
+      //       this.recordInfo.recordData[this.currentIndex].good_type_id =
318
+      //         val.selectedGoodInfo[i].good_type_id;
319
+      //       this.recordInfo.recordData[this.currentIndex].good_id =
320
+      //         val.selectedGoodInfo[i].id;
321
+      //       this.recordInfo.recordData[
322
+      //         this.currentIndex
323
+      //       ].price = val.selectedGoodInfo[i].buy_price.toString();
324
+      //     } else {
325
+      //       console.log(val.selectedGoodInfo[i].buy_price.toString());
326
+      //       const tempForm = {};
327
+      //       tempForm["good_type_id"] = val.selectedGoodInfo[i].good_type_id;
328
+      //       tempForm["good_id"] = val.selectedGoodInfo[i].id;
329
+      //       tempForm["count"] = "";
330
+      //       tempForm["price"] = val.selectedGoodInfo[i].buy_price.toString();
331
+      //       tempForm["remark"] = "";
332
+      //       this.recordInfo.recordData.splice(
333
+      //         this.currentIndex + 1,
334
+      //         0,
335
+      //         tempForm
336
+      //       );
337
+      //     }
338
+      //   }
339
+      // }
340
+      //
341
+      // this.currentIndex = -1;
342
+    },
343
+    cancle: function() {
344
+      this.$refs.dialog.hide();
345
+    },
346
+    GetConfigInfo: function() {
347
+
348
+      GetAllConfig().then(response => {
349
+        const loading = this.$loading({
350
+          lock: true,
351
+          text: "Loading",
352
+          spinner: "el-icon-loading",
353
+          background: "rgba(0, 0, 0, 0.7)"
354
+        });
355
+
356
+        if (response.data.state == 0) {
357
+          this.$message.error(response.data.msg);
358
+          return false;
359
+        } else {
360
+          this.manufacturer = response.data.data.manufacturer;
361
+          this.dealer = response.data.data.dealer;
362
+          for(let i = 0; i<  response.data.data.drugs.length;i++){
363
+            this.goodType.push(response.data.data.drugs[i])
364
+            if(response.data.data.drugs[i].drug_specs != null) {
365
+              for (let b = 0; b < response.data.data.drugs[i].drug_specs.length; b++) {
366
+                this.goodInfo.push(response.data.data.drugs[i].drug_specs[b])
367
+              }
368
+            }
369
+          }
370
+          this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
371
+          this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
372
+
373
+          this.form.manufacturer = 0
374
+          this.form.dealer = 0
375
+        }
376
+        loading.close()
377
+
378
+      });
379
+    },
380
+    typeName: function(drug_id) {
381
+      let name = "";
382
+      for (let i = 0; i < this.goodInfo.length; i++) {
383
+        if (this.goodInfo[i].id == drug_id) {
384
+          name = this.goodInfo[i].drug_name;
385
+
386
+        }
387
+      }
388
+      return name;
389
+    }, specificationName: function(drug_id) {
390
+      let name = "";
391
+      for (let i = 0; i < this.goodInfo.length; i++) {
392
+        if (this.goodInfo[i].id == drug_id) {
393
+          name = this.goodInfo[i].drug_spec;
394
+        }
395
+      }
396
+      return name;
397
+    },
398
+    handleEdit: function(index, row) {
399
+      const tempObj = {};
400
+      tempObj["drug_id"] = 0;
401
+      tempObj["count"] = "";
402
+      tempObj["price"] = "";
403
+      tempObj["remark"] = "";
404
+
405
+      this.recordInfo.recordData.push(tempObj);
406
+    },
407
+    handleDelete: function(index, row) {
408
+      if (this.recordInfo.recordData.length <= 1) {
409
+        this.$message.error("只有一条记录的时候无法删除");
410
+        return;
411
+      } else {
412
+        this.recordInfo.recordData.splice(index, 1);
413
+      }
414
+    },
415
+    calculate: function(val) {
416
+      if (isNaN(val)) {
417
+        return "";
418
+      }
419
+      if (val == 0) {
420
+        return "";
421
+      }
422
+      return Math.round(parseFloat(val) * 100) / 100;
423
+    },
424
+    getTime(val, temp) {
425
+      if (val != 0) {
426
+        return uParseTime(val, temp);
427
+      } else {
428
+        return "";
429
+      }
430
+    },
431
+    showDialog(index, row) {
432
+      const loading = this.$loading({
433
+        lock: true,
434
+        text: 'Loading',
435
+        spinner: 'el-icon-loading',
436
+        background: 'rgba(0, 0, 0, 0.7)'
437
+      })
438
+      this.currentIndex = index
439
+      const params = {
440
+        manufacturer_id: this.form.manufacturer,
441
+        dealer_id: this.form.dealer
442
+      }
443
+      GetAllDrugInfoByID(params).then(response => {
444
+          if (response.data.state == 0) {
445
+            this.$message.error(response.data.msg)
446
+            return false
447
+            loading.close()
448
+
449
+          } else {
450
+            loading.close()
451
+
452
+            if (response.data.data.drugs.length <= 0) {
453
+              this.$message.error('该厂商或经销商没有物品信息')
454
+              return
455
+            }
456
+
457
+
458
+            this.$refs.dialog.show()
459
+            for (let i = 0; i < response.data.data.drugs.length; i++) {
460
+              this.propForm.goods.push(
461
+                response.data.data.drugs[i]
462
+              );
463
+            }
464
+            const obj = {};
465
+            this.propForm.goods = this.propForm.goods.reduce(
466
+              (cur, next) => {
467
+                obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
468
+                return cur;
469
+              },
470
+              []
471
+            ); // 设置cur默认类型为数组,并且初始值为空的数组
472
+
473
+
474
+          }
475
+
476
+        for (let i = 0; i < this.propForm.goods.length; i++) {
477
+          for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
478
+            var respObj = this.propForm.goods[i].drug_specs[a];
479
+            respObj["isSelected"] = false;
480
+          }
481
+        }
482
+        }
483
+      )
484
+
485
+    },
486
+    back() {
487
+      this.$router.go(-1);
488
+    },
489
+    submit() {
490
+      this.$refs["tableForm"].validate(valid => {
491
+        if (valid) {
492
+          const array = this.recordInfo.recordData;
493
+          let total = 0;
494
+          for (let i = 0; i < array.length; i++) {
495
+            if (array[i].good_type_id == 0) {
496
+              this.$message.error("商品类型不能为空");
497
+              return;
498
+            }
499
+            if (array[i].good_id == 0) {
500
+              this.$message.error("规格名称不能为空");
501
+              return;
502
+            }
503
+            total = total + array[i].price * array[i].return_count;
504
+          }
505
+          if (this.recordInfo.recordData.length <= 0) {
506
+            this.$message.success("请添加出库商品");
507
+            return;
508
+          }
509
+
510
+          const params = {
511
+            stockOut: this.recordInfo.recordData
512
+          };
513
+          console.log(this.form.dealer);
514
+
515
+          postDrugWarehouseOut(
516
+            params,
517
+            this.warehouse_out_time,
518
+            this.form.dealer,
519
+            this.form.manufacturer,
520
+            this.type
521
+          ).then(response => {
522
+            if (response.data.state == 0) {
523
+              this.$message.error(response.data.msg);
524
+              return false;
525
+            } else {
526
+              this.$message.success("出库成功");
527
+              this.recordInfo.recordData = [];
528
+              this.$router.back(-1);
529
+            }
530
+          });
531
+        } else {
532
+          return false;
533
+        }
534
+      });
535
+    },
536
+    changeManufacturer(val) {
537
+      this.propForm.manufacturer = val;
538
+    },
539
+    changeDealer(val) {
540
+      this.propForm.dealer = val;
541
+    }
542
+  },
543
+  created() {
544
+    var nowDate = new Date();
545
+    var nowYear = nowDate.getFullYear();
546
+    var nowMonth = nowDate.getMonth() + 1;
547
+    var nowDay = nowDate.getDate();
548
+    this.warehouse_out_time =
549
+      nowYear +
550
+      "-" +
551
+      (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
552
+      "-" +
553
+      (nowDay < 10 ? "0" + nowDay : nowDay);
554
+    const tempObj = {};
555
+    tempObj["drug_id"] = 0;
556
+    tempObj["return_count"] = 0;
557
+    tempObj["price"] = "";
558
+    tempObj["remark"] = "";
559
+
560
+    this.recordInfo.recordData.push(tempObj);
561
+    this.GetConfigInfo();
562
+    this.propForm.goodUnit = this.$store.getters.good_unit;
563
+  }
564
+};
565
+</script>
566
+
567
+<style rel="stylesheet/css" lang="scss" scoped>
568
+.information {
569
+  border: 1px #dcdfe6 solid;
570
+  padding: 30px 20px 30px 20px;
571
+
572
+  .border {
573
+    border-bottom: 1px #dcdfe6 solid;
574
+    margin: 0px 0 20px 0;
575
+  }
576
+}
577
+
578
+.edit_separater {
579
+  border-top: 1px solid rgb(233, 233, 233);
580
+  margin-top: 15px;
581
+  margin-bottom: 15px;
582
+}
583
+</style>
584
+
585
+<style>
586
+.sign-and-weigh-box .sign-and-weigh-box-patients .cell {
587
+  font-size: 12px;
588
+}
589
+
590
+.sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
591
+  background: #6fb5fa;
592
+}
593
+</style>

+ 300 - 0
src/xt_pages/stock/drugs/drugStockOutOrderDetail.vue Vedi File

@@ -0,0 +1,300 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
6
+
7
+    </div>
8
+
9
+    <div class="app-container">
10
+
11
+      <div class="filter-container">
12
+        <span style="font-size: 18px;color: #606266">出库单详情</span>
13
+        <el-row style="float:right;">
14
+          <span style="color: #606266">{{warehousingOutInfo.info.warehouse_out_order_number}}</span>
15
+        </el-row>
16
+      </div>
17
+
18
+
19
+      <div class="cell clearfix">
20
+        <span style="width: 300px;color: #606266">单据日期:  {{warehousingOutInfo.info.warehouse_out_time | parseTime('{y}-{m}-{d}')}} </span>
21
+        <span style="width: 300px;color: #606266">厂商 {{warehousingOutInfo.info.manufacturers?warehousingOutInfo.info.manufacturers.manufacturer_name:''}}</span>
22
+        <span style="width: 300px;color: #606266">经销商 {{warehousingOutInfo.info.dealers?warehousingOutInfo.info.dealers.dealer_name:''}}</span>
23
+      </div>
24
+
25
+      <div class="filter-container" style="margin-top: 10px">
26
+        <el-button size="small" icon="el-icon-edit" @click="editRecord" v-if="warehousingOutInfo.info.is_sys != 1">编辑</el-button>
27
+        <el-button size="small" icon="el-icon-delete" @click="deleteRecord" v-if="warehousingOutInfo.info.is_sys != 1">删除</el-button>
28
+      </div>
29
+
30
+      <el-row :gutter="12" style="margin-top: 10px">
31
+        <el-table :data="warehousingOutInfo.warehousingOutData" :class="signAndWeighBoxPatients" style="width: 100%"
32
+                  border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
33
+                  :span-method="merge"
34
+        >
35
+          <el-table-column min-width="35" align="center">
36
+            <template slot="header" slot-scope="scope">
37
+              <span>药品名称</span>
38
+            </template>
39
+
40
+            <template slot-scope="scope">
41
+              <span v-if="scope.row.drug_id != 0">{{
42
+                scope.row.drug.drug_name
43
+              }}</span>
44
+            </template>
45
+          </el-table-column>
46
+          <el-table-column min-width="35" align="center">
47
+            <template slot="header" slot-scope="scope">
48
+              <span>规格名称</span>
49
+            </template>
50
+            <template slot-scope="scope">
51
+              <span v-if="scope.row.drug_id != 0">{{
52
+                scope.row.drug?scope.row.drug.drug_spec:''
53
+              }}</span>
54
+            </template>
55
+          </el-table-column>
56
+
57
+          <el-table-column min-width="23" align="center">
58
+            <template slot="header" slot-scope="scope">
59
+              <span>单价</span>
60
+            </template>
61
+            <template slot-scope="scope">
62
+              <span>{{scope.row.price}}</span>
63
+            </template>
64
+          </el-table-column>
65
+
66
+          <el-table-column min-width="23" align="center">
67
+            <template slot="header" slot-scope="scope">
68
+              <span>出库数量</span>
69
+            </template>
70
+            <template slot-scope="scope">
71
+              <span>{{scope.row.count}}</span>
72
+
73
+            </template>
74
+          </el-table-column>
75
+          <el-table-column label="总价" min-width="20" align="center">
76
+            <template slot-scope="scope">
77
+              {{calculate(scope.row.price*scope.row.count)}}
78
+            </template>
79
+          </el-table-column>
80
+
81
+          <el-table-column label="备注" min-width="20" align="center">
82
+            <template slot-scope="scope">
83
+              <el-popover placement="top-start" width="250" trigger="hover">
84
+                <div>{{scope.row.remark}}</div>
85
+                <span slot="reference"
86
+                      v-if="scope.row.remark.length > 20">{{ scope.row.remark.substr(0,20)+'...' }}</span>
87
+                <span slot="reference" v-else>{{ scope.row.remark}}</span>
88
+              </el-popover>
89
+
90
+            </template>
91
+          </el-table-column>
92
+
93
+          <el-table-column label="" align="center"  >
94
+            <template slot-scope="scope" v-if="scope.row.is_sys == 1">
95
+             <div style="color: #589ff8" @click="jump(scope.row)">使用明细</div>
96
+            </template>
97
+          </el-table-column>
98
+
99
+
100
+
101
+        </el-table>
102
+      </el-row>
103
+    </div>
104
+  </div>
105
+</template>
106
+
107
+<script>
108
+  import { uParseTime } from '@/utils/tools'
109
+  import { deleteDrugWarehouseOut, GetAllConfig, getDrugWarehouseOutInfo } from '@/api/drug/drug_stock'
110
+  import BreadCrumb from '../../components/bread-crumb'
111
+
112
+  export default {
113
+    name: 'stockInOrderDetail',
114
+    components: { BreadCrumb },
115
+    created() {
116
+      const order_id = this.$route.query.id
117
+      this.GetConfigInfo()
118
+      this.GetOrderDetail(order_id)
119
+    },
120
+    data() {
121
+      return {
122
+        tempArr: [],
123
+        sameRowArr: [],
124
+        crumbs: [
125
+          { path: false, name: '库存管理' },
126
+          { path: false, name: '耗材出库单' },
127
+          { path: false, name: '出库单详情' }
128
+        ],
129
+        crumbs2: [
130
+          { path: false, name: '库存管理' },
131
+          { path: false, name: '其他出库单' },
132
+          { path: false, name: '出库单详情' }
133
+        ],
134
+        isEdit: 0,
135
+        checked: false,
136
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
137
+        goodType: [],
138
+        goodInfo: [],
139
+        manufacturer: [],
140
+        dealer: [],
141
+
142
+        warehousingOutInfo: {
143
+          loading: false,
144
+          warehousingOutData: [],
145
+          info: {}
146
+        }
147
+      }
148
+    },
149
+    methods: {
150
+     calculate: function(val) {
151
+        if (val == 0) {
152
+          return ''
153
+        }
154
+        return Math.round(parseFloat(val) * 100) / 100
155
+      }, GetOrderDetail: function(order_id) {
156
+        const params = {
157
+          'id': order_id
158
+        }
159
+        getDrugWarehouseOutInfo(params).then(response => {
160
+          if (response.data.state == 0) {
161
+
162
+            this.$message.error(response.data.msg)
163
+            return false
164
+          } else {
165
+            for (let i = 0; i < response.data.data.list.length; i++) {
166
+              this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
167
+            }
168
+            this.warehousingOutInfo.info = response.data.data.info
169
+            this.handleSpanTempArr()
170
+          }
171
+        })
172
+      }, deleteRecord: function() {
173
+        const ids = []
174
+        ids.push(this.warehousingOutInfo.info.id)
175
+        const idStr = ids.join(',')
176
+
177
+        const params = {
178
+          ids: idStr
179
+        }
180
+
181
+        this.$confirm('确认删除出库单?', '删除出库单记录', {
182
+          confirmButtonText: '确定',
183
+          cancelButtonText: '取消',
184
+          type: 'warning'
185
+        }).then(() => {
186
+          deleteDrugWarehouseOut(params).then(response => {
187
+            if (response.data.state == 0) {
188
+              this.$message.error(response.data.msg)
189
+              return false
190
+            } else {
191
+              this.$notify({
192
+                title: '成功',
193
+                message: '删除成功',
194
+                type: 'success',
195
+                duration: 2000
196
+              })
197
+
198
+              this.$router.back(-1)
199
+            }
200
+          })
201
+        }).catch(() => {
202
+        })
203
+      }, editRecord: function() {
204
+        this.$emit('edit-record')
205
+      },jump(row){
206
+        this.$router.push({
207
+          name: 'user_detail',
208
+          query: { id: row.id }
209
+        })
210
+      },merge({ row, column, rowIndex, columnIndex }) {
211
+        if (columnIndex === 0) {
212
+          const _row = this.tempArr[rowIndex]
213
+          const _col = _row > 0 ? 1 : 0
214
+          return {
215
+            rowspan: _row,
216
+            colspan: _col
217
+          }
218
+        }
219
+      },handleSpanTempArr(){
220
+        this.tempArr = []
221
+
222
+        for (let i = 0; i < this.warehousingOutInfo.warehousingOutData.length; i++) {
223
+          if (i === 0) {
224
+            this.tempArr.push(1)
225
+            this.pos = 0
226
+          } else {
227
+            // 判断当前元素与上一个元素是否相同
228
+            if (this.warehousingOutInfo.warehousingOutData[i].good_type_id === this.warehousingOutInfo.warehousingOutData[i - 1].good_type_id) {
229
+              this.tempArr[this.pos] += 1
230
+              this.tempArr.push(0)
231
+            } else {
232
+              this.tempArr.push(1)
233
+              this.pos = i
234
+            }
235
+          }
236
+        }
237
+
238
+        let sameRowArr = [], sIdx = 0
239
+        this.warehousingOutInfo.warehousingOutData.forEach((item, index) => {
240
+          item.index = index
241
+          if (index === 0) {
242
+            sameRowArr.push([index])
243
+          } else {
244
+            if (item.good_type_id === this.warehousingOutInfo.warehousingOutData[index - 1].good_type_id) {
245
+              sameRowArr[sIdx].push(index)
246
+            } else {
247
+              sIdx = sIdx + 1
248
+              sameRowArr.push([index])
249
+            }
250
+          }
251
+        })
252
+        this.sameRowArr = sameRowArr
253
+
254
+
255
+
256
+      }
257
+    }
258
+  }
259
+</script>
260
+
261
+<style rel="stylesheet/css" lang="scss" scoped>
262
+  .information {
263
+    border: 1px #dcdfe6 solid;
264
+    padding: 30px 20px 30px 20px;
265
+
266
+  .border {
267
+    border-bottom: 1px #dcdfe6 solid;
268
+    margin: 0px 0 20px 0;
269
+  }
270
+
271
+  }
272
+
273
+
274
+  .edit_separater {
275
+    border-top: 1px solid rgb(233, 233, 233);
276
+    margin-top: 15px;
277
+    margin-bottom: 15px;
278
+  }
279
+
280
+</style>
281
+
282
+<style>
283
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
284
+    font-size: 12px;
285
+  }
286
+
287
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
288
+    background: #6fb5fa;
289
+  }
290
+
291
+  .count {
292
+    color: #bd2c00;
293
+
294
+  }
295
+  .el-table__body div > div:hover {
296
+    background-color: #409eff !important;
297
+    color: #fff !important;
298
+  }
299
+
300
+</style>

+ 533 - 0
src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue Vedi File

@@ -0,0 +1,533 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb v-if="this.$route.query.type == 1" :crumbs='crumbs'></bread-crumb>
5
+      <bread-crumb v-if="this.$route.query.type == 2" :crumbs='crumbs2'></bread-crumb>
6
+
7
+
8
+      <div style="float:right;">
9
+        <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
10
+        <el-button size="small" type="primary" @click="submit()" class="filter-item">保 存</el-button>
11
+      </div>
12
+    </div>
13
+
14
+    <div class="app-container">
15
+
16
+      <!--<stock-in-dialog-->
17
+        <!--ref="dialog"-->
18
+        <!--:propForm="propForm"-->
19
+        <!--:visibility="isVisibility"-->
20
+        <!--v-on:dialog-comfirm="comfirm"-->
21
+        <!--v-on:dialog-cancle="cancle"-->
22
+      <!--&gt;</stock-in-dialog>-->
23
+      <!--<stock-in-dialog-->
24
+        <!--ref="dialog"-->
25
+        <!--:propForm="propForm"-->
26
+        <!--:visibility="isVisibility"-->
27
+        <!--v-on:dialog-comfirm="comfirm"-->
28
+        <!--v-on:dialog-cancle="cancle"-->
29
+      <!--&gt;-->
30
+      <!--</stock-in-dialog>-->
31
+
32
+      <drugs-stock-dialog
33
+        ref="dialog"
34
+        :propForm="propForm"
35
+        :visibility="isVisibility"
36
+        v-on:dialog-comfirm="comfirm"
37
+        v-on:dialog-cancle="cancle"
38
+      >
39
+      </drugs-stock-dialog>
40
+
41
+      <div class="cell clearfix">
42
+        <label class="title"><span class="name">出库时间</span> : </label>
43
+        <el-date-picker size="small" v-model="warehouse_out_time" prefix-icon="el-icon-date" :editable="false"
44
+                        style="width: 196px;"
45
+                        type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
46
+                        value-format="yyyy-MM-dd"></el-date-picker>
47
+      </div>
48
+
49
+
50
+      <div class="cell clearfix">
51
+        <label class="title"><span class="name">经销商</span> : </label>
52
+        <el-select size="small" v-model="form.dealer" clearable placeholder="请选择经销商" @change="changeDealer">
53
+          <el-option
54
+            v-for="(option, index) in dealer"
55
+            :key="index"
56
+            :label="option.dealer_name"
57
+            :value="option.id">
58
+          </el-option>
59
+        </el-select>
60
+      </div>
61
+
62
+
63
+      <div class="cell clearfix">
64
+        <label class="title"><span class="name">厂商</span> : </label>
65
+
66
+        <el-select size="small" v-model="form.manufacturer" clearable placeholder="请选择厂商" @change="changeManufacturer">
67
+          <el-option
68
+            v-for="(option, index) in manufacturer"
69
+            :key="index"
70
+            :label="option.manufacturer_name"
71
+            :value="option.id">
72
+          </el-option>
73
+        </el-select>
74
+      </div>
75
+
76
+      <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
77
+        <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
78
+                  max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
79
+        >
80
+
81
+          <el-table-column align="center" width="200">
82
+            <template slot="header" slot-scope="scope">
83
+              <span>药品名称<span style="color: red">*</span></span>
84
+            </template>
85
+
86
+            <template slot-scope="scope">
87
+              <el-form-item style="padding-top: 15px">
88
+                <el-input
89
+                  placeholder="请输入药品名称"
90
+                  v-model="scope.row.drug_id"
91
+                  :value="typeName(scope.row.drug_id)"
92
+                  @focus="showDialog(scope.$index, scope.row)"
93
+                ></el-input>
94
+              </el-form-item>
95
+            </template>
96
+          </el-table-column>
97
+          <el-table-column align="center" width="200">
98
+            <template slot="header" slot-scope="scope">
99
+              <span>规格名称<span style="color: red">*</span></span>
100
+            </template>
101
+            <template slot-scope="scope">
102
+              <el-form-item style="padding-top: 15px">
103
+                <el-input
104
+                  placeholder="请输入规格名称"
105
+                  v-model="scope.row.drug_id"
106
+                  :value="specificationName(scope.row.drug_id)"
107
+                  @focus="showDialog(scope.$index, scope.row)"
108
+                ></el-input>
109
+              </el-form-item>
110
+            </template>
111
+          </el-table-column>
112
+
113
+
114
+          <el-table-column min-width="23" align="center">
115
+            <template slot="header" slot-scope="scope">
116
+              <span>单价<span style="color: red">*</span></span>
117
+            </template>
118
+            <template slot-scope="scope">
119
+              <!--<el-input type="number" v-model="scope.row.price"  @blur="handleBlur(scope.$index, scope.row)"></el-input>-->
120
+              <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
121
+                            style="padding-top: 17px">
122
+                <el-input type="number" v-model="scope.row.price"></el-input>
123
+              </el-form-item>
124
+
125
+
126
+            </template>
127
+          </el-table-column>
128
+
129
+          <el-table-column min-width="23" align="center">
130
+            <template slot="header" slot-scope="scope">
131
+              <span>出库数量<span style="color: red">*</span></span>
132
+            </template>
133
+            <template slot-scope="scope">
134
+              <el-form-item :prop="'recordData.' + scope.$index + '.count'" :rules='tableRules.count'
135
+                            style="padding-top: 17px">
136
+                <el-input type="number" v-model="scope.row.count"></el-input>
137
+              </el-form-item>
138
+            </template>
139
+          </el-table-column>
140
+
141
+          <el-table-column label="总价" min-width="20" align="center">
142
+            <template slot-scope="scope">
143
+              {{calculate(scope.row.price*scope.row.count)}}
144
+            </template>
145
+          </el-table-column>
146
+          <el-table-column label="备注" min-width="20" align="center">
147
+            <template slot-scope="scope">
148
+              <el-input v-model="scope.row.remark"></el-input>
149
+            </template>
150
+          </el-table-column>
151
+          <el-table-column label="操作" align="center" min-width="20">
152
+            <template slot-scope="scope">
153
+              <el-tooltip class="item" effect="dark" content="新增" placement="top">
154
+
155
+                <el-button
156
+                  size="mini"
157
+                  type="primary"
158
+                  icon="el-icon-circle-plus-outline"
159
+                  @click="handleEdit(scope.$index, scope.row)">
160
+                </el-button>
161
+              </el-tooltip>
162
+              <el-tooltip class="item" effect="dark" content="删除" placement="top">
163
+
164
+                <el-button
165
+                  size="mini"
166
+                  type="danger"
167
+                  icon="el-icon-delete"
168
+                  @click="handleDelete(scope.$index, scope.row)">
169
+                </el-button>
170
+              </el-tooltip>
171
+
172
+            </template>
173
+          </el-table-column>
174
+        </el-table>
175
+      </el-form>
176
+
177
+    </div>
178
+  </div>
179
+
180
+</template>
181
+
182
+<script>
183
+  import { uParseTime } from '@/utils/tools'
184
+
185
+  import { deleteDrugWarehouseOutInfo, editDrugWarehouseoutInfo, getDrugSalesReturnConfig, getDrugWarehouseOutInfo,GetAllConfig,GetAllDrugInfoByID } from '@/api/drug/drug_stock'
186
+  import BreadCrumb from '../../components/bread-crumb'
187
+  import DrugsStockDialog from './drugsStockDialog/index'
188
+
189
+  export default {
190
+    components: { DrugsStockDialog, BreadCrumb},
191
+    name: 'salesReturnEdit',
192
+
193
+    data() {
194
+      return {
195
+        crumbs: [
196
+          { path: false, name: '库存管理' },
197
+          { path: false, name: '耗材出库单' },
198
+          { path: false, name: '编辑出库单' }
199
+        ],
200
+        crumbs2: [
201
+          { path: false, name: '库存管理' },
202
+          { path: false, name: '其他出库单' },
203
+          { path: false, name: '编辑出库单' }
204
+        ],
205
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
206
+
207
+        adminUserOptions: null,
208
+        currentIndex: 0,
209
+        warehouse_out_time: '',
210
+        recordInfo: {
211
+          recordData: [],
212
+          stock_in_code: '',
213
+          current_index: ''
214
+
215
+        },
216
+        tableRules: {
217
+          count: [
218
+            { required: true, message: '数量不能为空', trigge: 'blur' }
219
+          ],
220
+          price: [
221
+            { required: true, message: '单价不能为空', trigger: 'blur' }
222
+          ]
223
+
224
+        },
225
+        ruleForm: {
226
+          manufacturer: [
227
+            { required: true, message: '请选择厂商', trigger: 'change' }
228
+          ]
229
+        },
230
+        // prop
231
+        isVisibility: false,
232
+        propForm: {
233
+          goods:[],
234
+          goodType: [],
235
+          goodInfo: [],
236
+          goodUnit: [],
237
+          title: '入库',
238
+          manufacturer: 0,
239
+          dealer: 0
240
+        },
241
+
242
+        form: {
243
+          manufacturer: 0,
244
+          dealer: 0
245
+        },
246
+        warehouseInfoList: [],
247
+        warehouseOut: {},
248
+        manufacturer: [],
249
+        dealer: [],
250
+        goodType: [],
251
+        goodInfo:[],
252
+      }
253
+    },
254
+    methods: {
255
+      comfirm: function(val) {
256
+        this.$refs.dialog.hide();
257
+        this.propForm.goodType = [];
258
+        this.propForm.goods = [];
259
+
260
+        if (val.selectedGoodInfo.length > 0) {
261
+          for (let i = val.selectedGoodInfo.length - 1; ; i--) {
262
+            if (i == 0) {
263
+
264
+              this.recordInfo.recordData[this.currentIndex].drug_id =
265
+                val.selectedGoodInfo[i].id;
266
+
267
+            } else {
268
+              const tempForm = {};
269
+              tempForm["id"] = 0;
270
+              tempForm["drug_id"] = val.selectedGoodInfo[i].id;
271
+              tempForm["count"] = "";
272
+              tempForm["price"] = val.selectedGoodInfo[i].buy_price.toString();
273
+              tempForm["remark"] = "";
274
+              this.recordInfo.recordData.splice(
275
+                this.currentIndex + 1,
276
+                0,
277
+                tempForm
278
+              );
279
+            }
280
+          }
281
+        }
282
+        this.currentIndex = -1;
283
+      },
284
+      cancle: function() {
285
+        this.$refs.dialog.hide()
286
+        this.propForm.goods = [];
287
+
288
+        this.propForm.goodType = [];
289
+      }, GetConfigInfo: function() {
290
+        const loading = this.$loading({
291
+          lock: true,
292
+          text: "Loading",
293
+          spinner: "el-icon-loading",
294
+          background: "rgba(0, 0, 0, 0.7)"
295
+        });
296
+        GetAllConfig().then(response => {
297
+          if (response.data.state == 0) {
298
+            this.$message.error(response.data.msg);
299
+            return false;
300
+          } else {
301
+            this.manufacturer = response.data.data.manufacturer;
302
+            this.dealer = response.data.data.dealer;
303
+            for(let i = 0; i<  response.data.data.drugs.length;i++){
304
+              this.goodType.push(response.data.data.drugs[i])
305
+              if(response.data.data.drugs[i].drug_specs != null) {
306
+                for (let b = 0; b < response.data.data.drugs[i].drug_specs.length; b++) {
307
+                  this.goodInfo.push(response.data.data.drugs[i].drug_specs[b])
308
+                }
309
+              }
310
+            }
311
+            this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
312
+            this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
313
+          }
314
+          loading.close();
315
+        });
316
+      },  typeName: function(drug_id) {
317
+        let name = "";
318
+        for (let i = 0; i < this.goodInfo.length; i++) {
319
+          if (this.goodInfo[i].id == drug_id) {
320
+            name = this.goodInfo[i].drug_name;
321
+
322
+          }
323
+        }
324
+        return name;
325
+      },
326
+      specificationName: function(drug_id) {
327
+        console.log(this.goodInfo)
328
+        let name = "";
329
+        for (let i = 0; i < this.goodInfo.length; i++) {
330
+          if (this.goodInfo[i].id == drug_id) {
331
+            name = this.goodInfo[i].drug_spec;
332
+          }
333
+        }
334
+        return name;
335
+      }, handleEdit: function(index, row) {
336
+        const tempObj = {}
337
+        tempObj['id'] = 0
338
+        tempObj['drug_id'] = 0
339
+        tempObj['count'] = ''
340
+        tempObj['price'] = ''
341
+        tempObj['remark'] = ''
342
+        this.recordInfo.recordData.push(tempObj)
343
+      }, handleDelete: function(index, row) {
344
+        if (row.id == 0) {
345
+          this.recordInfo.recordData.splice(index, 1)
346
+        } else {
347
+          const params = {
348
+            id: row.id
349
+          }
350
+          this.$confirm('确认删除该出库商品信息记录?', '删除出库商品信息记录', {
351
+            confirmButtonText: '确定',
352
+            cancelButtonText: '取消',
353
+            type: 'warning'
354
+          }).then(() => {
355
+            deleteDrugWarehouseOutInfo(params).then(response => {
356
+              if (response.data.state == 0) {
357
+                this.$message.error(response.data.msg)
358
+                return false
359
+              } else {
360
+                this.$message.success('删除成功')
361
+
362
+                this.recordInfo.recordData.splice(index, 1)
363
+              }
364
+            })
365
+          }).catch(() => {
366
+          })
367
+        }
368
+      }, getTime(val, temp) {
369
+        if (val != 0) {
370
+          return uParseTime(val, temp)
371
+        } else {
372
+          return ''
373
+        }
374
+      },
375
+      showDialog(index, row) {
376
+        this.currentIndex = index;
377
+        const loading = this.$loading({
378
+          lock: true,
379
+          text: "Loading",
380
+          spinner: "el-icon-loading",
381
+          background: "rgba(0, 0, 0, 0.7)"
382
+        });
383
+
384
+        const params = {
385
+          manufacturer_id: this.form.manufacturer,
386
+          dealer_id: this.form.dealer
387
+        };
388
+        GetAllDrugInfoByID(params).then(response => {
389
+          if (response.data.state == 0) {
390
+            this.$message.error(response.data.msg);
391
+            return false;
392
+          } else {
393
+            if (response.data.data.goodInfo.length <= 0) {
394
+              this.$message.error("该厂商或经销商没有药品信息");
395
+              return;
396
+            }
397
+            this.$refs.dialog.show();
398
+            for (let i = 0; i < response.data.data.drugs.length; i++) {
399
+              this.propForm.goods.push(
400
+                response.data.data.drugs[i]
401
+              );
402
+            }
403
+            const obj = {};
404
+            this.propForm.goods = this.propForm.goods.reduce(
405
+              (cur, next) => {
406
+                obj[next.id] ? "" : (obj[next.id] = true && cur.push(next));
407
+                return cur;
408
+              },
409
+              []
410
+            ); // 设置cur默认类型为数组,并且初始值为空的数组
411
+          }
412
+
413
+          for (let i = 0; i < this.propForm.goods.length; i++) {
414
+            for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
415
+              var respObj = this.propForm.goods[i].drug_specs[a];
416
+              respObj["isSelected"] = false;
417
+            }
418
+          }
419
+          loading.close();
420
+        });
421
+      },
422
+
423
+      back() {
424
+        this.$router.go(-1)
425
+      }, submit() {
426
+        this.$refs['tableForm'].validate((valid) => {
427
+          if (valid) {
428
+            const array = this.recordInfo.recordData
429
+            for (let i = 0; i < array.length; i++) {
430
+              if (array[i].drug_id == 0) {
431
+                this.$message.error("药品名称或者药品规格名称不能为空");
432
+                return;
433
+              }
434
+            }
435
+
436
+            const params = {
437
+              'stockOut': this.recordInfo.recordData
438
+            }
439
+            editDrugWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
440
+              if (response.data.state == 0) {
441
+                this.$message.error(response.data.msg)
442
+                return false
443
+              } else {
444
+                this.$message.success('保存成功')
445
+                this.$router.back(-1)
446
+              }
447
+            })
448
+          } else {
449
+            return false
450
+          }
451
+        })
452
+      }, GetOrderDetail: function(order_id) {
453
+        const params = {
454
+          'id': order_id
455
+        }
456
+        getDrugWarehouseOutInfo(params).then(response => {
457
+          if (response.data.state == 0) {
458
+            this.$message.error(response.data.msg)
459
+            return false
460
+          } else {
461
+            for (let i = 0; i < response.data.data.list.length; i++) {
462
+              response.data.data.list[i].price = response.data.data.list[i].price.toString()
463
+              response.data.data.list[i].count = response.data.data.list[i].count.toString()
464
+              this.recordInfo.recordData.push(response.data.data.list[i])
465
+            }
466
+            this.warehouseOut = response.data.data.info
467
+            this.warehouse_out_time = this.getTime(this.warehouseOut.warehouse_out_time, '{y}-{m}-{d}')
468
+            this.form.manufacturer = this.warehouseOut.manufacturer
469
+            this.form.dealer = this.warehouseOut.dealer
470
+
471
+          }
472
+
473
+          if (this.recordInfo.recordData.length == 0) {
474
+            const tempObj = {}
475
+            tempObj['id'] = 0
476
+            tempObj['drug_id'] = 0
477
+            tempObj['count'] = ''
478
+            tempObj['price'] = ''
479
+            tempObj['remark'] = ''
480
+            this.recordInfo.recordData.push(tempObj)
481
+          }
482
+        })
483
+      }, calculate: function(val) {
484
+        if (val == 0) {
485
+          return ''
486
+        }
487
+        return Math.round(parseFloat(val) * 100) / 100
488
+      }, changeManufacturer(val) {
489
+        this.propForm.manufacturer = val
490
+      }, changeDealer(val) {
491
+        this.propForm.dealer = val
492
+      }
493
+    },
494
+    created() {
495
+      this.GetConfigInfo()
496
+      this.propForm.goodUnit = this.$store.getters.good_unit
497
+      const order_id = this.$route.query.id
498
+      this.GetOrderDetail(order_id)
499
+    }
500
+
501
+  }
502
+</script>
503
+
504
+<style rel="stylesheet/css" lang="scss" scoped>
505
+  .information {
506
+    border: 1px #dcdfe6 solid;
507
+    padding: 30px 20px 30px 20px;
508
+
509
+  .border {
510
+    border-bottom: 1px #dcdfe6 solid;
511
+    margin: 0px 0 20px 0;
512
+  }
513
+
514
+  }
515
+
516
+  .edit_separater {
517
+    border-top: 1px solid rgb(233, 233, 233);
518
+    margin-top: 15px;
519
+    margin-bottom: 15px;
520
+  }
521
+
522
+</style>
523
+
524
+<style>
525
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
526
+    font-size: 12px;
527
+  }
528
+
529
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
530
+    background: #6fb5fa;
531
+  }
532
+
533
+</style>

+ 171 - 0
src/xt_pages/stock/drugs/drugStockUserDetail.vue Vedi File

@@ -0,0 +1,171 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+    </div>
6
+
7
+    <div class="app-container">
8
+
9
+      <div class="filter-container">
10
+        <span style="font-size: 18px;color: #606266">商品使用明细</span>
11
+      </div>
12
+
13
+      <div class="cell clearfix">
14
+        <span style="width: 300px;color: #606266">商品类型: {{userList[0].type.type_name}} </span>
15
+        <span style="width: 300px;color: #606266">规格名称: {{userList[0].info.specification_name}}</span>
16
+      </div>
17
+
18
+      <el-row :gutter="12" style="margin-top: 10px">
19
+        <el-table :data="userList" :class="signAndWeighBoxPatients" style="width: 50%"
20
+                  border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
21
+        >
22
+          <el-table-column min-width="35" align="center">
23
+            <template slot="header" slot-scope="scope">
24
+              <span>序号</span>
25
+            </template>
26
+            <template slot-scope="scope">
27
+              <span v-if="scope.row.is_total == 0">{{scope.$index+1}}</span>
28
+              <span v-if="scope.row.is_total == 1">{{'合计'}}</span>
29
+            </template>
30
+          </el-table-column>
31
+
32
+          <el-table-column min-width="35" align="center">
33
+            <template slot="header" slot-scope="scope">
34
+              <span>使用人</span>
35
+            </template>
36
+            <template slot-scope="scope">
37
+              <span v-if="scope.row.is_total == 0">{{scope.row.user.name}}</span>
38
+              <span v-if="scope.row.is_total == 1"></span>
39
+            </template>
40
+          </el-table-column>
41
+          <el-table-column min-width="35" align="center">
42
+            <template slot="header" slot-scope="scope">
43
+              <span>使用数量</span>
44
+            </template>
45
+            <template slot-scope="scope">
46
+              <span >{{scope.row.count}}</span>
47
+            </template>
48
+          </el-table-column>
49
+          <el-table-column min-width="35" align="center">
50
+            <template slot="header" slot-scope="scope">
51
+              <span>使用时间</span>
52
+            </template>
53
+            <template slot-scope="scope">
54
+              <span  v-if="scope.row.is_total == 0">{{scope.row.ctime | parseTime('{y}-{m}-{d} {h}:{i}')}} </span>
55
+              <span  v-if="scope.row.is_total == 1">{{scope.row.total}} </span>
56
+            </template>
57
+          </el-table-column>
58
+
59
+        </el-table>
60
+      </el-row>
61
+    </div>
62
+  </div>
63
+</template>
64
+
65
+<script>
66
+  import { uParseTime } from '@/utils/tools'
67
+  import { getWarehouseOutUser } from '@/api/stock'
68
+  import BreadCrumb from '../components/bread-crumb'
69
+
70
+  export default {
71
+    name: 'stockInOrderDetail',
72
+    components: { BreadCrumb },
73
+    created() {
74
+      const order_id = this.$route.query.id
75
+      this.GetOrderDetail(order_id)
76
+    },
77
+    data() {
78
+      return {
79
+        crumbs: [
80
+          { path: false, name: '库存管理' },
81
+          { path: false, name: '耗材出库单' },
82
+          { path: false, name: '出库单详情' },
83
+          { path: false, name: '使用明细' }
84
+
85
+        ],
86
+        signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
87
+        userList:[]
88
+      }
89
+    },
90
+    methods: {
91
+      getSpecificationName: function(id) {
92
+        let name = ''
93
+        for (let i = 0; i < this.goodInfo.length; i++) {
94
+          if (this.goodInfo[i].id == id) {
95
+            name = this.goodInfo[i].specification_name
96
+          }
97
+        }
98
+        return name
99
+      }, getTypeName: function(id) {
100
+        let name = ''
101
+        for (let i = 0; i < this.goodType.length; i++) {
102
+          if (this.goodType[i].id == id) {
103
+            name = this.goodType[i].type_name
104
+          }
105
+        }
106
+        return name
107
+      }, GetOrderDetail: function(order_id) {
108
+        const params = {
109
+          'id': order_id
110
+        }
111
+        getWarehouseOutUser(params).then(response => {
112
+          if (response.data.state == 0) {
113
+            this.$message.error(response.data.msg)
114
+            return false
115
+          } else {
116
+            var total = 0
117
+            for (let i = 0; i < response.data.data.list.length; i++) {
118
+              var obj = response.data.data.list[i]
119
+              obj['is_total'] = 0
120
+              this.userList.push(obj)
121
+              total = total + response.data.data.list[i].count
122
+            }
123
+            this.userList.push({
124
+              is_total: 1,
125
+              total: total,
126
+            })
127
+
128
+            console.log(this.userList)
129
+          }
130
+        })
131
+      }
132
+    }
133
+  }
134
+</script>
135
+
136
+<style rel="stylesheet/css" lang="scss" scoped>
137
+  .information {
138
+    border: 1px #dcdfe6 solid;
139
+    padding: 30px 20px 30px 20px;
140
+
141
+  .border {
142
+    border-bottom: 1px #dcdfe6 solid;
143
+    margin: 0px 0 20px 0;
144
+  }
145
+
146
+  }
147
+
148
+
149
+  .edit_separater {
150
+    border-top: 1px solid rgb(233, 233, 233);
151
+    margin-top: 15px;
152
+    margin-bottom: 15px;
153
+  }
154
+
155
+</style>
156
+
157
+<style>
158
+  .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
159
+    font-size: 12px;
160
+  }
161
+
162
+  .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
163
+    background: #6fb5fa;
164
+  }
165
+
166
+  .count {
167
+    color: #bd2c00;
168
+
169
+  }
170
+
171
+</style>

+ 249 - 0
src/xt_pages/stock/drugs/drugsStockDialog/index.vue Vedi File

@@ -0,0 +1,249 @@
1
+<template>
2
+  <el-dialog title="选择药品" :visible.sync="visibility" :close-on-click-modal="isClose"
3
+             :close-on-press-escape="isClose">
4
+
5
+    <div class="filter-container">
6
+      <el-input style="width: 150px;" class="filter-item" placeholder="药品规格名称" v-model="keywords"/>
7
+      <el-button class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
8
+    </div>
9
+
10
+    <el-row :gutter="20">
11
+      <el-col :span="8">
12
+        <el-table
13
+          :data="propForm.goods"
14
+          ref="table"
15
+          border
16
+          highlight-current-row
17
+          max-height="250"
18
+          :row-class-name="tableRows"
19
+          @row-click="onRowClicks"
20
+          @current-change="goodTypeTableChange"
21
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
22
+          style="width: 100%">
23
+          <el-table-column
24
+            align="center"
25
+            label="药品规格">
26
+            <template slot-scope="scope">
27
+              <span>{{scope.row.drug_name}}</span>
28
+            </template>
29
+          </el-table-column>
30
+        </el-table>
31
+      </el-col>
32
+      <el-col :span="16">
33
+        <el-table
34
+          :data="goodInfoTableData"
35
+          border
36
+          ref="multipleTable"
37
+          max-height="250"
38
+          @row-click="clickRow"
39
+          @selection-change="changeGoodInfoTableData"
40
+          @select="selectGoodInfo"
41
+          @select-all="changeAllGoodInfoTableData"
42
+          row-key="row_key"
43
+          style="width: 100%"
44
+          :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
45
+        >
46
+          <el-table-column
47
+            align="center"
48
+            type="selection"
49
+            width="55">
50
+          </el-table-column>
51
+          <el-table-column
52
+            align="center"
53
+            label="规格名称"
54
+            property="drug_spec"
55
+            style="word-break: keep-all;white-space:nowrap;"
56
+          ></el-table-column>
57
+          <el-table-column
58
+            align="center"
59
+            label="单位"
60
+            property="good_unit"
61
+          >
62
+            <template slot-scope="scope">
63
+              <!--<span>{{getName(scope.row.good_unit)}}</span>-->
64
+            </template>
65
+          </el-table-column>
66
+
67
+          <el-table-column
68
+            align="center"
69
+            label="单价"
70
+            property="buy_price"
71
+          >
72
+            <template slot-scope="scope">
73
+              <!--<span>{{scope.row.buy_price}}</span>-->
74
+            </template>
75
+          </el-table-column>
76
+
77
+        </el-table>
78
+      </el-col>
79
+    </el-row>
80
+
81
+
82
+    <span slot="footer" class="dialog-footer">
83
+    <el-button @click="cancle('form')">取 消</el-button>
84
+    <el-button type="primary" @click="comfirm('form')">保 存</el-button>
85
+  </span>
86
+  </el-dialog>
87
+
88
+</template>
89
+
90
+<script>
91
+  import { GetGoodInfoByGoodId } from '@/api/stock'
92
+
93
+  export default {
94
+    name: 'drugsStockDialog',
95
+    data() {
96
+      return {
97
+        goodInfo: [],
98
+        goodInfoTableData: [],
99
+        keywords: '',
100
+        multipleSelection: [],
101
+        currentGoodTypeId: 0,
102
+        isClose: false,
103
+        visibility: false,
104
+        SelectedDatas: [],
105
+        table_current_index: -1
106
+      }
107
+    },
108
+    props: {
109
+      propForm: {
110
+        type: Object
111
+      }
112
+    },
113
+    methods: {
114
+      hide: function() {
115
+        this.visibility = false
116
+      },
117
+      show: function() {
118
+        this.visibility = true
119
+
120
+      },
121
+      goodTypeTableChange: function(currentRow, oldCurrentRow) {
122
+        this.goodInfoTableData = currentRow.drug_specs != null ? currentRow.drug_specs : []
123
+        for (let i = 0; i < this.goodInfoTableData.length; i++) {
124
+          if (this.goodInfoTableData[i].isSelected) {
125
+            this.$nextTick(function() {
126
+              this.$refs.multipleTable.toggleRowSelection(this.goodInfoTableData[i])
127
+            })
128
+          }
129
+        }
130
+
131
+      },
132
+      cancle: function(formName) {
133
+        this.goodInfoTableData = []
134
+        this.$emit('dialog-cancle', this.getValue())
135
+        this.$refs.multipleTable.clearSelection()
136
+        this.$refs.table.setCurrentRow(null)
137
+
138
+      },
139
+      comfirm: function(formName) {
140
+        this.goodInfoTableData = []
141
+        this.$emit('dialog-comfirm', this.getValue())
142
+        this.$refs.multipleTable.clearSelection()
143
+        this.$refs.table.setCurrentRow(null)
144
+      },
145
+      getValue: function() {
146
+        this.multipleSelection = []
147
+        for (let i = 0; i < this.propForm.goods.length; i++) {
148
+          for (let a = 0; a < this.propForm.goods[i].drug_specs.length; a++) {
149
+                if (this.propForm.goods[i].drug_specs[a].isSelected) {
150
+                  this.multipleSelection.push(this.propForm.goods[i].drug_specs[a])
151
+                }
152
+          }
153
+        }
154
+        const obj = {
155
+          selectedGoodInfo: this.multipleSelection,
156
+        }
157
+        console.log(obj)
158
+        return obj
159
+      }, goodTypeSelect: function(id) {
160
+        this.tempGoodInfo = []
161
+        this.goodInfo = []
162
+        for (let i = 0; i < this.propForm.goodInfo.length; i++) {
163
+          if (this.propForm.goodInfo[i].good_type_id == id) {
164
+            this.tempGoodInfo.push(this.propForm.goodInfo[i])
165
+          }
166
+        }
167
+      }, goodInfoSelect: function(id) {
168
+        let index = 0
169
+        for (let i = 0; i < this.propForm.goodInfo.length; i++) {
170
+          if (this.propForm.goodInfo[i].id == id) {
171
+            index = i
172
+          }
173
+        }
174
+        this.form.good_type_id = this.propForm.goodInfo[index].good_type_id
175
+      }, getName: function(id) {
176
+        if (id == 0) {
177
+          return ''
178
+        }
179
+
180
+        for (let i = 0; i < this.propForm.goodUnit.length; i++) {
181
+          if (this.propForm.goodUnit[i].id == id) {
182
+            return this.propForm.goodUnit[i].name
183
+          }
184
+        }
185
+      }, search: function() {
186
+        if (this.keywords.length <= 0) {
187
+          this.$message.error('搜索关键字不能为空')
188
+          return
189
+        }
190
+        const searchArr = []
191
+        for (let i = 0; i < this.goodInfoTableData.length; i++) {
192
+          if (this.goodInfoTableData[i].drug_spec.indexOf(this.keywords) != -1) {
193
+            searchArr.push(this.goodInfoTableData[i])
194
+          }
195
+        }
196
+        this.goodInfoTableData = []
197
+        for (let i = 0; i < searchArr.length; i++) {
198
+          this.goodInfoTableData.push(searchArr[i])
199
+        }
200
+      }, changeGoodInfoTableData: function(val) {
201
+        console.log(val)
202
+      }, changeAllGoodInfoTableData: function(selection) {
203
+        var goodInfos = this.propForm.goods[this.table_current_index].drug_specs
204
+        if (selection.length > 0) {
205
+          for (let y = 0; y < goodInfos.length; y++) {
206
+            for (let i = 0; i < selection.length; i++) {
207
+              if (goodInfos[y].id == selection[i].id) {
208
+                goodInfos[y].isSelected = true
209
+              }
210
+            }
211
+          }
212
+        }
213
+      }, clickRow: function(row) {
214
+        // this.$refs.multipleTable.toggleRowSelection(row)
215
+
216
+      },tableRows({ row, rowIndex }) {
217
+        // 把每一行的索引放进row
218
+        row.index = rowIndex
219
+      },
220
+      onRowClicks(row, event, column) {
221
+        this.table_current_index = row.index
222
+      }, selectGoodInfo(selection, row) {
223
+
224
+        var goodInfos = this.propForm.goods[this.table_current_index].drug_specs
225
+        // for (let y = 0; y < goodInfos.length; y++) {
226
+        //   goodInfos[y].isSelected = false
227
+        // }
228
+        if (selection.length > 0) {
229
+          for (let y = 0; y < goodInfos.length; y++) {
230
+            for (let i = 0; i < selection.length; i++) {
231
+              if (goodInfos[y].id == selection[i].id) {
232
+                goodInfos[y].isSelected = true
233
+              }
234
+            }
235
+          }
236
+        }
237
+
238
+
239
+
240
+      }
241
+    }
242
+
243
+  }
244
+
245
+</script>
246
+
247
+<style scoped>
248
+
249
+</style>

+ 71 - 0
src/xt_pages/stock/drugs/index.vue Vedi File

@@ -0,0 +1,71 @@
1
+<template>
2
+  <div class="main-contain">
3
+    <div class="position">
4
+      <bread-crumb :crumbs='crumbs'></bread-crumb>
5
+    </div>
6
+    <!--<el-checkbox style="float: right;margin-right: 35px;padding-top: 20px;height: 15px" v-model="is_open" @change="changeOpen">是否启用自动扣减功能</el-checkbox>-->
7
+    <div class="app-container" >
8
+      <div class="service-box">
9
+        <el-tabs v-model="activeName">
10
+          <el-tab-pane label="厂家" name="first">
11
+            <manufacturer></manufacturer>
12
+          </el-tab-pane>
13
+          <el-tab-pane label="经销商">
14
+            <dealer></dealer>
15
+          </el-tab-pane>
16
+          <el-tab-pane label="商品类型">
17
+            <good-type></good-type>
18
+          </el-tab-pane>
19
+          <el-tab-pane label="商品信息">
20
+            <good-info></good-info>
21
+          </el-tab-pane>
22
+          <el-tab-pane label="自动扣减">
23
+            <automatic-reduce></automatic-reduce>
24
+          </el-tab-pane>
25
+
26
+        </el-tabs>
27
+
28
+      </div>
29
+    </div>
30
+  </div>
31
+</template>
32
+
33
+<script>
34
+  import Dealer from './config/dealer'
35
+  import Manufacturer from './config/manufacturer'
36
+  import GoodInfo from './config/goodInfo'
37
+  import GoodType from './config/goodType'
38
+  import BreadCrumb from '@/xt_pages/components/bread-crumb'
39
+  import AutomaticReduce from './config/automaticReduce'
40
+  export default {
41
+    name: 'service',
42
+    components: {
43
+      AutomaticReduce,
44
+      GoodType,
45
+      GoodInfo,
46
+      Manufacturer,
47
+      Dealer,
48
+      BreadCrumb
49
+    },
50
+    data() {
51
+      return {
52
+        is_open: false,
53
+        crumbs: [
54
+          { path: false, name: '库存管理' },
55
+          { path: '/stock/config', name: '库存配置' }
56
+        ],
57
+        activeName: 'first',
58
+        config:null,
59
+      }
60
+    },
61
+    methods: {
62
+      handleClick(tab, event) {
63
+        console.log(tab, event, this.activeName)
64
+      }
65
+    },created(){
66
+
67
+    }
68
+  }
69
+</script>
70
+
71
+

+ 4 - 1
src/xt_pages/workforce/schedule_print.vue Vedi File

@@ -273,6 +273,7 @@
273 273
             const collection = this.schedules[index]
274 274
             collection.day = resp.data.days[index].split("-")[1]+"-"+resp.data.days[index].split("-")[2]
275 275
           }
276
+
276 277
           this.total = resp.data.total
277 278
           var schedules = resp.data.schedules
278 279
 
@@ -297,7 +298,7 @@
297 298
             } else {
298 299
               time_type_schedules = main_collection.all.evening
299 300
             }
300
-            
301
+
301 302
 
302 303
             var zone_schedules = time_type_schedules[schedule.zone.name] ? time_type_schedules[schedule.zone.name] : []
303 304
 
@@ -305,6 +306,7 @@
305 306
 
306 307
             time_type_schedules[schedule.zone.name] = zone_schedules
307 308
 
309
+
308 310
             if (schedule.mode.id == 2) { // HDF
309 311
               main_collection.hdf.push(schedule)
310 312
 
@@ -315,6 +317,7 @@
315 317
 
316 318
           }
317 319
 
320
+
318 321
         } else {
319 322
           this.$message.error(resp.msg)
320 323
         }

+ 13 - 13
src/xt_permission.js Vedi File

@@ -12,19 +12,19 @@ const permissionWhiteList = loginWhiteList.concat(['/']) // 权限验证白名
12 12
 
13 13
 router.beforeEach((to, from, next) => {
14 14
   // 线上注释
15
-  // if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
16
-  //     store.dispatch('VerifyConfigList', []).then(() => {
17
-  //       next()
18
-  //     })
19
-  //   }
20
-  //   if (store.getters.permission_routers === undefined) {
21
-  //     store.dispatch('xt_GenerateRoutes', []).then(() => {
22
-  //       next()
23
-  //     })
24
-  //   } else {
25
-  //     next()
26
-  //   }
27
-  //   return
15
+  if (!store.getters.configlist || store.getters.configlist === undefined || store.getters.configlist.length <= 0) {
16
+      store.dispatch('VerifyConfigList', []).then(() => {
17
+        next()
18
+      })
19
+    }
20
+    if (store.getters.permission_routers === undefined) {
21
+      store.dispatch('xt_GenerateRoutes', []).then(() => {
22
+        next()
23
+      })
24
+    } else {
25
+      next()
26
+    }
27
+    return
28 28
   // 线上注释
29 29
 
30 30
   NProgress.start()