浏览代码

518合并代码

XMLWAN 3 年前
父节点
当前提交
05bcc1227f
共有 54 个文件被更改,包括 3293 次插入795 次删除
  1. 12 12
      src/api/drug/drug_stock.js
  2. 26 11
      src/api/stock.js
  3. 31 15
      src/api/warehouse.js
  4. 5 2
      src/lang/zh.js
  5. 7 2
      src/router/modules/hisTool.js
  6. 12 0
      src/router/modules/stock.js
  7. 55 16
      src/xt_pages/stock/cancelStockOrder.vue
  8. 26 12
      src/xt_pages/stock/cancelStockOrderAdd.vue
  9. 16 2
      src/xt_pages/stock/cancelStockOrderEdit.vue
  10. 48 47
      src/xt_pages/stock/detail/cancelStockDetail.vue
  11. 50 8
      src/xt_pages/stock/detail/stockInDetail.vue
  12. 77 37
      src/xt_pages/stock/detail/stockOutDetail.vue
  13. 56 11
      src/xt_pages/stock/drugs/cancelDrugStockOrder.vue
  14. 20 3
      src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue
  15. 24 12
      src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue
  16. 45 6
      src/xt_pages/stock/drugs/components/drugCancelDetail.vue
  17. 54 10
      src/xt_pages/stock/drugs/components/drugInOrder.vue
  18. 56 18
      src/xt_pages/stock/drugs/components/drugOutDetail.vue
  19. 25 9
      src/xt_pages/stock/drugs/drugBatchNumber.vue
  20. 39 0
      src/xt_pages/stock/drugs/drugDamaged.vue
  21. 39 25
      src/xt_pages/stock/drugs/drugStockFlow.vue
  22. 70 20
      src/xt_pages/stock/drugs/drugStockInOrder.vue
  23. 22 7
      src/xt_pages/stock/drugs/drugStockInOrderAdd.vue
  24. 33 18
      src/xt_pages/stock/drugs/drugStockInOrderEdit.vue
  25. 70 25
      src/xt_pages/stock/drugs/drugStockOutOrder.vue
  26. 51 9
      src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue
  27. 3 1
      src/xt_pages/stock/drugs/drugStockOutOrderDetail.vue
  28. 64 8
      src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue
  29. 41 3
      src/xt_pages/stock/drugs/inventory.vue
  30. 41 3
      src/xt_pages/stock/drugs/inventoryDetails.vue
  31. 234 35
      src/xt_pages/stock/drugs/query.vue
  32. 110 70
      src/xt_pages/stock/inventory.vue
  33. 42 0
      src/xt_pages/stock/inventoryDetails.vue
  34. 492 76
      src/xt_pages/stock/inventoryTransfer/Addtrans.vue
  35. 300 38
      src/xt_pages/stock/inventoryTransfer/index.vue
  36. 86 26
      src/xt_pages/stock/inventoryTransfer/transDetails.vue
  37. 24 12
      src/xt_pages/stock/stockBatchNumber.vue
  38. 43 24
      src/xt_pages/stock/stockDamaged.vue
  39. 31 20
      src/xt_pages/stock/stockFlow.vue
  40. 75 24
      src/xt_pages/stock/stockInOrder.vue
  41. 24 10
      src/xt_pages/stock/stockInOrderAdd.vue
  42. 37 7
      src/xt_pages/stock/stockInOrderEdit.vue
  43. 73 10
      src/xt_pages/stock/stockOutOrder.vue
  44. 58 18
      src/xt_pages/stock/stockOutOrderAdd.vue
  45. 105 53
      src/xt_pages/stock/stockOutOrderEdit.vue
  46. 381 8
      src/xt_pages/stock/stockQuery.vue
  47. 0 2
      src/xt_pages/supply/components/addGoodOrder.vue
  48. 29 0
      src/xt_pages/supply/components/addGoodReturn.vue
  49. 2 2
      src/xt_pages/supply/components/editGoodReturn.vue
  50. 2 1
      src/xt_pages/supply/purchaseOrderQuery.vue
  51. 1 0
      src/xt_pages/supply/supplyQuery.vue
  52. 15 3
      src/xt_pages/user/components/PatientDetail.vue
  53. 10 1
      src/xt_pages/user/components/PatientForm.vue
  54. 1 3
      src/xt_pages/user/doctorAdvice.vue

+ 12 - 12
src/api/drug/drug_stock.js 查看文件

1
 import request from '@/utils/request'
1
 import request from '@/utils/request'
2
 
2
 
3
-export function postDrugWarehouse(params, warehousing_time, manufacturer_id, dealer_id, type) {
3
+export function postDrugWarehouse(params, warehousing_time, manufacturer_id, dealer_id, type, storehouse_id) {
4
   return request({
4
   return request({
5
-    url: '/api/drugwarehouse/create?warehousing_time=' + warehousing_time + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type,
5
+    url: '/api/drugwarehouse/create?warehousing_time=' + warehousing_time + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id,
6
     method: 'post',
6
     method: 'post',
7
     data: params
7
     data: params
8
   })
8
   })
72
   })
72
   })
73
 }
73
 }
74
 
74
 
75
-export function postDrugWarehouseOut(params, warehousing_time, dealer_id, manufacturer_id, type) {
75
+export function postDrugWarehouseOut(params, warehousing_time, dealer_id, manufacturer_id, type, storehouse_id) {
76
   return request({
76
   return request({
77
-    url: '/api/drugwarehouseout/create?warehousing_out_time=' + warehousing_time + '&dealer_id=' + dealer_id + '&manufacturer_id=' + manufacturer_id + '&type=' + type,
77
+    url: '/api/drugwarehouseout/create?warehousing_out_time=' + warehousing_time + '&dealer_id=' + dealer_id + '&manufacturer_id=' + manufacturer_id + '&type=' + type + '&storehouse_id=' + storehouse_id,
78
     method: 'post',
78
     method: 'post',
79
     data: params
79
     data: params
80
   })
80
   })
185
   })
185
   })
186
 }
186
 }
187
 
187
 
188
-export function EditDrugWarehouse(params, warehousing_time, id, type, manufacturer_id, dealer_id) {
188
+export function EditDrugWarehouse(params, warehousing_time, id, type, manufacturer_id, dealer_id, storehouse_id) {
189
   return request({
189
   return request({
190
-    url: '/api/drugwarehouse/edit?warehousing_time=' + warehousing_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id,
190
+    url: '/api/drugwarehouse/edit?warehousing_time=' + warehousing_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&storehouse_id=' + storehouse_id,
191
     method: 'post',
191
     method: 'post',
192
     data: params
192
     data: params
193
   })
193
   })
273
   })
273
   })
274
 }
274
 }
275
 
275
 
276
-export function editDrugWarehouseoutInfo(params, warehouse_out_time, id, type, manufacturer_id, dealer_id) {
276
+export function editDrugWarehouseoutInfo(params, warehouse_out_time, id, type, manufacturer_id, dealer_id, storehouse_id) {
277
   return request({
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,
278
+    url: '/api/drugwarehouseout/edit?warehouse_out_time=' + warehouse_out_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&storehouse_id=' + storehouse_id,
279
     method: 'post',
279
     method: 'post',
280
     data: params
280
     data: params
281
   })
281
   })
289
   })
289
   })
290
 }
290
 }
291
 
291
 
292
-export function editDrugCancelStockInfo(params, cancel_stock_time, id, type, manufacturer_id, dealer_id) {
292
+export function editDrugCancelStockInfo(params, cancel_stock_time, id, type, manufacturer_id, dealer_id, storehouse_id) {
293
   return request({
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,
294
+    url: '/api/drugcancelstockinfo/edit?cancel_time=' + cancel_stock_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&storehouse_id=' + storehouse_id,
295
     method: 'post',
295
     method: 'post',
296
     data: params
296
     data: params
297
   })
297
   })
321
   })
321
   })
322
 }
322
 }
323
 
323
 
324
-export function postDrugCancelStock(params, cancelStockTime, manufacturer_id, dealer_id, type) {
324
+export function postDrugCancelStock(params, cancelStockTime, manufacturer_id, dealer_id, type, storehouse_id) {
325
   return request({
325
   return request({
326
-    url: '/api/drugcancelstock/create?time=' + cancelStockTime + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type,
326
+    url: '/api/drugcancelstock/create?time=' + cancelStockTime + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id,
327
     method: 'post',
327
     method: 'post',
328
     data: params
328
     data: params
329
   })
329
   })

+ 26 - 11
src/api/stock.js 查看文件

201
   })
201
   })
202
 }
202
 }
203
 
203
 
204
-export function postWarehouse(params, warehousing_time, manufacturer_id, dealer_id, type) {
204
+export function postWarehouse(params, warehousing_time, manufacturer_id, dealer_id, type, storehouse_id) {
205
   return request({
205
   return request({
206
-    url: '/api/warehouse/create?warehousing_time=' + warehousing_time + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type,
206
+    url: '/api/warehouse/create?warehousing_time=' + warehousing_time + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id,
207
     method: 'post',
207
     method: 'post',
208
     data: params
208
     data: params
209
   })
209
   })
273
   })
273
   })
274
 }
274
 }
275
 
275
 
276
-export function postWarehouseOut(params, warehousing_time, dealer_id, manufacturer_id, type) {
276
+export function postWarehouseOut(params, warehousing_time, dealer_id, manufacturer_id, type, storehouse_id) {
277
   return request({
277
   return request({
278
-    url: '/api/warehouseout/create?warehousing_out_time=' + warehousing_time + '&dealer_id=' + dealer_id + '&manufacturer_id=' + manufacturer_id + '&type=' + type,
278
+    url: '/api/warehouseout/create?warehousing_out_time=' + warehousing_time + '&dealer_id=' + dealer_id + '&manufacturer_id=' + manufacturer_id + '&type=' + type + '&storehouse_id=' + storehouse_id,
279
     method: 'post',
279
     method: 'post',
280
     data: params
280
     data: params
281
   })
281
   })
386
   })
386
   })
387
 }
387
 }
388
 
388
 
389
-export function EditWarehouse(params, warehousing_time, id, type, manufacturer_id, dealer_id) {
389
+export function EditWarehouse(params, warehousing_time, id, type, manufacturer_id, dealer_id, storehouse_id) {
390
   return request({
390
   return request({
391
-    url: '/api/warehouse/edit?warehousing_time=' + warehousing_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id,
391
+    url: '/api/warehouse/edit?warehousing_time=' + warehousing_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&storehouse_id=' + storehouse_id,
392
     method: 'post',
392
     method: 'post',
393
     data: params
393
     data: params
394
   })
394
   })
474
   })
474
   })
475
 }
475
 }
476
 
476
 
477
-export function editWarehouseoutInfo(params, warehouse_out_time, id, type, manufacturer_id, dealer_id) {
477
+export function editWarehouseoutInfo(params, warehouse_out_time, id, type, manufacturer_id, dealer_id, storehouse_id) {
478
   return request({
478
   return request({
479
-    url: '/api/warehouseout/edit?warehouse_out_time=' + warehouse_out_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id,
479
+    url: '/api/warehouseout/edit?warehouse_out_time=' + warehouse_out_time + '&id=' + id + '&type=' + type + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&storehouse_id=' + storehouse_id,
480
     method: 'post',
480
     method: 'post',
481
     data: params
481
     data: params
482
   })
482
   })
522
   })
522
   })
523
 }
523
 }
524
 
524
 
525
-export function postCancelStock(params, cancelStockTime, manufacturer_id, dealer_id, type) {
525
+export function postCancelStock(params, cancelStockTime, manufacturer_id, dealer_id, type, storehouse_id) {
526
   return request({
526
   return request({
527
-    url: '/api/cancelstock/create?time=' + cancelStockTime + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type,
527
+    url: '/api/cancelstock/create?time=' + cancelStockTime + '&manufacturer_id=' + manufacturer_id + '&dealer_id=' + dealer_id + '&type=' + type + '&storehouse_id=' + storehouse_id,
528
     method: 'post',
528
     method: 'post',
529
     data: params
529
     data: params
530
   })
530
   })
779
 }
779
 }
780
 
780
 
781
 export function getReportStockList(params) {
781
 export function getReportStockList(params) {
782
-  console.log('params', params)
783
   return request({
782
   return request({
784
     url: '/api/stock/getreportstocklist',
783
     url: '/api/stock/getreportstocklist',
785
     method: 'get',
784
     method: 'get',
978
     params: params
977
     params: params
979
   })
978
   })
980
 }
979
 }
980
+
981
+export function getDrugDetailSummary(params) {
982
+  return request({
983
+    url: '/api/stock/getdrugdetailsummary',
984
+    method: 'get',
985
+    params: params
986
+  })
987
+}
988
+
989
+export function getGoodDetailSummary(params) {
990
+  return request({
991
+    url: '/api/stock/getgooddetialsummary',
992
+    method: 'Get',
993
+    params: params
994
+  })
995
+}

+ 31 - 15
src/api/warehouse.js 查看文件

1
 import request from '@/utils/request'
1
 import request from '@/utils/request'
2
 
2
 
3
-//分页(已渲染)
3
+// 分页(已渲染)
4
 export function storehouselist(params) {
4
 export function storehouselist(params) {
5
   return request({
5
   return request({
6
     url: '/api/secondary/storehouselist',
6
     url: '/api/secondary/storehouselist',
9
   })
9
   })
10
 }
10
 }
11
 
11
 
12
-//获取当前机构的所有可用仓库名称接口(已渲染)
12
+// 获取当前机构的所有可用仓库名称接口(已渲染)
13
 export function getallstorehousename(params) {
13
 export function getallstorehousename(params) {
14
   return request({
14
   return request({
15
     url: '/api/secondary/getallstorehousename',
15
     url: '/api/secondary/getallstorehousename',
18
   })
18
   })
19
 }
19
 }
20
 
20
 
21
-//获取一条仓库数据接口(好像用不到了)
21
+// 获取一条仓库数据接口(好像用不到了)
22
 export function getonestorehouse(params) {
22
 export function getonestorehouse(params) {
23
   return request({
23
   return request({
24
     url: '/api/secondary/getonestorehouse',
24
     url: '/api/secondary/getonestorehouse',
27
   })
27
   })
28
 }
28
 }
29
 
29
 
30
-//修改仓库接口(已渲染)
30
+// 修改仓库接口(已渲染)
31
 export function updatestorehouse(data) {
31
 export function updatestorehouse(data) {
32
   return request({
32
   return request({
33
     url: '/api/secondary/updatestorehouse',
33
     url: '/api/secondary/updatestorehouse',
36
   })
36
   })
37
 }
37
 }
38
 
38
 
39
-//添加仓库接口(已渲染)
39
+// 添加仓库接口(已渲染)
40
 export function addstorehouse(data) {
40
 export function addstorehouse(data) {
41
   return request({
41
   return request({
42
     url: '/api/secondary/addstorehouse',
42
     url: '/api/secondary/addstorehouse',
45
   })
45
   })
46
 }
46
 }
47
 
47
 
48
-//仓库地址查重接口(合并到新增)
48
+// 仓库地址查重接口(合并到新增)
49
 export function isstorehouseaddress(params) {
49
 export function isstorehouseaddress(params) {
50
   return request({
50
   return request({
51
     url: '/api/secondary/isstorehouseaddress',
51
     url: '/api/secondary/isstorehouseaddress',
54
   })
54
   })
55
 }
55
 }
56
 
56
 
57
-//仓库名称查重接口(合并到新增)
57
+// 仓库名称查重接口(合并到新增)
58
 export function isstorehousename(params) {
58
 export function isstorehousename(params) {
59
   return request({
59
   return request({
60
     url: '/api/secondary/isstorehousename',
60
     url: '/api/secondary/isstorehousename',
63
   })
63
   })
64
 }
64
 }
65
 
65
 
66
-//删除仓库接口(已渲染)
66
+// 删除仓库接口(已渲染)
67
 export function deletestorehouse(params) {
67
 export function deletestorehouse(params) {
68
   return request({
68
   return request({
69
     url: '/api/secondary/deletestorehouse',
69
     url: '/api/secondary/deletestorehouse',
72
   })
72
   })
73
 }
73
 }
74
 
74
 
75
-//修改仓库状态接口(已渲染)
75
+// 修改仓库状态接口(已渲染)
76
 export function updatestatus(params) {
76
 export function updatestatus(params) {
77
   return request({
77
   return request({
78
     url: '/api/secondary/updatestatus',
78
     url: '/api/secondary/updatestatus',
81
   })
81
   })
82
 }
82
 }
83
 
83
 
84
-//获取仓库编号接口(已渲染)
84
+// 获取仓库编号接口(已渲染)
85
 export function getcode(params) {
85
 export function getcode(params) {
86
   return request({
86
   return request({
87
     url: '/api/secondary/getcode',
87
     url: '/api/secondary/getcode',
90
   })
90
   })
91
 }
91
 }
92
 
92
 
93
-//查询该机构的仓库配置(已渲染)
93
+// 查询该机构的仓库配置(已渲染)
94
 export function findstorehouseconfig(params) {
94
 export function findstorehouseconfig(params) {
95
   return request({
95
   return request({
96
     url: '/api/secondary/findstorehouseconfig',
96
     url: '/api/secondary/findstorehouseconfig',
99
   })
99
   })
100
 }
100
 }
101
 
101
 
102
-//更改耗材自动入库仓库(已渲染)
102
+// 更改耗材自动入库仓库(已渲染)
103
 export function updateinfo(params) {
103
 export function updateinfo(params) {
104
   return request({
104
   return request({
105
     url: '/api/secondary/updateinfo',
105
     url: '/api/secondary/updateinfo',
107
     params: params
107
     params: params
108
   })
108
   })
109
 }
109
 }
110
-//更改耗材自动出库仓库(已渲染)
110
+// 更改耗材自动出库仓库(已渲染)
111
 export function updateoutinfo(params) {
111
 export function updateoutinfo(params) {
112
   return request({
112
   return request({
113
     url: '/api/secondary/updateoutinfo',
113
     url: '/api/secondary/updateoutinfo',
115
     params: params
115
     params: params
116
   })
116
   })
117
 }
117
 }
118
-//更改药品自动入库仓库(已渲染)
118
+// 更改药品自动入库仓库(已渲染)
119
 export function updatedruginfo(params) {
119
 export function updatedruginfo(params) {
120
   return request({
120
   return request({
121
     url: '/api/secondary/updatedruginfo',
121
     url: '/api/secondary/updatedruginfo',
123
     params: params
123
     params: params
124
   })
124
   })
125
 }
125
 }
126
-//更改药品自动出库仓库(已渲染)
126
+// 更改药品自动出库仓库(已渲染)
127
 export function updatedrugout(params) {
127
 export function updatedrugout(params) {
128
   return request({
128
   return request({
129
     url: '/api/secondary/updatedrugout',
129
     url: '/api/secondary/updatedrugout',
131
     params: params
131
     params: params
132
   })
132
   })
133
 }
133
 }
134
+// 获取管理员列表(已渲染)
135
+export function getusername(params) {
136
+  return request({
137
+    url: '/api/secondary/getusername',
138
+    method: 'get',
139
+    params: params
140
+  })
141
+}
142
+// 获取当前登录人的id(已渲染)
143
+export function getcreaterid(params) {
144
+  return request({
145
+    url: '/api/secondary/getcreaterid',
146
+    method: 'get',
147
+    params: params
148
+  })
149
+}
134
 //获取管理员列表(已渲染)
150
 //获取管理员列表(已渲染)
135
 export function getusername(params) {
151
 export function getusername(params) {
136
   return request({
152
   return request({

+ 5 - 2
src/lang/zh.js 查看文件

174
     selfPreparedMedicineQuery: '自备药查询',
174
     selfPreparedMedicineQuery: '自备药查询',
175
     selfPreparedMedicineIndex: '自备药管理',
175
     selfPreparedMedicineIndex: '自备药管理',
176
     selfPreparedMedicine: '自备药管理',
176
     selfPreparedMedicine: '自备药管理',
177
+    wareHouseManage: '仓库管理',
178
+    inventoryTransfer: '库存调拨',
177
     wareHouseManage:'仓库管理',
179
     wareHouseManage:'仓库管理',
178
-    
180
+
179
     inventoryTransfer:'库存调拨',
181
     inventoryTransfer:'库存调拨',
180
 
182
 
181
     consumablesManagement: '耗材管理',
183
     consumablesManagement: '耗材管理',
278
     labelPrint: '标签打印',
280
     labelPrint: '标签打印',
279
     faPiao: '发票设置',
281
     faPiao: '发票设置',
280
     chargeDetailManagement: '收费明细',
282
     chargeDetailManagement: '收费明细',
281
-    yidiClear: '异地清分'
283
+    yidiClear: '异地清分',
284
+    zeroSummary: '零用明细汇总'
282
   },
285
   },
283
   navbar: {
286
   navbar: {
284
     logOut: '退出登录',
287
     logOut: '退出登录',

+ 7 - 2
src/router/modules/hisTool.js 查看文件

34
       component: () => import('@/xt_pages/outpatientRecord/outpatientRecord'),
34
       component: () => import('@/xt_pages/outpatientRecord/outpatientRecord'),
35
       name: 'outpatientSickRecord',
35
       name: 'outpatientSickRecord',
36
       meta: { title: 'outpatientSickRecord', noCache: true }
36
       meta: { title: 'outpatientSickRecord', noCache: true }
37
-    },{
37
+    }, {
38
       path: '/hisTool/summary',
38
       path: '/hisTool/summary',
39
       component: () => import('@/xt_pages/outpatientTool/summary'),
39
       component: () => import('@/xt_pages/outpatientTool/summary'),
40
       name: 'outpatientSickRecord',
40
       name: 'outpatientSickRecord',
63
       name: 'statistics',
63
       name: 'statistics',
64
       meta: { title: 'statistics', noCache: true }
64
       meta: { title: 'statistics', noCache: true }
65
     },
65
     },
66
-
66
+    {
67
+      path: '/hisTool/zeroSummary',
68
+      component: () => import('@/xt_pages/outpatientTool/zeroSummary'),
69
+      name: 'zeroSummary',
70
+      meta: { title: 'zeroSummary', noCache: true }
71
+    }
67
   ]
72
   ]
68
 }
73
 }

+ 12 - 0
src/router/modules/stock.js 查看文件

372
         title: '调拨详情',
372
         title: '调拨详情',
373
         noCache: true
373
         noCache: true
374
       }
374
       }
375
+    },
376
+
377
+    {
378
+      path: '/stock/inventoryTransfer/transedit',
379
+      component: () => import('@/xt_pages/stock/inventoryTransfer/transEdit'),
380
+      hidden: true,
381
+      is_menu: false,
382
+      name: 'transEdit',
383
+      meta: {
384
+        title: '编辑调拨',
385
+        noCache: true
386
+      }
375
     }
387
     }
376
   ]
388
   ]
377
 }
389
 }

+ 55 - 16
src/xt_pages/stock/cancelStockOrder.vue 查看文件

15
 
15
 
16
     <div class="app-container">
16
     <div class="app-container">
17
       <div class="cell clearfix">
17
       <div class="cell clearfix">
18
+        <label class="title"><span class="name">仓库</span> :</label>
19
+        <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeStoreHouse">
20
+            <el-option
21
+              v-for="(option, index) in houseList"
22
+              :key="index"
23
+              :label="option.storehouse_name"
24
+              :value="option.id">
25
+            </el-option>
26
+        </el-select> 
18
         <el-input
27
         <el-input
19
           size="small"
28
           size="small"
20
-          style="width: 400px;"
29
+          style="width: 200px;"
21
           class="filter-item"
30
           class="filter-item"
22
           v-model.trim="searchKey"
31
           v-model.trim="searchKey"
23
-          placeholder="单据编码/制单人/厂商"
32
+          placeholder="单据编码/制单人"
24
         />
33
         />
25
         <el-button
34
         <el-button
26
           size="small"
35
           size="small"
105
             </template>
114
             </template>
106
           </el-table-column>
115
           </el-table-column>
107
 
116
 
117
+          <el-table-column label="仓库名称" align="center">
118
+            <template slot-scope="scope">
119
+              {{getHouseName(scope.row.storehouse_id) }}
120
+            </template>
121
+          </el-table-column>
122
+
108
           <el-table-column label="制单人" align="center">
123
           <el-table-column label="制单人" align="center">
109
             <template slot-scope="scope">
124
             <template slot-scope="scope">
110
               {{ getXuserName(scope.row.creater) }}
125
               {{ getXuserName(scope.row.creater) }}
192
             </template>
207
             </template>
193
           </el-table-column>
208
           </el-table-column>
194
 
209
 
210
+         <el-table-column label="仓库名称" align="center">
211
+            <template slot-scope="scope">
212
+              {{getHouseName(scope.row.storehouse_id)}}
213
+            </template>
214
+          </el-table-column>
215
+
195
           <el-table-column label="退库数量" align="center">
216
           <el-table-column label="退库数量" align="center">
196
             <template slot-scope="scope">
217
             <template slot-scope="scope">
197
               {{ scope.row.count}}{{scope.row.GoodInfo.packing_unit}}
218
               {{ scope.row.count}}{{scope.row.GoodInfo.packing_unit}}
321
       tableList:[],
342
       tableList:[],
322
       showTable:false,
343
       showTable:false,
323
       order_id:"",
344
       order_id:"",
324
-      exportList:[]
345
+      exportList:[],
346
+      houseList:[],
347
+      storehouse_id:0,
325
     };
348
     };
326
   },
349
   },
327
   methods: {
350
   methods: {
332
         start_time: this.start_time,
355
         start_time: this.start_time,
333
         end_time: this.end_time,
356
         end_time: this.end_time,
334
         type: this.type,
357
         type: this.type,
335
-        keywords: this.searchKey
358
+        keywords: this.searchKey,
359
+        storehouse_id:this.storehouse_id,
336
       };
360
       };
337
       this.cancelStockDate = [];
361
       this.cancelStockDate = [];
338
       getCancelStockList(Params).then(response => {
362
       getCancelStockList(Params).then(response => {
344
           for (let i = 0; i < response.data.data.list.length; i++) {
368
           for (let i = 0; i < response.data.data.list.length; i++) {
345
             this.cancelStockDate.push(response.data.data.list[i]);
369
             this.cancelStockDate.push(response.data.data.list[i]);
346
           }
370
           }
371
+          this.houseList = response.data.data.houseList
347
         }
372
         }
348
       });
373
       });
349
     },
374
     },
359
         limit: this.limit,
384
         limit: this.limit,
360
         start_time: this.start_time,
385
         start_time: this.start_time,
361
         end_time: this.end_time,
386
         end_time: this.end_time,
362
-        type: this.type
387
+        type: this.type,
388
+        storehouse_id:this.storehouse_id,
363
       };
389
       };
364
       this.cancelStockDate = [];
390
       this.cancelStockDate = [];
365
       getCancelStockList(Params).then(response => {
391
       getCancelStockList(Params).then(response => {
371
           for (let i = 0; i < response.data.data.list.length; i++) {
397
           for (let i = 0; i < response.data.data.list.length; i++) {
372
             this.cancelStockDate.push(response.data.data.list[i]);
398
             this.cancelStockDate.push(response.data.data.list[i]);
373
           }
399
           }
400
+          var obj = {id:0,storehouse_name:"全部"}
401
+          this.houseList = []
402
+          this.houseList.push(obj)
403
+          for(let i=0;i<response.data.data.houseList.length;i++){
404
+            this.houseList.push(response.data.data.houseList[i])
405
+          }
406
+        
374
         }
407
         }
375
       });
408
       });
376
     },
409
     },
399
     },
432
     },
400
     fetchAllAdminUsers() {
433
     fetchAllAdminUsers() {
401
       fetchAllAdminUsers().then(response => {
434
       fetchAllAdminUsers().then(response => {
402
-        console.log(response);
435
+     
403
         if (response.data.state == 1) {
436
         if (response.data.state == 1) {
404
           this.adminUserOptions = response.data.data.users;
437
           this.adminUserOptions = response.data.data.users;
405
           var alen = this.adminUserOptions.length;
438
           var alen = this.adminUserOptions.length;
474
       }
507
       }
475
     },
508
     },
476
     handleEdit: function(index, row) {
509
     handleEdit: function(index, row) {
477
-      console.log("row22222",row.id)
510
+    
478
       this.$router.push({"path":"/stock/cancel/cancelstockorderedit?id="+row.id})
511
       this.$router.push({"path":"/stock/cancel/cancelstockorderedit?id="+row.id})
479
     },
512
     },
480
     handleDelete: function(index, row) {
513
     handleDelete: function(index, row) {
485
       const params = {
518
       const params = {
486
         ids: idStr
519
         ids: idStr
487
       };
520
       };
488
-      console.log("params233223232323232323",params)
489
-     
521
+
490
       this.$confirm("确认删除退库单记录?", "删除退库单记录", {
522
       this.$confirm("确认删除退库单记录?", "删除退库单记录", {
491
         confirmButtonText: "确定",
523
         confirmButtonText: "确定",
492
         cancelButtonText: "取消",
524
         cancelButtonText: "取消",
583
       getSingCancelOrder(params).then(response=>{
615
       getSingCancelOrder(params).then(response=>{
584
         if(response.data.state == 1){
616
         if(response.data.state == 1){
585
           var list = response.data.data.list
617
           var list = response.data.data.list
586
-          console.log("list0000000000",list)
587
           this.tableList = list
618
           this.tableList = list
588
           this.showTable = true
619
           this.showTable = true
589
         }
620
         }
590
       }) 
621
       }) 
591
     },
622
     },
592
     toPrint(){
623
     toPrint(){
593
-      console.log("22222",this.order_id)
594
       if(this.order_id == ""){
624
       if(this.order_id == ""){
595
         this.$message.error("请勾选退库单")
625
         this.$message.error("请勾选退库单")
596
       }else{
626
       }else{
597
-        console.log("232332332")
598
         this.$router.push({path:'/stock/drugs/cancelstockorderprint?order_id='+this.order_id+"&start_time="+this.start_time+"&end_time="+this.end_time})
627
         this.$router.push({path:'/stock/drugs/cancelstockorderprint?order_id='+this.order_id+"&start_time="+this.start_time+"&end_time="+this.end_time})
599
       }
628
       }
600
     },
629
     },
614
         end_time: this.end_time,
643
         end_time: this.end_time,
615
         order_id:this.order_id,
644
         order_id:this.order_id,
616
       };
645
       };
617
-      console.log("params2323232",Params)
646
+
618
      getCancelExportList(Params).then(response=>{
647
      getCancelExportList(Params).then(response=>{
619
         if(response.data.state == 1){
648
         if(response.data.state == 1){
620
           var list =  response.data.data.list
649
           var list =  response.data.data.list
621
-          console.log("list2323232",list)
622
           this.exportList = list
650
           this.exportList = list
623
         }
651
         }
624
      })
652
      })
630
         return
658
         return
631
       }
659
       }
632
      import('@/vendor/Export2Excel').then(excel => {
660
      import('@/vendor/Export2Excel').then(excel => {
633
-      console.log("23232323",this.exportList)
634
       for(let i=0;i<this.exportList.length;i++){
661
       for(let i=0;i<this.exportList.length;i++){
635
         this.exportList[i].total_price = this.exportList[i].count * this.exportList[i].price
662
         this.exportList[i].total_price = this.exportList[i].count * this.exportList[i].price
636
         this.exportList[i].good_name = this.exportList[i].GoodInfo.good_name
663
         this.exportList[i].good_name = this.exportList[i].GoodInfo.good_name
647
       }
674
       }
648
       const tHeader = ['耗材名称',  '规格&单位','退库数量','退库单价','批次','品名/注册证号(备案凭证号)','生产厂家','生产日期','有效期','退库原因']
675
       const tHeader = ['耗材名称',  '规格&单位','退库数量','退库单价','批次','品名/注册证号(备案凭证号)','生产厂家','生产日期','有效期','退库原因']
649
       const filterVal = ['good_name', 'unit','count','price','number','register_account','manufacturer','product_date','expiry_date','remark']
676
       const filterVal = ['good_name', 'unit','count','price','number','register_account','manufacturer','product_date','expiry_date','remark']
650
-      console.log("table",this.exportList)
677
+
651
      
678
      
652
       const data = this.formatJson(filterVal, this.exportList)
679
       const data = this.formatJson(filterVal, this.exportList)
653
       excel.export_json_to_excel({
680
       excel.export_json_to_excel({
661
     formatJson(filterVal, jsonData) {
688
     formatJson(filterVal, jsonData) {
662
     return jsonData.map(v => filterVal.map(j => v[j]));
689
     return jsonData.map(v => filterVal.map(j => v[j]));
663
    },
690
    },
691
+    getHouseName(id){
692
+      var storehouse_name = ""
693
+      for(let i=0;i<this.houseList.length;i++){
694
+        if(id == this.houseList[i].id){
695
+          storehouse_name = this.houseList[i].storehouse_name
696
+        }
697
+      }
698
+      return storehouse_name
699
+    },
700
+    changeStoreHouse(){
701
+      this.GetCancelStock()
702
+    }
664
   }
703
   }
665
 };
704
 };
666
 </script>
705
 </script>

+ 26 - 12
src/xt_pages/stock/cancelStockOrderAdd.vue 查看文件

35
       ></stock-in-dialog>
35
       ></stock-in-dialog>
36
       <div class="filter-container">
36
       <div class="filter-container">
37
         <div class="cell clearfix">
37
         <div class="cell clearfix">
38
+         <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
39
+         <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px">
40
+              <el-option
41
+                v-for="(option, index) in list"
42
+                :key="index"
43
+                :label="option.storehouse_name"
44
+                :value="option.id">
45
+              </el-option>
46
+         </el-select>
38
           <label class="title"><span class="name">退库时间</span> : </label>
47
           <label class="title"><span class="name">退库时间</span> : </label>
39
-
40
           <el-date-picker
48
           <el-date-picker
41
             size="small"
49
             size="small"
42
             v-model="return_time"
50
             v-model="return_time"
63
         >
71
         >
64
        
72
        
65
          <el-table-column align="center" width="320" fixed="left">
73
          <el-table-column align="center" width="320" fixed="left">
74
+       
66
              <template slot="header" slot-scope="scope">
75
              <template slot="header" slot-scope="scope">
67
               <span>耗材名称</span>
76
               <span>耗材名称</span>
68
             </template>
77
             </template>
346
       goodInfo:[],
355
       goodInfo:[],
347
       numberList:[],
356
       numberList:[],
348
       dealerList:[],
357
       dealerList:[],
349
-      manufacturerList:[]
358
+      manufacturerList:[],
359
+      list:[],
360
+      storehouse_id:"",
350
     };
361
     };
351
   },
362
   },
352
   methods: {
363
   methods: {
402
           this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
413
           this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
403
           this.form.manufacturer = 0
414
           this.form.manufacturer = 0
404
           this.form.dealer = 0
415
           this.form.dealer = 0
416
+          this.list = response.data.data.list
417
+          this.storehouse_id = response.data.data.configlist.storehouse_out_info
405
         }
418
         }
406
         loading.close()
419
         loading.close()
407
       })
420
       })
569
           const params = {
582
           const params = {
570
             cancelStock: this.recordInfo.recordData
583
             cancelStock: this.recordInfo.recordData
571
           };
584
           };
572
-        
573
-          console.log("parasm23233222332323",params)
574
-          
585
+         
575
           postCancelStock(
586
           postCancelStock(
576
             params,
587
             params,
577
             this.return_time,
588
             this.return_time,
578
             this.form.manufacturer,
589
             this.form.manufacturer,
579
             this.form.dealer,
590
             this.form.dealer,
580
-            this.type
591
+            this.type,
592
+            this.storehouse_id,
581
           ).then(response => {
593
           ).then(response => {
582
             if (response.data.state == 0) {
594
             if (response.data.state == 0) {
583
               this.$message.error(response.data.msg);
595
               this.$message.error(response.data.msg);
585
               return false;
597
               return false;
586
             } else {
598
             } else {
587
              var msg =  response.data.data.msg
599
              var msg =  response.data.data.msg
600
+             var good_name = response.data.data.good_name
601
+             var specification_name = response.data.data.specification_name
602
+             var storehose_name = response.data.data.storehouse_name
603
+            var str = storehose_name + " " + good_name +"*" + specification_name +"该批次退库数量大于出库数量"
588
              if (msg == 1){
604
              if (msg == 1){
589
                 this.$message.error("无出库记录")
605
                 this.$message.error("无出库记录")
590
                 return
606
                 return
591
              }
607
              }
592
              if(msg == 2){
608
              if(msg == 2){
593
-               this.$message.error("该批次退库数量大于出库数量")
609
+               this.$message.error(str)
594
              }
610
              }
595
               if(msg == 4){
611
               if(msg == 4){
596
-               this.$message.error("该批次退库数量大于入库数量")
612
+               this.$message.error(str)
597
              }
613
              }
598
              if(msg == 5){
614
              if(msg == 5){
599
-              this.$message.error("该批次退库数量大于入库数量")
615
+              this.$message.error(str)
600
              }
616
              }
601
              if(msg == 3){
617
              if(msg == 3){
602
                this.$notify({
618
                this.$notify({
662
       this.currentIndex = val
678
       this.currentIndex = val
663
     },
679
     },
664
     handleSelect(val){
680
     handleSelect(val){
665
-      console.log("列表23323232332",this.recordInfo.recordData)
681
+     
666
       for(let i=0;i<this.recordInfo.recordData.length;i++){
682
       for(let i=0;i<this.recordInfo.recordData.length;i++){
667
         if(this.currentIndex == i){
683
         if(this.currentIndex == i){
668
           this.recordInfo.recordData[i].good_name = val.good_name
684
           this.recordInfo.recordData[i].good_name = val.good_name
697
       getStockBatchNumber(params).then(response=>{
713
       getStockBatchNumber(params).then(response=>{
698
         if(response.data.state == 1){
714
         if(response.data.state == 1){
699
           var list = response.data.data.list
715
           var list = response.data.data.list
700
-          console.log("list2243444",list)
701
-
702
           this.numberList = []
716
           this.numberList = []
703
           this.numberList = list
717
           this.numberList = list
704
         }
718
         }

+ 16 - 2
src/xt_pages/stock/cancelStockOrderEdit.vue 查看文件

16
         v-on:dialog-cancle="cancle"
16
         v-on:dialog-cancle="cancle"
17
       ></stock-in-dialog>
17
       ></stock-in-dialog>
18
       <div class="cell clearfix">
18
       <div class="cell clearfix">
19
-
19
+      
20
+         <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
21
+         <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" :disabled="true">
22
+              <el-option
23
+                v-for="(option, index) in list"
24
+                :key="index"
25
+                :label="option.storehouse_name"
26
+                :value="option.id">
27
+              </el-option>
28
+         </el-select>
20
         <label class="title"><span class="name">退库时间</span> : </label>
29
         <label class="title"><span class="name">退库时间</span> : </label>
21
         <el-date-picker size="small" v-model="return_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
30
         <el-date-picker size="small" v-model="return_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
22
                         type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
31
                         type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
315
         manufacturerList:[],
324
         manufacturerList:[],
316
         dealerList:[],
325
         dealerList:[],
317
         numberList:[],
326
         numberList:[],
318
-        numberShow:true
327
+        numberShow:true,
328
+        storehouse_id:"",
329
+        list:[],
319
       }
330
       }
320
     },
331
     },
321
     methods: {
332
     methods: {
365
             this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
376
             this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
366
             this.form.manufacturer = 0
377
             this.form.manufacturer = 0
367
             this.form.dealer = 0
378
             this.form.dealer = 0
379
+            this.list = response.data.data.list
380
+          
368
           }
381
           }
369
           loading.close()
382
           loading.close()
370
         })
383
         })
598
               this.recordInfo.recordData.push(response.data.data.list[i])
611
               this.recordInfo.recordData.push(response.data.data.list[i])
599
             }
612
             }
600
             this.cancelStock = response.data.data.info
613
             this.cancelStock = response.data.data.info
614
+            this.storehouse_id = response.data.data.info.storehouse_id
601
             this.return_time = this.getTime(this.cancelStock.return_time, '{y}-{m}-{d}')
615
             this.return_time = this.getTime(this.cancelStock.return_time, '{y}-{m}-{d}')
602
             this.form.manufacturer = this.cancelStock.manufacturer
616
             this.form.manufacturer = this.cancelStock.manufacturer
603
             this.form.dealer = this.cancelStock.dealer
617
             this.form.dealer = this.cancelStock.dealer

+ 48 - 47
src/xt_pages/stock/detail/cancelStockDetail.vue 查看文件

23
       >汇总导出
23
       >汇总导出
24
     </el-button>
24
     </el-button>
25
     <div class="cell clearfix">
25
     <div class="cell clearfix">
26
+     <label class="title"><span class="name">仓库</span> :</label>
27
+      <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
28
+          <el-option
29
+            v-for="(option, index) in houseList"
30
+            :key="index"
31
+            :label="option.storehouse_name"
32
+            :value="option.id">
33
+          </el-option>
34
+      </el-select>  
26
       <el-input
35
       <el-input
27
         size="small"
36
         size="small"
28
-        style="width: 400px;"
37
+        style="width:200px;"
29
         class="filter-item"
38
         class="filter-item"
30
         v-model.trim="searchKey"
39
         v-model.trim="searchKey"
31
         placeholder="单据编码/制单人/规格名称/耗材名称"
40
         placeholder="单据编码/制单人/规格名称/耗材名称"
38
         @click="search"
47
         @click="search"
39
         >搜索</el-button
48
         >搜索</el-button
40
       >
49
       >
41
-      <div style="margin-left:10px;">
50
+     
42
         <label class="title"><span class="name">日期查询</span> : </label>
51
         <label class="title"><span class="name">日期查询</span> : </label>
43
         <el-date-picker
52
         <el-date-picker
44
           size="small"
53
           size="small"
67
           value-format="yyyy-MM-dd"
76
           value-format="yyyy-MM-dd"
68
           @change="endTimeChange"
77
           @change="endTimeChange"
69
         ></el-date-picker>
78
         ></el-date-picker>
70
-      </div>
71
-    </div>
72
-
73
     
79
     
80
+    </div>
74
 
81
 
75
-    <!-- <div class="cell clearfix">
76
-      <label class="title"><span class="name">单据类型</span> : </label>
77
-      <el-select
78
-        size="small"
79
-        v-model="order_type"
80
-        clearable
81
-        placeholder="单据类型"
82
-        @change="changeType"
83
-      >
84
-        <el-option
85
-          v-for="item in orderTypeArr"
86
-          :key="item.value"
87
-          :label="item.label"
88
-          :value="item.value"
89
-        >
90
-        </el-option>
91
-      </el-select>
92
-    </div> -->
93
-
94
-    <!-- <div class="cell clearfix">
95
-      <label class="title"><span class="name">其它</span> : </label>
96
-      <el-select
97
-        size="small"
98
-        v-model="manufacturer_id"
99
-        clearable
100
-        placeholder="厂商"
101
-        @change="changeManufacturer"
102
-      >
103
-        <el-option
104
-          v-for="item in manufacturer"
105
-          :key="item.id"
106
-          :label="item.manufacturer_name"
107
-          :value="item.id"
108
-        >
109
-        </el-option>
110
-      </el-select>
111
-    </div> -->
112
-
82
+  
113
     <el-row :gutter="12" style="margin-top: 10px">
83
     <el-row :gutter="12" style="margin-top: 10px">
114
       <el-table
84
       <el-table
115
         :data="cancelStockDate"
85
         :data="cancelStockDate"
166
           </template>
136
           </template>
167
         </el-table-column>
137
         </el-table-column>
168
 
138
 
139
+        <el-table-column label="仓库名称" align="center">
140
+          <template slot-scope="scope">
141
+            {{ getStorehouseName(scope.row.storehouse_id) }}
142
+          </template>
143
+        </el-table-column>
144
+
169
         <el-table-column label="数量" align="center">
145
         <el-table-column label="数量" align="center">
170
           <template slot-scope="scope">
146
           <template slot-scope="scope">
171
             {{ scope.row.count }}
147
             {{ scope.row.count }}
280
       goodUnit:[],
256
       goodUnit:[],
281
       tableDataList:[],
257
       tableDataList:[],
282
       table:[],
258
       table:[],
259
+      houseList:[],
260
+      storehouse_id:0
283
     };
261
     };
284
   },
262
   },
285
   methods: {
263
   methods: {
390
         manufacturer: this.manufacturer_id,
368
         manufacturer: this.manufacturer_id,
391
         order_type: this.order_type,
369
         order_type: this.order_type,
392
         dealer: this.dealer_id,
370
         dealer: this.dealer_id,
393
-        keywords: this.searchKey
371
+        keywords: this.searchKey,
372
+        storehouse_id:this.storehouse_id,
394
       };
373
       };
395
-      // console.log("Params23232233223232332",Params)
374
+    
396
       this.cancelStockDate = [];
375
       this.cancelStockDate = [];
397
       getStockDetail(Params).then(response => {
376
       getStockDetail(Params).then(response => {
398
         if (response.data.state == 0) {
377
         if (response.data.state == 0) {
400
           return false;
379
           return false;
401
         } else {
380
         } else {
402
           this.total = response.data.data.total;
381
           this.total = response.data.data.total;
403
-          // console.log("数据源头",response.data.data.list)
382
+          var obj = {id:0,storehouse_name:"全部"}
383
+          this.houseList = []
384
+          this.houseList.push(obj)
385
+          for(let i=0;i<response.data.data.houseList.length;i++){
386
+           this.houseList.push(response.data.data.houseList[i])
387
+          }
404
           var total = 0
388
           var total = 0
405
           for (let i = 0; i < response.data.data.list.length; i++) {
389
           for (let i = 0; i < response.data.data.list.length; i++) {
406
             
390
             
728
         }
712
         }
729
       }
713
       }
730
       return total
714
       return total
731
-    }
715
+    },
716
+   getStorehouseName(id){
717
+       var storehouse_name = ""
718
+       for(let i=0;i<this.houseList.length;i++){
719
+         if(id == this.houseList[i].id){
720
+           storehouse_name = this.houseList[i].storehouse_name
721
+         }
722
+       }
723
+       if(storehouse_name == "全部"){
724
+          return ""
725
+       }else{
726
+         return storehouse_name
727
+       }
728
+     },
729
+     changeHouseList(){
730
+       this.houseList = []
731
+       this.GetCancelStock()
732
+     }
732
   }
733
   }
733
 };
734
 };
734
 </script>
735
 </script>

+ 50 - 8
src/xt_pages/stock/detail/stockInDetail.vue 查看文件

26
     </el-button>
26
     </el-button>
27
 
27
 
28
     <div class="cell clearfix">
28
     <div class="cell clearfix">
29
+      <label class="title"><span class="name">仓库</span> :</label>
30
+      <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
31
+          <el-option
32
+            v-for="(option, index) in houseList"
33
+            :key="index"
34
+            :label="option.storehouse_name"
35
+            :value="option.id">
36
+          </el-option>
37
+      </el-select>  
29
       <el-input
38
       <el-input
30
         size="small"
39
         size="small"
31
-        style="width: 400px;"
40
+        style="width: 180px;"
32
         class="filter-item"
41
         class="filter-item"
33
         v-model.trim="searchKey"
42
         v-model.trim="searchKey"
34
         placeholder="单据编码/制单人/规格名称/耗材名称"
43
         placeholder="单据编码/制单人/规格名称/耗材名称"
41
         @click="search"
50
         @click="search"
42
         >搜索</el-button
51
         >搜索</el-button
43
       >
52
       >
44
-      <div style="margin-left:10px;">
53
+    
45
         <label class="title"><span class="name">日期查询</span> : </label>
54
         <label class="title"><span class="name">日期查询</span> : </label>
46
         <el-date-picker
55
         <el-date-picker
47
           size="small"
56
           size="small"
70
           value-format="yyyy-MM-dd"
79
           value-format="yyyy-MM-dd"
71
           @change="endTimeChange"
80
           @change="endTimeChange"
72
         ></el-date-picker>
81
         ></el-date-picker>
73
-      </div>
82
+      
74
     </div>
83
     </div>
75
 
84
 
76
     <el-row :gutter="12" style="margin-top: 10px">
85
     <el-row :gutter="12" style="margin-top: 10px">
102
         <el-table-column label="耗材名称" align="center">
111
         <el-table-column label="耗材名称" align="center">
103
           <template slot-scope="scope">
112
           <template slot-scope="scope">
104
             {{ typeNameOne(scope.row.good_id) }}
113
             {{ typeNameOne(scope.row.good_id) }}
114
+          
105
           </template>
115
           </template>
106
         </el-table-column>
116
         </el-table-column>
107
 
117
 
108
         <el-table-column label="规格型号" align="center">
118
         <el-table-column label="规格型号" align="center">
109
           <template slot-scope="scope">
119
           <template slot-scope="scope">
110
             {{ specificationName(scope.row.good_id) }}
120
             {{ specificationName(scope.row.good_id) }}
121
+           
111
           </template>
122
           </template>
112
         </el-table-column>
123
         </el-table-column>
113
 
124
 
122
             {{ getXuserName(scope.row.Warehousing.creater) }}
133
             {{ getXuserName(scope.row.Warehousing.creater) }}
123
           </template>
134
           </template>
124
         </el-table-column>
135
         </el-table-column>
136
+        <el-table-column label="仓库名称" align="center">
137
+          <template slot-scope="scope">
138
+            {{getStorehouseName(scope.row.storehouse_id) }}
139
+          </template>
140
+        </el-table-column>
125
         <el-table-column label="进货价" align="center">
141
         <el-table-column label="进货价" align="center">
126
           <template slot-scope="scope">
142
           <template slot-scope="scope">
127
             {{ scope.row.price }}
143
             {{ scope.row.price }}
247
       org_id:0,
263
       org_id:0,
248
       tableInfo:[],
264
       tableInfo:[],
249
       tableDataList:[],
265
       tableDataList:[],
266
+      houseList:[],
267
+      storehouse_id:0,
250
     };
268
     };
251
   },
269
   },
252
   methods: {
270
   methods: {
308
         start_time: this.start_time,
326
         start_time: this.start_time,
309
         end_time: this.end_time,
327
         end_time: this.end_time,
310
         type: this.type,
328
         type: this.type,
311
-        keywords: this.searchKey
329
+        keywords: this.searchKey,
330
+        storehouse_id:this.storehouse_id,
312
       };
331
       };
313
       this.cancelStockDate = [];
332
       this.cancelStockDate = [];
314
       this.tableList = []
333
       this.tableList = []
361
         manufacturer: this.manufacturer_id,
380
         manufacturer: this.manufacturer_id,
362
         order_type: this.order_type,
381
         order_type: this.order_type,
363
         dealer: this.dealer_id,
382
         dealer: this.dealer_id,
364
-        keywords: this.searchKey
383
+        keywords: this.searchKey,
384
+        storehouse_id:this.storehouse_id,
365
       };
385
       };
366
       this.cancelStockDate = [];
386
       this.cancelStockDate = [];
367
       getStockDetail(Params).then(response => {
387
       getStockDetail(Params).then(response => {
370
           return false;
390
           return false;
371
         } else {
391
         } else {
372
           this.total = response.data.data.total;
392
           this.total = response.data.data.total;
393
+          var obj = {id:0,storehouse_name:"全部"}
394
+          this.houseList = []
395
+          this.houseList.push(obj)
396
+          for(let i=0;i<response.data.data.houseList.length;i++){
397
+           this.houseList.push(response.data.data.houseList[i])
398
+          }
373
           var total_price = 0
399
           var total_price = 0
374
           for (let i = 0; i < response.data.data.list.length; i++) {
400
           for (let i = 0; i < response.data.data.list.length; i++) {
375
             total_price += parseInt(response.data.data.list[i].warehousing_count) * response.data.data.list[i].price
401
             total_price += parseInt(response.data.data.list[i].warehousing_count) * response.data.data.list[i].price
379
             this.cancelStockDate.push(obj);
405
             this.cancelStockDate.push(obj);
380
           }
406
           }
381
           this.tableDataList = response.data.data.list
407
           this.tableDataList = response.data.data.list
408
+          console.log("表格发3223332322332332323232332233",this.cancelStockDate)
409
+         
382
           this.cancelStockDate.push({
410
           this.cancelStockDate.push({
383
             warehousing_order: "合计",
411
             warehousing_order: "合计",
384
             is_total: 1,
412
             is_total: 1,
430
       this.multipleSelection = val;
458
       this.multipleSelection = val;
431
     },
459
     },
432
     handleSizeChange(val) {
460
     handleSizeChange(val) {
433
-      console.log("val2332323223",val)
434
       this.limit = val;
461
       this.limit = val;
435
       this.GetCancelStock();
462
       this.GetCancelStock();
436
     },
463
     },
437
     handleCurrentChange(val) {
464
     handleCurrentChange(val) {
438
-      console.log("888888",val)
439
       this.page = val;
465
       this.page = val;
440
       this.GetCancelStock();
466
       this.GetCancelStock();
441
     },
467
     },
795
       getGoodDetailPrintList(params).then(response=>{
821
       getGoodDetailPrintList(params).then(response=>{
796
         if(response.data.state == 1){
822
         if(response.data.state == 1){
797
           var list = response.data.data.list
823
           var list = response.data.data.list
798
-          // console.log("入库详情单",list)
799
           this.tableInfo = list
824
           this.tableInfo = list
800
         }
825
         }
801
       })
826
       })
827
+     },
828
+     getStorehouseName(id){
829
+       var storehouse_name = ""
830
+       for(let i=0;i<this.houseList.length;i++){
831
+         if(id == this.houseList[i].id){
832
+           storehouse_name = this.houseList[i].storehouse_name
833
+         }
834
+       }
835
+       if(storehouse_name == "全部"){
836
+          return ""
837
+       }else{
838
+         return storehouse_name
839
+       }
840
+     },
841
+     changeHouseList(){
842
+       this.houseList = []
843
+       this.GetCancelStock()
802
      }
844
      }
803
   }
845
   }
804
 };
846
 };

+ 77 - 37
src/xt_pages/stock/detail/stockOutDetail.vue 查看文件

23
       >汇总导出
23
       >汇总导出
24
     </el-button>
24
     </el-button>
25
     <div class="cell clearfix">
25
     <div class="cell clearfix">
26
+      <label class="title"><span class="name">仓库</span> :</label>
27
+      <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
28
+          <el-option
29
+            v-for="(option, index) in houseList"
30
+            :key="index"
31
+            :label="option.storehouse_name"
32
+            :value="option.id">
33
+          </el-option>
34
+      </el-select>
26
       <el-input
35
       <el-input
27
         size="small"
36
         size="small"
28
-        style="width: 400px;"
37
+        style="width:180px;"
29
         class="filter-item"
38
         class="filter-item"
30
         v-model.trim="searchKey"
39
         v-model.trim="searchKey"
31
         placeholder="单据编码/制单人/规格名称/耗材名称"
40
         placeholder="单据编码/制单人/规格名称/耗材名称"
38
         @click="search"
47
         @click="search"
39
         >搜索</el-button
48
         >搜索</el-button
40
       >
49
       >
41
-      <div style="margin-left:10px;">
50
+
42
         <label class="title"><span class="name">日期查询</span> : </label>
51
         <label class="title"><span class="name">日期查询</span> : </label>
43
         <el-date-picker
52
         <el-date-picker
44
           size="small"
53
           size="small"
67
           value-format="yyyy-MM-dd"
76
           value-format="yyyy-MM-dd"
68
           @change="endTimeChange"
77
           @change="endTimeChange"
69
         ></el-date-picker>
78
         ></el-date-picker>
70
-      </div>
79
+
71
     </div>
80
     </div>
72
 
81
 
73
     <el-row :gutter="12" style="margin-top: 10px">
82
     <el-row :gutter="12" style="margin-top: 10px">
123
           <template slot-scope="scope">
132
           <template slot-scope="scope">
124
             {{ getXuserName(scope.row.WarehouseOut.creater) }}
133
             {{ getXuserName(scope.row.WarehouseOut.creater) }}
125
           </template>
134
           </template>
135
+        </el-table-column>
136
+         <el-table-column label="仓库名称" align="center">
137
+          <template slot-scope="scope">
138
+            {{ getStorehouseName(scope.row.storehouse_id) }}
139
+          </template>
126
         </el-table-column>
140
         </el-table-column>
127
         <el-table-column label="出货价" align="center">
141
         <el-table-column label="出货价" align="center">
128
           <template slot-scope="scope">
142
           <template slot-scope="scope">
129
             <span v-if="scope.row.is_total == 0 && (orgId == 9919)">{{scope.row.GoodInfo.buy_price}}</span>
143
             <span v-if="scope.row.is_total == 0 && (orgId == 9919)">{{scope.row.GoodInfo.buy_price}}</span>
130
-            <span v-else> 
131
-              <span v-if="scope.row.price > 0"> {{ scope.row.price }} </span> 
132
-               <span v-if="scope.row.price == 0"> {{ scope.row.GoodInfo.packing_price }} </span> 
144
+            <span v-else>
145
+              <span v-if="scope.row.price > 0"> {{ scope.row.price }} </span>
146
+               <span v-if="scope.row.price == 0"> {{ scope.row.GoodInfo.packing_price }} </span>
133
             </span>
147
             </span>
134
           </template>
148
           </template>
135
         </el-table-column>
149
         </el-table-column>
170
 
184
 
171
 export default {
185
 export default {
172
   name: "stockOutDetail",
186
   name: "stockOutDetail",
173
-  
187
+
174
   created() {
188
   created() {
175
     var nowDate = new Date();
189
     var nowDate = new Date();
176
     var nowYear = nowDate.getFullYear();
190
     var nowYear = nowDate.getFullYear();
201
       this.end_time = end_time
215
       this.end_time = end_time
202
     }
216
     }
203
     window.sessionStorage.removeItem('start')
217
     window.sessionStorage.removeItem('start')
204
-    window.sessionStorage.removeItem('end')  
218
+    window.sessionStorage.removeItem('end')
205
     this.getGoodDetailPrintList()
219
     this.getGoodDetailPrintList()
206
     this.GetCancelStock();
220
     this.GetCancelStock();
207
     this.GetConfigInfo();
221
     this.GetConfigInfo();
209
     this.goodUnit = this.$store.getters.good_unit
223
     this.goodUnit = this.$store.getters.good_unit
210
     var org_id = this.$store.getters.xt_user.org.id
224
     var org_id = this.$store.getters.xt_user.org.id
211
     this.orgId = org_id
225
     this.orgId = org_id
212
-    
213
-    
226
+
227
+
214
   },
228
   },
215
   data() {
229
   data() {
216
     return {
230
     return {
249
       tableData:[],
263
       tableData:[],
250
       tableOut:[],
264
       tableOut:[],
251
       tableDataList:[],
265
       tableDataList:[],
266
+      storehouse_id:0,
267
+      houseList:[],
252
     };
268
     };
253
   },
269
   },
254
   methods: {
270
   methods: {
256
       this.order_type = val;
272
       this.order_type = val;
257
       this.GetCancelStock();
273
       this.GetCancelStock();
258
       this.getGoodDetailPrintList()
274
       this.getGoodDetailPrintList()
259
-      
275
+
260
     },
276
     },
261
     changeManufacturer: function(val) {
277
     changeManufacturer: function(val) {
262
       this.manufacturer_id = val;
278
       this.manufacturer_id = val;
323
           var total = 0
339
           var total = 0
324
           for (let i = 0; i < response.data.data.list.length; i++) {
340
           for (let i = 0; i < response.data.data.list.length; i++) {
325
             this.tableData.push(response.data.data.list[i])
341
             this.tableData.push(response.data.data.list[i])
326
-            
342
+
327
             var obj = response.data.data.list[i];
343
             var obj = response.data.data.list[i];
328
             total += response.data.data.list[i].price * response.data.data.list[i].count
344
             total += response.data.data.list[i].price * response.data.data.list[i].count
329
             obj["is_total"] = 0;
345
             obj["is_total"] = 0;
330
             this.cancelStockDate.push(obj);
346
             this.cancelStockDate.push(obj);
331
-       
347
+
332
           }
348
           }
333
           this.cancelStockDate.push({
349
           this.cancelStockDate.push({
334
             warehouse_out_order_number: "合计",
350
             warehouse_out_order_number: "合计",
338
               warehouse_out_time: 0
354
               warehouse_out_time: 0
339
             }
355
             }
340
           });
356
           });
357
+
341
         }
358
         }
342
       });
359
       });
343
     },
360
     },
357
         manufacturer: this.manufacturer_id,
374
         manufacturer: this.manufacturer_id,
358
         order_type: this.order_type,
375
         order_type: this.order_type,
359
         dealer: this.dealer_id,
376
         dealer: this.dealer_id,
360
-        keywords: this.searchKey
377
+        keywords: this.searchKey,
378
+        storehouse_id:this.storehouse_id,
361
       };
379
       };
362
       this.cancelStockDate = [];
380
       this.cancelStockDate = [];
363
       getStockDetail(Params).then(response => {
381
       getStockDetail(Params).then(response => {
367
         } else {
385
         } else {
368
 
386
 
369
           this.total = response.data.data.total;
387
           this.total = response.data.data.total;
370
-         
388
+          var obj = {id:0,storehouse_name:"全部"}
389
+          this.houseList = []
390
+          this.houseList.push(obj)
391
+          for(let i=0;i<response.data.data.houseList.length;i++){
392
+           this.houseList.push(response.data.data.houseList[i])
393
+          }
371
           var total = 0
394
           var total = 0
372
           for (let i = 0; i < response.data.data.list.length; i++) {
395
           for (let i = 0; i < response.data.data.list.length; i++) {
373
             this.tableData.push(response.data.data.list[i])
396
             this.tableData.push(response.data.data.list[i])
378
             if(response.data.data.list[i].price == 0){
401
             if(response.data.data.list[i].price == 0){
379
                total += response.data.data.list[i].GoodInfo.packing_price * response.data.data.list[i].count
402
                total += response.data.data.list[i].GoodInfo.packing_price * response.data.data.list[i].count
380
             }
403
             }
381
-           
404
+
382
             obj["is_total"] = 0;
405
             obj["is_total"] = 0;
383
             this.cancelStockDate.push(obj);
406
             this.cancelStockDate.push(obj);
384
           }
407
           }
385
-          
408
+
386
           this.tableDataList = response.data.data.list
409
           this.tableDataList = response.data.data.list
387
-          
410
+
388
           this.cancelStockDate.push({
411
           this.cancelStockDate.push({
389
             warehouse_out_order_number: "合计",
412
             warehouse_out_order_number: "合计",
390
             is_total: 1,
413
             is_total: 1,
393
               warehouse_out_time: 0
416
               warehouse_out_time: 0
394
             }
417
             }
395
           });
418
           });
396
-          
419
+
397
         }
420
         }
398
       });
421
       });
399
     },
422
     },
456
         this.cancelStockDate = []
479
         this.cancelStockDate = []
457
         this.GetCancelStock();
480
         this.GetCancelStock();
458
         this.getGoodDetailPrintList()
481
         this.getGoodDetailPrintList()
459
-       
482
+
460
       }
483
       }
461
     },
484
     },
462
     endTimeChange(val) {
485
     endTimeChange(val) {
649
     //   getPrintStockGood(params).then(response=>{
672
     //   getPrintStockGood(params).then(response=>{
650
     //       if(response.data.state == 1){
673
     //       if(response.data.state == 1){
651
     //         var stockTotal =  response.data.data.stockTotal
674
     //         var stockTotal =  response.data.data.stockTotal
652
-          
675
+
653
     //         this.stockTotal = stockTotal
676
     //         this.stockTotal = stockTotal
654
     //         var list =  response.data.data.list
677
     //         var list =  response.data.data.list
655
     //         this.tableList = []
678
     //         this.tableList = []
727
           is_mark:"",
750
           is_mark:"",
728
           manufacturer:"",
751
           manufacturer:"",
729
         }
752
         }
730
-       
753
+
731
         getGoodInfoList(params).then(response => {
754
         getGoodInfoList(params).then(response => {
732
           if (response.data.state == 0) {
755
           if (response.data.state == 0) {
733
             this.$message.error(response.data.msg)
756
             this.$message.error(response.data.msg)
737
             for (let i = 0; i < response.data.data.list.length; i++) {
760
             for (let i = 0; i < response.data.data.list.length; i++) {
738
               this.goodInfoData.push(response.data.data.list[i])
761
               this.goodInfoData.push(response.data.data.list[i])
739
             }
762
             }
740
-           
763
+
741
           }
764
           }
742
         })
765
         })
743
       },
766
       },
758
         }else{
781
         }else{
759
           this.tableOut[i].total_price = (this.getStockCount(this.tableOut[i].good_id) * this.tableOut[i].retail_price).toFixed(2)
782
           this.tableOut[i].total_price = (this.getStockCount(this.tableOut[i].good_id) * this.tableOut[i].retail_price).toFixed(2)
760
         }
783
         }
761
-       
784
+
762
         if(this.orgId  == 10265 || this.orgId ==10215 ){
785
         if(this.orgId  == 10265 || this.orgId ==10215 ){
763
-        
786
+
764
          this.tableOut[i].out_count = this.getMySelfCount(this.tableOut[i].good_id)
787
          this.tableOut[i].out_count = this.getMySelfCount(this.tableOut[i].good_id)
765
         }
788
         }
766
         if(this.orgId!=10265 && this.orgId !=10215){
789
         if(this.orgId!=10265 && this.orgId !=10215){
773
        const filterVal = ['index','good_name', 'specification_name', 'packing_unit','out_count','packing_price','total_price','remark']
796
        const filterVal = ['index','good_name', 'specification_name', 'packing_unit','out_count','packing_price','total_price','remark']
774
 
797
 
775
        const data = this.formatJson(filterVal, this.tableOut)
798
        const data = this.formatJson(filterVal, this.tableOut)
776
-       console.log("date2332323232",data)
777
-      
799
+
800
+
778
         excel.export_json_to_excel({
801
         excel.export_json_to_excel({
779
            header: tHeader,
802
            header: tHeader,
780
            data,
803
            data,
802
             this.tableDataList[i].total_price = (this.tableDataList[i].count * this.tableDataList[i].price).toFixed(2)
825
             this.tableDataList[i].total_price = (this.tableDataList[i].count * this.tableDataList[i].price).toFixed(2)
803
             total += this.tableDataList[i].count * this.tableDataList[i].price
826
             total += this.tableDataList[i].count * this.tableDataList[i].price
804
           }
827
           }
805
-         
806
-         
828
+
829
+
807
         }
830
         }
808
         obj.total_price = total.toFixed(2)
831
         obj.total_price = total.toFixed(2)
809
-      
832
+
810
         this.tableDataList.push(obj)
833
         this.tableDataList.push(obj)
811
        import('@/vendor/Export2Excel').then(excel => {
834
        import('@/vendor/Export2Excel').then(excel => {
812
        const tHeader = ['序号','单据编号', '耗材类型', '耗材名称','规格型号','操作时间','制单人','出货价','数量','总价']
835
        const tHeader = ['序号','单据编号', '耗材类型', '耗材名称','规格型号','操作时间','制单人','出货价','数量','总价']
813
        const filterVal = ['index','warehouse_out_order_number', 'good_type_name', 'good_name','specification_name','time','user_name','price','out_count','total_price']
836
        const filterVal = ['index','warehouse_out_order_number', 'good_type_name', 'good_name','specification_name','time','user_name','price','out_count','total_price']
814
 
837
 
815
        const data = this.formatJson(filterVal, this.tableDataList)
838
        const data = this.formatJson(filterVal, this.tableDataList)
816
- 
817
-      
839
+
840
+
818
         excel.export_json_to_excel({
841
         excel.export_json_to_excel({
819
            header: tHeader,
842
            header: tHeader,
820
            data,
843
            data,
842
        }
865
        }
843
        return total_price
866
        return total_price
844
      },
867
      },
845
-   
868
+
846
      getGoodDetailPrintList(){
869
      getGoodDetailPrintList(){
847
         const params = {
870
         const params = {
848
           start_time:this.start_time,
871
           start_time:this.start_time,
853
       getGoodDetailPrintList(params).then(response=>{
876
       getGoodDetailPrintList(params).then(response=>{
854
         if(response.data.state == 1){
877
         if(response.data.state == 1){
855
           var list = response.data.data.list
878
           var list = response.data.data.list
856
-          console.log("lisrt23323223233232232323232323",list)
879
+
857
           this.tableOut = list
880
           this.tableOut = list
858
           var stockTotal = response.data.data.stockTotal
881
           var stockTotal = response.data.data.stockTotal
859
-          console.log("list88888888888888888888",stockTotal)
882
+
860
           this.stockTotal = stockTotal
883
           this.stockTotal = stockTotal
861
         }
884
         }
862
       })
885
       })
863
      },
886
      },
864
      getStockCount(id){
887
      getStockCount(id){
865
-     
888
+
866
         var count = ""
889
         var count = ""
867
         for(let i=0;i<this.stockTotal.length;i++){
890
         for(let i=0;i<this.stockTotal.length;i++){
868
             if(id == this.stockTotal[i].good_id){
891
             if(id == this.stockTotal[i].good_id){
870
             }
893
             }
871
         }
894
         }
872
         return count
895
         return count
873
-    }, 
896
+    },
874
     getMySelfCount(good_id){
897
     getMySelfCount(good_id){
875
        var total = 0
898
        var total = 0
876
        for(let i=0;i<this.tableOut.length;i++){
899
        for(let i=0;i<this.tableOut.length;i++){
887
        }
910
        }
888
        return total
911
        return total
889
      },
912
      },
913
+    getStorehouseName(id){
914
+       var storehouse_name = ""
915
+       for(let i=0;i<this.houseList.length;i++){
916
+         if(id == this.houseList[i].id){
917
+           storehouse_name = this.houseList[i].storehouse_name
918
+         }
919
+       }
920
+       if(storehouse_name == "全部"){
921
+          return ""
922
+       }else{
923
+         return storehouse_name
924
+       }
925
+     },
926
+     changeHouseList(){
927
+       this.houseList = []
928
+       this.GetCancelStock()
929
+     }
890
   }
930
   }
891
 };
931
 };
892
 </script>
932
 </script>

+ 56 - 11
src/xt_pages/stock/drugs/cancelDrugStockOrder.vue 查看文件

14
     </div>
14
     </div>
15
 
15
 
16
     <div class="app-container">
16
     <div class="app-container">
17
+      
17
       <div class="cell clearfix">
18
       <div class="cell clearfix">
19
+        <label class="title"><span class="name">仓库</span> :</label>
20
+        <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeStoreHouse">
21
+            <el-option
22
+              v-for="(option, index) in houseList"
23
+              :key="index"
24
+              :label="option.storehouse_name"
25
+              :value="option.id">
26
+            </el-option>
27
+        </el-select> 
18
         <el-input
28
         <el-input
19
           size="small"
29
           size="small"
20
-          style="width: 400px;"
30
+          style="width: 200px;"
21
           class="filter-item"
31
           class="filter-item"
22
           v-model.trim="searchKey"
32
           v-model.trim="searchKey"
23
-          placeholder="单据编码/制单人/厂商"
33
+          placeholder="单据编码/制单人"
24
         />
34
         />
25
         <el-button
35
         <el-button
26
           size="small"
36
           size="small"
104
           </template>
114
           </template>
105
         </el-table-column>
115
         </el-table-column>
106
 
116
 
117
+        <el-table-column label="仓库名称" align="center">
118
+          <template slot-scope="scope">
119
+            {{getHouseName(scope.row.storehouse_id)}}
120
+          </template>
121
+        </el-table-column>
122
+
123
+
107
         <el-table-column label="制单人" align="center">
124
         <el-table-column label="制单人" align="center">
108
           <template slot-scope="scope">
125
           <template slot-scope="scope">
109
             {{ getXuserName(scope.row.creater) }}
126
             {{ getXuserName(scope.row.creater) }}
187
                 {{ scope.row.BaseDrugLib.medical_insurance_number}}
204
                 {{ scope.row.BaseDrugLib.medical_insurance_number}}
188
               </template>
205
               </template>
189
             </el-table-column>
206
             </el-table-column>
207
+
208
+
209
+            <el-table-column label="仓库名称" align="center">
210
+              <template slot-scope="scope">
211
+                {{getHouseName(scope.row.storehouse_id)}}
212
+              </template>
213
+            </el-table-column>
214
+
190
             <el-table-column label="退库数量" align="center">
215
             <el-table-column label="退库数量" align="center">
191
               <template slot-scope="scope">
216
               <template slot-scope="scope">
192
                 {{ scope.row.count}}
217
                 {{ scope.row.count}}
326
       tableList:[],
351
       tableList:[],
327
       showTable:false,
352
       showTable:false,
328
       order_id:"",
353
       order_id:"",
329
-      exportList:[]
354
+      exportList:[],
355
+      houseList:[],
356
+      storehouse_id:0,
330
     };
357
     };
331
   },
358
   },
332
   methods: {
359
   methods: {
337
         start_time: this.start_time,
364
         start_time: this.start_time,
338
         end_time: this.end_time,
365
         end_time: this.end_time,
339
         type: this.type,
366
         type: this.type,
340
-        keywords: this.searchKey
367
+        keywords: this.searchKey,
368
+        storehouse_id:this.storehouse_id,
341
       };
369
       };
342
       this.cancelStockDate = [];
370
       this.cancelStockDate = [];
343
       getDrugCancelStockList(Params).then(response => {
371
       getDrugCancelStockList(Params).then(response => {
364
         limit: this.limit,
392
         limit: this.limit,
365
         start_time: this.start_time,
393
         start_time: this.start_time,
366
         end_time: this.end_time,
394
         end_time: this.end_time,
367
-        type: this.type
395
+        type: this.type,
396
+        storehouse_id:this.storehouse_id,
368
       };
397
       };
369
       this.cancelStockDate = [];
398
       this.cancelStockDate = [];
370
       getDrugCancelStockList(Params).then(response => {
399
       getDrugCancelStockList(Params).then(response => {
372
           this.$message.error(response.data.msg);
401
           this.$message.error(response.data.msg);
373
           return false;
402
           return false;
374
         } else {
403
         } else {
375
-          console.log("列表23232323232323",response.data.data.list)
404
+         
376
           
405
           
377
           this.total = response.data.data.total;
406
           this.total = response.data.data.total;
378
           for (let i = 0; i < response.data.data.list.length; i++) {
407
           for (let i = 0; i < response.data.data.list.length; i++) {
379
             this.cancelStockDate.push(response.data.data.list[i]);
408
             this.cancelStockDate.push(response.data.data.list[i]);
380
           }
409
           }
410
+          var obj= {id:0,storehouse_name:"全部"}
411
+          this.houseList = []
412
+          this.houseList.push(obj)
413
+          for(let i=0;i<response.data.data.houseList.length;i++){
414
+            this.houseList.push(response.data.data.houseList[i])
415
+          }
381
         }
416
         }
382
       });
417
       });
383
     },
418
     },
555
         confirmButtonText: "确定",
590
         confirmButtonText: "确定",
556
         cancelButtonText: "取消",
591
         cancelButtonText: "取消",
557
         type: "warning"
592
         type: "warning"
558
-      })
559
-        .then(() => {
593
+      }).then(() => {
560
           deleteDrugCancelStock(params).then(response => {
594
           deleteDrugCancelStock(params).then(response => {
561
             if (response.data.state == 0) {
595
             if (response.data.state == 0) {
562
               this.$message.error(response.data.msg);
596
               this.$message.error(response.data.msg);
582
         .catch(() => {});
616
         .catch(() => {});
583
     },
617
     },
584
     handleCurrentChangeOne(val) {
618
     handleCurrentChangeOne(val) {
619
+     if(val!=null){
585
       this.getCancelStockDetail(val.id)
620
       this.getCancelStockDetail(val.id)
621
+     }
586
     },
622
     },
587
     getCancelStockDetail(id){
623
     getCancelStockDetail(id){
588
-      console.log("id232233223",id)
589
         var params = {
624
         var params = {
590
           id:id
625
           id:id
591
         }
626
         }
592
       getCancelStockDetail(params).then(response=>{
627
       getCancelStockDetail(params).then(response=>{
593
        if(response.data.state == 1){
628
        if(response.data.state == 1){
594
          var list =  response.data.data.list
629
          var list =  response.data.data.list
595
-         console.log("hhhh23233323223",list)
596
          for(let i=0;i<list.length;i++){
630
          for(let i=0;i<list.length;i++){
597
            list[i].product_date = this.getTime(list[i].product_date,"{y}-{h}-{d}")
631
            list[i].product_date = this.getTime(list[i].product_date,"{y}-{h}-{d}")
598
            list[i].expiry_date = this.getTime(list[i].expiry_date,"{y}-{h}-{d}")
632
            list[i].expiry_date = this.getTime(list[i].expiry_date,"{y}-{h}-{d}")
599
          }
633
          }
600
          this.tableList = list
634
          this.tableList = list
601
-        //  console.log("list23232",list)
602
          this.showTable = true
635
          this.showTable = true
603
        }
636
        }
604
       })
637
       })
669
     formatJson(filterVal, jsonData) {
702
     formatJson(filterVal, jsonData) {
670
     return jsonData.map(v => filterVal.map(j => v[j]));
703
     return jsonData.map(v => filterVal.map(j => v[j]));
671
    },
704
    },
705
+   getHouseName(id){
706
+    var storehouse_name = ""
707
+    for(let i=0;i<this.houseList.length;i++){
708
+        if(id == this.houseList[i].id){
709
+          storehouse_name = this.houseList[i].storehouse_name
710
+        }
711
+    }
712
+    return storehouse_name
713
+  },
714
+  changeStoreHouse(){
715
+    this.GetCancelStock()
716
+  }
672
   }
717
   }
673
 };
718
 };
674
 </script>
719
 </script>

+ 20 - 3
src/xt_pages/stock/drugs/cancelDrugStockOrderAdd.vue 查看文件

38
 
38
 
39
       <div class="filter-container">
39
       <div class="filter-container">
40
         <div class="cell clearfix">
40
         <div class="cell clearfix">
41
+          <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
42
+          <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px">
43
+              <el-option
44
+                v-for="(option, index) in list"
45
+                :key="index"
46
+                :label="option.storehouse_name"
47
+                :value="option.id">
48
+              </el-option>
49
+            </el-select>
41
           <label class="title"><span class="name">退库时间</span> : </label>
50
           <label class="title"><span class="name">退库时间</span> : </label>
42
-
43
           <el-date-picker
51
           <el-date-picker
44
             size="small"
52
             size="small"
45
             v-model="return_time"
53
             v-model="return_time"
365
       dealerList:[],
373
       dealerList:[],
366
       manufacturerList:[],
374
       manufacturerList:[],
367
       numberList:[],
375
       numberList:[],
368
-      unitList:[]
376
+      unitList:[],
377
+      list:[],
378
+      storehouse_id:"",
369
     };
379
     };
370
   },
380
   },
371
   methods: {
381
   methods: {
425
 
435
 
426
           this.form.manufacturer = 0
436
           this.form.manufacturer = 0
427
           this.form.dealer = 0
437
           this.form.dealer = 0
438
+          this.list = response.data.data.list
439
+          this.storehouse_id = response.data.data.configlist.drug_storehouse_out
428
         }
440
         }
429
         loading.close()
441
         loading.close()
430
       })
442
       })
546
       this.$router.go(-1);
558
       this.$router.go(-1);
547
     },
559
     },
548
     submit() {
560
     submit() {
561
+      if(this.storehouse_id == ""){
562
+        this.$message.error("仓库不能为空!")
563
+        return
564
+      }
549
       this.$refs["tableForm"].validate(valid => {
565
       this.$refs["tableForm"].validate(valid => {
550
         if (valid) {
566
         if (valid) {
551
           const array = this.recordInfo.recordData;
567
           const array = this.recordInfo.recordData;
584
             this.return_time,
600
             this.return_time,
585
             this.form.manufacturer,
601
             this.form.manufacturer,
586
             this.form.dealer,
602
             this.form.dealer,
587
-            this.type
603
+            this.type,
604
+            this.storehouse_id,
588
           ).then(response => {
605
           ).then(response => {
589
             if (response.data.state == 0) {
606
             if (response.data.state == 0) {
590
               this.$message.error(response.data.msg);
607
               this.$message.error(response.data.msg);

+ 24 - 12
src/xt_pages/stock/drugs/cancelDrugStockOrderEdit.vue 查看文件

18
       >
18
       >
19
       </drugs-stock-dialog>
19
       </drugs-stock-dialog>
20
       <div class="cell clearfix">
20
       <div class="cell clearfix">
21
-
21
+        <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
22
+          <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" :disabled="true">
23
+            <el-option
24
+              v-for="(option, index) in houseList"
25
+              :key="index"
26
+              :label="option.storehouse_name"
27
+              :value="option.id">
28
+            </el-option>
29
+          </el-select>
22
         <label class="title"><span class="name">退库时间</span> : </label>
30
         <label class="title"><span class="name">退库时间</span> : </label>
23
         <el-date-picker size="small" v-model="return_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
31
         <el-date-picker size="small" v-model="return_time" prefix-icon="el-icon-date" :editable="false" style="width: 196px;"
24
                         type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
32
                         type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
342
         dealerList:[],
350
         dealerList:[],
343
         numberList:[],
351
         numberList:[],
344
         unitList:[],
352
         unitList:[],
345
-        canCelShow:true
353
+        canCelShow:true,
354
+        storehouse_id:"",
355
+        houseList:[],
346
       }
356
       }
347
     },
357
     },
348
     methods: {
358
     methods: {
420
         }
430
         }
421
         return name;
431
         return name;
422
       },  specificationName: function(drug_id) {
432
       },  specificationName: function(drug_id) {
423
-        console.log(this.goodInfo)
433
+
424
         let name = "";
434
         let name = "";
425
         for (let i = 0; i < this.goodInfo.length; i++) {
435
         for (let i = 0; i < this.goodInfo.length; i++) {
426
           if (this.goodInfo[i].id == drug_id) {
436
           if (this.goodInfo[i].id == drug_id) {
555
             const params = {
565
             const params = {
556
               'cancelStock': this.recordInfo.recordData
566
               'cancelStock': this.recordInfo.recordData
557
             }
567
             }
558
-            console.log("232323223",this.recordInfo.recordData)
568
+           
559
             
569
             
560
-            editDrugCancelStockInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer).then(response => {
570
+            editDrugCancelStockInfo(params, this.return_time, this.$route.query.id, this.$route.query.type,this.form.manufacturer,this.form.dealer,this.storehouse_id).then(response => {
561
               if (response.data.state == 0) {
571
               if (response.data.state == 0) {
562
                 this.$message.error(response.data.msg)
572
                 this.$message.error(response.data.msg)
563
                 return false
573
                 return false
590
             this.$message.error(response.data.msg)
600
             this.$message.error(response.data.msg)
591
             return false
601
             return false
592
           } else {
602
           } else {
593
-            console.log("list232323",response.data.data.list)
603
+           
594
             for (let i = 0; i < response.data.data.list.length; i++) {
604
             for (let i = 0; i < response.data.data.list.length; i++) {
595
               response.data.data.list[i].count = response.data.data.list[i].count.toString()
605
               response.data.data.list[i].count = response.data.data.list[i].count.toString()
596
               response.data.data.list[i].price = response.data.data.list[i].price.toString()
606
               response.data.data.list[i].price = response.data.data.list[i].price.toString()
603
               this.recordInfo.recordData.push(response.data.data.list[i])
613
               this.recordInfo.recordData.push(response.data.data.list[i])
604
             }
614
             }
605
             this.cancelStock = response.data.data.info
615
             this.cancelStock = response.data.data.info
606
-            console.log("hhhh23hh2hh23h223",this.cancelStock)
616
+           
617
+            this.storehouse_id = response.data.data.info.storehouse_id
607
             this.return_time = this.getTime(this.cancelStock.return_time, '{y}-{m}-{d}')
618
             this.return_time = this.getTime(this.cancelStock.return_time, '{y}-{m}-{d}')
608
             this.form.manufacturer = this.cancelStock.manufacturer
619
             this.form.manufacturer = this.cancelStock.manufacturer
609
             this.form.dealer = this.cancelStock.dealer
620
             this.form.dealer = this.cancelStock.dealer
621
+            this.houseList = response.data.data.houselist
610
           }
622
           }
611
           if (this.recordInfo.recordData.length == 0) {
623
           if (this.recordInfo.recordData.length == 0) {
612
             const tempObj = {}
624
             const tempObj = {}
634
             searchArray = response.data.data.list;
646
             searchArray = response.data.data.list;
635
             
647
             
636
              var list = response.data.data.list
648
              var list = response.data.data.list
637
-             console.log("猎豹22222222222",list)
649
+      
638
 
650
 
639
              this.drugList = list
651
              this.drugList = list
640
              var manufacturerList = response.data.data.manufacturerList
652
              var manufacturerList = response.data.data.manufacturerList
672
             arr.push(this.recordInfo.recordData[i].drug_id)
684
             arr.push(this.recordInfo.recordData[i].drug_id)
673
          }
685
          }
674
          var str = arr.join(",")
686
          var str = arr.join(",")
675
-         console.log("str",str)
687
+       
676
          if(str.indexOf(val.id)!=-1){
688
          if(str.indexOf(val.id)!=-1){
677
             this.$message.error("该药品已存在列表中")
689
             this.$message.error("该药品已存在列表中")
678
             return
690
             return
679
          }
691
          }
680
          this.getDrugBatchNumber(val.id)
692
          this.getDrugBatchNumber(val.id)
681
-         console.log("val2323232323223",val)
693
+
682
          for(let i=0;i<this.recordInfo.recordData.length;i++){
694
          for(let i=0;i<this.recordInfo.recordData.length;i++){
683
            if(i == this.currentIndex){
695
            if(i == this.currentIndex){
684
              this.recordInfo.recordData[i].drug_id  = val.id
696
              this.recordInfo.recordData[i].drug_id  = val.id
699
             
711
             
700
            }
712
            }
701
         }
713
         }
702
-        console.log("333333",this.recordInfo.recordData)
714
+       
703
       },
715
       },
704
       getDrugBatchNumber(id){
716
       getDrugBatchNumber(id){
705
           var params = {
717
           var params = {
708
         getDrugBatchNumber(params).then(response=>{
720
         getDrugBatchNumber(params).then(response=>{
709
            if(response.data.state == 1){
721
            if(response.data.state == 1){
710
              var list = response.data.data.list
722
              var list = response.data.data.list
711
-             console.log("list2222",list)
723
+       
712
              for(let i=0;i<list.length;i++){
724
              for(let i=0;i<list.length;i++){
713
                this.numberList.push(list[i])
725
                this.numberList.push(list[i])
714
              }
726
              }

+ 45 - 6
src/xt_pages/stock/drugs/components/drugCancelDetail.vue 查看文件

23
       >汇总导出
23
       >汇总导出
24
     </el-button>
24
     </el-button>
25
     <div class="cell clearfix">
25
     <div class="cell clearfix">
26
+     <label class="title"><span class="name">仓库</span> :</label>
27
+      <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
28
+          <el-option
29
+            v-for="(option, index) in houseList"
30
+            :key="index"
31
+            :label="option.storehouse_name"
32
+            :value="option.id">
33
+          </el-option>
34
+      </el-select>  
26
       <el-input
35
       <el-input
27
         size="small"
36
         size="small"
28
-        style="width: 400px;"
37
+        style="width: 200px;"
29
         class="filter-item"
38
         class="filter-item"
30
         v-model.trim="searchKey"
39
         v-model.trim="searchKey"
31
         placeholder="单据编码/制单人/药品名称"
40
         placeholder="单据编码/制单人/药品名称"
38
         @click="search"
47
         @click="search"
39
         >搜索</el-button
48
         >搜索</el-button
40
       >
49
       >
41
-      <div style="margin-left:10px;">
50
+    
42
         <label class="title"><span class="name">日期查询</span> : </label>
51
         <label class="title"><span class="name">日期查询</span> : </label>
43
         <el-date-picker
52
         <el-date-picker
44
           size="small"
53
           size="small"
67
           value-format="yyyy-MM-dd"
76
           value-format="yyyy-MM-dd"
68
           @change="endTimeChange"
77
           @change="endTimeChange"
69
         ></el-date-picker>
78
         ></el-date-picker>
70
-      </div>
79
+     
71
     </div>
80
     </div>
72
 
81
 
73
     <el-row :gutter="12" style="margin-top: 10px">
82
     <el-row :gutter="12" style="margin-top: 10px">
128
           {{getAdminUser(scope.row.creater)}}
137
           {{getAdminUser(scope.row.creater)}}
129
           </template>
138
           </template>
130
         </el-table-column>
139
         </el-table-column>
140
+       <el-table-column label="仓库名称" align="center">
141
+          <template slot-scope="scope">
142
+          {{getStorehouseName(scope.row.storehouse_id)}}
143
+          </template>
144
+        </el-table-column>
131
         <el-table-column label="退货价" align="center">
145
         <el-table-column label="退货价" align="center">
132
           <template slot-scope="scope">
146
           <template slot-scope="scope">
133
           {{scope.row.price}}
147
           {{scope.row.price}}
235
       tableList:[],
249
       tableList:[],
236
       tableDataList:[],
250
       tableDataList:[],
237
       drugTypeList:[],
251
       drugTypeList:[],
252
+      storehouse_id:0,
253
+      houseList:[],
238
     };
254
     };
239
   },
255
   },
240
   methods: {
256
   methods: {
272
    
288
    
273
     fetchAllAdminUsers() {
289
     fetchAllAdminUsers() {
274
       fetchAllAdminUsers().then(response => {
290
       fetchAllAdminUsers().then(response => {
275
-        console.log(response);
291
+     
276
         if (response.data.state == 1) {
292
         if (response.data.state == 1) {
277
           this.adminUserOptions = response.data.data.users;
293
           this.adminUserOptions = response.data.data.users;
278
         }
294
         }
343
         keyword:this.searchKey,
359
         keyword:this.searchKey,
344
         limit:this.limit,
360
         limit:this.limit,
345
         page:this.page,
361
         page:this.page,
362
+        storehouse_id:this.storehouse_id,
346
        }
363
        }
347
       getDrugCancelDetail(params).then(response=>{
364
       getDrugCancelDetail(params).then(response=>{
348
          if(response.data.state == 1){
365
          if(response.data.state == 1){
349
            var order =  response.data.data.order
366
            var order =  response.data.data.order
350
            var list = response.data.data.orderPrint
367
            var list = response.data.data.orderPrint
351
-           //this.drugTypeList = response.data.data.drugTypeList
368
+           var obj = {id:0,storehouse_name:"全部"}
369
+            this.houseList = []
370
+            this.houseList.push(obj)
371
+            for(let i=0;i<response.data.data.houseList.length;i++){
372
+            this.houseList.push(response.data.data.houseList[i])
373
+            }
352
            for(let i=0;i<list.length;i++){
374
            for(let i=0;i<list.length;i++){
353
              list[i].child = []
375
              list[i].child = []
354
             for(let j=0;j<order.length;j++){
376
             for(let j=0;j<order.length;j++){
489
         }
511
         }
490
       }
512
       }
491
       return name
513
       return name
492
-    } 
514
+    },
515
+    getStorehouseName(id){
516
+       var storehouse_name = ""
517
+       for(let i=0;i<this.houseList.length;i++){
518
+         if(id == this.houseList[i].id){
519
+           storehouse_name = this.houseList[i].storehouse_name
520
+         }
521
+       }
522
+       if(storehouse_name == "全部"){
523
+          return ""
524
+       }else{
525
+         return storehouse_name
526
+       }
527
+     },
528
+     changeHouseList(){
529
+       this.houseList = []
530
+       this.getlist()
531
+     }  
493
   }
532
   }
494
 };
533
 };
495
 </script>
534
 </script>

+ 54 - 10
src/xt_pages/stock/drugs/components/drugInOrder.vue 查看文件

23
       type="primary"
23
       type="primary"
24
       >汇总导出
24
       >汇总导出
25
     </el-button>
25
     </el-button>
26
-
26
+   
27
     <div class="cell clearfix">
27
     <div class="cell clearfix">
28
+      <label class="title"><span class="name">仓库</span> :</label>
29
+      <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
30
+          <el-option
31
+            v-for="(option, index) in houseList"
32
+            :key="index"
33
+            :label="option.storehouse_name"
34
+            :value="option.id">
35
+          </el-option>
36
+      </el-select>  
28
       <el-input
37
       <el-input
29
         size="small"
38
         size="small"
30
-        style="width: 400px;"
39
+        style="width: 200px;"
31
         class="filter-item"
40
         class="filter-item"
32
         v-model.trim="searchKey"
41
         v-model.trim="searchKey"
33
         placeholder="单据编码/制单人/药品名称"
42
         placeholder="单据编码/制单人/药品名称"
40
         @click="search"
49
         @click="search"
41
         >搜索</el-button
50
         >搜索</el-button
42
       >
51
       >
43
-      <div style="margin-left:10px;">
44
         <label class="title"><span class="name">日期查询</span> : </label>
52
         <label class="title"><span class="name">日期查询</span> : </label>
45
         <el-date-picker
53
         <el-date-picker
46
           size="small"
54
           size="small"
70
           value-format="yyyy-MM-dd"
78
           value-format="yyyy-MM-dd"
71
           @change="endTimeChange"
79
           @change="endTimeChange"
72
         ></el-date-picker>
80
         ></el-date-picker>
73
-      </div>
74
     </div>
81
     </div>
75
 
82
 
76
     <el-row :gutter="12" style="margin-top: 10px">
83
     <el-row :gutter="12" style="margin-top: 10px">
124
            {{getAdminUser(scope.row.creater)}}
131
            {{getAdminUser(scope.row.creater)}}
125
           </template>
132
           </template>
126
         </el-table-column>
133
         </el-table-column>
134
+        <el-table-column label="仓库名称" align="center">
135
+          <template slot-scope="scope">
136
+           {{getStorehouseName(scope.row.storehouse_id)}}
137
+          </template>
138
+        </el-table-column>
127
         <el-table-column label="进货价" align="center">
139
         <el-table-column label="进货价" align="center">
128
           <template slot-scope="scope">
140
           <template slot-scope="scope">
129
             {{scope.row.price}}
141
             {{scope.row.price}}
134
             {{scope.row.warehousing_count}}
146
             {{scope.row.warehousing_count}}
135
           </template>
147
           </template>
136
         </el-table-column>
148
         </el-table-column>
149
+        <el-table-column label="单位" align="center">
150
+          <template slot-scope="scope">
151
+            {{scope.row.count_unit}}
152
+          </template>
153
+        </el-table-column>
137
         <el-table-column label="总价" align="center">
154
         <el-table-column label="总价" align="center">
138
           <template slot-scope="scope">
155
           <template slot-scope="scope">
139
             {{scope.row.total_price}}
156
             {{scope.row.total_price}}
190
     
207
     
191
     var end_time =  window.sessionStorage.getItem('drug_end_in_time')
208
     var end_time =  window.sessionStorage.getItem('drug_end_in_time')
192
     if(start_time !=null){
209
     if(start_time !=null){
193
-      console.log("hh232323232红红火火")
194
       this.start_time = start_time
210
       this.start_time = start_time
195
     }
211
     }
196
     if(end_time!=null){
212
     if(end_time!=null){
238
       tableList:[],
254
       tableList:[],
239
       tabelePrintList:[],
255
       tabelePrintList:[],
240
       drugTypeList:[],
256
       drugTypeList:[],
257
+      storehouse_id:0,
258
+      houseList:[],
241
     };
259
     };
242
   },
260
   },
243
   methods: {
261
   methods: {
342
         keyword:this.searchKey,
360
         keyword:this.searchKey,
343
         limit:this.limit,
361
         limit:this.limit,
344
         page:this.page,
362
         page:this.page,
363
+        storehouse_id:this.storehouse_id,
345
        }
364
        }
346
       getDrugIndetail(params).then(response=>{
365
       getDrugIndetail(params).then(response=>{
347
         if(response.data.state == 1){
366
         if(response.data.state == 1){
348
           var drugInOrder = response.data.data.detail
367
           var drugInOrder = response.data.data.detail
349
           var drugTypeParent = response.data.data.drugTypeParent
368
           var drugTypeParent = response.data.data.drugTypeParent
350
-          console.log("药品类型",drugTypeParent)
351
-        //  this.drugTypeList = drugTypeParent
369
+          var obj = {id:0,storehouse_name:"全部"}
370
+          this.houseList = []
371
+          this.houseList.push(obj)
372
+          for(let i=0;i<response.data.data.houseList.length;i++){
373
+           this.houseList.push(response.data.data.houseList[i])
374
+          }
352
           var total_price = 0
375
           var total_price = 0
353
           for(let i=0;i<drugInOrder.length;i++){
376
           for(let i=0;i<drugInOrder.length;i++){
354
              drugInOrder[i].specification_name  = drugInOrder[i].dose + drugInOrder[i].dose_unit + "*" + drugInOrder[i].min_number +  drugInOrder[i].min_unit + "/" + drugInOrder[i].max_unit
377
              drugInOrder[i].specification_name  = drugInOrder[i].dose + drugInOrder[i].dose_unit + "*" + drugInOrder[i].min_number +  drugInOrder[i].min_unit + "/" + drugInOrder[i].max_unit
378
+             if(drugInOrder[i].storehouse_id > 0){
379
+               drugInOrder[i].total_price = (drugInOrder[i].warehousing_count * drugInOrder[i].price).toFixed(2)
380
+             }
355
              drugInOrder[i].is_total = 0
381
              drugInOrder[i].is_total = 0
356
              total_price += drugInOrder[i].warehousing_count * drugInOrder[i].price
382
              total_price += drugInOrder[i].warehousing_count * drugInOrder[i].price
357
           }
383
           }
362
             ctime:"",
388
             ctime:"",
363
             total_price:total_price.toFixed(2),
389
             total_price:total_price.toFixed(2),
364
           });
390
           });
391
+          console.log("drugInOrder232332322323233232322332322332",drugInOrder)
365
           this.cancelStockDate = drugInOrder
392
           this.cancelStockDate = drugInOrder
366
            let objInfo = {}
393
            let objInfo = {}
367
           drugInOrder.forEach((item,index)=>{
394
           drugInOrder.forEach((item,index)=>{
416
         end_time:this.end_time,
443
         end_time:this.end_time,
417
         order_type:this.order_type,
444
         order_type:this.order_type,
418
       }
445
       }
419
-     console.log("药品入库232323223",params)
446
+    
420
      getDrugWarehouseInfoPrint(params).then(response=>{
447
      getDrugWarehouseInfoPrint(params).then(response=>{
421
           if(response.data.state == 1){
448
           if(response.data.state == 1){
422
             var list = response.data.data.list
449
             var list = response.data.data.list
443
       return name
470
       return name
444
     },
471
     },
445
      exportList(){
472
      exportList(){
446
-        console.log("hhh233223232323",this.tabelePrintList)
473
+       
447
         for(let i=0;i<this.tabelePrintList.length;i++){
474
         for(let i=0;i<this.tabelePrintList.length;i++){
448
           this.tabelePrintList[i].index = i+1
475
           this.tabelePrintList[i].index = i+1
449
           this.tabelePrintList[i].drug_name = this.tabelePrintList[i].XtBaseDrug.drug_name
476
           this.tabelePrintList[i].drug_name = this.tabelePrintList[i].XtBaseDrug.drug_name
517
         }
544
         }
518
       }
545
       }
519
       return name
546
       return name
520
-    }
547
+    },
548
+   getStorehouseName(id){
549
+       var storehouse_name = ""
550
+       for(let i=0;i<this.houseList.length;i++){
551
+         if(id == this.houseList[i].id){
552
+           storehouse_name = this.houseList[i].storehouse_name
553
+         }
554
+       }
555
+       if(storehouse_name == "全部"){
556
+          return ""
557
+       }else{
558
+         return storehouse_name
559
+       }
560
+     },
561
+     changeHouseList(){
562
+       this.houseList = []
563
+       this.getlist()
564
+     }
521
   }
565
   }
522
 };
566
 };
523
 </script>
567
 </script>

+ 56 - 18
src/xt_pages/stock/drugs/components/drugOutDetail.vue 查看文件

24
     </el-button>
24
     </el-button>
25
    
25
    
26
     <div class="cell clearfix">
26
     <div class="cell clearfix">
27
+       <label class="title"><span class="name">仓库</span> :</label>
28
+      <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
29
+          <el-option
30
+            v-for="(option, index) in houseList"
31
+            :key="index"
32
+            :label="option.storehouse_name"
33
+            :value="option.id">
34
+          </el-option>
35
+      </el-select>  
27
       <el-input
36
       <el-input
28
         size="small"
37
         size="small"
29
-        style="width: 400px;"
38
+        style="width: 200px;"
30
         class="filter-item"
39
         class="filter-item"
31
         v-model.trim="searchKey"
40
         v-model.trim="searchKey"
32
         placeholder="单据编码/制单人/药品名称"
41
         placeholder="单据编码/制单人/药品名称"
39
         @click="search"
48
         @click="search"
40
         >搜索</el-button
49
         >搜索</el-button
41
       >
50
       >
42
-      <div style="margin-left:10px;">
43
         <label class="title"><span class="name">日期查询</span> : </label>
51
         <label class="title"><span class="name">日期查询</span> : </label>
44
         <el-date-picker
52
         <el-date-picker
45
           size="small"
53
           size="small"
68
           value-format="yyyy-MM-dd"
76
           value-format="yyyy-MM-dd"
69
           @change="endTimeChange"
77
           @change="endTimeChange"
70
         ></el-date-picker>
78
         ></el-date-picker>
71
-      </div>
79
+     
72
     </div>
80
     </div>
73
 
81
 
74
   
82
   
125
            {{getAdminUser(scope.row.creater)}}
133
            {{getAdminUser(scope.row.creater)}}
126
           </template>
134
           </template>
127
         </el-table-column>
135
         </el-table-column>
136
+        <el-table-column label="仓库名称" align="center">
137
+          <template slot-scope="scope">
138
+           {{getStorehouseName(scope.row.storehouse_id)}}
139
+          </template>
140
+        </el-table-column>
128
         <el-table-column label="出货价" align="center">
141
         <el-table-column label="出货价" align="center">
129
           <template slot-scope="scope">
142
           <template slot-scope="scope">
130
            <span v-if="org_id == 9919">{{scope.row.last_price}} </span> 
143
            <span v-if="org_id == 9919">{{scope.row.last_price}} </span> 
265
       tablePrint:[],
278
       tablePrint:[],
266
       org_id:0,
279
       org_id:0,
267
       drugTypeList:[],
280
       drugTypeList:[],
281
+      storehouse_id:0,
282
+      houseList:[],
268
     };
283
     };
269
   },
284
   },
270
   methods: {
285
   methods: {
317
     },
332
     },
318
     fetchAllAdminUsers() {
333
     fetchAllAdminUsers() {
319
       fetchAllAdminUsers().then(response => {
334
       fetchAllAdminUsers().then(response => {
320
-        console.log(response);
335
+       
321
         if (response.data.state == 1) {
336
         if (response.data.state == 1) {
322
           this.adminUserOptions = response.data.data.users;
337
           this.adminUserOptions = response.data.data.users;
323
         }
338
         }
396
          keyword:this.searchKey,
411
          keyword:this.searchKey,
397
          page:this.page,
412
          page:this.page,
398
          limit:this.limit,
413
          limit:this.limit,
414
+         storehouse_id:this.storehouse_id,
399
       }  
415
       }  
400
       getDrugOutDetail(params).then(response=>{
416
       getDrugOutDetail(params).then(response=>{
401
         this.tableData = []
417
         this.tableData = []
402
         this.tableList = []
418
         this.tableList = []
403
         if(response.data.state == 1){
419
         if(response.data.state == 1){
404
           var order = response.data.data.order
420
           var order = response.data.data.order
405
-          console.log("出库数据",order)
421
+          var obj = {id:0,storehouse_name:"全部"}
422
+          this.houseList = []
423
+          this.houseList.push(obj)
424
+          for(let i=0;i<response.data.data.houseList.length;i++){
425
+           this.houseList.push(response.data.data.houseList[i])
426
+          }
406
           var total_price = 0
427
           var total_price = 0
407
           for(let i=0;i<order.length;i++){
428
           for(let i=0;i<order.length;i++){
408
              order[i].specification_name  = order[i].dose + order[i].dose_unit + "*" + order[i].min_number +  order[i].min_unit + "/" + order[i].max_unit
429
              order[i].specification_name  = order[i].dose + order[i].dose_unit + "*" + order[i].min_number +  order[i].min_unit + "/" + order[i].max_unit
424
              }
445
              }
425
             
446
             
426
           }
447
           }
427
-          console.log("total_price23322332232332323232",order)
448
+         
428
            order.push({
449
            order.push({
429
             warehouse_out_order_number: "合计",
450
             warehouse_out_order_number: "合计",
430
             is_total: 1,
451
             is_total: 1,
437
             order[i].total_price = order[i].total_price.toFixed(2)
458
             order[i].total_price = order[i].total_price.toFixed(2)
438
           }
459
           }
439
        
460
        
440
-          console.log("order232233232232323232332",order)
461
+         
441
           this.tableData = order
462
           this.tableData = order
442
            let objInfo = {}
463
            let objInfo = {}
443
           order.forEach((item,index)=>{
464
           order.forEach((item,index)=>{
526
     },
547
     },
527
 
548
 
528
      exportList(){
549
      exportList(){
529
-        console.log("hh23233223",this.tablePrint)
550
+    
530
         for(let i=0;i<this.tablePrint.length;i++){
551
         for(let i=0;i<this.tablePrint.length;i++){
531
           this.tablePrint[i].index = i+1
552
           this.tablePrint[i].index = i+1
532
         }
553
         }
544
               this.tablePrint[i].total = this.getTotalPriceOne(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].min_price) 
565
               this.tablePrint[i].total = this.getTotalPriceOne(this.tablePrint[i].child,this.tablePrint[i].max_unit,this.tablePrint[i].min_number,this.tablePrint[i].min_price) 
545
            }
566
            }
546
         }
567
         }
547
-       console.log("列表数据333333333",this.tablePrint)
568
+  
548
        
569
        
549
        import('@/vendor/Export2Excel').then(excel => {
570
        import('@/vendor/Export2Excel').then(excel => {
550
        const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
571
        const tHeader = ['序号','药品名称', '规格型号', '单位','数量','单价','总价','备注']
556
        obj.total_price = obj.total_price.toFixed(2)
577
        obj.total_price = obj.total_price.toFixed(2)
557
        this.tablePrint.push(obj)
578
        this.tablePrint.push(obj)
558
        const data = this.formatJson(filterVal, this.tablePrint)
579
        const data = this.formatJson(filterVal, this.tablePrint)
559
-       console.log("data",data)
580
+  
560
        
581
        
561
        excel.export_json_to_excel({
582
        excel.export_json_to_excel({
562
            header: tHeader,
583
            header: tHeader,
610
          }
631
          }
611
        }
632
        }
612
        const data = this.formatJson(filterVal, this.tableData)
633
        const data = this.formatJson(filterVal, this.tableData)
613
-       console.log("data",data)
634
+  
614
      
635
      
615
        excel.export_json_to_excel({
636
        excel.export_json_to_excel({
616
            header: tHeader,
637
            header: tHeader,
641
             for (let i = 0; i < response.data.data.list.length; i++) {
662
             for (let i = 0; i < response.data.data.list.length; i++) {
642
               this.drugList.push(response.data.data.list[i])
663
               this.drugList.push(response.data.data.list[i])
643
             }
664
             }
644
-            console.log("药品列表",this.drugList)
665
+ 
645
           }
666
           }
646
         })
667
         })
647
       },
668
       },
651
          end_time:this.end_time,
672
          end_time:this.end_time,
652
          order_type:2,
673
          order_type:2,
653
       }  
674
       }  
654
-      console.log("poara232323223233223",params)
675
+     
655
      getDrugOutOrderPrint(params).then(response=>{
676
      getDrugOutOrderPrint(params).then(response=>{
656
         if(response.data.state == 1){
677
         if(response.data.state == 1){
657
             var list = response.data.data.list
678
             var list = response.data.data.list
658
-            console.log("药品出库详情",list)
679
+          
659
             let objInfo = {}
680
             let objInfo = {}
660
             if(this.org_id == 9671 || this.org_id == 9919){
681
             if(this.org_id == 9671 || this.org_id == 9919){
661
               list.forEach((item,index)=>{
682
               list.forEach((item,index)=>{
712
               }
733
               }
713
             }
734
             }
714
            this.tablePrint = newArr
735
            this.tablePrint = newArr
715
-           console.log(" this.tablePrint",this.tablePrint)  
736
+          
716
         }
737
         }
717
      })
738
      })
718
     },
739
     },
755
         for(let j=0;j<arr.length;j++){
776
         for(let j=0;j<arr.length;j++){
756
           total +=arr[j].count
777
           total +=arr[j].count
757
         }
778
         }
758
-        console.log("total23232",total)
779
+        
759
         return (total*min_price).toFixed(2)
780
         return (total*min_price).toFixed(2)
760
       },
781
       },
761
 
782
 
771
         for(let j=0;j<arr.length;j++){
792
         for(let j=0;j<arr.length;j++){
772
           total +=arr[j].count
793
           total +=arr[j].count
773
         }
794
         }
774
-        console.log("total23232",total)
795
+     
775
         return total*min_price
796
         return total*min_price
776
       },
797
       },
777
       getCountSix(drug_id,val){
798
       getCountSix(drug_id,val){
813
           }
834
           }
814
         }
835
         }
815
         return price
836
         return price
816
-      } 
837
+      },
838
+      getStorehouseName(id){
839
+       var storehouse_name = ""
840
+       for(let i=0;i<this.houseList.length;i++){
841
+         if(id == this.houseList[i].id){
842
+           storehouse_name = this.houseList[i].storehouse_name
843
+         }
844
+       }
845
+       if(storehouse_name == "全部"){
846
+          return ""
847
+       }else{
848
+         return storehouse_name
849
+       }
850
+     },
851
+     changeHouseList(){
852
+       this.houseList = []
853
+       this.getlist()
854
+     } 
817
   }
855
   }
818
 };
856
 };
819
 </script>
857
 </script>

+ 25 - 9
src/xt_pages/stock/drugs/drugBatchNumber.vue 查看文件

44
         :data="tableList"
44
         :data="tableList"
45
         border
45
         border
46
         style="width: 100%">
46
         style="width: 100%">
47
-        <el-table-column prop="date" label="序号" width="180" align="center">
47
+        <el-table-column prop="date" label="序号" width="100" align="center">
48
            <template  slot-scope="scope">
48
            <template  slot-scope="scope">
49
               {{scope.$index + 1}}
49
               {{scope.$index + 1}}
50
            </template>
50
            </template>
73
            <template slot-scope="scope">
73
            <template slot-scope="scope">
74
               {{scope.row.batch_number}}
74
               {{scope.row.batch_number}}
75
            </template>
75
            </template>
76
+        </el-table-column>
77
+        <el-table-column prop="drug_name" label="仓库名称" width="200" align="center">
78
+           <template slot-scope="scope">
79
+              <span>{{getHouseName(scope.row.storehouse_id)}}</span>
80
+           </template>
76
         </el-table-column>
81
         </el-table-column>
77
          <el-table-column prop="drug_name" label="数量" align="center">
82
          <el-table-column prop="drug_name" label="数量" align="center">
78
            <template slot-scope="scope">
83
            <template slot-scope="scope">
187
         minCount:[],
192
         minCount:[],
188
         drugOutList:[],
193
         drugOutList:[],
189
         drug:{},
194
         drug:{},
195
+        houseList:[],
190
       }
196
       }
191
     },
197
     },
192
     methods:{
198
     methods:{
199
         getBatchOrderDetail(params).then(response=>{
205
         getBatchOrderDetail(params).then(response=>{
200
            if(response.data.state == 1){
206
            if(response.data.state == 1){
201
               var detail =  response.data.data.detail
207
               var detail =  response.data.data.detail
202
-              console.log("detail2343434",detail)
208
+             
203
               this.tableList = detail
209
               this.tableList = detail
204
               this.manufacturerList = response.data.data.manufacturerList
210
               this.manufacturerList = response.data.data.manufacturerList
205
               var total = response.data.data.total
211
               var total = response.data.data.total
206
-              console.log("total",total)
212
+              
207
               this.total = total
213
               this.total = total
208
               this.drug =  response.data.data.drug
214
               this.drug =  response.data.data.drug
215
+              this.houseList = response.data.data.houseList
209
            }
216
            }
210
         })
217
         })
211
       },
218
       },
244
       getDrugCountList(params).then(response=>{
251
       getDrugCountList(params).then(response=>{
245
           if(response.data.state == 1){
252
           if(response.data.state == 1){
246
             var countlist =  response.data.data.countList
253
             var countlist =  response.data.data.countList
247
-            console.log("入库数据",countlist)
254
+          
248
             this.countList = countlist
255
             this.countList = countlist
249
             var outcountlist = response.data.data.outCountList
256
             var outcountlist = response.data.data.outCountList
250
-            console.log("出库数据",outcountlist)
257
+           
251
             this.outCountList = outcountlist
258
             this.outCountList = outcountlist
252
             var aucountlist = response.data.data.auCountList
259
             var aucountlist = response.data.data.auCountList
253
-            console.log("自动数据",aucountlist)
260
+           
254
             this.autoCountList = aucountlist
261
             this.autoCountList = aucountlist
255
              var minCount = response.data.data.minCount
262
              var minCount = response.data.data.minCount
256
-            console.log("minCount",minCount)
263
+            
257
             this.minCount = minCount
264
             this.minCount = minCount
258
             var info = response.data.data.info
265
             var info = response.data.data.info
259
             for(let i=0;i<info.length;i++){
266
             for(let i=0;i<info.length;i++){
261
                  info[i].count = info[i].count * info[i].min_number
268
                  info[i].count = info[i].count * info[i].min_number
262
               }
269
               }
263
             }
270
             }
264
-            console.log("info2222222",info)
271
+          
265
             this.drugOutList = info
272
             this.drugOutList = info
266
           }
273
           }
267
         })
274
         })
362
            name = this.drug.drug_name
369
            name = this.drug.drug_name
363
         }
370
         }
364
         return name
371
         return name
365
-     }
372
+     },
373
+     getHouseName(id){
374
+      var storehouse_name = ""
375
+      for(let i=0;i<this.houseList.length;i++){
376
+        if(id == this.houseList[i].id){
377
+          storehouse_name = this.houseList[i].storehouse_name
378
+        }
379
+      }
380
+      return storehouse_name
381
+     },
366
     }
382
     }
367
   }
383
   }
368
 </script>
384
 </script>

+ 39 - 0
src/xt_pages/stock/drugs/drugDamaged.vue 查看文件

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
     <div  style="margin-bottom:10px;">
3
     <div  style="margin-bottom:10px;">
4
+    <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changehouseList">
5
+        <el-option
6
+          v-for="(option, index) in houseList"
7
+          :key="index"
8
+          :label="option.storehouse_name"
9
+          :value="option.id">
10
+        </el-option>
11
+      </el-select>   
4
       <el-input
12
       <el-input
5
       size="small"
13
       size="small"
6
       style="width: 200px;"
14
       style="width: 200px;"
60
               {{getTotalPrice(scope.row.drug_id,scope.row.min_price)}}
68
               {{getTotalPrice(scope.row.drug_id,scope.row.min_price)}}
61
             </template>
69
             </template>
62
         </el-table-column>
70
         </el-table-column>
71
+        <el-table-column prop="name" label="仓库名称" align="center">
72
+            <template slot-scope="scope">
73
+              {{getHouseName(scope.row.storehouse_id)}}
74
+            </template>
75
+        </el-table-column>
63
         <el-table-column prop="name" label="操作人" align="center">
76
         <el-table-column prop="name" label="操作人" align="center">
64
             <template slot-scope="scope">
77
             <template slot-scope="scope">
65
               {{getDoctorName(scope.row.creater)}}
78
               {{getDoctorName(scope.row.creater)}}
219
                 product_date:"",
232
                 product_date:"",
220
                 stock_max_number:"",
233
                 stock_max_number:"",
221
                 stock_min_number:"",
234
                 stock_min_number:"",
235
+                storehouse_id:"",
222
             },
236
             },
223
             drugList:[],
237
             drugList:[],
224
             manufacturerList:[],
238
             manufacturerList:[],
258
             min_unit:"",
272
             min_unit:"",
259
             min_price:0,
273
             min_price:0,
260
             drug_id:0,
274
             drug_id:0,
275
+            storehouse_id:0,
261
         }
276
         }
262
     },
277
     },
263
     methods:{
278
     methods:{
295
           start_time:this.start_time,
310
           start_time:this.start_time,
296
           end_time:this.end_time,
311
           end_time:this.end_time,
297
           keyword:this.searchKey,
312
           keyword:this.searchKey,
313
+          storehouse_id:this.storehouse_id,
298
         }
314
         }
299
 
315
 
300
         getDrugDamageList(params).then(response=>{
316
         getDrugDamageList(params).then(response=>{
304
              this.doctorList = response.data.data.doctorList
320
              this.doctorList = response.data.data.doctorList
305
              var datamagelist = response.data.data.damagelist
321
              var datamagelist = response.data.data.damagelist
306
              this.datamageList = datamagelist
322
              this.datamageList = datamagelist
323
+             var obj = {id:0,storehouse_name:"全部"}
324
+             this.houseList = []
325
+             this.houseList.push(obj)
326
+             for(let i=0;i<response.data.data.houseList.length;i++){
327
+              this.houseList.push(response.data.data.houseList[i])
328
+             }
307
            }
329
            }
308
         })
330
         })
309
       },
331
       },
432
        all_count =  total_count * this.min_number
454
        all_count =  total_count * this.min_number
433
 
455
 
434
        return (count / all_count).toFixed(2)*100
456
        return (count / all_count).toFixed(2)*100
457
+     },
458
+     changehouseList(){
459
+       this.houseList = []
460
+       this.getlist()
461
+     },
462
+     getHouseName(id){
463
+      var storehouse_name  = ""
464
+      for(let i=0;i<this.houseList.length;i++){
465
+        if(id == this.houseList[i].id){
466
+          storehouse_name = this.houseList[i].storehouse_name
467
+        }
468
+      }
469
+      if(storehouse_name == "全部"){
470
+        return ""
471
+      }else{
472
+        return storehouse_name
473
+      }
435
      }
474
      }
436
     },
475
     },
437
     created(){
476
     created(){

+ 39 - 25
src/xt_pages/stock/drugs/drugStockFlow.vue 查看文件

71
              <span v-if="scope.row.consumable_type == 7">自动退库</span>
71
              <span v-if="scope.row.consumable_type == 7">自动退库</span>
72
              <span v-if="scope.row.consumable_type == 5">报损数量</span>
72
              <span v-if="scope.row.consumable_type == 5">报损数量</span>
73
              <span v-if="scope.row.consumable_type == 10">盘盈</span>
73
              <span v-if="scope.row.consumable_type == 10">盘盈</span>
74
-            <span v-if="scope.row.consumable_type == 11">盘亏</span>
74
+             <span v-if="scope.row.consumable_type == 11">盘亏</span>
75
+             <span v-if="scope.row.consumable_type == 12">调拨出库</span>
76
+             <span v-if="scope.row.consumable_type == 13">调拨入库</span>
75
            </template>
77
            </template>
76
         </el-table-column>
78
         </el-table-column>
77
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
79
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
78
            <template slot-scope="scope">
80
            <template slot-scope="scope">
79
              <span v-if="scope.row.consumable_type == 1">{{scope.row.warehousing_order}}</span>
81
              <span v-if="scope.row.consumable_type == 1">{{scope.row.warehousing_order}}</span>
80
-              <span v-if="scope.row.consumable_type == 2 || scope.row.consumable_type == 3">{{scope.row.warehouse_out_order_number}}</span>
82
+              <span v-if="scope.row.consumable_type == 2 || scope.row.consumable_type == 3 || scope.row.consumable_type == 12">{{scope.row.warehouse_out_order_number}}</span>
81
               <span v-if="scope.row.consumable_type == 4 || scope.row.consumable_type == 7">{{scope.row.cancel_order_number}}</span>
83
               <span v-if="scope.row.consumable_type == 4 || scope.row.consumable_type == 7">{{scope.row.cancel_order_number}}</span>
82
               <span v-if="scope.row.consumable_type == 5">{{scope.row.warehouse_out_order_number}}</span>
84
               <span v-if="scope.row.consumable_type == 5">{{scope.row.warehouse_out_order_number}}</span>
83
-              <span v-if="scope.row.consumable_type == 10 || scope.row.consumable_type == 11">{{scope.row.warehousing_order}}</span>
85
+              <span v-if="scope.row.consumable_type == 10 || scope.row.consumable_type == 11 || scope.row.consumable_type == 13">{{scope.row.warehousing_order}}</span>
84
            </template>
86
            </template>
85
         </el-table-column>
87
         </el-table-column>
86
         <el-table-column prop="drug_name" label="操作日期" align="center">
88
         <el-table-column prop="drug_name" label="操作日期" align="center">
88
              {{getTime(scope.row.ctime,"{y}-{h}-{d}")}}
90
              {{getTime(scope.row.ctime,"{y}-{h}-{d}")}}
89
            </template>
91
            </template>
90
         </el-table-column>
92
         </el-table-column>
93
+        <el-table-column prop="drug_name" label="仓库名称" align="center">
94
+           <template slot-scope="scope">
95
+              <span>{{getHouseName(scope.row.storehouse_id)}}</span>
96
+           </template>
97
+        </el-table-column>
91
         <el-table-column prop="drug_name" label="数量" align="center">
98
         <el-table-column prop="drug_name" label="数量" align="center">
92
            <template slot-scope="scope">
99
            <template slot-scope="scope">
93
               {{scope.row.count}}
100
               {{scope.row.count}}
184
       var drugCategory = getDictionaryDataConfig('system','drug_category')
191
       var drugCategory = getDictionaryDataConfig('system','drug_category')
185
       this.drugCategory.push(...drugCategory)
192
       this.drugCategory.push(...drugCategory)
186
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
193
       this.drugTypeList = getDictionaryDataConfig('system','drug_type') 
187
-      // this.getlist()
188
-      // this.getOutList()
189
-      // this.getDrugCountList()
190
-
194
+  
191
       this.getDrugFlow()
195
       this.getDrugFlow()
192
     },
196
     },
193
     components: {
197
     components: {
234
           {id:3,name:"自动出库"},
238
           {id:3,name:"自动出库"},
235
           {id:4,name:"手动退库"},
239
           {id:4,name:"手动退库"},
236
           {id:10,name:"盘盈"},
240
           {id:10,name:"盘盈"},
237
-          {id:11,name:"盘亏"}
241
+          {id:11,name:"盘亏"},
242
+          {id:12,name:"调拨出库"},
243
+          {id:13,name:"调拨入库"}
238
         ],
244
         ],
239
         outList:[],
245
         outList:[],
240
         countList:[],
246
         countList:[],
243
         drugOutList:[],
249
         drugOutList:[],
244
         total:0,
250
         total:0,
245
         drug:{},
251
         drug:{},
252
+        houseList:[],
246
       }
253
       }
247
     },
254
     },
248
     methods:{
255
     methods:{
249
        getlist(){
256
        getlist(){
250
-         console.log("2332233232",this.$route.query.drug_id)
251
            var params = {
257
            var params = {
252
              drug_id:this.$route.query.drug_id,
258
              drug_id:this.$route.query.drug_id,
253
              start_time:this.start_time,
259
              start_time:this.start_time,
256
              limit:this.limit,
262
              limit:this.limit,
257
              stock_type:this.stock_type,  
263
              stock_type:this.stock_type,  
258
            }
264
            }
259
-          console.log("params23322323232332",params)
260
          getDrugStockFlow(params).then(response=>{
265
          getDrugStockFlow(params).then(response=>{
261
            if(response.data.state == 1){
266
            if(response.data.state == 1){
262
             var list = response.data.data.list
267
             var list = response.data.data.list
263
-            console.log("库存数量",list)
268
+          
264
             for(let i=0;i<list.length;i++){
269
             for(let i=0;i<list.length;i++){
265
                list[i].drug_way = 4
270
                list[i].drug_way = 4
266
                this.tableList.push(list[i])
271
                this.tableList.push(list[i])
286
          getOutDrugStockFlow(params).then(response=>{
291
          getOutDrugStockFlow(params).then(response=>{
287
             if(response.data.state == 1){
292
             if(response.data.state == 1){
288
                var outList = response.data.data.outList
293
                var outList = response.data.data.outList
289
-               console.log("outlist",outList)
294
+              
290
 
295
 
291
               for(let i=0;i<outList.length;i++){
296
               for(let i=0;i<outList.length;i++){
292
                
297
                
294
                   outList[i].drug_way = 2
299
                   outList[i].drug_way = 2
295
                 }
300
                 }
296
                 if(outList[i].is_sys == 0){
301
                 if(outList[i].is_sys == 0){
297
-                  console.log("进来22222")
302
+                 
298
                   outList[i].drug_way = 1
303
                   outList[i].drug_way = 1
299
                 }
304
                 }
300
                 this.tableList.push(outList[i])
305
                 this.tableList.push(outList[i])
301
               }
306
               }
302
               this.total = response.data.data.total
307
               this.total = response.data.data.total
303
-              console.log("出库列表数据",this.tableList)
308
+            
304
             }
309
             }
305
          })
310
          })
306
        },
311
        },
360
       getDrugCountList(params).then(response=>{
365
       getDrugCountList(params).then(response=>{
361
           if(response.data.state == 1){
366
           if(response.data.state == 1){
362
             var countlist =  response.data.data.countList
367
             var countlist =  response.data.data.countList
363
-            // console.log("入库数据",countlist)
368
+           
364
             this.countList = countlist
369
             this.countList = countlist
365
             var outcountlist = response.data.data.outCountList
370
             var outcountlist = response.data.data.outCountList
366
-            // console.log("出库数据",outcountlist)
371
+         
367
             this.outCountList = outcountlist
372
             this.outCountList = outcountlist
368
             var aucountlist = response.data.data.auCountList
373
             var aucountlist = response.data.data.auCountList
369
-            // console.log("自动数据",aucountlist)
374
+            
370
             this.autoCountList = aucountlist
375
             this.autoCountList = aucountlist
371
              var minCount = response.data.data.minCount
376
              var minCount = response.data.data.minCount
372
-            // console.log("minCount",minCount)
377
+           
373
             this.minCount = minCount
378
             this.minCount = minCount
374
             var info = response.data.data.info
379
             var info = response.data.data.info
375
             for(let i=0;i<info.length;i++){
380
             for(let i=0;i<info.length;i++){
377
                  info[i].count = info[i].count * info[i].min_number
382
                  info[i].count = info[i].count * info[i].min_number
378
               }
383
               }
379
             }
384
             }
380
-            // console.log("info2222222",info)
385
+           
381
             this.drugOutList = info
386
             this.drugOutList = info
382
           }
387
           }
383
         })
388
         })
469
        if((count%min_number)!=0){
474
        if((count%min_number)!=0){
470
          str_min = count%min_number + min_unit
475
          str_min = count%min_number + min_unit
471
        }
476
        }
472
-       console.log("str2323222",str)
473
-       console.log("str22333333",str_min)
474
        return str+str_min
477
        return str+str_min
475
      },
478
      },
476
 
479
 
486
        getDrugFlow(params).then(response=>{
489
        getDrugFlow(params).then(response=>{
487
           if(response.data.state ==1){
490
           if(response.data.state ==1){
488
             var list = response.data.data.list
491
             var list = response.data.data.list
489
-            console.log("list232323232",list)
492
+           
490
             this.tableList = list
493
             this.tableList = list
491
             var total = response.data.data.total
494
             var total = response.data.data.total
492
-            console.log("total23232",total)
495
+           
493
             this.total =total
496
             this.total =total
494
             this.manufacturerList = response.data.data.manufacturerList
497
             this.manufacturerList = response.data.data.manufacturerList
495
             this.dealerList = response.data.data.dealerList
498
             this.dealerList = response.data.data.dealerList
496
             var drug = response.data.data.drug
499
             var drug = response.data.data.drug
497
-            console.log("drug233223232323223",drug)
500
+           
498
             this.drug = drug
501
             this.drug = drug
502
+
503
+            this.houseList = response.data.data.houseList
499
           }
504
           }
500
        })
505
        })
501
      },
506
      },
527
          min_price = this.drug.min_price
532
          min_price = this.drug.min_price
528
        }
533
        }
529
        return min_price
534
        return min_price
530
-     }
535
+     },
536
+     getHouseName(id){
537
+      var storehouse_name = ""
538
+      for(let i=0;i<this.houseList.length;i++){
539
+        if(id == this.houseList[i].id){
540
+          storehouse_name = this.houseList[i].storehouse_name
541
+        }
542
+      }
543
+      return storehouse_name
544
+     },
531
     }
545
     }
532
   }
546
   }
533
 </script>
547
 </script>

+ 70 - 20
src/xt_pages/stock/drugs/drugStockInOrder.vue 查看文件

15
 
15
 
16
     <div class="app-container">
16
     <div class="app-container">
17
       <div class="cell clearfix">
17
       <div class="cell clearfix">
18
+       <label class="title"><span class="name">仓库</span> :</label>
19
+        <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeStoreHouse">
20
+            <el-option
21
+              v-for="(option, index) in houseList"
22
+              :key="index"
23
+              :label="option.storehouse_name"
24
+              :value="option.id">
25
+            </el-option>
26
+        </el-select> 
18
         <el-input
27
         <el-input
19
           size="small"
28
           size="small"
20
-          style="width: 400px;"
29
+          style="width: 200px;"
21
           v-model.trim="searchKey"
30
           v-model.trim="searchKey"
22
           class="filter-item"
31
           class="filter-item"
23
           placeholder="单据编码/制单人/药品名称"
32
           placeholder="单据编码/制单人/药品名称"
31
           >搜索</el-button
40
           >搜索</el-button
32
         >
41
         >
33
         <div style="margin-left:10px;">
42
         <div style="margin-left:10px;">
43
+
34
           <label class="title"><span class="name">入库时间</span> : </label>
44
           <label class="title"><span class="name">入库时间</span> : </label>
35
           <el-date-picker
45
           <el-date-picker
36
             size="small"
46
             size="small"
107
           </template>
117
           </template>
108
         </el-table-column>
118
         </el-table-column>
109
 
119
 
120
+        <el-table-column label="仓库名称" align="center">
121
+          <template slot-scope="scope">
122
+            {{getHouseName(scope.row.storehouse_id)}}
123
+          </template>
124
+        </el-table-column>
125
+
110
         <el-table-column label="制单人" align="center">
126
         <el-table-column label="制单人" align="center">
111
           <template slot-scope="scope">
127
           <template slot-scope="scope">
112
             {{ getXuserName(scope.row.creater) }}
128
             {{ getXuserName(scope.row.creater) }}
113
           </template>
129
           </template>
114
         </el-table-column>
130
         </el-table-column>
115
 
131
 
132
+       <el-table-column label="入库方式" align="center">
133
+          <template slot-scope="scope">
134
+           <span v-if="scope.row.is_sys == 13">调拨入库</span>
135
+           <span v-else>手动入库</span>
136
+          </template>
137
+        </el-table-column>
138
+
116
         <el-table-column label="操作" align="center" width="240">
139
         <el-table-column label="操作" align="center" width="240">
117
           <template slot-scope="scope">
140
           <template slot-scope="scope">
118
 
141
 
200
             {{scope.row.batch_number}}
223
             {{scope.row.batch_number}}
201
           </template>
224
           </template>
202
         </el-table-column>
225
         </el-table-column>
226
+        <el-table-column label="仓库名称" align="center">
227
+          <template slot-scope="scope">
228
+            {{getHouseName(scope.row.storehouse_id)}}
229
+          </template>
230
+        </el-table-column>
203
         <el-table-column label="入库数量" align="center">
231
         <el-table-column label="入库数量" align="center">
204
           <template slot-scope="scope">
232
           <template slot-scope="scope">
205
             {{scope.row.warehousing_count}}{{scope.row.max_unit}}
233
             {{scope.row.warehousing_count}}{{scope.row.max_unit}}
437
       order_id:"",
465
       order_id:"",
438
       dealerList:[],
466
       dealerList:[],
439
       exportList:[],
467
       exportList:[],
468
+      houseList:[],
469
+      storehouse_id:0,
440
     };
470
     };
441
   },
471
   },
442
   methods: {
472
   methods: {
447
         start_time: this.start_time,
477
         start_time: this.start_time,
448
         end_time: this.end_time,
478
         end_time: this.end_time,
449
         type: this.type,
479
         type: this.type,
450
-        keywords: this.searchKey
480
+        keywords: this.searchKey,
481
+        storehouse_id:this.storehouse_id,
451
       };
482
       };
452
-      console.log("parasm2222222",Params)
453
       this.Warehouse.warehouseDate = [];
483
       this.Warehouse.warehouseDate = [];
454
       getDrugWarehouseList(Params).then(response => {
484
       getDrugWarehouseList(Params).then(response => {
455
         if (response.data.state == 0) {
485
         if (response.data.state == 0) {
462
           for (let i = 0; i < response.data.data.list.length; i++) {
492
           for (let i = 0; i < response.data.data.list.length; i++) {
463
             this.Warehouse.warehouseDate.push(response.data.data.list[i]);
493
             this.Warehouse.warehouseDate.push(response.data.data.list[i]);
464
           }
494
           }
465
-          
466
         }
495
         }
467
       });
496
       });
468
     },
497
     },
474
         end_time: this.end_time,
503
         end_time: this.end_time,
475
         type: this.type,
504
         type: this.type,
476
         keywords:this.searchKey,
505
         keywords:this.searchKey,
506
+        storehouse_id:this.storehouse_id,
477
       };
507
       };
478
       this.Warehouse.warehouseDate = [];
508
       this.Warehouse.warehouseDate = [];
479
       getDrugWarehouseList(Params).then(response => {
509
       getDrugWarehouseList(Params).then(response => {
487
           for (let i = 0; i < response.data.data.list.length; i++) {
517
           for (let i = 0; i < response.data.data.list.length; i++) {
488
             this.Warehouse.warehouseDate.push(response.data.data.list[i]);
518
             this.Warehouse.warehouseDate.push(response.data.data.list[i]);
489
           }
519
           }
490
-          // console.log("列表999988888",this.warehouse.warehouseDate)
520
+          var obj = {id:0,storehouse_name:"全部"}
521
+          this.houseList = []
522
+          this.houseList.push(obj)
523
+          for(let i=0;i<response.data.data.houseList.length;i++){
524
+             this.houseList.push(response.data.data.houseList[i])
525
+          }
491
         }
526
         }
492
       });
527
       });
493
     },
528
     },
549
     },
584
     },
550
     fetchAllAdminUsers() {
585
     fetchAllAdminUsers() {
551
       fetchAllAdminUsers().then(response => {
586
       fetchAllAdminUsers().then(response => {
552
-        console.log(response);
587
+       
553
         if (response.data.state == 1) {
588
         if (response.data.state == 1) {
554
           this.adminUserOptions = response.data.data.users;
589
           this.adminUserOptions = response.data.data.users;
555
-          console.log("制单人2222222",this.adminUserOptions)
590
+         
556
           var alen = this.adminUserOptions.length;
591
           var alen = this.adminUserOptions.length;
557
           for (let index = 0; index < alen; index++) {
592
           for (let index = 0; index < alen; index++) {
558
             if (this.adminUserOptions[index].user_type == 2) {
593
             if (this.adminUserOptions[index].user_type == 2) {
563
       });
598
       });
564
     },
599
     },
565
     clicks: function() {
600
     clicks: function() {
566
-      console.log(this.WarehouseInfo.warehouseInfoDate);
567
     },
601
     },
568
     handleWarehouse: function() {
602
     handleWarehouse: function() {
569
       this.$router.push({ path: "/drugstock/in/add", query: { type: this.type } });
603
       this.$router.push({ path: "/drugstock/in/add", query: { type: this.type } });
619
     handleEdit:function(index,row){
653
     handleEdit:function(index,row){
620
        this.$router.push({
654
        this.$router.push({
621
          name:"drugStockInOrderEdit",
655
          name:"drugStockInOrderEdit",
622
-         query:{id:row.id,type:this.type,supply_warehouse_id:row.supply_warehouse_id}
656
+         query:{id:row.id,type:this.type,supply_warehouse_id:row.supply_warehouse_id,is_sys:row.is_sys}
623
        })
657
        })
624
     },
658
     },
625
     handleSearch(id){
659
     handleSearch(id){
631
       const params = {
665
       const params = {
632
         id: order_id
666
         id: order_id
633
       };
667
       };
634
-      console.log("parasm222222222",params)
668
+
635
       this.WarehouseInfo.warehouseInfoDate = []
669
       this.WarehouseInfo.warehouseInfoDate = []
636
       getDrugWarehouseInfoList(params).then(response => {
670
       getDrugWarehouseInfoList(params).then(response => {
637
         if (response.data.state == 0) {
671
         if (response.data.state == 0) {
638
           this.$message.error(response.data.msg);
672
           this.$message.error(response.data.msg);
639
           return false;
673
           return false;
640
         } else {
674
         } else {
641
-          console.log("hhhhhhhhhh",response.data.data.info)
675
+         
642
           for (let i = 0; i < response.data.data.info.length; i++) {
676
           for (let i = 0; i < response.data.data.info.length; i++) {
643
             this.showOne = true
677
             this.showOne = true
644
             this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
678
             this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
645
-            console.log("列表详情",this.WarehouseInfo.warehouseInfoDate)
679
+           
646
           }
680
           }
647
           this.WarehouseInfo.warehouse = response.data.data.warehousing;
681
           this.WarehouseInfo.warehouse = response.data.data.warehousing;
648
           this.getAllDrugList()
682
           this.getAllDrugList()
650
       });
684
       });
651
     },
685
     },
652
     handleDelete: function(index, row) {
686
     handleDelete: function(index, row) {
653
-      console.log("rowe23323223",row)
687
+      if(row.is_sys ==13){
688
+        this.$message.error("调拨入库数据不能删除!")
689
+        return false
690
+      }
654
       if(row.supply_warehouse_id >0 ){
691
       if(row.supply_warehouse_id >0 ){
655
         this.$message.error("自动入库数据不能删除!")
692
         this.$message.error("自动入库数据不能删除!")
656
         return false
693
         return false
717
       const ids = [];
754
       const ids = [];
718
       const idOne = []
755
       const idOne = []
719
       for (let i = 0; i < this.selectedTableData.length; i++) {
756
       for (let i = 0; i < this.selectedTableData.length; i++) {
757
+        if(this.selectedTableData[i].is_sys== 13){
758
+          this.$message.error("调拨入库数据不能删除!")
759
+          return false
760
+        }
720
         ids.push(this.selectedTableData[i].id);
761
         ids.push(this.selectedTableData[i].id);
721
         idOne.push(this.selectedTableData[i].supply_warehouse_id)
762
         idOne.push(this.selectedTableData[i].supply_warehouse_id)
722
       }
763
       }
723
-      console.log("idson233223233223",idOne)
764
+     
724
       for(let i=0;i<idOne.length;i++){
765
       for(let i=0;i<idOne.length;i++){
725
         if(idOne[i] >0 ){
766
         if(idOne[i] >0 ){
726
            this.$message.error("自动入库数据不能删除!")
767
            this.$message.error("自动入库数据不能删除!")
830
       exportDrugList(params).then(response=>{
871
       exportDrugList(params).then(response=>{
831
          if(response.data.state == 1){
872
          if(response.data.state == 1){
832
           var list =  response.data.data.list
873
           var list =  response.data.data.list
833
-          console.log("list23232323",list)
874
+          
834
           for(let i=0;i<list.length;i++){
875
           for(let i=0;i<list.length;i++){
835
             list[i].product_date = this.getTime(list[i].product_date)
876
             list[i].product_date = this.getTime(list[i].product_date)
836
             list[i].expiry_date = this.getTime(list[i].expiry_date)
877
             list[i].expiry_date = this.getTime(list[i].expiry_date)
839
           var manufacturerList = response.data.data.manufacturerList
880
           var manufacturerList = response.data.data.manufacturerList
840
           this.manufacturerList = manufacturerList
881
           this.manufacturerList = manufacturerList
841
           var dealerList = response.data.data.dealerList
882
           var dealerList = response.data.data.dealerList
842
-          console.log("经销是,",dealerList)
883
+        
843
           this.dealerList = dealerList
884
           this.dealerList = dealerList
844
          }
885
          }
845
       })
886
       })
849
       if(this.order_id == ""){
890
       if(this.order_id == ""){
850
         this.$message.error("请勾选入库单")
891
         this.$message.error("请勾选入库单")
851
       }
892
       }
852
-      console.log("hhhh2323",this.exportList)
853
       for(let i=0;i<this.exportList.length;i++){
893
       for(let i=0;i<this.exportList.length;i++){
854
         this.exportList[i].index = i+1
894
         this.exportList[i].index = i+1
855
         this.exportList[i].unit = this.exportList[i].dose + this.exportList[i].dose_unit + "*" + this.exportList[i].min_number + this.exportList[i].min_unit + "/"+this.exportList[i].max_unit
895
         this.exportList[i].unit = this.exportList[i].dose + this.exportList[i].dose_unit + "*" + this.exportList[i].min_number + this.exportList[i].min_unit + "/"+this.exportList[i].max_unit
875
       }
915
       }
876
       
916
       
877
       import('@/vendor/Export2Excel').then(excel => {
917
       import('@/vendor/Export2Excel').then(excel => {
878
-        console.log("232323",this.drugTypeList)
879
-        console.log("hhh23",this.exportList)
880
          for(let i=0;i<this.exportList.length;i++){
918
          for(let i=0;i<this.exportList.length;i++){
881
            for(let j=0;j<this.drugTypeList.length;j++){
919
            for(let j=0;j<this.drugTypeList.length;j++){
882
              if(this.exportList[i].drug_type == this.drugTypeList[j].id){
920
              if(this.exportList[i].drug_type == this.drugTypeList[j].id){
889
         const filterVal = ['index','drug_name', 'drug_type','unit','batch_number','warehousing_count','price','total_price','manufacturer','product_date','expiry_date','dealer','number','remark']
927
         const filterVal = ['index','drug_name', 'drug_type','unit','batch_number','warehousing_count','price','total_price','manufacturer','product_date','expiry_date','dealer','number','remark']
890
          
928
          
891
      
929
      
892
-        console.log("table",this.exportList)
930
+
893
         
931
         
894
         const data = this.formatJson(filterVal, this.exportList)
932
         const data = this.formatJson(filterVal, this.exportList)
895
         excel.export_json_to_excel({
933
         excel.export_json_to_excel({
903
    formatJson(filterVal, jsonData) {
941
    formatJson(filterVal, jsonData) {
904
     return jsonData.map(v => filterVal.map(j => v[j]));
942
     return jsonData.map(v => filterVal.map(j => v[j]));
905
    },
943
    },
944
+  getHouseName(id){
945
+    var storehouse_name = ""
946
+    for(let i=0;i<this.houseList.length;i++){
947
+        if(id == this.houseList[i].id){
948
+          storehouse_name = this.houseList[i].storehouse_name
949
+        }
950
+    }
951
+    return storehouse_name
952
+  },
953
+  changeStoreHouse(){
954
+    this.GetWarehouse()
955
+  }
906
   }
956
   }
907
 };
957
 };
908
 </script>
958
 </script>

+ 22 - 7
src/xt_pages/stock/drugs/drugStockInOrderAdd.vue 查看文件

23
 
23
 
24
 
24
 
25
       <div class="cell clearfix">
25
       <div class="cell clearfix">
26
+        <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
27
+        <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px">
28
+            <el-option
29
+              v-for="(option, index) in list"
30
+              :key="index"
31
+              :label="option.storehouse_name"
32
+              :value="option.id">
33
+            </el-option>
34
+          </el-select>
26
         <label class="title"><span class="name">入库时间</span> : </label>
35
         <label class="title"><span class="name">入库时间</span> : </label>
27
         <el-date-picker size="small" v-model="warehousing_time" prefix-icon="el-icon-date" :editable="false"
36
         <el-date-picker size="small" v-model="warehousing_time" prefix-icon="el-icon-date" :editable="false"
28
                         style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
37
                         style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
452
         totalPrice:0,
461
         totalPrice:0,
453
         unitList:[],
462
         unitList:[],
454
         loading:false,
463
         loading:false,
464
+        list:[],
465
+        storehouse_id:"",
455
       }
466
       }
456
     },
467
     },
457
     methods: {
468
     methods: {
527
           } else {
538
           } else {
528
             this.manufacturer = response.data.data.manufacturer;
539
             this.manufacturer = response.data.data.manufacturer;
529
             this.dealer = response.data.data.dealer;
540
             this.dealer = response.data.data.dealer;
530
-            console.log("2222333333",response.data.data.drugs)
541
+            
531
             for(let i = 0; i<  response.data.data.drugs.length;i++){
542
             for(let i = 0; i<  response.data.data.drugs.length;i++){
532
               this.goodType.push(response.data.data.drugs[i])
543
               this.goodType.push(response.data.data.drugs[i])
533
               if(response.data.data.drugs[i].drug_specs != null) {
544
               if(response.data.data.drugs[i].drug_specs != null) {
541
 
552
 
542
             this.form.manufacturer = 0
553
             this.form.manufacturer = 0
543
             this.form.dealer = 0
554
             this.form.dealer = 0
555
+            this.list = response.data.data.list
556
+            this.storehouse_id = response.data.data.configlist.drug_storehouse_info
544
           }
557
           }
545
           loading.close()
558
           loading.close()
546
 
559
 
631
           manufacturer_id: this.form.manufacturer,
644
           manufacturer_id: this.form.manufacturer,
632
           dealer_id: this.form.dealer
645
           dealer_id: this.form.dealer
633
         }
646
         }
634
-        console.log("2222",this.form.dealer)
647
+      
635
         GetAllDrugInfoByID(params).then(response => {
648
         GetAllDrugInfoByID(params).then(response => {
636
           
649
           
637
             if (response.data.state == 0) {
650
             if (response.data.state == 0) {
708
           if (valid) {
721
           if (valid) {
709
             this.loading = true
722
             this.loading = true
710
             const array = this.recordInfo.recordData
723
             const array = this.recordInfo.recordData
711
-          
724
+            if(this.storehouse_id == 0){
725
+             this.$message.error("仓库不能为空!")
726
+             return false
727
+            }
712
             for (let i = 0; i < array.length; i++) {
728
             for (let i = 0; i < array.length; i++) {
713
 
729
 
714
               if (array[i].drug_id == 0) {
730
               if (array[i].drug_id == 0) {
745
             const params = {
761
             const params = {
746
               'stockIn': this.recordInfo.recordData
762
               'stockIn': this.recordInfo.recordData
747
             }
763
             }
748
-            console.log("params2222222",params)
749
            
764
            
750
-            postDrugWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type).then(response => {
765
+            postDrugWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type,this.storehouse_id).then(response => {
751
               if (response.data.state == 0) {
766
               if (response.data.state == 0) {
752
                 this.loading = false
767
                 this.loading = false
753
                 this.$message.error(response.data.msg)
768
                 this.$message.error(response.data.msg)
814
             searchArray = response.data.data.list;
829
             searchArray = response.data.data.list;
815
             
830
             
816
              var list = response.data.data.list
831
              var list = response.data.data.list
817
-             console.log("猎豹22222222222",list)
832
+            
818
 
833
 
819
              this.drugList = list
834
              this.drugList = list
820
              var manufacturerList = response.data.data.manufacturerList
835
              var manufacturerList = response.data.data.manufacturerList
872
             
887
             
873
            }
888
            }
874
         }
889
         }
875
-        console.log("333333",this.recordInfo.recordData)
890
+       
876
       }
891
       }
877
      
892
      
878
     }
893
     }

+ 33 - 18
src/xt_pages/stock/drugs/drugStockInOrderEdit.vue 查看文件

36
       </drugs-stock-dialog>
36
       </drugs-stock-dialog>
37
 
37
 
38
       <div class="cell clearfix">
38
       <div class="cell clearfix">
39
+        <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
40
+        <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" :disabled="true">
41
+            <el-option
42
+              v-for="(option, index) in list"
43
+              :key="index"
44
+              :label="option.storehouse_name"
45
+              :value="option.id">
46
+            </el-option>
47
+        </el-select>
39
         <label class="title"><span class="name">入库时间</span> : </label>
48
         <label class="title"><span class="name">入库时间</span> : </label>
40
         <el-date-picker
49
         <el-date-picker
41
           size="small"
50
           size="small"
452
       drug_show:false,
461
       drug_show:false,
453
       loading:false,
462
       loading:false,
454
       disabled:false,
463
       disabled:false,
464
+      storehouse_id:"",
465
+      list:[],
455
     };
466
     };
456
   },
467
   },
457
   methods: {
468
   methods: {
491
           }
502
           }
492
         }
503
         }
493
       }
504
       }
494
-
495
-      // console.log( this.recordInfo.recordData)
496
-
497
       this.currentIndex = -1;
505
       this.currentIndex = -1;
498
     },
506
     },
499
     cancle: function() {
507
     cancle: function() {
551
       return name;
559
       return name;
552
     },
560
     },
553
     handleEdit: function(index, row) {
561
     handleEdit: function(index, row) {
554
-      console.log("row23323223",row)
562
+      if(parseInt(this.$route.query.is_sys)==13){
563
+        this.$message.error("调拨入库数据不能新增!")
564
+        return false
565
+      }
555
       if(row.supply_warehouse_id > 0){
566
       if(row.supply_warehouse_id > 0){
556
         this.$message.error("自动入库数据不能新增!")
567
         this.$message.error("自动入库数据不能新增!")
557
         return false
568
         return false
573
       this.recordInfo.recordData.push(tempObj);
584
       this.recordInfo.recordData.push(tempObj);
574
     },
585
     },
575
     handleDelete: function(index, row) {
586
     handleDelete: function(index, row) {
587
+      if(parseInt(this.$route.query.is_sys)==13){
588
+        this.$message.error("调拨入库数据不能删除!")
589
+        return false
590
+      }
576
       if(row.supply_warehouse_id > 0){
591
       if(row.supply_warehouse_id > 0){
577
         this.$message.error("自动入库数据不能删除!")
592
         this.$message.error("自动入库数据不能删除!")
578
         return false
593
         return false
587
           confirmButtonText: "确定",
602
           confirmButtonText: "确定",
588
           cancelButtonText: "取消",
603
           cancelButtonText: "取消",
589
           type: "warning"
604
           type: "warning"
590
-        })
591
-          .then(() => {
605
+        }).then(() => {
592
             DeleteDrugWarehouseInfoItem(params).then(response => {
606
             DeleteDrugWarehouseInfoItem(params).then(response => {
593
               if (response.data.state == 0) {
607
               if (response.data.state == 0) {
594
                 this.$message.error(response.data.msg);
608
                 this.$message.error(response.data.msg);
673
         if (valid) {
687
         if (valid) {
674
           this.loading = true
688
           this.loading = true
675
           const array = this.recordInfo.recordData;
689
           const array = this.recordInfo.recordData;
676
-        
690
+          if(this.storehouse_id == 0){
691
+            this.$message.error("仓库不能为空!")
692
+            return false
693
+          }
677
           for (let i = 0; i < array.length; i++) {
694
           for (let i = 0; i < array.length; i++) {
678
             if (array[i].drug_id == 0) {
695
             if (array[i].drug_id == 0) {
679
               this.$message.error("药品名称或者药品规格名称不能为空");
696
               this.$message.error("药品名称或者药品规格名称不能为空");
710
           const params = {
727
           const params = {
711
             stockIn: this.recordInfo.recordData
728
             stockIn: this.recordInfo.recordData
712
           };
729
           };
713
-          console.log("params22222222222",params)
714
-        
715
           EditDrugWarehouse(
730
           EditDrugWarehouse(
716
             params,
731
             params,
717
             this.warehousing_time,
732
             this.warehousing_time,
718
             this.$route.query.id,
733
             this.$route.query.id,
719
             this.$route.query.type,
734
             this.$route.query.type,
720
             this.form.manufacturer,
735
             this.form.manufacturer,
721
-            this.form.dealer
736
+            this.form.dealer,
737
+            this.storehouse_id,
722
           ).then(response => {
738
           ).then(response => {
723
             if (response.data.state == 0) {
739
             if (response.data.state == 0) {
724
               this.$message.error(response.data.msg);
740
               this.$message.error(response.data.msg);
753
           var dealerList  = response.data.data.dealerList
769
           var dealerList  = response.data.data.dealerList
754
         
770
         
755
           this.dealerList = dealerList
771
           this.dealerList = dealerList
756
-          console.log("详情32332323232323232232323323232323232",response.data.data.info)
772
+         
757
           for (let i = 0; i < response.data.data.info.length; i++) {
773
           for (let i = 0; i < response.data.data.info.length; i++) {
758
             response.data.data.info[i].product_date = this.getTime(
774
             response.data.data.info[i].product_date = this.getTime(
759
               response.data.data.info[i].product_date,
775
               response.data.data.info[i].product_date,
805
                }
821
                }
806
             }
822
             }
807
           }
823
           }
808
-          console.log("列表详情",this.recordInfo.recordData)
809
-
810
-
811
           this.warehouse = response.data.data.warehousing;
824
           this.warehouse = response.data.data.warehousing;
812
-          // this.form.manufacturer = this.warehouse.manufacturer;
813
-          // this.form.dealer = this.warehouse.dealer;
814
-
825
+          this.storehouse_id = response.data.data.warehousing.storehouse_id
826
+          this.list = response.data.data.list
815
           this.warehousing_time = this.getTime(
827
           this.warehousing_time = this.getTime(
816
             this.warehouse.warehousing_time,
828
             this.warehouse.warehousing_time,
817
             "{y}-{m}-{d}"
829
             "{y}-{m}-{d}"
867
         this.currentIndex = val
879
         this.currentIndex = val
868
       },
880
       },
869
       handleSelect(val){
881
       handleSelect(val){
870
-        console.log("val2222",val)
871
         for(let i=0;i<this.recordInfo.recordData.length;i++){
882
         for(let i=0;i<this.recordInfo.recordData.length;i++){
872
            if(i == this.currentIndex){
883
            if(i == this.currentIndex){
873
              this.recordInfo.recordData[i].drug_id = val.id
884
              this.recordInfo.recordData[i].drug_id = val.id
912
     if( parseInt(this.$route.query.supply_warehouse_id)>0){
923
     if( parseInt(this.$route.query.supply_warehouse_id)>0){
913
       this.disabled = true
924
       this.disabled = true
914
     }
925
     }
926
+    if(parseInt(this.$route.query.is_sys) == 13){
927
+      this.disabled = true
928
+    }
929
+
915
   }
930
   }
916
 };
931
 };
917
 </script>
932
 </script>

+ 70 - 25
src/xt_pages/stock/drugs/drugStockOutOrder.vue 查看文件

13
     </div>
13
     </div>
14
     <div class="app-container">
14
     <div class="app-container">
15
       <div class="cell clearfix">
15
       <div class="cell clearfix">
16
+        <label class="title"><span class="name">仓库</span> :</label>
17
+        <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeStoreHouse">
18
+            <el-option
19
+              v-for="(option, index) in houseList"
20
+              :key="index"
21
+              :label="option.storehouse_name"
22
+              :value="option.id">
23
+            </el-option>
24
+        </el-select>
16
         <el-input
25
         <el-input
17
           size="small"
26
           size="small"
18
-          style="width: 400px;"
27
+          style="width: 200px;"
19
           class="filter-item"
28
           class="filter-item"
20
           v-model.trim="searchKey"
29
           v-model.trim="searchKey"
21
           placeholder="单据编码/制单人/厂商"
30
           placeholder="单据编码/制单人/厂商"
103
           </template>
112
           </template>
104
         </el-table-column>
113
         </el-table-column>
105
 
114
 
115
+        <el-table-column label="仓库名称" align="center">
116
+          <template slot-scope="scope">
117
+            {{getHouseName(scope.row.storehouse_id)}}
118
+          </template>
119
+        </el-table-column>
120
+
106
         <el-table-column label="制单人" align="center">
121
         <el-table-column label="制单人" align="center">
107
           <template slot-scope="scope">
122
           <template slot-scope="scope">
108
             {{ getXuserName(scope.row.creater) }}
123
             {{ getXuserName(scope.row.creater) }}
115
           </template>
130
           </template>
116
           <template slot-scope="scope">
131
           <template slot-scope="scope">
117
             <span v-if="scope.row.is_sys == 1">{{"自动出库"}}</span>
132
             <span v-if="scope.row.is_sys == 1">{{"自动出库"}}</span>
118
-            <span v-if="scope.row.is_sys != 1">{{"手动出库"}}</span>
119
-
120
-          </template>
121
-        </el-table-column>
122
-
123
-        <!-- <el-table-column label="厂家" align="center">
124
-          <template slot-scope="scope">
125
-            {{scope.row.manufacturers ? scope.row.manufacturers.manufacturer_name:''}}
133
+            <span v-if="scope.row.is_sys == 0">{{"手动出库"}}</span>
134
+            <span v-if="scope.row.is_sys == 12">{{"调拨出库"}}</span>
126
           </template>
135
           </template>
127
         </el-table-column>
136
         </el-table-column>
128
 
137
 
129
-        <el-table-column label="经销商" align="center">
130
-          <template slot-scope="scope">
131
-            {{scope.row.dealers ? scope.row.dealers.dealer_name:''}}
132
-          </template>
133
-        </el-table-column> -->
134
-
135
 
138
 
136
         <el-table-column label="操作" align="center" width="240">
139
         <el-table-column label="操作" align="center" width="240">
137
           <template slot-scope="scope">
140
           <template slot-scope="scope">
216
               {{scope.row.medical_insurance_number}}
219
               {{scope.row.medical_insurance_number}}
217
             </template>
220
             </template>
218
           </el-table-column>
221
           </el-table-column>
222
+          <el-table-column label="仓库名称" align="center">
223
+          <template slot-scope="scope">
224
+            {{getHouseName(scope.row.storehouse_id)}}
225
+          </template>
226
+        </el-table-column>
227
+
219
           <el-table-column label="出库数量" align="center">
228
           <el-table-column label="出库数量" align="center">
220
             <template slot-scope="scope">
229
             <template slot-scope="scope">
221
               <!-- <span v-if="scope.row.is_sys ==  0">{{getTotalCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span> -->
230
               <!-- <span v-if="scope.row.is_sys ==  0">{{getTotalCount(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span> -->
222
               <span> {{getTotalCountOne(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span>
231
               <span> {{getTotalCountOne(scope.row.drug_id,scope.row.min_number,scope.row.max_unit,scope.row.min_unit)}}</span>
223
             </template>
232
             </template>
224
           </el-table-column>
233
           </el-table-column>
234
+          <el-table-column label="出库对象" align="center" v-if="is_sys == 0">
235
+            <template slot-scope="scope">
236
+              <span>{{getXuserName(scope.row.admin_user_id)}} </span>
237
+            </template>
238
+          </el-table-column>
239
+          <el-table-column label="出货单价" align="center">
225
           <el-table-column label="出库单价" align="center">
240
           <el-table-column label="出库单价" align="center">
226
             <template slot-scope="scope">
241
             <template slot-scope="scope">
227
               <span v-if="scope.row.price > 0"> {{scope.row.price}}</span>
242
               <span v-if="scope.row.price > 0"> {{scope.row.price}}</span>
488
       exportList:[],
503
       exportList:[],
489
       batchNumberList:[],
504
       batchNumberList:[],
490
       drugFlowList:[],
505
       drugFlowList:[],
506
+      houseList:[],
507
+      storehouse_id:0,
508
+      is_sys:0,
491
     };
509
     };
492
   },
510
   },
493
   methods: {
511
   methods: {
498
         start_time: this.start_time,
516
         start_time: this.start_time,
499
         end_time: this.end_time,
517
         end_time: this.end_time,
500
         type: this.type,
518
         type: this.type,
501
-        keywords: this.searchKey
519
+        keywords: this.searchKey,
520
+        storehouse_id:this.storehouse_id,
502
       };
521
       };
503
       this.warehouseOutDate = [];
522
       this.warehouseOutDate = [];
504
       getDrugWarehouseOutList(Params).then(response => {
523
       getDrugWarehouseOutList(Params).then(response => {
510
           for (let i = 0; i < response.data.data.list.length; i++) {
529
           for (let i = 0; i < response.data.data.list.length; i++) {
511
             this.warehouseOutDate.push(response.data.data.list[i]);
530
             this.warehouseOutDate.push(response.data.data.list[i]);
512
           }
531
           }
532
+          this.houseList = response.data.data.houseList
513
         }
533
         }
514
       });
534
       });
515
     },
535
     },
526
         start_time: this.start_time,
546
         start_time: this.start_time,
527
         end_time: this.end_time,
547
         end_time: this.end_time,
528
         type: this.type,
548
         type: this.type,
529
-        keywords: this.searchKey
549
+        keywords: this.searchKey,
550
+        storehouse_id:this.storehouse_id,
530
       };
551
       };
531
       this.warehouseOutDate = [];
552
       this.warehouseOutDate = [];
532
       getDrugWarehouseOutList(Params).then(response => {
553
       getDrugWarehouseOutList(Params).then(response => {
538
           for (let i = 0; i < response.data.data.list.length; i++) {
559
           for (let i = 0; i < response.data.data.list.length; i++) {
539
             this.warehouseOutDate.push(response.data.data.list[i]);
560
             this.warehouseOutDate.push(response.data.data.list[i]);
540
           }
561
           }
541
-
562
+          var obj = {id:0,storehouse_name:"全部"}
563
+          this.houseList = []
564
+          this.houseList.push(obj)
565
+          for(let i=0;i<response.data.data.houseList.length;i++){
566
+            this.houseList.push(response.data.data.houseList[i])
567
+          }
542
         }
568
         }
543
       });
569
       });
544
     },
570
     },
631
       this.$router.push({path:"/drug/out/drugstockoutorderedit?id="+row.id+"&type="+this.type+"&is_sys="+row.is_sys+"&supply_cancel_out_id="+row.supply_cancel_out_id})
657
       this.$router.push({path:"/drug/out/drugstockoutorderedit?id="+row.id+"&type="+this.type+"&is_sys="+row.is_sys+"&supply_cancel_out_id="+row.supply_cancel_out_id})
632
     },
658
     },
633
     handleSearch(val){
659
     handleSearch(val){
634
-
660
+       this.is_sys = val.is_sys
635
        this.getInitializtion()
661
        this.getInitializtion()
636
        this.getSinleOrderDetail(val.id,val.warehouse_out_time,val.is_sys)
662
        this.getSinleOrderDetail(val.id,val.warehouse_out_time,val.is_sys)
637
        this.list = []
663
        this.list = []
639
     },
665
     },
640
 
666
 
641
     handleDelete: function(index, row) {
667
     handleDelete: function(index, row) {
668
+      if(row.is_sys == 12){
669
+       this.$message.error("调拨出库数据不能删除!")
670
+       return
671
+      }
642
       if(row.supply_cancel_out_id >0){
672
       if(row.supply_cancel_out_id >0){
643
         this.$message.error("采购出库数据不能删除!")
673
         this.$message.error("采购出库数据不能删除!")
644
         return
674
         return
711
           this.$message.error("自动出库数据不能删除!")
741
           this.$message.error("自动出库数据不能删除!")
712
           return false
742
           return false
713
         }
743
         }
744
+        if(this.selectedTableData[i].is_sys == 12){
745
+          this.$message.error("调拨出库数据不能删除!")
746
+          return false
747
+        }
714
         if(this.selectedTableData[i].is_sys == 0){
748
         if(this.selectedTableData[i].is_sys == 0){
715
           ids.push(this.selectedTableData[i].id);
749
           ids.push(this.selectedTableData[i].id);
716
           idsOne.push(this.selectedTableData[i].supply_cancel_out_id)
750
           idsOne.push(this.selectedTableData[i].supply_cancel_out_id)
924
          id:id,
958
          id:id,
925
          start_time:start_time,
959
          start_time:start_time,
926
        }
960
        }
927
-      console.log("is_sys22222",is_sys)
928
      getSinleOrderDetail(params).then(response=>{
961
      getSinleOrderDetail(params).then(response=>{
929
         if(response.data.state == 1){
962
         if(response.data.state == 1){
930
           this.tableShow = true
963
           this.tableShow = true
934
          this.manufacturerList = response.data.data.manufacturerList
967
          this.manufacturerList = response.data.data.manufacturerList
935
          this.dealerList = response.data.data.dealerList
968
          this.dealerList = response.data.data.dealerList
936
          var drugFlowList = response.data.data.drugFlowList
969
          var drugFlowList = response.data.data.drugFlowList
970
+
937
          if (is_sys == 1){
971
          if (is_sys == 1){
938
            if(drugFlowList.length >0){
972
            if(drugFlowList.length >0){
939
             for(let i=0;i<drugFlowList.length;i++){
973
             for(let i=0;i<drugFlowList.length;i++){
946
 
980
 
947
             }
981
             }
948
            }
982
            }
949
-        
983
+
950
             this.drugFlowList = drugFlowList
984
             this.drugFlowList = drugFlowList
951
          }
985
          }
952
-         if(is_sys == 0){
986
+         if(is_sys == 0 || is_sys == 12){
953
             var flowlist = response.data.data.flowlist
987
             var flowlist = response.data.data.flowlist
954
             this.drugFlowList = []
988
             this.drugFlowList = []
955
             for(let i=0;i<flowlist.length;i++){
989
             for(let i=0;i<flowlist.length;i++){
972
               list[i].number = ""
1006
               list[i].number = ""
973
            }
1007
            }
974
          }
1008
          }
975
-         console.log("list233223323233223",list)
1009
+
976
          this.tableList = list
1010
          this.tableList = list
977
         }
1011
         }
978
      })
1012
      })
995
 
1029
 
996
           this.drugDialogVisible = true
1030
           this.drugDialogVisible = true
997
         }
1031
         }
998
-        if(val.is_sys == 0){
1032
+        if(val.is_sys == 0 || val.is_sys == 12){
999
 
1033
 
1000
           this.drugDialogVisibleTwo = true
1034
           this.drugDialogVisibleTwo = true
1001
         }
1035
         }
1094
          return str + min_str
1128
          return str + min_str
1095
       },
1129
       },
1096
       getTotalCountOne(id,min_number,max_unit,min_unit){
1130
       getTotalCountOne(id,min_number,max_unit,min_unit){
1097
-        console.log("hhhahdhhff",this.drugFlowList)
1098
         var arr = []
1131
         var arr = []
1099
         for(let i=0;i<this.drugFlowList.length;i++){
1132
         for(let i=0;i<this.drugFlowList.length;i++){
1100
           if(id == this.drugFlowList[i].drug_id){
1133
           if(id == this.drugFlowList[i].drug_id){
1237
 
1270
 
1238
         return  all_price
1271
         return  all_price
1239
       },
1272
       },
1273
+    getHouseName(id){
1274
+      var storehouse_name = ""
1275
+      for(let i=0;i<this.houseList.length;i++){
1276
+          if(id == this.houseList[i].id){
1277
+            storehouse_name = this.houseList[i].storehouse_name
1278
+          }
1279
+      }
1280
+      return storehouse_name
1281
+    },
1282
+    changeStoreHouse(){
1283
+      this.GetWarehouseOut()
1284
+    }
1240
   }
1285
   }
1241
 };
1286
 };
1242
 </script>
1287
 </script>

+ 51 - 9
src/xt_pages/stock/drugs/drugStockOutOrderAdd.vue 查看文件

27
     <div class="app-container">
27
     <div class="app-container">
28
   
28
   
29
       <div class="cell clearfix">
29
       <div class="cell clearfix">
30
+        <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
31
+        <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px">
32
+            <el-option
33
+              v-for="(option, index) in list"
34
+              :key="index"
35
+              :label="option.storehouse_name"
36
+              :value="option.id">
37
+            </el-option>
38
+          </el-select>
30
         <label class="title"><span class="name">出库时间</span> : </label>
39
         <label class="title"><span class="name">出库时间</span> : </label>
31
         <el-date-picker
40
         <el-date-picker
32
           size="small"
41
           size="small"
141
             </template>
150
             </template>
142
 
151
 
143
           </el-table-column>
152
           </el-table-column>
153
+
154
+          <el-table-column label="出库对象" width="140" align="center">
155
+            <template slot-scope="scope">
156
+               <el-select v-model="scope.row.admin_user_id" filterable placeholder="请选择厂商">
157
+                <el-option
158
+                  v-for="(option, index) in doctorList"
159
+                  :key="index"
160
+                  :label="option.user_name"
161
+                  :value="option.admin_user_id">
162
+                </el-option>
163
+               </el-select>
164
+            </template>
165
+          </el-table-column>
166
+
144
           <el-table-column width="120" align="center">
167
           <el-table-column width="120" align="center">
145
             <template slot="header" slot-scope="scope">
168
             <template slot="header" slot-scope="scope">
146
               <span>出货价<span style="color: red">*</span></span>
169
               <span>出货价<span style="color: red">*</span></span>
346
       unitList:[],
369
       unitList:[],
347
       numberList:[],
370
       numberList:[],
348
       listLoading: false,
371
       listLoading: false,
372
+      storehouse_id:"",
373
+      list:[],
374
+      doctorList:[],
349
     };
375
     };
350
   },
376
   },
351
   methods: {
377
   methods: {
382
 
408
 
383
           this.form.manufacturer = 0
409
           this.form.manufacturer = 0
384
           this.form.dealer = 0
410
           this.form.dealer = 0
411
+          this.storehouse_id = response.data.data.configlist.drug_storehouse_out
412
+          this.list = response.data.data.list
413
+          this.doctorList = response.data.data.doctorList
385
         }
414
         }
386
         loading.close()
415
         loading.close()
387
 
416
 
424
       tempObj["warehouse_info_id"] = 0
453
       tempObj["warehouse_info_id"] = 0
425
       tempObj["dealer"] = ""
454
       tempObj["dealer"] = ""
426
       tempObj['manufacturer'] = ''
455
       tempObj['manufacturer'] = ''
456
+      tempObj["admin_user_id"] =  this.$store.getters.xt_user.user.user_name
427
       this.recordInfo.recordData.push(tempObj);
457
       this.recordInfo.recordData.push(tempObj);
428
     },
458
     },
429
     handleDelete: function(index, row) {
459
     handleDelete: function(index, row) {
521
             }
551
             }
522
             total = total + array[i].price * array[i].return_count;
552
             total = total + array[i].price * array[i].return_count;
523
           }
553
           }
554
+          if(this.storehouse_id == 0){
555
+            this.$message.error("仓库不能为空!")
556
+            return false
557
+          }
524
           if (this.recordInfo.recordData.length <= 0) {
558
           if (this.recordInfo.recordData.length <= 0) {
525
             this.$message.success("请添加出库商品");
559
             this.$message.success("请添加出库商品");
526
             return;
560
             return;
548
                 this.recordInfo.recordData[i].batch_number = this.numberList[y].batch_number
582
                 this.recordInfo.recordData[i].batch_number = this.numberList[y].batch_number
549
                 this.recordInfo.recordData[i].warehouse_info_id = this.numberList[y].id
583
                 this.recordInfo.recordData[i].warehouse_info_id = this.numberList[y].id
550
               }
584
               }
551
-           
552
             }
585
             }
586
+           for(let s=0;s<this.doctorList.length;s++){
587
+            if(this.recordInfo.recordData[i].admin_user_id == this.doctorList[s].user_name){
588
+              this.recordInfo.recordData[i].admin_user_id = this.doctorList[s].admin_user_id
589
+            }
590
+
591
+            }
592
+
553
           }
593
           }
554
           const params = {
594
           const params = {
555
             stockOut: this.recordInfo.recordData
595
             stockOut: this.recordInfo.recordData
556
           };
596
           };
557
-          console.log("param23323232",params)
597
+       
558
          
598
          
559
           const loading = this.$loading({
599
           const loading = this.$loading({
560
             lock: true,
600
             lock: true,
567
             this.warehouse_out_time,
607
             this.warehouse_out_time,
568
             this.form.dealer,
608
             this.form.dealer,
569
             this.form.manufacturer,
609
             this.form.manufacturer,
570
-            this.type
610
+            this.type,
611
+            this.storehouse_id
571
           ).then(response => {
612
           ).then(response => {
572
             if (response.data.state == 0) {
613
             if (response.data.state == 0) {
573
               this.$message.error("库存不足");
614
               this.$message.error("库存不足");
623
           if (response.data.state == 1) {
664
           if (response.data.state == 1) {
624
             searchArray = response.data.data.list;
665
             searchArray = response.data.data.list;
625
              var list = response.data.data.list
666
              var list = response.data.data.list
626
-             console.log("list99999999",list)
667
+     
627
              this.drugList = list
668
              this.drugList = list
628
              var manufacturerList = response.data.data.manufacturerList
669
              var manufacturerList = response.data.data.manufacturerList
629
              this.manufacturerList = manufacturerList
670
              this.manufacturerList = manufacturerList
630
              var dealerList = response.data.data.dealerList
671
              var dealerList = response.data.data.dealerList
631
              this.dealerList = dealerList
672
              this.dealerList = dealerList
632
-             console.log("经销商",this.dealerList)
673
+           
633
              for(let i=0;i<this.drugList.length;i++){
674
              for(let i=0;i<this.drugList.length;i++){
634
                 for(let j=0;j<this.manufacturerList.length;j++){
675
                 for(let j=0;j<this.manufacturerList.length;j++){
635
                   if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
676
                   if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
659
             arr.push(this.recordInfo.recordData[i].drug_id)
700
             arr.push(this.recordInfo.recordData[i].drug_id)
660
          }
701
          }
661
          var str = arr.join(",")
702
          var str = arr.join(",")
662
-         console.log("str",str)
703
+       
663
          if(str.indexOf(val.id)!=-1){
704
          if(str.indexOf(val.id)!=-1){
664
             this.$message.error("该药品已存在列表中")
705
             this.$message.error("该药品已存在列表中")
665
             return
706
             return
706
         getDrugBatchNumber(params).then(response=>{
747
         getDrugBatchNumber(params).then(response=>{
707
            if(response.data.state == 1){
748
            if(response.data.state == 1){
708
              var list = response.data.data.list
749
              var list = response.data.data.list
709
-             console.log("list2222",list)
750
+            
710
              this.numberList = []
751
              this.numberList = []
711
              this.numberList = list
752
              this.numberList = list
712
            }
753
            }
713
         })
754
         })
714
       },
755
       },
715
       changeUnit(val){
756
       changeUnit(val){
716
-        console.log("val2323232322323",val,this.recordInfo.recordData)
757
+       
717
         this.getDrugBatchNumber(val.drug_id)
758
         this.getDrugBatchNumber(val.drug_id)
718
         for(let i=0;i<this.recordInfo.recordData.length;i++){
759
         for(let i=0;i<this.recordInfo.recordData.length;i++){
719
           if(this.recordInfo.recordData[i].drug_id == val.drug_id){
760
           if(this.recordInfo.recordData[i].drug_id == val.drug_id){
732
         }
773
         }
733
       },
774
       },
734
       changeBatchNumber(val){
775
       changeBatchNumber(val){
735
-        console.log("val",val)
776
+       
736
         this.getDrugBatchNumber(val.drug_id)
777
         this.getDrugBatchNumber(val.drug_id)
737
         for(let i=0;i<this.recordInfo.recordData.length;i++){
778
         for(let i=0;i<this.recordInfo.recordData.length;i++){
738
             if(this.currentIndex == i){
779
             if(this.currentIndex == i){
775
     tempObj["number"] = ""
816
     tempObj["number"] = ""
776
     tempObj["warehouse_info_id"] = 0
817
     tempObj["warehouse_info_id"] = 0
777
     tempObj["count"] = ""
818
     tempObj["count"] = ""
819
+    tempObj["admin_user_id"] =  this.$store.getters.xt_user.user.user_name
778
     this.recordInfo.recordData.push(tempObj);
820
     this.recordInfo.recordData.push(tempObj);
779
     this.GetConfigInfo();
821
     this.GetConfigInfo();
780
     this.propForm.goodUnit = this.$store.getters.good_unit;
822
     this.propForm.goodUnit = this.$store.getters.good_unit;

+ 3 - 1
src/xt_pages/stock/drugs/drugStockOutOrderDetail.vue 查看文件

144
           loading: false,
144
           loading: false,
145
           warehousingOutData: [],
145
           warehousingOutData: [],
146
           info: {}
146
           info: {}
147
-        }
147
+        },
148
+        doctorList:[],
148
       }
149
       }
149
     },
150
     },
150
     methods: {
151
     methods: {
168
               this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
169
               this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
169
             }
170
             }
170
             this.warehousingOutInfo.info = response.data.data.info
171
             this.warehousingOutInfo.info = response.data.data.info
172
+            this.doctorList = response.data.data.doctorList
171
             this.handleSpanTempArr()
173
             this.handleSpanTempArr()
172
           }
174
           }
173
         })
175
         })

+ 64 - 8
src/xt_pages/stock/drugs/drugStockOutOrderEdit.vue 查看文件

21
         v-on:dialog-cancle="cancle"
21
         v-on:dialog-cancle="cancle"
22
       >
22
       >
23
       </drugs-stock-dialog>
23
       </drugs-stock-dialog>
24
-
24
+        
25
+      <div class="cell clearfix">
26
+        <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
27
+        <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" :disabled="true">
28
+            <el-option
29
+              v-for="(option, index) in houstList"
30
+              :key="index"
31
+              :label="option.storehouse_name"
32
+              :value="option.id">
33
+            </el-option>
34
+          </el-select>
35
+        <label class="title"><span class="name">出库时间</span> : </label>
36
+        <el-date-picker
37
+          :disabled="drug_show"
38
+          size="small"
39
+          v-model="warehouse_out_time"
40
+          prefix-icon="el-icon-date"
41
+          :editable="false"
42
+          style="width: 200px;"
43
+          type="date"
44
+          placeholder="选择日期时间"
45
+          align="right"
46
+          format="yyyy-MM-dd"
47
+          value-format="yyyy-MM-dd"
48
+        ></el-date-picker>
49
+      </div>
25
 
50
 
26
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
51
       <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
27
         <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
52
         <el-table :data="recordInfo.recordData" :class="signAndWeighBoxPatients" style="width: 100%" border
133
 
158
 
134
             </template>
159
             </template>
135
           </el-table-column>
160
           </el-table-column>
161
+          <el-table-column label="出库对象" width="140" align="center">
162
+            <template slot-scope="scope">
163
+               <el-select v-model="scope.row.admin_user_id" filterable placeholder="请选择厂商"  :disabled="drug_show">
164
+                <el-option
165
+                  v-for="(option, index) in doctorList"
166
+                  :key="index"
167
+                  :label="option.user_name"
168
+                  :value="option.admin_user_id">
169
+                </el-option>
170
+               </el-select>
171
+            </template>
172
+          </el-table-column>
136
          <el-table-column width="120" align="center">
173
          <el-table-column width="120" align="center">
137
             <template slot="header" slot-scope="scope">
174
             <template slot="header" slot-scope="scope">
138
               <span>出货价<span style="color: red">*</span></span>
175
               <span>出货价<span style="color: red">*</span></span>
334
         drug_show:false,
371
         drug_show:false,
335
         unitList:[],
372
         unitList:[],
336
         unitShow:true,
373
         unitShow:true,
337
-        numberList:[]
374
+        numberList:[],
375
+        houstList:[],
376
+        storehouse_id:"",
338
       }
377
       }
339
     },
378
     },
340
     methods: {
379
     methods: {
429
         return name;
468
         return name;
430
       },
469
       },
431
        handleEdit: function(index, row) {
470
        handleEdit: function(index, row) {
471
+        if(parseInt(this.$route.query.is_sys) == 12){
472
+          this.$message.error("调拨出库数据不能新增!")
473
+          return
474
+        }
432
         if(row.supply_cancel_out_id >0){
475
         if(row.supply_cancel_out_id >0){
433
          this.$message.error("采购出库数据不能新增!")
476
          this.$message.error("采购出库数据不能新增!")
434
          return
477
          return
451
         tempObj['dealer'] = ""
494
         tempObj['dealer'] = ""
452
         tempObj['manufacturer'] = ""
495
         tempObj['manufacturer'] = ""
453
         tempObj['warehouse_info_id'] = 0
496
         tempObj['warehouse_info_id'] = 0
497
+        tempObj["admin_user_id"] =  this.$store.getters.xt_user.user.user_name
454
         this.recordInfo.recordData.push(tempObj)
498
         this.recordInfo.recordData.push(tempObj)
455
       }, handleDelete: function(index, row) {
499
       }, handleDelete: function(index, row) {
456
-        console.log("row323232232",row)
500
+        if(parseInt(this.$route.query.is_sys) == 12){
501
+          this.$message.error("调拨出库数据不能删除!")
502
+          return
503
+        }
457
         if(row.supply_cancel_out_id >0){
504
         if(row.supply_cancel_out_id >0){
458
          this.$message.error("采购出库数据不能删除!")
505
          this.$message.error("采购出库数据不能删除!")
459
          return
506
          return
591
                      this.recordInfo.recordData[i].warehouse_info_id =  this.numberList[y].id
638
                      this.recordInfo.recordData[i].warehouse_info_id =  this.numberList[y].id
592
                   }
639
                   }
593
                }
640
                }
641
+              
642
+               for(let s=0;s<this.doctorList.length;s++){
643
+                  if(this.recordInfo.recordData[i].admin_user_id == this.doctorList[s].user_name){
644
+                    this.recordInfo.recordData[i].admin_user_id = this.doctorList[s].admin_user_id
645
+                  }
594
 
646
 
647
+               }
595
             }
648
             }
596
             const loading = this.$loading({
649
             const loading = this.$loading({
597
               lock: true,
650
               lock: true,
602
             const params = {
655
             const params = {
603
               'stockOut': this.recordInfo.recordData
656
               'stockOut': this.recordInfo.recordData
604
             }
657
             }
605
-            console.log("param23322323233222323",params)
606
-
607
-            editDrugWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
658
+         
659
+            editDrugWarehouseoutInfo(params, this.warehouse_out_time, this.$route.query.id, this.$route.query.type, this.form.manufacturer, this.form.dealer,this.storehouse_id).then(response => {
608
               if (response.data.state == 0) {
660
               if (response.data.state == 0) {
609
                 this.$message.error(response.data.msg)
661
                 this.$message.error(response.data.msg)
610
                 loading.close()
662
                 loading.close()
692
               }
744
               }
693
 
745
 
694
             this.warehouseOut = response.data.data.info
746
             this.warehouseOut = response.data.data.info
747
+            this.storehouse_id = response.data.data.info.storehouse_id
695
             this.warehouse_out_time = this.getTime(this.warehouseOut.warehouse_out_time, '{y}-{m}-{d}')
748
             this.warehouse_out_time = this.getTime(this.warehouseOut.warehouse_out_time, '{y}-{m}-{d}')
696
-
697
-
749
+            this.houstList = response.data.data.houstList
750
+            this.doctorList = response.data.data.doctorList
698
           }
751
           }
699
 
752
 
700
           if (this.recordInfo.recordData.length == 0) {
753
           if (this.recordInfo.recordData.length == 0) {
818
       if(sys == 1){
871
       if(sys == 1){
819
         this.drug_show = true
872
         this.drug_show = true
820
       }
873
       }
874
+      if(sys == 12){
875
+        this.drug_show = true
876
+      }
821
       if(parseInt(this.$route.query.supply_cancel_out_id)>0){
877
       if(parseInt(this.$route.query.supply_cancel_out_id)>0){
822
         this.drug_show = true
878
         this.drug_show = true
823
       }
879
       }

+ 41 - 3
src/xt_pages/stock/drugs/inventory.vue 查看文件

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
     <div v-show="showSearch">
3
     <div v-show="showSearch">
4
+    <label class="title"><span class="name">仓库</span> :</label>
5
+      <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px">
6
+          <el-option
7
+            v-for="(option, index) in houseList"
8
+            :key="index"
9
+            :label="option.storehouse_name"
10
+            :value="option.id">
11
+          </el-option>
12
+      </el-select>   
4
      <el-autocomplete
13
      <el-autocomplete
5
         class="checkSearch"
14
         class="checkSearch"
6
         popper-class="my-autocomplete"
15
         popper-class="my-autocomplete"
62
                     {{scope.row.manufacturer_name}}
71
                     {{scope.row.manufacturer_name}}
63
                   </template> 
72
                   </template> 
64
               </el-table-column>
73
               </el-table-column>
74
+             <el-table-column prop="name" label="仓库名称" width="100"  align="center">
75
+                  <template slot-scope="scope">
76
+                    {{getHouseName(scope.row.storehouse_id)}}
77
+                  </template> 
78
+              </el-table-column>
65
               <el-table-column prop="name" label="盘点前数量" width="180"  align="center">
79
               <el-table-column prop="name" label="盘点前数量" width="180"  align="center">
66
                 <template slot-scope="scope">
80
                 <template slot-scope="scope">
67
                     <span><el-input style="width:50px" v-model="scope.row.stock_max_number" :disabled="true"></el-input>{{scope.row.max_unit}}</span> 
81
                     <span><el-input style="width:50px" v-model="scope.row.stock_max_number" :disabled="true"></el-input>{{scope.row.max_unit}}</span> 
96
               </el-table-column>
110
               </el-table-column>
97
           </el-table>
111
           </el-table>
98
       </el-collapse-item>
112
       </el-collapse-item>
113
+     <label class="title"><span class="name">仓库</span> :</label>
114
+      <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px">
115
+          <el-option
116
+            v-for="(option, index) in houseList"
117
+            :key="index"
118
+            :label="option.storehouse_name"
119
+            :value="option.id">
120
+          </el-option>
121
+      </el-select>   
99
       <el-autocomplete
122
       <el-autocomplete
100
           class="checkSearch"
123
           class="checkSearch"
101
           popper-class="my-autocomplete"
124
           popper-class="my-autocomplete"
166
                 proof_count:"",
189
                 proof_count:"",
167
                 min_count:"",
190
                 min_count:"",
168
                 min_unit:"",
191
                 min_unit:"",
192
+                storehouse_id:"",
169
             },
193
             },
170
             total: 0,
194
             total: 0,
171
             editdialogVisible:false,
195
             editdialogVisible:false,
201
             showTableOne:false,
225
             showTableOne:false,
202
             panShow:true,
226
             panShow:true,
203
             panOneShow:true,
227
             panOneShow:true,
228
+            houseList:[],
229
+            storehouse_id:"",
204
         }
230
         }
205
     },
231
     },
206
     methods:{
232
     methods:{
234
             }
260
             }
235
              var params = {
261
              var params = {
236
                 keyword:key,
262
                 keyword:key,
263
+                storehouse_id:this.storehouse_id,
237
              }
264
              }
238
             
265
             
239
             postSearchDrugWarehouseList(params).then(response => {
266
             postSearchDrugWarehouseList(params).then(response => {
279
             return
306
             return
280
           }
307
           }
281
            var params = {
308
            var params = {
282
-              id:val.drug_id
309
+              id:val.drug_id,
310
+              storehouse_id:this.storehouse_id,
283
             }
311
             }
284
            getDrugWarehouseInfoList(params).then(response=>{
312
            getDrugWarehouseInfoList(params).then(response=>{
285
              if(response.data.state == 1){
313
              if(response.data.state == 1){
566
               
594
               
567
               this.doctorList =  response.data.data.doctorList
595
               this.doctorList =  response.data.data.doctorList
568
               
596
               
597
+              this.houseList = response.data.data.houseList
569
 
598
 
599
+              this.storehouse_id = response.data.data.houseConfig.drug_storehouse_out
570
             }
600
             }
571
           })
601
           })
572
         },
602
         },
860
        var params = {
890
        var params = {
861
          tableData:arr
891
          tableData:arr
862
        }
892
        }
863
-      console.log("paramse32323232",params)
893
+     
864
       saveInentoryList(params).then(response=>{
894
       saveInentoryList(params).then(response=>{
865
         if(response.data.state == 1){
895
         if(response.data.state == 1){
866
            var inventory = response.data.data.inventory
896
            var inventory = response.data.data.inventory
870
           
900
           
871
         }
901
         }
872
       })
902
       })
903
+    },
904
+    getHouseName(id){
905
+      var storehouse_name = ""
906
+      for(let i=0;i<this.houseList.length;i++){
907
+        if(id == this.houseList[i].id){
908
+          storehouse_name = this.houseList[i].storehouse_name
909
+        }
910
+      }
911
+      return storehouse_name
873
     }
912
     }
874
     },
913
     },
875
     created(){
914
     created(){
876
       this.unitList =  this.getDataConfig('hemodialysis','units')
915
       this.unitList =  this.getDataConfig('hemodialysis','units')
877
-      console.log("单位",this.unitList)
878
       this.getlist()
916
       this.getlist()
879
     },
917
     },
880
     mounted() {
918
     mounted() {

+ 41 - 3
src/xt_pages/stock/drugs/inventoryDetails.vue 查看文件

2
     <div>
2
     <div>
3
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
3
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
4
             <div>
4
             <div>
5
+              <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changehouseList">
6
+                <el-option
7
+                  v-for="(option, index) in houseList"
8
+                  :key="index"
9
+                  :label="option.storehouse_name"
10
+                  :value="option.id">
11
+                </el-option>
12
+              </el-select>   
5
                 <el-input
13
                 <el-input
6
                 size="small"
14
                 size="small"
7
                 style="width: 200px;margin-left:10px;"
15
                 style="width: 200px;margin-left:10px;"
61
                    {{getTime(scope.row.expiry_date)}}
69
                    {{getTime(scope.row.expiry_date)}}
62
                 </template>  
70
                 </template>  
63
             </el-table-column>
71
             </el-table-column>
72
+
73
+           <el-table-column prop="name" label="仓库名称" width="200"  align="center">
74
+                <template slot-scope="scope">
75
+                   {{getHouseName(scope.row.storehouse_id)}}
76
+                </template>  
77
+            </el-table-column>
64
            
78
            
65
            <el-table-column prop="name" label="盘点前数量" width="100"  align="center">
79
            <el-table-column prop="name" label="盘点前数量" width="100"  align="center">
66
                 <template slot-scope="scope">
80
                 <template slot-scope="scope">
117
             total: 0,
131
             total: 0,
118
             limit:10,
132
             limit:10,
119
             page:1,
133
             page:1,
120
-            
134
+            storehouse_id:0,
121
         }
135
         }
122
     },
136
     },
123
     methods:{
137
     methods:{
140
               limit:this.limit,
154
               limit:this.limit,
141
               page:this.page,
155
               page:this.page,
142
               keyword:this.searchKey,
156
               keyword:this.searchKey,
157
+              storehouse_id:this.storehouse_id,
143
             }
158
             }
144
         
159
         
145
           getInventoryDetailList(params).then(response=>{
160
           getInventoryDetailList(params).then(response=>{
146
              if(response.data.state == 1){
161
              if(response.data.state == 1){
147
               this.total =  response.data.data.total
162
               this.total =  response.data.data.total
148
               this.tableData = response.data.data.list
163
               this.tableData = response.data.data.list
149
-              console.log("比阿哥",this.tableData)
164
+           
150
               this.doctorList = response.data.data.doctorList
165
               this.doctorList = response.data.data.doctorList
166
+              var obj = {id:0,storehouse_name:"全部"}
167
+              this.houseList= []
168
+              this.houseList.push(obj)
169
+              for(let i=0;i<response.data.data.houseList.length;i++){
170
+                this.houseList.push(response.data.data.houseList[i])
171
+              }
172
+
151
              }
173
              }
152
           })   
174
           })   
153
         },
175
         },
165
             return uParseTime(val, '{y}-{m}-{d}')
187
             return uParseTime(val, '{y}-{m}-{d}')
166
          }
188
          }
167
         },
189
         },
168
-
190
+       changehouseList(){
191
+         this.houseList = []
192
+         this.getlist()
193
+       },
194
+       getHouseName(id){
195
+         var storehouse_name = ""
196
+         for(let i=0;i<this.houseList.length;i++){
197
+           if(id == this.houseList[i].id){
198
+              storehouse_name = this.houseList[i].storehouse_name
199
+           }
200
+         }
201
+         if(storehouse_name == "全部"){
202
+           return ""
203
+         }else{
204
+           return storehouse_name
205
+         }
206
+       }
169
     },
207
     },
170
     created(){
208
     created(){
171
       this.getlist()
209
       this.getlist()

+ 234 - 35
src/xt_pages/stock/drugs/query.vue 查看文件

30
     </div>
30
     </div>
31
     <div class="app-container ">
31
     <div class="app-container ">
32
       <div class="cell clearfix">
32
       <div class="cell clearfix">
33
-         <el-select v-model="drug_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
33
+        <div>
34
+          <span>仓库名称:</span>
35
+          <el-select v-model="storehouse_id" style="width:200px;margin-right:10px;" placeholder="请选择"
36
+          filterable
37
+           @change="changeStorehouseName">
38
+            <el-option
39
+              v-for="item in storeList"
40
+              :key="item.id"
41
+              :label="item.storehouse_name"
42
+              :value="item.id">
43
+            </el-option>
44
+          </el-select>
45
+          <span>药品名称:</span>
46
+          <el-select v-model="drug_id" style="width:200px;margin-right:10px;" placeholder="请选择" 
47
+          filterable
48
+           @change="changeDrugName">
49
+            <el-option
50
+              v-for="item in medicalList"
51
+              :key="item.id"
52
+              :label="item.drug_name"
53
+              :value="item.id">
54
+            </el-option>
55
+          </el-select> 
56
+        </div>
57
+         <!-- <el-select v-model="drug_type" style="width:160px;margin-right:10px;" placeholder="请选择" @change="changeDrug">
34
             <el-option
58
             <el-option
35
               v-for="(item,index) in drugTypeList"
59
               v-for="(item,index) in drugTypeList"
36
               :key="index"
60
               :key="index"
37
               :label="item.name"
61
               :label="item.name"
38
               :value="item.id">
62
               :value="item.id">
39
             </el-option>
63
             </el-option>
40
-        </el-select>
41
-         <el-date-picker
64
+        </el-select> -->
65
+         <!-- <el-date-picker
42
             v-model="start_time"
66
             v-model="start_time"
43
             prefix-icon="el-icon-date"
67
             prefix-icon="el-icon-date"
44
             :editable="false"
68
             :editable="false"
61
               format="yyyy-MM-dd"
85
               format="yyyy-MM-dd"
62
               value-format="yyyy-MM-dd"
86
               value-format="yyyy-MM-dd"
63
               @change="endTimeChange"
87
               @change="endTimeChange"
64
-          ></el-date-picker>
65
-          <el-input
88
+          ></el-date-picker> -->
89
+          <!-- <el-input
66
             style="width: 200px;"
90
             style="width: 200px;"
67
             class="filter-item"
91
             class="filter-item"
68
             v-model.trim="keywords"
92
             v-model.trim="keywords"
75
             icon="el-icon-search"
99
             icon="el-icon-search"
76
             @click="search"
100
             @click="search"
77
           >搜索
101
           >搜索
78
-          </el-button>
102
+          </el-button> -->
79
       </div>
103
       </div>
80
 
104
 
81
-       <el-table :data="tableList" border style="width: 100%">
82
-
83
-        <el-table-column prop="drug_type" label="药品类型" width="180" align="center">
105
+       <el-table :data="tableList" border style="width: 100%"   :cell-class-name="cellStyle">
106
+ 
107
+        <el-table-column prop="drug_type" label="药品类型" width="100" align="center">
84
            <template slot-scope="scope">
108
            <template slot-scope="scope">
85
              {{getDrugType(scope.row.drug_type)}}
109
              {{getDrugType(scope.row.drug_type)}}
86
            </template>
110
            </template>
110
              {{getManufacturerList(scope.row.manufacturer)}}
134
              {{getManufacturerList(scope.row.manufacturer)}}
111
            </template>
135
            </template>
112
         </el-table-column>
136
         </el-table-column>
137
+       <el-table-column prop="drug_name" label="仓库名称" align="center">
138
+           <template slot-scope="scope">
139
+            <tr style="background: none" v-for="(item,index) in scope.row.drug_warehouse" :key="index">
140
+              <td style="border-right: none; border-inline-end: none;text-align: center">
141
+                {{getHouseName(item.storehouse_id)}}
142
+              </td>
143
+            </tr>
144
+           </template>
145
+        </el-table-column>
113
         <el-table-column prop="drug_name" label="入库数量" align="center">
146
         <el-table-column prop="drug_name" label="入库数量" align="center">
114
            <template slot-scope="scope">
147
            <template slot-scope="scope">
115
-            <span v-if="getWarehoseInfo(scope.row.drug_warehouse_info)>0">
116
-              {{getWarehoseInfoOne(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}
117
-            </span>
148
+             <tr style="background: none" v-for="(item,index) in scope.row.drug_warehouse" :key="index">
149
+              <td style="border-right: none; border-inline-end: none;text-align: center">
150
+               {{getWarehoseInfoSeven(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,item.storehouse_id)}}
151
+              </td>
152
+            </tr>
118
            </template>
153
            </template>
119
         </el-table-column>
154
         </el-table-column>
120
-        <el-table-column prop="drug_name" label="出库数量" align="center" v-if="showOne">
155
+        <el-table-column prop="drug_name" label="出库数量" align="center">
121
            <template slot-scope="scope">
156
            <template slot-scope="scope">
122
-              <span>
123
-                 {{getOutFlush(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,scope.row.drug_cancel_stock_info)}}
124
-              </span>
157
+            <tr style="background: none" v-for="(item,index) in scope.row.drug_warehouse" :key="index">
158
+              <td style="border-right: none; border-inline-end: none;text-align: center">
159
+              {{getOutFlushNight(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,scope.row.drug_cancel_stock_info,item.storehouse_id)}}
160
+              </td>
161
+            </tr>
125
            </template>
162
            </template>
126
         </el-table-column>
163
         </el-table-column>
127
 
164
 
128
-        <el-table-column prop="drug_name" label="出库数量" align="center" v-if="showTwo">
165
+        <el-table-column prop="drug_name" label="剩余库存量" align="center">
129
            <template slot-scope="scope">
166
            <template slot-scope="scope">
130
-           
131
-             <span>{{getOutCount(scope.row.id)+getAutoCount(scope.row.id)}}{{scope.row.max_unit}}</span>
132
-             
167
+              <tr style="background: none" v-for="(item,index) in scope.row.drug_warehouse" :key="index">
168
+                <td style="border-right: none; border-inline-end: none;text-align: center">
169
+                {{getOverFlushInfoEight(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number,item.storehouse_id,scope.row.storehouse_id)}}
170
+                </td>
171
+            </tr>
133
            </template>
172
            </template>
134
         </el-table-column>
173
         </el-table-column>
135
-        
136
-        <el-table-column prop="drug_name" label="剩余库存量" align="center" v-if="showThree">
174
+
175
+       <el-table-column prop="drug_name" label="总库存量" align="center" v-if="showThree">
137
            <template slot-scope="scope">
176
            <template slot-scope="scope">
138
             <div v-if="getWarehoseInfo(scope.row.drug_warehouse_info)>0">
177
             <div v-if="getWarehoseInfo(scope.row.drug_warehouse_info)>0">
139
                 {{ getOverFlushInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)?getOverFlushInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number):0}}
178
                 {{ getOverFlushInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)?getOverFlushInfo(scope.row.drug_warehouse_info,scope.row.max_unit,scope.row.min_unit,scope.row.min_number):0}}
140
             </div>
179
             </div>
141
            </template>
180
            </template>
142
-        </el-table-column>
143
-        <el-table-column prop="drug_name" label="剩余库存量" align="center" v-if="showFour">
144
-           <template slot-scope="scope">
145
-            <div v-if="getWarehoseInfo(scope.row.drug_warehouse_info) >0">
146
-               <span>{{getWarehoseInfo(scope.row.drug_warehouse_info) - getOutCount(scope.row.id) - getAutoCount(scope.row.id)}}{{scope.row.max_unit}} </span>         
147
-            </div>
148
-           </template>
149
-        </el-table-column>
181
+        </el-table-column> 
150
         <el-table-column prop="drug_name" label="操作" align="center" width="200px">
182
         <el-table-column prop="drug_name" label="操作" align="center" width="200px">
151
           <template slot-scope="scope">
183
           <template slot-scope="scope">
152
             <el-button
184
             <el-button
213
       var drugTypeList = getDictionaryDataConfig('system','drug_type')
245
       var drugTypeList = getDictionaryDataConfig('system','drug_type')
214
       this.drugTypeList.push(...drugTypeList)
246
       this.drugTypeList.push(...drugTypeList)
215
       this.org_id =  this.$store.getters.xt_user.org.id
247
       this.org_id =  this.$store.getters.xt_user.org.id
216
-      console.log("机构ID",this.org_id)
217
-      // this.getDrugCountList()
218
-
219
-
220
     },
248
     },
221
     components: {
249
     components: {
222
       SettingDialog,
250
       SettingDialog,
269
         showTwo:false,
297
         showTwo:false,
270
         showThree:true,
298
         showThree:true,
271
         showFour:false,
299
         showFour:false,
300
+        houseList:[],
301
+        medicalList:[],
302
+        storehouse_id:0,
303
+        drug_id:0,
304
+        storeList:[],
272
       }
305
       }
273
     },
306
     },
274
     methods: {
307
     methods: {
281
           drug_type:this.drug_type,
314
           drug_type:this.drug_type,
282
           start_time:this.start_time,
315
           start_time:this.start_time,
283
           end_time:this.end_time,
316
           end_time:this.end_time,
317
+          drug_id:this.drug_id,
318
+          storehouse_id:this.storehouse_id,
284
         }
319
         }
285
         getDrugStockList(params).then(response=>{
320
         getDrugStockList(params).then(response=>{
286
           if(response.data.state == 1){
321
           if(response.data.state == 1){
305
                  }
340
                  }
306
                }
341
                }
307
              }
342
              }
308
-             console.log("列表list232323323232323223",list)
309
              this.tableList = list
343
              this.tableList = list
310
              var total = response.data.data.total
344
              var total = response.data.data.total
311
              this.total = total
345
              this.total = total
312
              this.manufacturerList = response.data.data.manufacturerList
346
              this.manufacturerList = response.data.data.manufacturerList
347
+             this.houseList = []
348
+             this.storeList = []
349
+             var obj = {
350
+               id:0,storehouse_name:"全部"
351
+             }
352
+             var objOne = {
353
+               id:0,drug_name:"全部"
354
+             }
313
 
355
 
356
+             this.storeList.push(obj)
357
+             for(let i=0;i<response.data.data.houseList.length;i++){
358
+               this.houseList.push(response.data.data.houseList[i])
359
+               this.storeList.push(response.data.data.houseList[i])
360
+             }
361
+             this.medicalList = []
362
+             this.medicalList.push(objOne)
363
+             for(let i=0;i<response.data.data.medicalList.length;i++){
364
+               for(let j=0;j<response.data.data.manufacturerList.length;j++){
365
+                if(response.data.data.medicalList[i].manufacturer == response.data.data.manufacturerList[j].id){
366
+                   response.data.data.medicalList[i].manufacturer = response.data.data.manufacturerList[j].manufacturer_name
367
+                }
368
+              }
369
+              response.data.data.medicalList[i].drug_name = response.data.data.medicalList[i].drug_name +response.data.data.medicalList[i].dose + response.data.data.medicalList[i].dose_unit + "*" + response.data.data.medicalList[i].min_number +  response.data.data.medicalList[i].min_unit+ "/"+ response.data.data.medicalList[i].max_unit +  " " +response.data.data.medicalList[i].manufacturer
370
+               this.medicalList.push(response.data.data.medicalList[i])
371
+             }
372
+             
314
            }
373
            }
315
         })
374
         })
316
       },
375
       },
892
            str_min =  over_count%min_number + min_unit
951
            str_min =  over_count%min_number + min_unit
893
          }
952
          }
894
        return str+str_min
953
        return str+str_min
954
+      },
955
+    getHouseName(id){
956
+      var storehouse_name = ""
957
+      for(let i=0;i<this.houseList.length;i++){
958
+        if(id == this.houseList[i].id){
959
+          storehouse_name = this.houseList[i].storehouse_name
960
+        }
895
       }
961
       }
962
+      return storehouse_name
963
+     },
964
+     getWarehoseInfoSeven(arr,max_unit,min_unit,min_number,storehouse_id){
965
+        var total = 0
966
+        var max_str=  ""
967
+         var min_str = ""
968
+        if (arr.length > 0) {
969
+          for(let i=0;i<arr.length;i++){
970
+            if(arr[i].storehouse_id == storehouse_id){
971
+              total += parseInt(arr[i].warehousing_count)
972
+            } 
973
+          }
974
+        }
975
+        if (total < min_number){
976
+          min_str = total + min_unit
977
+        }
978
+        if (total == 0) {
979
+          min_str = ""
980
+          max_str = ""
981
+        }
982
+        if (total >=min_number) {
983
+           if(parseInt(total/min_number)!=0){
984
+              max_str = parseInt(total/min_number) + max_unit
985
+           }
986
+           if(total%min_number!=0){
987
+              min_str = total%min_number + min_unit
988
+           }
989
+
990
+        }
991
+        return max_str + min_str
992
+      },
993
+           
994
+      getOverFlushInfoEight(arr,max_unit,min_unit,min_number,storehouse_id){
995
+
996
+         var max_str=  ""
997
+         var min_str = ""
998
+         var total = 0
999
+         var newarr = arr
1000
+         if(newarr.length > 0 ){
1001
+           for(let i=0;i<newarr.length;i++){
1002
+            if(newarr[i].storehouse_id == storehouse_id){
1003
+              total += (newarr[i].stock_max_number+newarr[i].stock_min_number)
1004
+            }
1005
+           }
1006
+         }
1007
+         if (total < min_number){
1008
+           min_str = total + min_unit
1009
+         }
1010
+         if (total == 0) {
1011
+            min_str = ""
1012
+            max_str = ""
1013
+         }
1014
+         if (total >=min_number) {
1015
+           if(parseInt(total/min_number)!=0){
1016
+              max_str = parseInt(total/min_number) + max_unit
1017
+           }
1018
+           if(total%min_number!=0){
1019
+              min_str = total%min_number + min_unit
1020
+           }
1021
+
1022
+         }
1023
+        return max_str + min_str
1024
+      },
1025
+      getOutFlushNight(info,max_unit,min_unit,min_number,cancel_info,storehouse_id){
1026
+
1027
+        var str = ""
1028
+        var str_min = ""
1029
+        //总库存
1030
+        var total = 0
1031
+        var out_count = 0
1032
+        var over_count = 0
1033
+        var cancel_count = 0
1034
+        for(let i=0;i<info.length;i++){
1035
+          if(info[i].storehouse_id == storehouse_id){
1036
+            total += info[i].warehousing_count
1037
+          }
1038
+          
1039
+        }
1040
+        
1041
+        for(let j=0;j<info.length;j++){
1042
+          if(info[j].storehouse_id == storehouse_id){
1043
+            out_count += (info[j].stock_max_number + info[j].stock_min_number)
1044
+          }
1045
+          
1046
+        }
1047
+       
1048
+        // for(let z=0;z<cancel_info.length;z++){
1049
+        //    cancel_count += cancel_info[z].count
1050
+        // }
1051
+       // over_count = total - out_count + cancel_count
1052
+         over_count = total - out_count 
1053
+        if(parseInt(over_count/min_number)!=0){
1054
+            str = parseInt(over_count/min_number)+ max_unit
1055
+         }
1056
+         if(over_count%min_number !=0){
1057
+           str_min =  over_count%min_number + min_unit
1058
+         }
1059
+       return str+str_min
1060
+      },
1061
+      changeStorehouseName(){
1062
+        this.getlist()
1063
+     },
1064
+      changeDrugName(){
1065
+        this.getlist()
1066
+      },
1067
+     // 合并单元格样式
1068
+     cellStyle({ row, column, rowIndex, columnIndex }) {
1069
+      let arr = [6, 7, 8, 9];
1070
+      if (arr.indexOf(columnIndex) > -1) {
1071
+        return "spanClass";
1072
+      }
1073
+    },
896
     }
1074
     }
897
   }
1075
   }
898
 </script>
1076
 </script>
950
   .el-table::before {
1128
   .el-table::before {
951
     background-color: #d0d3da;
1129
     background-color: #d0d3da;
952
   }
1130
   }
1131
+
1132
+
1133
+/* 合并表格线样式 */
1134
+.spanClass .cell {
1135
+  padding: 0 !important;
1136
+}
1137
+
1138
+.spanClass .cell tr {
1139
+  display: inline-block;
1140
+  width: 100%;
1141
+}
1142
+
1143
+.spanClass .cell tr td {
1144
+  padding: 10px 0;
1145
+  border-bottom: 1px solid #ebeef5;
1146
+  display: block;
1147
+  width: 100%;
1148
+}
1149
+.spanClass .cell tr:last-of-type td{
1150
+  border-bottom: none;
1151
+}
953
 </style>
1152
 </style>

+ 110 - 70
src/xt_pages/stock/inventory.vue 查看文件

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
     <div v-show="showSearch">
3
     <div v-show="showSearch">
4
+      <label class="title"><span class="name">仓库</span> :</label>
5
+        <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
6
+            <el-option
7
+              v-for="(option, index) in houseList"
8
+              :key="index"
9
+              :label="option.storehouse_name"
10
+              :value="option.id">
11
+            </el-option>
12
+       </el-select>  
4
      <el-autocomplete
13
      <el-autocomplete
5
         class="checkSearch"
14
         class="checkSearch"
6
         popper-class="my-autocomplete"
15
         popper-class="my-autocomplete"
62
                     {{scope.row.manufacturer_name}}
71
                     {{scope.row.manufacturer_name}}
63
                   </template> 
72
                   </template> 
64
               </el-table-column>
73
               </el-table-column>
74
+
75
+             <el-table-column prop="name" label="仓库名称" width="100"  align="center">
76
+                  <template slot-scope="scope">
77
+                    {{getStorehouseName(scope.row.storehouse_id)}}
78
+                  </template> 
79
+              </el-table-column>
65
               <el-table-column prop="name" label="盘点前数量" width="120"  align="center">
80
               <el-table-column prop="name" label="盘点前数量" width="120"  align="center">
66
                 <template slot-scope="scope">
81
                 <template slot-scope="scope">
67
                     <span><el-input style="width:80px" v-model="scope.row.stock_count" :disabled="true"></el-input>{{scope.row.max_unit}}</span> 
82
                     <span><el-input style="width:80px" v-model="scope.row.stock_count" :disabled="true"></el-input>{{scope.row.max_unit}}</span> 
94
               </el-table-column>
109
               </el-table-column>
95
           </el-table>
110
           </el-table>
96
       </el-collapse-item>
111
       </el-collapse-item>
112
+        <label class="title"><span class="name">仓库</span>:</label>
113
+          <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
114
+                <el-option
115
+                  v-for="(option, index) in houseList"
116
+                  :key="index"
117
+                  :label="option.storehouse_name"
118
+                  :value="option.id">
119
+                </el-option>
120
+          </el-select>
97
       <el-autocomplete
121
       <el-autocomplete
98
           class="checkSearch"
122
           class="checkSearch"
99
           popper-class="my-autocomplete"
123
           popper-class="my-autocomplete"
160
                 product_date:"",
184
                 product_date:"",
161
                 number:"",
185
                 number:"",
162
                 proof_count:"",
186
                 proof_count:"",
187
+                storehouse_id:"",
163
             },
188
             },
164
          manufacturerList:[],
189
          manufacturerList:[],
165
          dealerList:[],
190
          dealerList:[],
194
          inventory_total:0,
219
          inventory_total:0,
195
          WarehouseList:[],
220
          WarehouseList:[],
196
          showTableOne:false,
221
          showTableOne:false,
222
+         houseList:[],
223
+         storehouse_id:"",
197
         }
224
         }
198
     },
225
     },
199
     methods:{
226
     methods:{
203
                 key = keyword
230
                 key = keyword
204
             }
231
             }
205
             var params = {
232
             var params = {
206
-              keyword:key
233
+              keyword:key,
234
+              storehouse_id:this.storehouse_id,
207
             }
235
             }
208
             postSearchGoodWarehouseList(params).then(response => {
236
             postSearchGoodWarehouseList(params).then(response => {
209
             if (response.data.state == 1) {
237
             if (response.data.state == 1) {
210
             
238
             
211
                 var list = response.data.data.list
239
                 var list = response.data.data.list
212
-                console.log("列表数据",list)
240
+              
213
                 this.goodList = list
241
                 this.goodList = list
214
                 var manufacturerList = response.data.data.manufacturerList
242
                 var manufacturerList = response.data.data.manufacturerList
215
                 this.manufacturerList = manufacturerList
243
                 this.manufacturerList = manufacturerList
272
           this.page = val
300
           this.page = val
273
           this.getlist()
301
           this.getlist()
274
         },
302
         },
275
-    getlist(){
276
-      var params = {
277
-            keyword:this.searchKey,
278
-            start_time:this.start_time,
279
-            end_time:this.end_time,
280
-            inventory_status:this.inventory_status, 
281
-            page:this.page,
282
-            limit:this.limit,
283
-          }
284
-          console.log("我爱你中国parasm",params)
285
-        getInventoryList(params).then(response=>{
286
-            if(response.data.state ==1 ){
287
-            var list =  response.data.data.list
288
-            console.log("列表23232323232",list)
289
-            this.tableList = list
290
-            var total = response.data.data.total
291
-            this.total = total
292
-            this.doctorList =  response.data.data.doctorlist
303
+      changeHouseList(){
304
+        this.querySearchAsync()
305
+      },
306
+      getlist(){
307
+        var params = {
308
+              keyword:this.searchKey,
309
+              start_time:this.start_time,
310
+              end_time:this.end_time,
311
+              inventory_status:this.inventory_status, 
312
+              page:this.page,
313
+              limit:this.limit,
293
             }
314
             }
294
-        })
315
+          getInventoryList(params).then(response=>{
316
+              if(response.data.state ==1 ){
317
+              var list =  response.data.data.list
318
+              this.tableList = list
319
+              var total = response.data.data.total
320
+              this.total = total
321
+              this.doctorList =  response.data.data.doctorlist
322
+              this.houseList = response.data.data.houseList
323
+              var houseConfig = response.data.data.houseConfig
324
+              this.storehouse_id = houseConfig.storehouse_out_info
325
+              }
326
+          })
327
+        },
328
+      getChecker(id){
329
+        var name = ""
330
+        for(let i=0;i<this.doctorList.length;i++){
331
+            if(id == this.doctorList[i].admin_user_id){
332
+              name = this.doctorList[i].user_name
333
+            }
334
+        }
335
+        return name
295
       },
336
       },
296
-     getChecker(id){
297
-       var name = ""
298
-       for(let i=0;i<this.doctorList.length;i++){
299
-          if(id == this.doctorList[i].admin_user_id){
300
-             name = this.doctorList[i].user_name
301
-          }
302
-       }
303
-       return name
304
-     },
305
-    toCheck(){
306
-      if(this.ids.length <=0){
307
-         this.$message.error("请勾选核对数据")
308
-         return
309
-       }else{
310
-         this.checkDialogVisible = true
311
-       }
312
-     },
313
-    changePrice(val){  
314
-       var arr = []
337
+      toCheck(){
338
+        if(this.ids.length <=0){
339
+          this.$message.error("请勾选核对数据")
340
+          return
341
+        }else{
342
+          this.checkDialogVisible = true
343
+        }
344
+      },
345
+      changePrice(val){  
346
+        var arr = []
347
+        
348
+        for(let i=0;i<val.length;i++){
349
+          arr.push(val[i].id)
350
+        }
351
+        var str = arr.join(",")
315
       
352
       
316
-       for(let i=0;i<val.length;i++){
317
-         arr.push(val[i].id)
318
-       }
319
-      var str = arr.join(",")
320
-    
321
-      console.log("str",str)
322
-      this.ids = str
323
      
353
      
324
-     },
325
-     SaveCheckedInventory(){
326
-         var params = {
327
-            ids:this.ids,
328
-            check_time:this.getTime(this.check_time),
329
-            checker:this.checker,
330
-         }
331
-       console.log("params",params)
332
-       SaveCheckedInventory(params).then(response=>{
333
-         if(response.data.state == 1){
334
-           this.$message.success("保存成功")
335
-           var inventory = response.data.data.inventory
336
-           this.checkDialogVisible = false
337
-           this.getlist()
338
-         }
339
-       })
340
-     },
354
+        this.ids = str
355
+      
356
+      },
357
+      SaveCheckedInventory(){
358
+          var params = {
359
+              ids:this.ids,
360
+              check_time:this.getTime(this.check_time),
361
+              checker:this.checker,
362
+
363
+          }
364
+        SaveCheckedInventory(params).then(response=>{
365
+          if(response.data.state == 1){
366
+            this.$message.success("保存成功")
367
+            var inventory = response.data.data.inventory
368
+            this.checkDialogVisible = false
369
+            this.getlist()
370
+          }
371
+        })
372
+      },
341
       toDelete(index){
373
       toDelete(index){
342
        this.tableData.splice(index,1)
374
        this.tableData.splice(index,1)
343
      },
375
      },
345
        getInventoryDetail(id).then(response=>{
377
        getInventoryDetail(id).then(response=>{
346
           if(response.data.state == 1){
378
           if(response.data.state == 1){
347
             var detail =  response.data.data.detail
379
             var detail =  response.data.data.detail
348
-            console.log("detial",detail)
380
+         
349
             this.form.good_name = detail.good_name
381
             this.form.good_name = detail.good_name
350
             this.form.specification_name = detail.specification_name
382
             this.form.specification_name = detail.specification_name
351
             this.form.count = detail.count
383
             this.form.count = detail.count
415
     getGoodInventoryWarehouseList(id){
447
     getGoodInventoryWarehouseList(id){
416
        var params = {
448
        var params = {
417
          id:id,
449
          id:id,
450
+         storehouse_id:this.storehouse_id,
418
        }
451
        }
419
       getGoodInventoryWarehouseList(params).then(response=>{
452
       getGoodInventoryWarehouseList(params).then(response=>{
420
          if(response.data.state == 1){
453
          if(response.data.state == 1){
458
                 }
491
                 }
459
               }
492
               }
460
             }
493
             }
461
-          console.log("newList2333232323232",newList)
494
+        
462
           
495
           
463
           this.tableData = newList
496
           this.tableData = newList
464
           this.showSearch = false
497
           this.showSearch = false
497
       })
530
       })
498
     },
531
     },
499
     toMove(item,index){
532
     toMove(item,index){
500
-      console.log("index",item)
501
        this.$confirm('此操作将移除耗材整个批次, 是否继续?', '提示', {
533
        this.$confirm('此操作将移除耗材整个批次, 是否继续?', '提示', {
502
           confirmButtonText: '确定',
534
           confirmButtonText: '确定',
503
           cancelButtonText: '取消',
535
           cancelButtonText: '取消',
542
         
574
         
543
       }
575
       }
544
        var params = {
576
        var params = {
545
-         tableData:arr
577
+         tableData:arr,
578
+         storehouse_id:this.storehouse_id,
546
        }
579
        }
547
-      console.log("params2323323",params)
548
-     
549
       saveStockInentoryList(params).then(response=>{
580
       saveStockInentoryList(params).then(response=>{
550
         if(response.data.state == 1){
581
         if(response.data.state == 1){
551
            var inventory = response.data.data.inventory
582
            var inventory = response.data.data.inventory
554
            this.tableData = []
585
            this.tableData = []
555
         }
586
         }
556
       })
587
       })
588
+    },
589
+    getStorehouseName(id){
590
+      var storehouse_name = ""
591
+      for(let i=0;i<this.houseList.length;i++){
592
+        if(id == this.houseList[i].id){
593
+          storehouse_name = this.houseList[i].storehouse_name
594
+        }
595
+      }
596
+      return storehouse_name
557
     }
597
     }
558
    },
598
    },
559
     created(){
599
     created(){

+ 42 - 0
src/xt_pages/stock/inventoryDetails.vue 查看文件

2
     <div>
2
     <div>
3
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
3
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
4
             <div>
4
             <div>
5
+             <label class="title"><span class="name">仓库</span> :</label>
6
+              <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
7
+                  <el-option
8
+                    v-for="(option, index) in houseList"
9
+                    :key="index"
10
+                    :label="option.storehouse_name"
11
+                    :value="option.id">
12
+                  </el-option>
13
+               </el-select>  
5
                 <el-input
14
                 <el-input
6
                 size="small"
15
                 size="small"
7
                 style="width: 200px;margin-left:10px;"
16
                 style="width: 200px;margin-left:10px;"
42
                  {{getTime(scope.row.product_date)}}
51
                  {{getTime(scope.row.product_date)}}
43
                </template>
52
                </template>
44
             </el-table-column>
53
             </el-table-column>
54
+
55
+           <el-table-column  prop="name" label="仓库名称" width="200" align="center">
56
+               <template slot-scope="scope">
57
+                 {{getStorehouseName(scope.row.storehouse_id)}}
58
+               </template>
59
+            </el-table-column>
45
            
60
            
46
             <el-table-column prop="name" label="盘点前数量" width="100" align="center">
61
             <el-table-column prop="name" label="盘点前数量" width="100" align="center">
47
               <template slot-scope="scope">
62
               <template slot-scope="scope">
108
             page:1,
123
             page:1,
109
             ids:"",
124
             ids:"",
110
             damageList:[],
125
             damageList:[],
126
+            storehouse_id:0,
127
+            houseList:[],
111
          }
128
          }
112
     },
129
     },
113
     methods:{
130
     methods:{
134
             keyword:this.searchKey,
151
             keyword:this.searchKey,
135
             limit:this.limit,
152
             limit:this.limit,
136
             page:this.page,
153
             page:this.page,
154
+            storehouse_id:this.storehouse_id,
137
           }
155
           }
138
           this.tableData = []
156
           this.tableData = []
139
           getInventoryDetailList(params).then(response=>{
157
           getInventoryDetailList(params).then(response=>{
143
              
161
              
144
                this.tableData = list
162
                this.tableData = list
145
                this.total = response.data.data.total
163
                this.total = response.data.data.total
164
+               var obj = {id:0,storehouse_name:"全部"}
165
+               this.houseList = []
166
+               this.houseList.push(obj)
167
+               for(let i=0;i<response.data.data.houseList.length;i++){
168
+                 this.houseList.push(response.data.data.houseList[i])
169
+               }
170
+              
146
              }
171
              }
147
           })
172
           })
148
         },
173
         },
188
        },
213
        },
189
       inventoryExportList(){
214
       inventoryExportList(){
190
         this.$router.push({path:'/stock/inventoryPrint'})
215
         this.$router.push({path:'/stock/inventoryPrint'})
216
+      },
217
+      getStorehouseName(id){
218
+        var storehouse_name = ""
219
+        for(let i=0;i<this.houseList.length;i++){
220
+          if(id == this.houseList[i].id){
221
+            storehouse_name = this.houseList[i].storehouse_name
222
+          }
223
+        }
224
+        if(storehouse_name == "全部"){
225
+          return ""
226
+        }else{
227
+          return storehouse_name
228
+        }
229
+      },
230
+      changeHouseList(){
231
+        this.houseList = []
232
+        this.getlist()
191
       }
233
       }
192
     },
234
     },
193
     created(){
235
     created(){

+ 492 - 76
src/xt_pages/stock/inventoryTransfer/Addtrans.vue 查看文件

3
     <div class="position">
3
     <div class="position">
4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
4
       <bread-crumb :crumbs="crumbs"></bread-crumb>
5
       <div>
5
       <div>
6
-        <el-button type="primary" @click="save">保存</el-button>
7
-        <el-button type="warning" @click="examine">审核</el-button>
6
+        <el-button type="primary" @click="submit" v-show="showButton">保存</el-button>
7
+        <el-button type="warning" @click="examine" v-show="showCheck">审核</el-button>
8
       </div>
8
       </div>
9
     </div>
9
     </div>
10
-    <div class="app-container">
10
+    <div class="app-container" v-loading="loading">
11
       <div
11
       <div
12
         style="
12
         style="
13
           justify-content: flex-start;
13
           justify-content: flex-start;
18
       >
18
       >
19
         <el-form
19
         <el-form
20
           :inline="true"
20
           :inline="true"
21
-          :rules="rules"
22
           :model="formInline"
21
           :model="formInline"
23
           class="demo-form-inline"
22
           class="demo-form-inline"
24
         >
23
         >
25
           <el-form-item label="单据日期:">
24
           <el-form-item label="单据日期:">
26
             <el-date-picker
25
             <el-date-picker
27
-              v-model="value1"
26
+              v-model="warehousing_time"
27
+              format="yyyy-MM-dd"
28
+               value-format="yyyy-MM-dd"
28
               type="date"
29
               type="date"
29
               placeholder="选择日期"
30
               placeholder="选择日期"
30
             ></el-date-picker>
31
             ></el-date-picker>
31
           </el-form-item>
32
           </el-form-item>
32
-          <el-form-item label="调出仓库:" prop="region">
33
-            <el-select v-model="formInline.region" placeholder="活动区域">
34
-              <el-option label="区域一" value="shanghai"></el-option>
35
-              <el-option label="区域二" value="beijing"></el-option>
36
-            </el-select>
33
+          <span><span style="color:red">*</span>调出仓库:</span>
34
+          <el-form-item  prop="storehouse_out_id">
35
+              <el-select size="small" v-model="storehouse_out_id" filterable placeholder="请选择调出仓库" @change="changeHouseList">
36
+                <el-option
37
+                  v-for="(option, index) in houseList"
38
+                  :key="index"
39
+                  :label="option.storehouse_name"
40
+                  :value="option.id">
41
+                </el-option>
42
+              </el-select>
37
           </el-form-item>
43
           </el-form-item>
38
-          <el-form-item label="调入仓库:" prop="region">
39
-            <el-select v-model="formInline.region" placeholder="活动区域">
40
-              <el-option label="区域一" value="shanghai"></el-option>
41
-              <el-option label="区域二" value="beijing"></el-option>
42
-            </el-select>
44
+          <span><span style="color:red">*</span>调入仓库:</span>
45
+          <el-form-item prop="storehouse_in_id">
46
+            <el-select size="small" v-model="storehouse_in_id" filterable placeholder="请选择调入仓库">
47
+            <el-option
48
+              v-for="(option, index) in houseList"
49
+              :key="index"
50
+              :label="option.storehouse_name"
51
+              :value="option.id">
52
+            </el-option>
53
+           </el-select>
43
           </el-form-item>
54
           </el-form-item>
44
         </el-form>
55
         </el-form>
45
       </div>
56
       </div>
57
+     <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
46
       <el-table
58
       <el-table
47
         :row-style="changColor"
59
         :row-style="changColor"
48
         :header-cell-style="{
60
         :header-cell-style="{
49
           backgroundColor: 'rgb(245, 247, 250)',
61
           backgroundColor: 'rgb(245, 247, 250)',
50
           color: '#606266',
62
           color: '#606266',
51
         }"
63
         }"
52
-        :data="tableData"
53
-        :class="signAndWeighBoxPatients"
64
+        :data="recordInfo.recordData"
54
         border
65
         border
66
+       
55
       >
67
       >
56
-        >
57
-        <el-table-column label="单据编号" align="center">
58
-          <template slot-scope="scope">
59
-            <span>{{ scope.row.drug_name ? scope.row.drug_name : "" }}</span>
60
-          </template>
61
-        </el-table-column>
62
-        <el-table-column align="center">
63
-          <template slot="header" slot-scope="scope">
68
+      >
69
+    
70
+        <el-table-column align="center"  width="230">
71
+          <template slot="header" slot-scope="scope" >
64
             商品名称<span style="color:red;">*</span>
72
             商品名称<span style="color:red;">*</span>
65
           </template>
73
           </template>
66
           <template slot-scope="scope">
74
           <template slot-scope="scope">
67
-        <span>{{ scope.row.Count ? scope.row.Count : "" }}</span>
68
-          </template>
69
-        </el-table-column>
70
-        <el-table-column label="商品类型" align="center">
71
-          <template slot-scope="scope">
72
-            <span>{{ scope.row.Count ? scope.row.Count : "" }}</span>
73
-          </template>
74
-        </el-table-column>
75
-        <el-table-column label="规格&&单位" align="center">
76
-          <template slot-scope="scope">
77
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
75
+           <el-form-item
76
+                :prop="'recordData.' + scope.$index + '.name'"
77
+                :rules="tableRules.name"
78
+              >
79
+                <el-select
80
+                  @blur="selectGoodName"
81
+                  v-model="scope.row.name"
82
+                  style="width:200"
83
+                  filterable
84
+                  placeholder="请选择商品"
85
+                  @change="changeName"
86
+                  @input="changeGoodName(scope.$index)"
87
+                  :disabled="disabled"
88
+                >
89
+                  <el-option
90
+                    v-for="(item, index) in tabList"
91
+                    :key="index"
92
+                    :label="item.project_name"
93
+                    :value="item"
94
+                  >
95
+                  </el-option>
96
+                </el-select>
97
+              </el-form-item>
78
           </template>
98
           </template>
79
         </el-table-column>
99
         </el-table-column>
80
-        <el-table-column label="调拨数量" align="center">
81
-          <template slot-scope="scope">
82
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
83
-          </template>
100
+        <el-table-column align="center"  width="200">
101
+          <template slot="header" slot-scope="scope">
102
+              <span>商品类型<span style="color: red">*</span></span>
103
+            </template>
104
+     
105
+            <template slot-scope="scope">
106
+              <el-form-item style="padding-top: 20px;">
107
+                <el-input v-model="scope.row.project_type" :disabled="true" style="width:180px"></el-input>
108
+              </el-form-item>
109
+            </template>
84
         </el-table-column>
110
         </el-table-column>
85
-        <el-table-column label="库存总数" align="center">
86
-          <template slot-scope="scope">
87
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
88
-          </template>
111
+        <el-table-column  align="center" width="250">
112
+         <template slot="header" slot-scope="scope" >
113
+              <span>规格<span style="color: red">*</span></span>
114
+            </template>
115
+            <template slot-scope="scope">
116
+
117
+              <el-form-item style="padding-top: 20px">
118
+                 <el-input v-model="scope.row.second_specification_name" style="width:200px" :disabled="true"></el-input>
119
+              </el-form-item>
120
+
121
+            </template>
89
         </el-table-column>
122
         </el-table-column>
90
-        <el-table-column label="制单人" align="center">
91
-          <template slot-scope="scope">
92
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
93
-          </template>
123
+        <el-table-column  align="center" width="250">
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: 20px" :prop="'recordData.' + scope.$index + '.count'"
129
+                            :rules='tableRules.count' >
130
+                <el-input v-model="scope.row.count" style="width:100px"  @input="selectCount(scope.row.project_id,scope.row.sencond_unit,scope.row.is_source,scope.row.count,scope.$index)"></el-input>
131
+                <el-select
132
+                  v-model="scope.row.sencond_unit"
133
+                  style="width: 100px"
134
+                  filterable
135
+                  placeholder="请选择"
136
+                  :disabled="disabled"
137
+                 
138
+                >
139
+                  <el-option
140
+                    v-for="(item, index) in scope.row.unitList"
141
+                    :key="index"
142
+                    :label="item.name"
143
+                    :value="item.name"
144
+                  >
145
+                  </el-option>
146
+                </el-select>
147
+              </el-form-item>
148
+            </template>
94
         </el-table-column>
149
         </el-table-column>
95
-        <el-table-column label="备注" align="center">
150
+        <el-table-column label="库存总数" align="center" width="200">
151
+           <template slot="header" slot-scope="scope">
152
+              <span>库存总数<span style="color: red">*</span></span>
153
+            </template>
154
+            <template slot-scope="scope">
155
+              <el-form-item  style="padding-top: 20px">
156
+                <el-input v-model="scope.row.second_total" style="width:150px" :disabled="true"></el-input>
157
+              </el-form-item>
158
+            </template>
159
+         </el-table-column>
160
+      
161
+        <el-table-column label="备注" align="center" width="200">
96
           <template slot-scope="scope">
162
           <template slot-scope="scope">
97
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
163
+            <el-input v-model="scope.row.remake" style="width:160px"></el-input>
98
           </template>
164
           </template>
99
         </el-table-column>
165
         </el-table-column>
100
 
166
 
101
-
102
-
103
-        <el-table-column label="操作" align="center" width="260px">
167
+        <el-table-column label="操作" align="center" width="190px">
104
           <template slot-scope="scope">
168
           <template slot-scope="scope">
105
             <el-tooltip class="item" content="新增" placement="top-start">
169
             <el-tooltip class="item" content="新增" placement="top-start">
106
               <el-button
170
               <el-button
117
                 icon="el-icon-delete"
181
                 icon="el-icon-delete"
118
                 size="small"
182
                 size="small"
119
                 type="danger"
183
                 type="danger"
120
-                @click="toDelete(scope.row, scope.row.$index)"
184
+                @click="toDelete(scope.row, scope.$index)"
121
               >
185
               >
122
               </el-button>
186
               </el-button>
123
             </el-tooltip>
187
             </el-tooltip>
124
           </template>
188
           </template>
125
         </el-table-column>
189
         </el-table-column>
126
       </el-table>
190
       </el-table>
127
-      <el-pagination
128
-        @size-change="handleSizeChange"
129
-        @current-change="handleCurrentChange"
130
-        :page-sizes="[10, 50, 100, 200, 500, 1000]"
131
-        :page-size="10"
132
-        background
133
-        align="right"
134
-        style="margin-top: 20px"
135
-        layout="total, sizes, prev, pager, next, jumper"
136
-        :total="total"
137
-      >
138
-      </el-pagination>
191
+    </el-form>
139
     </div>
192
     </div>
140
   </div>
193
   </div>
141
 </template>
194
 </template>
142
 
195
 
143
 <script>
196
 <script>
144
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
197
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
198
+import { uParseTime } from '@/utils/tools'
199
+import {getSencondeGoodList,saveSencondOrder,checkSecondOrder,getStoreHouseGoodList,getSumSecondeCount} from '@/api/seconde'
145
 export default {
200
 export default {
146
   components: {
201
   components: {
147
     BreadCrumb,
202
     BreadCrumb,
161
         user: "",
216
         user: "",
162
         region: "",
217
         region: "",
163
       },
218
       },
164
-      rules: {
165
-        region: [
166
-          { required: true, message: "请选择活动区域", trigger: "change" },
167
-        ],
168
-      },
219
+      currentIndex: 0,
220
+      tableRules: {
221
+          name: [
222
+            { required: true, message: '商品名称不能为空', trigger: 'blur' }
223
+          ],
224
+          count: [
225
+            { required: true, message: '调拨数量不能为空', trigger: 'blur' }
226
+          ],
227
+        },
228
+        goodType: [],
229
+        manufacturerList:[],
230
+        goodList:[],
231
+        loading:false,
232
+        list:[],
233
+        configlist:{},
234
+        recordInfo: {
235
+          recordData: [],
236
+        },
237
+        drugList:[],
238
+        goodTypeList:[],
239
+        drugTypeList:[],
240
+        houseList:[],
241
+        tabList:[],
242
+        disabled:false,
243
+        storehouse_out_id:"",
244
+        storehouse_in_id:"",
245
+        loading:false,
246
+        warehousing_time:"",
247
+        showButton:true,
248
+        showCheck:false,
169
     };
249
     };
170
   },
250
   },
171
 
251
 
177
     approval() {},
257
     approval() {},
178
 
258
 
179
     // 审核
259
     // 审核
180
-    examine() {},
260
+    examine() {
261
+      this.loading = true
262
+      var array = []
263
+      array.push(this.id)
264
+      var ids = array.join(",")
265
+    
266
+      checkSecondOrder(ids).then(response=>{
267
+        if(response.data.state == 1){
268
+          var msg = response.data.data.msg
269
+          this.loading = false
270
+          if(msg == 1){
271
+            this.$message.success("审核成功!")
272
+            this.$router.push({path:"/stock/inventoryTransfer"})
273
+          }
274
+          if(msg == 2){
275
+            var good_name = response.data.data.good_name
276
+            var specification_name = response.data.data.specification_name
277
+            var storehose_name = response.data.data.storehose_name
181
 
278
 
182
-    // 保存
183
-    save() {},
279
+            this.$message.error(storehose_name + " "+good_name+"*"+specification_name+"库存不足,无法调拨,请修改调拨数量!")
280
+          }
281
+          if(msg == 3){
282
+            var drug_name =  response.data.data.drug_name
283
+            var dose = response.data.data.dose
284
+            var dose_unit = response.data.data.dose_unit
285
+            var min_number = response.data.data.min_number
286
+            var min_unit =  response.data.data.min_unit
287
+            var max_unit =  response.data.data.max_unit
288
+            var str = drug_name + " " + dose + dose_unit + "*" + min_number + min_unit+"/"+max_unit
289
+            var storehose_name = response.data.data.storehose_name
290
+            this.$message.error(storehose_name +" "+str +"库存不足,无法调拨,请修改调拨数量!")
184
 
291
 
292
+          }
293
+
294
+        }
295
+      })
296
+    },
185
     // 表单添加
297
     // 表单添加
186
-    toAdd() {},
298
+    toAdd() {
299
+      const tempObj = {}
300
+      tempObj["name"] = "";
301
+      tempObj['project_name'] = ""
302
+      tempObj['project_type'] = ""
303
+      tempObj['second_specification_name'] = ''
304
+      tempObj['sencond_unit'] = ''
305
+      tempObj['count'] = ''
306
+      tempObj['second_total'] = ''
307
+      tempObj["is_source"] = 0
308
+      tempObj["remake"] = ''
309
+      tempObj["project_id"] = 0
310
+      tempObj["min_price"] = 0
311
+      this.recordInfo.recordData.push(tempObj)
312
+    },
187
 
313
 
188
     // 删除
314
     // 删除
189
-    toDelete() {},
315
+    toDelete(row,index) {
316
+      if (this.recordInfo.recordData.length <= 1) {
317
+        this.$message.error('只有一条记录的时候无法删除')
318
+        return
319
+      } else {
320
+        this.recordInfo.recordData.splice(index, 1)
321
+      }
322
+    },
190
 
323
 
191
     // 详情查看
324
     // 详情查看
192
     toDetails() {},
325
     toDetails() {},
218
         };
351
         };
219
       }
352
       }
220
     },
353
     },
354
+    //获取基本数据信息
355
+    getlist(){
356
+      getSencondeGoodList().then(response=>{
357
+        if(response.data.state == 1){
358
+
359
+          var houseList =  response.data.data.houseList
360
+          this.houseList = houseList
361
+        }
362
+      })
363
+    },
364
+    getTime(val, temp) {
365
+      if (val != 0) {
366
+        return uParseTime(val, temp)
367
+      } else {
368
+        return ''
369
+      }
370
+    },
371
+    submit() { 
372
+      this.loading = true
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
+      if(this.storehouse_out_id <=0){
380
+        this.$message.error("调出仓库不能为空!")
381
+        this.loading = false
382
+        loading.close()
383
+        return
384
+      }
385
+      if(this.storehouse_in_id <=0){
386
+        this.$message.error("调入仓库不能为空!")
387
+        this.loading = false
388
+        loading.close()
389
+        return
390
+      }
391
+      this.$refs['tableForm'].validate((valid) => {
392
+        if(valid) {
393
+          const array = this.recordInfo.recordData
394
+        
395
+          for (let i = 0; i < array.length; i++) {
396
+            array[i].count = parseInt(array[i].count)
397
+            array[i].second_total = array[i].second_total.toString()
398
+          }
399
+          const params = {
400
+            'stockIn': this.recordInfo.recordData
401
+          }
402
+          var storehouse_in_id = parseInt(this.storehouse_in_id)
403
+          var storehouse_out_id = parseInt(this.storehouse_out_id)
404
+         
405
+          var warehouse_time = this.warehousing_time
406
+          
407
+          console.log("@3232332323232",warehouse_time)
408
+         
409
+          saveSencondOrder(params,warehouse_time,storehouse_in_id,storehouse_out_id).then(response => {
410
+            if (response.data.state == 1) {
411
+              this.showCheck = true
412
+              this.showButton = false
413
+              var warehousingInfo = response.data.data.warehousingInfo   
414
+              this.$message.success('保存成功')
415
+              this.loading = false 
416
+              loading.close()
417
+              this.id = response.data.data.id
418
+            } else {
419
+              this.$message.error("保存失败")
420
+              loading.close()
421
+            }
422
+          })
423
+        } else {
424
+          return false
425
+        }
426
+      })
427
+    },
428
+    changeGoodName(val) {
429
+      this.currentIndex = val;
430
+    },
431
+    selectGoodName(val){
432
+      if(this.storehouse_out_id == ""){
433
+        this.$message.error("请先选择调出仓库!")
434
+        return
435
+      }
436
+    },
437
+    changeName(val) {
438
+      for (let i = 0; i < this.recordInfo.recordData.length; i++) {
439
+        if (this.currentIndex == i) {
440
+          this.recordInfo.recordData[i].project_id = val.id;
441
+          this.recordInfo.recordData[i].is_source = val.is_source;
442
+          this.recordInfo.recordData[i].name = val.name;
443
+          this.recordInfo.recordData[i].project_name = val.project_name;
444
+          this.recordInfo.recordData[i].project_type = val.project_type;
445
+          this.recordInfo.recordData[i].second_specification_name = val.second_specification_name;
446
+          this.recordInfo.recordData[i].second_total = val.second_total;
447
+          this.recordInfo.recordData[i].sencond_unit = val.sencond_unit
448
+          this.recordInfo.recordData[i].min_price = val.min_price
449
+          if (val.count == NaN) {
450
+            this.recordInfo.recordData[i].count = "";
451
+          } else {
452
+            this.recordInfo.recordData[i].count = val.count? val.count : "";
453
+          }
454
+          this.recordInfo.recordData[i].unitList = val.unitList;
455
+        }
456
+      }
457
+    },
458
+    getWarehoseInfo(arr, max_unit, min_unit, min_number) {
459
+        var total = 0;
460
+        var max_str = "";
461
+        var min_str = "";
462
+        if (arr.length > 0) {
463
+            for (let i = 0; i < arr.length; i++) {
464
+            total += parseInt(arr[i].stock_max_number + arr[i].stock_min_number);
465
+            }
466
+        }
467
+        if (total < min_number) {
468
+            min_str = total + min_unit;
469
+        }
470
+        if (total == 0) {
471
+            min_str = "";
472
+            max_str = "";
473
+        }
474
+        if (total >= min_number) {
475
+            if (parseInt(total / min_number) != 0) {
476
+            max_str = parseInt(total / min_number) + max_unit;
477
+            }
478
+            if (total % min_number != 0) {
479
+            min_str = (total % min_number) + min_unit;
480
+            }
481
+        }
482
+        return max_str + min_str;
483
+      },
484
+      getTotalStockCount(arr) {
485
+        var total_count = 0;
486
+        for (let i = 0; i < arr.length; i++) {
487
+            total_count += arr[i].stock_count;
488
+        }
489
+        return total_count;
490
+      },
491
+      changeHouseList(){
492
+         var params = {
493
+           storehouse_out_id:this.storehouse_out_id,
494
+         }
495
+         this.tabList = []
496
+        getStoreHouseGoodList(params).then(response=>{
497
+          var drugList = response.data.data.drugList
498
+          this.drugList= drugList
499
+          var goodList = response.data.data.goodList
500
+          this.goodList = goodList
501
+          var manufactuerList = response.data.data.manufacturerList
502
+        
503
+          var goodTypeList = response.data.data.goodTypeList
504
+          this.goodTypeList = goodTypeList
505
+          var drugTypeList = response.data.data.drugTypeList
506
+          this.drugTypeList = drugTypeList
507
+         
508
+          for(let i=0;i<drugList.length;i++){
509
+            for (let j = 0; j < manufactuerList.length; j++) {
510
+              if (drugList[i].manufacturer == manufactuerList[j].id) {
511
+                drugList[i].manufacturer = manufactuerList[j].manufacturer_name;
512
+              }
513
+            }
514
+            for (let z = 0; z < drugList[i].drug_warehouse_info.length; z++) {
515
+              if (drugList[i].max_unit ==drugList[i].drug_warehouse_info[z].max_unit) {
516
+                  drugList[i].drug_warehouse_info[z].stock_max_number = drugList[i].drug_warehouse_info[z].stock_max_number *drugList[i].min_number;
517
+              }
518
+              }
519
+              for (let y = 0; y < this.drugTypeList.length; y++) {
520
+                if (drugList[i].drug_type == this.drugTypeList[y].value) {
521
+                    drugList[i].drug_type = this.drugTypeList[y].name;
522
+                  }
523
+              }
524
+              drugList[i].name = drugList[i].drug_name
525
+              drugList[i].project_name =drugList[i].drug_name + " " +drugList[i].dose + drugList[i].dose_unit + "*" +drugList[i].min_number +drugList[i].min_unit + "/" + drugList[i].max_unit + " " +drugList[i].manufacturer;
526
+              drugList[i].project_type = drugList[i].drug_type;
527
+              drugList[i].second_specification_name = drugList[i].dose + drugList[i].dose_unit +"*" + drugList[i].min_number +drugList[i].min_unit +"/" + drugList[i].max_unit;
528
+              drugList[i].second_total = this.getWarehoseInfo(drugList[i].drug_warehouse_info,drugList[i].max_unit,drugList[i].min_unit,drugList[i].min_number);
529
+              drugList[i].is_source = 1
530
+              drugList[i].count = ""
531
+              drugList[i].remake = ""
532
+              drugList[i].min_price = drugList[i].min_price
533
+            if (drugList[i].max_unit != drugList[i].min_unit) {
534
+              drugList[i].unitList = [
535
+                  { id: 1, name: "" },
536
+                  { id: 2, name: "" },
537
+              ];
538
+            }
539
+          if (drugList[i].max_unit == drugList[i].min_unit) {
540
+              drugList[i].unitList = [{ id: 1, name: "" }];
541
+          }
542
+
543
+          drugList[i].sencond_unit = drugList[i].max_unit;
544
+          for (let j = 0; j < drugList[i].unitList.length; j++) {
545
+            if (drugList[i].max_unit != drugList[i].min_unit) {
546
+              drugList[i].unitList[0].name = drugList[i].max_unit;
547
+              drugList[i].unitList[1].name = drugList[i].min_unit;
548
+            }
549
+            if (drugList[i].max_unit == drugList[i].min_unit) {
550
+              drugList[i].unitList[0].name = drugList[i].max_unit;
551
+            }
552
+          }
553
+          this.tabList.push(drugList[i]);
554
+          }
555
+
556
+        for (let i = 0; i < goodList.length; i++) {
557
+          for (let j = 0; j < manufactuerList.length; j++) {
558
+            if (goodList[i].manufacturer == manufactuerList[j].id) {
559
+                goodList[i].manufacturer = manufactuerList[j].manufacturer_name;
560
+            }
561
+          }
562
+          for (let y = 0; y < this.goodTypeList.length; y++) {
563
+            if (goodList[i].good_type_id == this.goodTypeList[y].id) {
564
+              goodList[i].good_type_id = this.goodTypeList[y].type_name;
565
+            }
566
+          }
567
+          goodList[i].name = goodList[i].good_name
568
+          goodList[i].project_name = goodList[i].good_name + " " + goodList[i].specification_name + " " + goodList[i].manufacturer;
569
+          goodList[i].project_type = goodList[i].good_type_id;
570
+          goodList[i].second_specification_name = goodList[i].specification_name;
571
+          goodList[i].second_total = this.getTotalStockCount(
572
+            goodList[i].good_warehouse_info
573
+          );
574
+          goodList[i].count = ""
575
+          goodList[i].is_source = 2;
576
+          goodList[i].name = goodList[i].good_name;
577
+          goodList[i].unitList = [{ id: 1, name: "" }];
578
+          goodList[i].sencond_unit = goodList[i].packing_unit;
579
+          goodList[i].remake = ""
580
+          goodList[i].min_price = goodList[i].retail_price
581
+          for (let j = 0; j < goodList[i].unitList.length; j++) {
582
+            goodList[i].unitList[0].name = goodList[i].packing_unit;
583
+          }
584
+          this.tabList.push(goodList[i]);
585
+        }
586
+       })
587
+      },
588
+     selectCount(project_id,sencond_unit,is_source,count,index){
589
+      var params = {
590
+        project_id:project_id,
591
+        sencond_unit:sencond_unit,
592
+        is_source:parseInt(is_source),
593
+        count:parseInt(count),
594
+        storehouse_out_id:this.storehouse_out_id
595
+      }
596
+      getSumSecondeCount(params).then(response=>{
597
+         if(response.data.state == 1){
598
+           var msg = response.data.data.msg
599
+           if(msg == 2){
600
+             this.$message.error("调拨数量不能大于库存总量!")
601
+             for(let i=0;i<this.recordInfo.recordData.length;i++){
602
+               if(index == i){
603
+                 this.recordInfo.recordData[i].count = ""
604
+               }
605
+             }
606
+           }
607
+         }
608
+      })
609
+
610
+    }
221
   },
611
   },
612
+  created(){
613
+    var nowDate = new Date()
614
+    var nowYear = nowDate.getFullYear()
615
+    var nowMonth = nowDate.getMonth() + 1
616
+    var nowDay = nowDate.getDate()
617
+    this.warehousing_time =
618
+      nowYear +
619
+      '-' +
620
+      (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
621
+      '-' +
622
+      (nowDay < 10 ? '0' + nowDay : nowDay)
623
+    const tempObj = {}
624
+    tempObj["name"] = "";
625
+    tempObj['project_name'] = ""
626
+    tempObj['project_type'] = ""
627
+    tempObj['second_specification_name'] = ''
628
+    tempObj['sencond_unit'] = ''
629
+    tempObj['count'] = ''
630
+    tempObj['second_total'] = ''
631
+    tempObj["remake"] = ''
632
+    tempObj["is_source"] = 0
633
+    tempObj["project_id"] = 0
634
+    tempObj["min_price"] = 0
635
+    this.recordInfo.recordData.push(tempObj)
636
+    this.getlist()  
637
+  }
222
 };
638
 };
223
 </script>
639
 </script>
224
 
640
 

+ 300 - 38
src/xt_pages/stock/inventoryTransfer/index.vue 查看文件

18
         "
18
         "
19
       >
19
       >
20
         <div>
20
         <div>
21
-          <el-input
22
-            size="small"
23
-            style="width: 200px; margin-left: 10px"
24
-            class="filter-item"
25
-            v-model.trim="keywords"
26
-          />
27
-          <el-button
21
+          <!-- <el-button
28
             size="small"
22
             size="small"
29
             class="filter-item"
23
             class="filter-item"
30
             type="primary"
24
             type="primary"
31
             icon="el-icon-search"
25
             icon="el-icon-search"
32
             @click="search"
26
             @click="search"
33
             >查看</el-button
27
             >查看</el-button
34
-          >
28
+          > -->
35
         </div>
29
         </div>
36
         <div>
30
         <div>
37
           单据日期:
31
           单据日期:
38
-          <el-date-picker v-model="value1" type="date" placeholder="选择日期">
39
-          </el-date-picker>
32
+          <el-date-picker
33
+            size="small"
34
+            v-model="start_time"
35
+            prefix-icon="el-icon-date"
36
+            :editable="false"
37
+            style="width: 196px"
38
+            type="date"
39
+            placeholder="选择日期时间"
40
+            align="right"
41
+            format="yyyy-MM-dd"
42
+            value-format="yyyy-MM-dd"
43
+            @change="startTimeChange"
44
+          ></el-date-picker
45
+          >-
46
+          <el-date-picker
47
+            size="small"
48
+            v-model="end_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
+            @change="endTimeChange"
58
+          ></el-date-picker>
59
+          <el-input
60
+            size="small"
61
+            style="width: 200px; margin-left: 10px"
62
+            class="filter-item"
63
+            placeholder="请输入单据编号,仓库名称"
64
+            v-model.trim="keywords"
65
+          />
40
           <el-button
66
           <el-button
41
             size="small"
67
             size="small"
42
             class="filter-item"
68
             class="filter-item"
60
         <el-table-column type="selection" width="55"> </el-table-column>
86
         <el-table-column type="selection" width="55"> </el-table-column>
61
         <el-table-column label="单据编号" align="center">
87
         <el-table-column label="单据编号" align="center">
62
           <template slot-scope="scope">
88
           <template slot-scope="scope">
63
-            <span>{{ scope.row.drug_name ? scope.row.drug_name : "" }}</span>
89
+            <span>{{scope.row.second_order_number}}</span>
64
           </template>
90
           </template>
65
         </el-table-column>
91
         </el-table-column>
66
         <el-table-column label="单据日期" align="center">
92
         <el-table-column label="单据日期" align="center">
67
           <template slot-scope="scope">
93
           <template slot-scope="scope">
68
-            <span>{{ scope.row.drug_spec ? scope.row.drug_spec : "" }}</span>
69
-          </template>
70
-        </el-table-column>
71
-        <el-table-column label="商品名称" align="center">
72
-          <template slot-scope="scope">
73
-            <span>{{ scope.row.Count ? scope.row.Count : "" }}</span>
94
+             {{getTime(scope.row.record_date)}}
74
           </template>
95
           </template>
75
         </el-table-column>
96
         </el-table-column>
97
+      
76
         <el-table-column label="调出仓库" align="center">
98
         <el-table-column label="调出仓库" align="center">
77
           <template slot-scope="scope">
99
           <template slot-scope="scope">
78
-            <span>{{ scope.row.Count ? scope.row.Count : "" }}</span>
100
+             {{getHouseName(scope.row.storehouse_out_id)}}
79
           </template>
101
           </template>
80
         </el-table-column>
102
         </el-table-column>
81
         <el-table-column label="调入仓库" align="center">
103
         <el-table-column label="调入仓库" align="center">
82
           <template slot-scope="scope">
104
           <template slot-scope="scope">
83
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
105
+            {{getHouseName(scope.row.storehouse_in_id)}}
84
           </template>
106
           </template>
85
         </el-table-column>
107
         </el-table-column>
86
         <el-table-column label="制单人" align="center">
108
         <el-table-column label="制单人" align="center">
87
           <template slot-scope="scope">
109
           <template slot-scope="scope">
88
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
110
+            {{getDocName(scope.row.creater)}}
89
           </template>
111
           </template>
90
         </el-table-column>
112
         </el-table-column>
91
         <el-table-column label="审核人" align="center">
113
         <el-table-column label="审核人" align="center">
92
           <template slot-scope="scope">
114
           <template slot-scope="scope">
93
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
115
+           {{getDocName(scope.row.checker)}}
94
           </template>
116
           </template>
95
         </el-table-column>
117
         </el-table-column>
96
         <el-table-column label="审核时间" align="center">
118
         <el-table-column label="审核时间" align="center">
97
           <template slot-scope="scope">
119
           <template slot-scope="scope">
98
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
120
+            {{getTime(scope.row.check_time)}}
99
           </template>
121
           </template>
100
         </el-table-column>
122
         </el-table-column>
101
         <el-table-column label="操作" align="center" width="260px">
123
         <el-table-column label="操作" align="center" width="260px">
114
                 icon="el-icon-delete"
136
                 icon="el-icon-delete"
115
                 size="small"
137
                 size="small"
116
                 type="danger"
138
                 type="danger"
117
-                @click="toDelete(scope.row, scope.row.$index)"
139
+                @click="toDelete(scope.row, scope.$index)"
118
               >
140
               >
119
               </el-button>
141
               </el-button>
120
             </el-tooltip>
142
             </el-tooltip>
150
 
172
 
151
 <script>
173
 <script>
152
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
174
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
175
+import {getAllSecondOrderList,checkSecondOrder,deleteStoreHouseList,returnCheckSecondOrder} from "@/api/seconde";
176
+import { uParseTime } from "@/utils/tools";
153
 export default {
177
 export default {
154
   components: {
178
   components: {
155
     BreadCrumb,
179
     BreadCrumb,
164
       total: 0,
188
       total: 0,
165
       page: 1,
189
       page: 1,
166
       limit: 10,
190
       limit: 10,
167
-      tableData: [{}, {}],
191
+      tableData: [],
192
+      keywords:"",
193
+      start_time:"",
194
+      end_time:"",
195
+      supplyList: [],
196
+      check_id: 0,
197
+      doctorList: [],
198
+      houseList:[],
199
+      check_id:0,
200
+      ids:"",
201
+      array:[],
202
+      checkArray:[],
203
+      returnArray:[],
168
     };
204
     };
169
   },
205
   },
170
 
206
 
171
   methods: {
207
   methods: {
172
-    // 初始化数据
173
-    init() {},
174
-
208
+   
175
     // 反审核
209
     // 反审核
176
-    approval() {},
210
+    approval() {
211
+      if(this.array.length<=0){
212
+       this.$message.error("请勾选需要反审核的订单!")
213
+       return
214
+      }
215
+      if(this.returnArray.length >0){
216
+        this.$message.error("不能勾选未审核的单据!")
217
+        return
218
+      }
219
+      var ids = this.array.join(",")
220
+      returnCheckSecondOrder(ids).then(response=>{
221
+         if(response.data.state == 1){
222
+          var msg = response.data.data.msg
223
+          if(msg == 0){
224
+            this.$message.success("反审核失败!")
225
+            this.getlist()
226
+          }
227
+          if(msg == 1){
228
+            this.$message.success("反审核成功!")
229
+            this.getlist()
230
+          }
231
+          if(msg == 2){
232
+            var good_name = response.data.data.good_name
233
+            var specification_name = response.data.data.specification_name
234
+            var storehose_name = response.data.data.storehose_name
235
+
236
+            this.$message.error(storehose_name + " "+good_name+"*"+specification_name+"已有出库数据不能反审核")
237
+          }
238
+          if(msg == 3){
239
+            var drug_name =  response.data.data.drug_name
240
+            var dose = response.data.data.dose
241
+            var dose_unit = response.data.data.dose_unit
242
+            var min_number = response.data.data.min_number
243
+            var min_unit =  response.data.data.min_unit
244
+            var max_unit =  response.data.data.max_unit
245
+            var str = drug_name + " " + dose + dose_unit + "*" + min_number + min_unit+"/"+max_unit
246
+            var storehose_name = response.data.data.storehose_name
247
+            this.$message.error(storehose_name +" "+str +"已有出库数据不能反审核!")
248
+
249
+          }
250
+         }
251
+      })
252
+
253
+    },
177
 
254
 
178
     // 审核
255
     // 审核
179
-    examine() {},
256
+    examine() {
257
+      if(this.checkArray.length >0){
258
+       this.$message.error("不能勾选已审核的单据!")
259
+       return
260
+      }
261
+
262
+      if(this.array.length <=0){
263
+       this.$message.error("请勾选需要审核的订单!")
264
+       return
265
+      }
266
+      var ids = this.array.join(",")
267
+      checkSecondOrder(ids).then(response=>{
268
+        if(response.data.state == 1){
269
+          var msg = response.data.data.msg
270
+         
271
+          if(msg == 1){
272
+            this.$message.success("审核成功!")
273
+            this.getlist()
274
+          }
275
+          if(msg == 2){
276
+            var good_name = response.data.data.good_name
277
+            var specification_name = response.data.data.specification_name
278
+            var storehose_name = response.data.data.storehose_name
279
+
280
+            this.$message.error("审核失败" + " "+storehose_name + " "+good_name+"*"+specification_name+"库存不足,无法调拨,请修改调拨数量!")
281
+          }
282
+          if(msg == 3){
283
+            var drug_name =  response.data.data.drug_name
284
+            var dose = response.data.data.dose
285
+            var dose_unit = response.data.data.dose_unit
286
+            var min_number = response.data.data.min_number
287
+            var min_unit =  response.data.data.min_unit
288
+            var max_unit =  response.data.data.max_unit
289
+            var str = drug_name + " " + dose + dose_unit + "*" + min_number + min_unit+"/"+max_unit
290
+            var storehose_name = response.data.data.storehose_name
291
+            this.$message.error("审核失败" + " " + storehose_name +" "+str +"库存不足,无法调拨,请修改调拨数量!")
292
+
293
+          }
294
+
295
+        }
296
+      })
297
+    },
180
 
298
 
181
     // 添加
299
     // 添加
182
     Add() {
300
     Add() {
183
-        this.$router.push({path:"/stock/inventoryTransfer/Addtrans"})
301
+      this.$router.push({path:"/stock/inventoryTransfer/Addtrans"})
184
     },
302
     },
185
 
303
 
186
     // 删除
304
     // 删除
187
-    toDelete() {},
305
+    toDelete(row,index) {
306
+      if(row.is_check == 1){
307
+        this.$message.error("已审核数据不能删除!")
308
+        return 
309
+      }
310
+      this.$confirm("确认删除库存调拨单记录?", "删除库存调拨单记录", {
311
+        confirmButtonText: "确定",
312
+        cancelButtonText: "取消", 
313
+        type: "warning"
314
+      }).then(() => {
315
+          deleteStoreHouseList(row.id).then(response => {
316
+            if (response.data.state == 0) {
317
+              this.$message.error(response.data.msg);
318
+              return false;
319
+            } else {
320
+              this.$notify({
321
+                title: "成功",
322
+                message: "删除成功",
323
+                type: "success",
324
+                duration: 2000
325
+              });
326
+              this.tableData.splice(index,1)
327
+            }
328
+          });
329
+        }).catch(() => {});
330
+    },
188
 
331
 
189
     // 详情查看
332
     // 详情查看
190
-    toDetails() {
191
-        this.$router.push({path:"/stock/inventoryTransfer/transDetails"})
333
+    toDetails(row) {
334
+        this.$router.push({path:"/stock/inventoryTransfer/transDetails?id="+row.id})
335
+    },
336
+    changeTypeName() {
337
+      this.getlist();
338
+    },
339
+    startTimeChange() {
340
+      
341
+      this.getlist();
342
+    },
343
+    endTimeChange() {
344
+     
345
+      this.getlist();
346
+    },
347
+    search() {
348
+      this.getlist();
349
+    },
350
+    getTimes(time) {
351
+      if (time === "") {
352
+        return "";
353
+      }
354
+      return uParseTime(time, "{y}-{m}-{d}");
192
     },
355
     },
193
-
194
     // 表单全选
356
     // 表单全选
195
-    handleSelectionChange() {},
196
-
357
+    handleSelectionChange(val) {
358
+      this.array = []
359
+      this.checkArray = []
360
+      this.returnArray = []
361
+     for(let i=0;i<val.length;i++){
362
+      this.array.push(val[i].id)
363
+      if(val[i].is_check == 1){
364
+        this.checkArray.push(val[i].is_check)
365
+      }
366
+      if(val[i].is_check == 2){
367
+        this.returnArray.push(val[i].is_check)
368
+      }
369
+     }
370
+    },
197
     // 页表操作
371
     // 页表操作
198
     handleSizeChange(val) {
372
     handleSizeChange(val) {
373
+      this.array= []
374
+      this.checkArray = []
375
+      this.returnArray = []
199
       this.limit = val;
376
       this.limit = val;
200
-      this.init();
377
+      this.getlist();
201
     },
378
     },
202
     handleCurrentChange(val) {
379
     handleCurrentChange(val) {
380
+      this.array= []
381
+      this.checkArray = []
382
+      this.returnArray = []
203
       this.page = val;
383
       this.page = val;
204
-      this.init();
384
+      this.getlist();
205
     },
385
     },
206
 
386
 
207
     // 表格样式
387
     // 表格样式
218
         };
398
         };
219
       }
399
       }
220
     },
400
     },
401
+    getlist() {
402
+      var params = {
403
+        check_id: this.check_id,
404
+        start_time: this.start_time,
405
+        end_time: this.end_time,
406
+        keyword: this.keywords,
407
+        page: this.page,
408
+        limit: this.limit,
409
+      };
410
+      getAllSecondOrderList(params).then((response) => {
411
+        if (response.data.state == 1) {
412
+          var list = response.data.data.list;
413
+          this.tableData = list;
414
+          var total = response.data.data.total;
415
+          this.total = total;
416
+          this.houseList = response.data.data.houseList
417
+          this.doctorList = response.data.data.doctorList
418
+        }
419
+      });
420
+    },
421
+    getName(id) {
422
+      var name = "";
423
+      for (let i = 0; i < this.supplyList.length; i++) {
424
+        if (id == this.supplyList[i].id) {
425
+          name = this.supplyList[i].supplier_name;
426
+        }
427
+      }
428
+      return name;
429
+    },
430
+    getDocName(id) {
431
+      var user_name = "";
432
+      for (let i = 0; i < this.doctorList.length; i++) {
433
+        if (id == this.doctorList[i].admin_user_id) {
434
+          user_name = this.doctorList[i].user_name;
435
+        }
436
+      }
437
+      return user_name;
438
+    },
439
+    getTime(time) {
440
+      if (time === "") {
441
+        return "";
442
+      }
443
+      return uParseTime(time, "{y}-{m}-{d}");
444
+    },
445
+    getHouseName(id){
446
+      var storehouse_name = ""
447
+      for(let i=0;i<this.houseList.length;i++){
448
+         if(id == this.houseList[i].id){
449
+           storehouse_name = this.houseList[i].storehouse_name
450
+         }
451
+      }
452
+      return storehouse_name
453
+    },
454
+    toEdit(row){
455
+      this.$router.push("/stock/inventoryTransfer/transedit?id="+row.id)
456
+    }
221
   },
457
   },
458
+  created(){
459
+    var now = new Date(); //当前日期
460
+    var nowMonth = now.getMonth(); //当前月
461
+    var nowYear = now.getFullYear(); //当前年
462
+    //本月的开始时间
463
+    var monthStartDate = new Date(nowYear, nowMonth, 1);
464
+    this.start_time = this.getTimes(monthStartDate);
465
+    this.end_time = this.getTimes(new Date());
466
+
467
+    // this.org_id = this.$store.getters.xt_user.org_id;
468
+    // var start_time =  window.sessionStorage.getItem('purchase_start_time')
469
+    
470
+    // var end_time =  window.sessionStorage.getItem('purchase_end_time')
471
+   
472
+    // if(start_time !=null){
473
+    //   this.start_time = ""
474
+    //   this.start_time = start_time
475
+    // }
476
+    // if(end_time!=null){
477
+    //   this.end_time = ""
478
+    //   this.end_time = end_time
479
+    // }
480
+    // window.sessionStorage.removeItem('purchase_start_time')
481
+    // window.sessionStorage.removeItem('purchase_end_time')
482
+    this.getlist();
483
+  }
222
 };
484
 };
223
 </script>
485
 </script>
224
 
486
 

+ 86 - 26
src/xt_pages/stock/inventoryTransfer/transDetails.vue 查看文件

10
           backgroundColor: 'rgb(245, 247, 250)',
10
           backgroundColor: 'rgb(245, 247, 250)',
11
           color: '#606266',
11
           color: '#606266',
12
         }"
12
         }"
13
-        :data="tableData"
14
-        :class="signAndWeighBoxPatients"
13
+        :data="tableList"
15
         border
14
         border
16
       >
15
       >
17
         >
16
         >
20
             商品名称<span style="color: red">*</span>
19
             商品名称<span style="color: red">*</span>
21
           </template>
20
           </template>
22
           <template slot-scope="scope">
21
           <template slot-scope="scope">
23
-            <span>{{ scope.row.Count ? scope.row.Count : "" }}</span>
22
+           {{scope.row.project_name}}
24
           </template>
23
           </template>
25
         </el-table-column>
24
         </el-table-column>
26
         <el-table-column label="商品类型" align="center">
25
         <el-table-column label="商品类型" align="center">
27
           <template slot-scope="scope">
26
           <template slot-scope="scope">
28
-            <span>{{ scope.row.Count ? scope.row.Count : "" }}</span>
27
+           {{scope.row.project_type}}
29
           </template>
28
           </template>
30
         </el-table-column>
29
         </el-table-column>
31
-        <el-table-column label="规格&&单位" align="center">
30
+        <el-table-column label="规格" align="center">
32
           <template slot-scope="scope">
31
           <template slot-scope="scope">
33
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
32
+             {{scope.row.second_specification_name}}
34
           </template>
33
           </template>
35
         </el-table-column>
34
         </el-table-column>
36
         <el-table-column label="调拨数量" align="center">
35
         <el-table-column label="调拨数量" align="center">
37
           <template slot-scope="scope">
36
           <template slot-scope="scope">
38
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
37
+            {{scope.row.count}}{{scope.row.sencond_unit}}
39
           </template>
38
           </template>
40
         </el-table-column>
39
         </el-table-column>
41
         <el-table-column label="调出仓库" align="center">
40
         <el-table-column label="调出仓库" align="center">
42
           <template slot-scope="scope">
41
           <template slot-scope="scope">
43
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
42
+           {{getHouseName(scope.row.storehouse_out_id)}}
44
           </template>
43
           </template>
45
         </el-table-column>
44
         </el-table-column>
46
         <el-table-column label="调入仓库" align="center">
45
         <el-table-column label="调入仓库" align="center">
47
           <template slot-scope="scope">
46
           <template slot-scope="scope">
48
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
47
+           {{getHouseName(scope.row.storehouse_in_id)}}
49
           </template>
48
           </template>
50
         </el-table-column>
49
         </el-table-column>
51
         <el-table-column label="库存总数" align="center">
50
         <el-table-column label="库存总数" align="center">
52
           <template slot-scope="scope">
51
           <template slot-scope="scope">
53
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
52
+            {{scope.row.second_total}}
54
           </template>
53
           </template>
55
         </el-table-column>
54
         </el-table-column>
56
         <el-table-column label="制单人" align="center">
55
         <el-table-column label="制单人" align="center">
57
           <template slot-scope="scope">
56
           <template slot-scope="scope">
58
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
57
+            {{getDocName(warehouse.creater)}}
59
           </template>
58
           </template>
60
         </el-table-column>
59
         </el-table-column>
61
         <el-table-column label="审核人" align="center">
60
         <el-table-column label="审核人" align="center">
62
           <template slot-scope="scope">
61
           <template slot-scope="scope">
63
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
62
+            {{getDocName(warehouse.checker)}}
64
           </template>
63
           </template>
65
         </el-table-column>
64
         </el-table-column>
66
         <el-table-column label="审核时间" align="center">
65
         <el-table-column label="审核时间" align="center">
67
           <template slot-scope="scope">
66
           <template slot-scope="scope">
68
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
67
+           <span v-if="warehouse.check_time >0">{{getTimes(warehouse.check_time)}}</span>  
69
           </template>
68
           </template>
70
         </el-table-column>
69
         </el-table-column>
71
         <el-table-column label="备注" align="center">
70
         <el-table-column label="备注" align="center">
72
           <template slot-scope="scope">
71
           <template slot-scope="scope">
73
-            <span>{{ scope.row.outCount ? scope.row.outCount : "" }}</span>
72
+            <span>{{ scope.row.remake ? scope.row.remake : "" }}</span>
74
           </template>
73
           </template>
75
         </el-table-column>
74
         </el-table-column>
76
       </el-table>
75
       </el-table>
77
-      <el-pagination
78
-        @size-change="handleSizeChange"
79
-        @current-change="handleCurrentChange"
80
-        :page-sizes="[10, 50, 100, 200, 500, 1000]"
81
-        :page-size="10"
82
-        background
83
-        align="right"
84
-        style="margin-top: 20px"
85
-        layout="total, sizes, prev, pager, next, jumper"
86
-        :total="total"
87
-      >
88
-      </el-pagination>
76
+     
89
     </div>
77
     </div>
90
   </div>
78
   </div>
91
 </template>
79
 </template>
92
 
80
 
93
 <script>
81
 <script>
94
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
82
 import BreadCrumb from "@/xt_pages/components/bread-crumb";
83
+import {getSecondOrderDetailList} from "@/api/seconde";
84
+import { uParseTime } from "@/utils/tools";
95
 export default {
85
 export default {
96
   components: {
86
   components: {
97
     BreadCrumb,
87
     BreadCrumb,
116
           { required: true, message: "请选择活动区域", trigger: "change" },
106
           { required: true, message: "请选择活动区域", trigger: "change" },
117
         ],
107
         ],
118
       },
108
       },
109
+      supplyList: [],
110
+      check_id: 0,
111
+      doctorList: [],
112
+      houseList:[],
113
+      warehouse:{},
114
+      tableList:[],
119
     };
115
     };
120
   },
116
   },
121
 
117
 
168
         };
164
         };
169
       }
165
       }
170
     },
166
     },
167
+       getTimes(time) {
168
+      if (time === "") {
169
+        return "";
170
+      }
171
+      return uParseTime(time, "{y}-{m}-{d}");
172
+    },
173
+    getlist() {
174
+       var id = parseInt(this.$route.query.id)
175
+      getSecondOrderDetailList(id).then((response) => {
176
+        if (response.data.state == 1) {
177
+          var list = response.data.data.list;
178
+          this.tableList = list;
179
+          this.houseList = response.data.data.houseList
180
+          this.doctorList = response.data.data.doctorList
181
+          var warehouse = response.data.data.warehouse
182
+          this.warehouse = warehouse
183
+        }
184
+      });
185
+    },
186
+    getHouseName(id){
187
+      var storehouse_name = ""
188
+      for(let i=0;i<this.houseList.length;i++){
189
+         if(id == this.houseList[i].id){
190
+           storehouse_name = this.houseList[i].storehouse_name
191
+         }
192
+      }
193
+      return storehouse_name
194
+    },
195
+    getDocName(id) {
196
+      var user_name = "";
197
+      for (let i = 0; i < this.doctorList.length; i++) {
198
+        if (id == this.doctorList[i].admin_user_id) {
199
+          user_name = this.doctorList[i].user_name;
200
+        }
201
+      }
202
+      return user_name;
203
+    }
171
   },
204
   },
205
+  created(){
206
+    var now = new Date(); //当前日期
207
+    var nowMonth = now.getMonth(); //当前月
208
+    var nowYear = now.getFullYear(); //当前年
209
+    //本月的开始时间
210
+    var monthStartDate = new Date(nowYear, nowMonth, 1);
211
+    this.start_time = this.getTimes(monthStartDate);
212
+    this.end_time = this.getTimes(new Date());
213
+
214
+    this.org_id = this.$store.getters.xt_user.org_id;
215
+    // var start_time =  window.sessionStorage.getItem('purchase_start_time')
216
+    
217
+    // var end_time =  window.sessionStorage.getItem('purchase_end_time')
218
+  
219
+    // if(start_time !=null){
220
+    //   this.start_time = ""
221
+    //   this.start_time = start_time
222
+    // }
223
+    // if(end_time!=null){
224
+    //   this.end_time = ""
225
+    //   this.end_time = end_time
226
+    // }
227
+    // window.sessionStorage.removeItem('purchase_start_time')
228
+    // window.sessionStorage.removeItem('purchase_end_time')
229
+  
230
+    this.getlist();
231
+  }
172
 };
232
 };
173
 </script>
233
 </script>
174
 
234
 

+ 24 - 12
src/xt_pages/stock/stockBatchNumber.vue 查看文件

71
              <span>{{scope.row.number}} </span>
71
              <span>{{scope.row.number}} </span>
72
            </template>
72
            </template>
73
         </el-table-column>
73
         </el-table-column>
74
+        <el-table-column prop="drug_name" label="仓库名称" align="center">
75
+           <template slot-scope="scope">
76
+              <span>{{getHouseName(scope.row.storehouse_id)}}</span>
77
+           </template>
78
+        </el-table-column>
74
         <el-table-column prop="drug_name" label="入库数量" align="center">
79
         <el-table-column prop="drug_name" label="入库数量" align="center">
75
            <template slot-scope="scope">
80
            <template slot-scope="scope">
76
              <span> {{scope.row.warehousing_count}}{{packing_unit}}</span>
81
              <span> {{scope.row.warehousing_count}}{{packing_unit}}</span>
183
         keywords:"",
188
         keywords:"",
184
         packing_unit:"",
189
         packing_unit:"",
185
         cancelCountList:[],
190
         cancelCountList:[],
191
+        houseList:[],
186
       }
192
       }
187
     },
193
     },
188
     methods:{
194
     methods:{
246
       getStockInList(params).then(response=>{
252
       getStockInList(params).then(response=>{
247
          if(response.data.state == 1){
253
          if(response.data.state == 1){
248
            var list = response.data.data.list
254
            var list = response.data.data.list
249
-           console.log("入库数据",list)
250
-          //  for(let i=0;i<list.length;i++){
251
-          //    list[i].stock_way = 4
252
-          //  }
255
+        
253
            this.tableList = list
256
            this.tableList = list
254
            var total = response.data.data.total
257
            var total = response.data.data.total
255
            this.total = total
258
            this.total = total
256
-           console.log("入库数据",this.tableList)
257
            var manufacturerList = response.data.data.manufacturerList
259
            var manufacturerList = response.data.data.manufacturerList
258
            this.manufacturerList = manufacturerList
260
            this.manufacturerList = manufacturerList
261
+           this.houseList = response.data.data.houseList
259
          }
262
          }
260
       })
263
       })
261
      },
264
      },
269
         return count
272
         return count
270
      },
273
      },
271
      getOutCount(id){
274
      getOutCount(id){
272
-        console.log("id222",id)
273
         var count = ""
275
         var count = ""
274
         for(let i=0;i<this.outCountList.length;i++){
276
         for(let i=0;i<this.outCountList.length;i++){
275
           if(id == this.outCountList[i].good_id){
277
           if(id == this.outCountList[i].good_id){
309
         getStockDrugCount(params).then(response=>{
311
         getStockDrugCount(params).then(response=>{
310
           if(response.data.state == 1){
312
           if(response.data.state == 1){
311
             var count = response.data.data.count
313
             var count = response.data.data.count
312
-            console.log("详情入库统计",count)
314
+           
313
             this.countList = count
315
             this.countList = count
314
             var outlist = response.data.data.outList
316
             var outlist = response.data.data.outList
315
-            console.log("详情出库数量",outlist)
316
-            
317
+           
317
             this.outCountList = outlist
318
             this.outCountList = outlist
318
             var autoCount = response.data.data.autoCount
319
             var autoCount = response.data.data.autoCount
319
-            console.log("详情自动出库",autoCount)
320
+           
320
             this.autoCountList = autoCount
321
             this.autoCountList = autoCount
321
             var totalCount = response.data.data.totalCount
322
             var totalCount = response.data.data.totalCount
322
-            console.log("totalcount",totalCount)
323
+  
323
             this.cancelCountList = totalCount
324
             this.cancelCountList = totalCount
325
+
326
+           
324
           }
327
           }
325
         })
328
         })
326
       },
329
       },
332
           }
335
           }
333
         }
336
         }
334
        return stock_count
337
        return stock_count
335
-      }
338
+      },
339
+      getHouseName(id){
340
+        var storehouse_name = ""
341
+        for(let i=0;i<this.houseList.length;i++){
342
+          if(id == this.houseList[i].id){
343
+            storehouse_name = this.houseList[i].storehouse_name
344
+          }
345
+        }
346
+        return storehouse_name
347
+     },
336
       
348
       
337
 
349
 
338
     }
350
     }

+ 43 - 24
src/xt_pages/stock/stockDamaged.vue 查看文件

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
     <div  style="margin-bottom:10px;">
3
     <div  style="margin-bottom:10px;">
4
+       <label class="title"><span class="name">仓库</span> :</label>
5
+       <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
6
+          <el-option
7
+            v-for="(option, index) in houseList"
8
+            :key="index"
9
+            :label="option.storehouse_name"
10
+            :value="option.id">
11
+          </el-option>
12
+        </el-select>  
4
         <el-input
13
         <el-input
5
         size="small"
14
         size="small"
6
         style="width: 200px;"
15
         style="width: 200px;"
60
             {{getAllDamageCount(scope.row.good_id,scope.row.buy_price)}}
69
             {{getAllDamageCount(scope.row.good_id,scope.row.buy_price)}}
61
             </template>    
70
             </template>    
62
         </el-table-column>
71
         </el-table-column>
72
+        <el-table-column prop="date" label="仓库名称"  align="center">
73
+          <template  slot-scope="scope">
74
+            {{getStorehouseName(scope.row.storehouse_id)}}
75
+            </template>    
76
+        </el-table-column>
63
         <el-table-column prop="name" label="操作"  align="center">
77
         <el-table-column prop="name" label="操作"  align="center">
64
           <template  slot-scope="scope">
78
           <template  slot-scope="scope">
65
             <el-button type="primary" @click="toDamagedDetail(scope.row.good_id)">查看详情</el-button>
79
             <el-button type="primary" @click="toDamagedDetail(scope.row.good_id)">查看详情</el-button>
444
             good_name:"",
458
             good_name:"",
445
             price:0,
459
             price:0,
446
             good_id:0,
460
             good_id:0,
461
+            storehouse_id:0,
462
+            houseList:[],
447
         }
463
         }
448
     },
464
     },
449
     methods:{
465
     methods:{
641
           keyword:this.searchKey,
657
           keyword:this.searchKey,
642
           limit:this.limit,
658
           limit:this.limit,
643
           page:this.page,
659
           page:this.page,
660
+          storehouse_id:this.storehouse_id,
644
          }
661
          }
645
        getReportStockList(params).then(response=>{
662
        getReportStockList(params).then(response=>{
646
           if(response.data.state == 1){
663
           if(response.data.state == 1){
647
             var list = response.data.data.list
664
             var list = response.data.data.list
648
-            console.log("报损金额22222",list)
649
             this.total = response.data.data.total
665
             this.total = response.data.data.total
650
             this.tableList = list
666
             this.tableList = list
651
            var doctorlist = response.data.data.doctorlist
667
            var doctorlist = response.data.data.doctorlist
652
            this.doctorList = doctorlist
668
            this.doctorList = doctorlist
653
            var damageList =  response.data.data.damageList
669
            var damageList =  response.data.data.damageList
654
-          
655
-          this.damageList = damageList
670
+           this.damageList = damageList
671
+           var obj = {id:0,storehouse_name:"全部"}
672
+           this.houseList = []
673
+           this.houseList.push(obj)
674
+           for(let i=0;i<response.data.data.houseList.length;i++){
675
+            this.houseList.push(response.data.data.houseList[i])
676
+           }
656
           }
677
           }
657
        })   
678
        })   
658
       },
679
       },
793
       },
814
       },
794
       toQuery(){
815
       toQuery(){
795
         this.toDamagedDetail(this.good_id)
816
         this.toDamagedDetail(this.good_id)
817
+      },
818
+      getStorehouseName(id){
819
+        var storehouse_name = ""
820
+        for(let i=0;i<this.houseList.length;i++){
821
+          if(id == this.houseList[i].id){
822
+            storehouse_name = this.houseList[i].storehouse_name
823
+          }
824
+        }
825
+        if(storehouse_name == "全部"){
826
+          return ""
827
+        }else{
828
+          return storehouse_name
829
+        }
830
+      },
831
+      changeHouseList(){
832
+        this.houseList = []
833
+        this.getlist()
796
       }
834
       }
797
     },
835
     },
798
     created(){
836
     created(){
799
-        // var nowDate = new Date();
800
-        // var nowYear = nowDate.getFullYear();
801
-        // var nowMonth = nowDate.getMonth() + 1;
802
-        // var nowDay = nowDate.getDate();
803
-        // this.end_time =
804
-        // nowYear +
805
-        // "-" +
806
-        // (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
807
-        // "-" +
808
-        // (nowDay < 10 ? "0" + nowDay : nowDay);
809
-        // nowDate.setMonth(nowDate.getMonth() - 1);
810
-        // nowYear = nowDate.getFullYear();
811
-        // nowMonth = nowDate.getMonth() + 1;
812
-        // nowDay = nowDate.getDate();
813
-        // this.start_time =
814
-        // nowYear +
815
-        // "-" +
816
-        // (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
817
-        // "-" +
818
-        // (nowDay < 10 ? "0" + nowDay : nowDay);
819
-         this.getlist()
837
+  
838
+       this.getlist()
820
     },
839
     },
821
   
840
   
822
     mounted() {
841
     mounted() {

+ 31 - 20
src/xt_pages/stock/stockFlow.vue 查看文件

68
              <span v-if="scope.row.consumable_type == 7">自动退库</span>
68
              <span v-if="scope.row.consumable_type == 7">自动退库</span>
69
              <span v-if="scope.row.consumable_type == 10">盘盈</span>
69
              <span v-if="scope.row.consumable_type == 10">盘盈</span>
70
              <span v-if="scope.row.consumable_type == 11">盘亏</span>
70
              <span v-if="scope.row.consumable_type == 11">盘亏</span>
71
+             <span v-if="scope.row.consumable_type == 12">调拨出库</span>
72
+             <span v-if="scope.row.consumable_type == 13">调拨入库</span>
71
            </template>
73
            </template>
72
         </el-table-column>
74
         </el-table-column>
73
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
75
         <el-table-column prop="drug_name" label="出/入库单据编码" align="center">
78
             <span v-if="scope.row.consumable_type == 4 || scope.row.consumable_type == 7">{{scope.row.cancel_order_number}}</span>  
80
             <span v-if="scope.row.consumable_type == 4 || scope.row.consumable_type == 7">{{scope.row.cancel_order_number}}</span>  
79
             <span v-if="scope.row.consumable_type == 10">{{scope.row.warehouse_out_order_number}}</span>
81
             <span v-if="scope.row.consumable_type == 10">{{scope.row.warehouse_out_order_number}}</span>
80
             <span v-if="scope.row.consumable_type == 11">{{scope.row.warehouse_out_order_number}}</span>
82
             <span v-if="scope.row.consumable_type == 11">{{scope.row.warehouse_out_order_number}}</span>
83
+            <span v-if="scope.row.consumable_type == 12">{{scope.row.warehouse_out_order_number}}</span>
84
+            <span v-if="scope.row.consumable_type == 13">{{scope.row.warehousing_order}}</span>
81
            </template>
85
            </template>
82
         </el-table-column>
86
         </el-table-column>
83
         <el-table-column prop="drug_name" label="操作日期" align="center">
87
         <el-table-column prop="drug_name" label="操作日期" align="center">
84
            <template slot-scope="scope">
88
            <template slot-scope="scope">
85
              {{getTime(scope.row.ctime)}}
89
              {{getTime(scope.row.ctime)}}
86
            </template>
90
            </template>
91
+        </el-table-column>
92
+        <el-table-column prop="drug_name" label="仓库名称"  align="center">
93
+           <template slot-scope="scope">
94
+             <span>{{getHouseName(scope.row.storehouse_id)}}</span>
95
+           </template>
87
         </el-table-column>
96
         </el-table-column>
88
          <el-table-column prop="drug_name" label="数量"  align="center">
97
          <el-table-column prop="drug_name" label="数量"  align="center">
89
            <template slot-scope="scope">
98
            <template slot-scope="scope">
90
              <span>{{scope.row.count}}{{packing_unit}}</span>
99
              <span>{{scope.row.count}}{{packing_unit}}</span>
91
            </template>
100
            </template>
92
         </el-table-column>
101
         </el-table-column>
93
-     
94
-       <!-- <el-table-column label="是否退库" align="center">
95
-         <template slot-scope="scope">
96
-           <span v-if="scope.row.is_edit == 2">是</span>
97
-           <span v-if="scope.row.is_edit ==1">否</span>   
98
-         </template>
99
-       </el-table-column> -->
102
+   
100
 
103
 
101
        <!-- <el-table-column label="批次" align="center">
104
        <!-- <el-table-column label="批次" align="center">
102
          <template slot-scope="scope">
105
          <template slot-scope="scope">
170
         (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
173
         (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
171
         "-" +
174
         "-" +
172
         (nowDay < 10 ? "0" + nowDay : nowDay);
175
         (nowDay < 10 ? "0" + nowDay : nowDay);
173
-      // this.getlist()
174
-      // this.getStockOutList()
175
-      // this.getStockDrugCount()
176
-    
176
+      
177
       this.getStockFlow()
177
       this.getStockFlow()
178
       this.packing_unit = this.$route.query.packing_unit
178
       this.packing_unit = this.$route.query.packing_unit
179
     },
179
     },
220
           {id:4,name:"手动退库"},
220
           {id:4,name:"手动退库"},
221
           {id:10,name:"盘盈"},
221
           {id:10,name:"盘盈"},
222
           {id:11,name:"盘亏"},
222
           {id:11,name:"盘亏"},
223
+          {id:12,name:"调拨出库"},
224
+          {id:13,name:"调拨入库"},
223
         ],
225
         ],
224
         countList:[],
226
         countList:[],
225
         outCountList:[],
227
         outCountList:[],
228
         obj:{},
230
         obj:{},
229
         packing_unit:"",
231
         packing_unit:"",
230
         cancelCountList:[],
232
         cancelCountList:[],
231
-        good:{}
233
+        good:{},
234
+        houseList:[],
232
       }
235
       }
233
     },
236
     },
234
     methods:{
237
     methods:{
345
       getStockDrugCount(params).then(response=>{
348
       getStockDrugCount(params).then(response=>{
346
          if(response.data.state == 1){
349
          if(response.data.state == 1){
347
            var count = response.data.data.count
350
            var count = response.data.data.count
348
-          //  console.log("详情入库统计",count)
351
+         
349
            this.countList = count
352
            this.countList = count
350
            var outlist = response.data.data.outList
353
            var outlist = response.data.data.outList
351
-          //  console.log("详情出库数量",outlist)
354
+        
352
           
355
           
353
            this.outCountList = outlist
356
            this.outCountList = outlist
354
            var autoCount = response.data.data.autoCount
357
            var autoCount = response.data.data.autoCount
355
-          //  console.log("详情自动出库",autoCount)
358
+         
356
            this.autoCountList = autoCount
359
            this.autoCountList = autoCount
357
            var totalCount = response.data.data.totalCount
360
            var totalCount = response.data.data.totalCount
358
-          //  console.log("totalcount",totalCount)
361
+         
359
            this.cancelCountList = totalCount
362
            this.cancelCountList = totalCount
360
          }
363
          }
361
       })
364
       })
370
         return count
373
         return count
371
         },
374
         },
372
       getOutCount(id){
375
       getOutCount(id){
373
-        console.log("id222",id)
376
+       
374
         var count = ""
377
         var count = ""
375
         for(let i=0;i<this.outCountList.length;i++){
378
         for(let i=0;i<this.outCountList.length;i++){
376
           if(id == this.outCountList[i].good_id){
379
           if(id == this.outCountList[i].good_id){
429
        getStockFlow(params).then(response=>{
432
        getStockFlow(params).then(response=>{
430
           if(response.data.state == 1){
433
           if(response.data.state == 1){
431
             var list =  response.data.data.list
434
             var list =  response.data.data.list
432
-            console.log("list2323",list)
433
             var total = response.data.data.total
435
             var total = response.data.data.total
434
-            console.log("total",total)
435
             this.tableList = list
436
             this.tableList = list
436
             this.total = total
437
             this.total = total
437
             this.good = response.data.data.good
438
             this.good = response.data.data.good
438
            var manufacturerList = response.data.data.manufacturerList
439
            var manufacturerList = response.data.data.manufacturerList
439
            this.manufacturerList = manufacturerList
440
            this.manufacturerList = manufacturerList
441
+           this.houseList = response.data.data.houseList
440
           }
442
           }
441
        })
443
        })
442
-     }
444
+     },
445
+     getHouseName(id){
446
+        var storehouse_name = ""
447
+        for(let i=0;i<this.houseList.length;i++){
448
+          if(id == this.houseList[i].id){
449
+            storehouse_name = this.houseList[i].storehouse_name
450
+          }
451
+        }
452
+        return storehouse_name
453
+     },
443
     }
454
     }
444
   }
455
   }
445
 </script>
456
 </script>

+ 75 - 24
src/xt_pages/stock/stockInOrder.vue 查看文件

15
     </div>
15
     </div>
16
 
16
 
17
     <div class="app-container">
17
     <div class="app-container">
18
+      
18
       <div class="cell clearfix">
19
       <div class="cell clearfix">
20
+        <label class="title"><span class="name">仓库</span> :</label>
21
+        <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeStoreHouse">
22
+            <el-option
23
+              v-for="(option, index) in list"
24
+              :key="index"
25
+              :label="option.storehouse_name"
26
+              :value="option.id">
27
+            </el-option>
28
+        </el-select>
19
         <el-input
29
         <el-input
20
           size="small"
30
           size="small"
21
-          style="width: 400px;"
31
+          style="width: 200px;"
22
           v-model.trim="searchKey"
32
           v-model.trim="searchKey"
23
           class="filter-item"
33
           class="filter-item"
24
           placeholder="单据编码/制单人/耗材名称"
34
           placeholder="单据编码/制单人/耗材名称"
110
           </template>
120
           </template>
111
         </el-table-column>
121
         </el-table-column>
112
 
122
 
123
+       <el-table-column label="仓库名称" align="center">
124
+          <template slot-scope="scope">
125
+            {{getHouseName(scope.row.storehouse_id)}}
126
+          </template>
127
+        </el-table-column>
128
+
113
         <el-table-column label="制单人" align="center">
129
         <el-table-column label="制单人" align="center">
114
           <template slot-scope="scope">
130
           <template slot-scope="scope">
115
             {{ getXuserName(scope.row.creater) }}
131
             {{ getXuserName(scope.row.creater) }}
116
           </template>
132
           </template>
117
         </el-table-column>
133
         </el-table-column>
118
 
134
 
135
+        <el-table-column label="入库方式" align="center">
136
+          <template slot-scope="scope">
137
+            <span v-if="scope.row.is_sys == 12">调拨入库</span>
138
+            <span v-if="scope.row.is_sys == 0">手动入库</span>
139
+          </template>
140
+        </el-table-column>
141
+
119
         <el-table-column label="操作" align="center" width="260px">
142
         <el-table-column label="操作" align="center" width="260px">
120
           <template slot-scope="scope">
143
           <template slot-scope="scope">
121
             <el-tooltip
144
             <el-tooltip
203
             {{ scope.row.number}}
226
             {{ scope.row.number}}
204
           </template>
227
           </template>
205
         </el-table-column>
228
         </el-table-column>
229
+         <el-table-column label="仓库名称" align="center">
230
+          <template slot-scope="scope">
231
+            {{getHouseName(scope.row.storehouse_id)}}
232
+          </template>
233
+        </el-table-column>
234
+
206
         <el-table-column label="入库数量" align="center">
235
         <el-table-column label="入库数量" align="center">
207
           <template slot-scope="scope">
236
           <template slot-scope="scope">
208
             {{ scope.row.warehousing_count}}{{scope.row.GoodInfo.packing_unit}}
237
             {{ scope.row.warehousing_count}}{{scope.row.GoodInfo.packing_unit}}
775
       order_id:0,
804
       order_id:0,
776
       exportList:[],
805
       exportList:[],
777
       checkAllStatus:false,
806
       checkAllStatus:false,
807
+      list:[],
808
+      storehouse_id:0,
778
     };
809
     };
779
     
810
     
780
   
811
   
793
         start_time: this.start_time,
824
         start_time: this.start_time,
794
         end_time: this.end_time,
825
         end_time: this.end_time,
795
         type: this.type,
826
         type: this.type,
796
-        keywords: this.searchKey
827
+        keywords: this.searchKey,
828
+        storehouse_id:this.storehouse_id,
797
       };
829
       };
798
       this.Warehouse.warehouseDate = [];
830
       this.Warehouse.warehouseDate = [];
799
       getWarehouseList(Params).then(response => {
831
       getWarehouseList(Params).then(response => {
807
           for (let i = 0; i < response.data.data.list.length; i++) {
839
           for (let i = 0; i < response.data.data.list.length; i++) {
808
             this.Warehouse.warehouseDate.push(response.data.data.list[i]);
840
             this.Warehouse.warehouseDate.push(response.data.data.list[i]);
809
           }
841
           }
842
+        
810
         }
843
         }
811
       });
844
       });
812
     },
845
     },
816
         limit: this.limit,
849
         limit: this.limit,
817
         start_time: this.start_time,
850
         start_time: this.start_time,
818
         end_time: this.end_time,
851
         end_time: this.end_time,
819
-        type: this.type
852
+        type: this.type,
853
+        storehouse_id:this.storehouse_id,
820
       };
854
       };
821
-      console.log("parasm22222",Params)
855
+
822
       this.Warehouse.warehouseDate = [];
856
       this.Warehouse.warehouseDate = [];
823
       getWarehouseList(Params).then(response => {
857
       getWarehouseList(Params).then(response => {
824
         if (response.data.state == 0) {
858
         if (response.data.state == 0) {
831
           for (let i = 0; i < response.data.data.list.length; i++) {
865
           for (let i = 0; i < response.data.data.list.length; i++) {
832
             this.Warehouse.warehouseDate.push(response.data.data.list[i]);
866
             this.Warehouse.warehouseDate.push(response.data.data.list[i]);
833
           }
867
           }
868
+          this.list = []
869
+          var obj = {id:0,storehouse_name:"全部"}
870
+          this.list.push(obj)
871
+          for(let i=0;i<response.data.data.houselist.length;i++){
872
+            this.list.push(response.data.data.houselist[i])
873
+          }
874
+          
834
         }
875
         }
835
       });
876
       });
836
     },
877
     },
890
     },
931
     },
891
     fetchAllAdminUsers() {
932
     fetchAllAdminUsers() {
892
       fetchAllAdminUsers().then(response => {
933
       fetchAllAdminUsers().then(response => {
893
-        console.log(response);
894
         if (response.data.state == 1) {
934
         if (response.data.state == 1) {
895
           this.adminUserOptions = response.data.data.users;
935
           this.adminUserOptions = response.data.data.users;
896
           var alen = this.adminUserOptions.length;
936
           var alen = this.adminUserOptions.length;
922
       return name;
962
       return name;
923
     },
963
     },
924
     getTypeNameOne:function(id){
964
     getTypeNameOne:function(id){
925
-      console.log("999999",this.goodInfo)
926
-     
927
       let name = "";
965
       let name = "";
928
       for (let i = 0; i < this.goodInfo.length; i++) {
966
       for (let i = 0; i < this.goodInfo.length; i++) {
929
         if (this.goodInfo[i].id == id) {
967
         if (this.goodInfo[i].id == id) {
960
       });
998
       });
961
     },
999
     },
962
     clicks: function() {
1000
     clicks: function() {
963
-      console.log(this.WarehouseInfo.warehouseInfoDate);
1001
+
964
     },
1002
     },
965
     handleWarehouse: function() {
1003
     handleWarehouse: function() {
966
       this.$router.push({ path: "/stock/in/add", query: { type: this.type } });
1004
       this.$router.push({ path: "/stock/in/add", query: { type: this.type } });
1038
         } else {
1076
         } else {
1039
           this.manufacturer = response.data.data.manufacturer;
1077
           this.manufacturer = response.data.data.manufacturer;
1040
           this.dealer = response.data.data.dealer;
1078
           this.dealer = response.data.data.dealer;
1041
-          // this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
1042
-          // this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
1079
+          // this.list = response.data.data.list
1043
           this.getlist()
1080
           this.getlist()
1044
         }
1081
         }
1045
       });
1082
       });
1059
       }
1096
       }
1060
     },
1097
     },
1061
     handleEdit: function(index, row) {
1098
     handleEdit: function(index, row) {
1062
-      console.log("rowe232323232332",row)
1063
-      this.$router.push({path:"/stock/in/order/edit?id="+row.id+"&supply_warehouse_id="+row.supply_warehouse_id})
1099
+      this.$router.push({path:"/stock/in/order/edit?id="+row.id+"&supply_warehouse_id="+row.supply_warehouse_id+"&is_sys="+row.is_sys})
1064
     },
1100
     },
1065
     handleDelete: function(index, row) {
1101
     handleDelete: function(index, row) {
1066
-     
1102
+      if(row.is_sys== 12){
1103
+        this.$message.error("调拨入库数据不能删除!")
1104
+        return false
1105
+      }
1067
       if(row.supply_warehouse_id > 0){
1106
       if(row.supply_warehouse_id > 0){
1068
         this.$message.error("采购入库单不能删除!")
1107
         this.$message.error("采购入库单不能删除!")
1069
         return false
1108
         return false
1107
     },
1146
     },
1108
    
1147
    
1109
     select(selection) {
1148
     select(selection) {
1110
-      console.log("selection",selection)
1111
       var ids= []
1149
       var ids= []
1112
       for(let i=0;i<selection.length;i++){
1150
       for(let i=0;i<selection.length;i++){
1113
         ids.push(selection[i].id)
1151
         ids.push(selection[i].id)
1126
       const ids = [];
1164
       const ids = [];
1127
       const idOne = []
1165
       const idOne = []
1128
       for (let i = 0; i < this.selectedTableData.length; i++) {
1166
       for (let i = 0; i < this.selectedTableData.length; i++) {
1167
+        if(this.selectedTableData[i].is_sys ==12){
1168
+          this.$message.error("调拨入库数据不能删除!")
1169
+          return false
1170
+        }
1129
         ids.push(this.selectedTableData[i].id);
1171
         ids.push(this.selectedTableData[i].id);
1130
         idOne.push(this.selectedTableData[i].supply_warehouse_id)
1172
         idOne.push(this.selectedTableData[i].supply_warehouse_id)
1131
       }
1173
       }
1132
-      console.log("idson23322323",idOne)
1133
       for(let i=0;i<idOne.length;i++){
1174
       for(let i=0;i<idOne.length;i++){
1134
         if(idOne[i] >0){
1175
         if(idOne[i] >0){
1135
           this.$message.error("采购入库数据不能删除!")
1176
           this.$message.error("采购入库数据不能删除!")
1203
 
1244
 
1204
             this.recordInfo.recordData.push(response.data.data.info[i]);
1245
             this.recordInfo.recordData.push(response.data.data.info[i]);
1205
             this.tableList.push(response.data.data.info[i])
1246
             this.tableList.push(response.data.data.info[i])
1206
-            console.log("详情",this.tableList)
1207
           }
1247
           }
1208
            this.warehouse = response.data.data.warehousing;
1248
            this.warehouse = response.data.data.warehousing;
1209
            this.warehousing_time = this.getTime(this.warehouse.warehousing_time,"{y}-{m}-{d}");
1249
            this.warehousing_time = this.getTime(this.warehouse.warehousing_time,"{y}-{m}-{d}");
1210
-           console.log("单据日期",this.warehousing_time)
1250
+
1211
           this.WarehouseInfo.warehouse = response.data.data.warehousing;
1251
           this.WarehouseInfo.warehouse = response.data.data.warehousing;
1212
          
1252
          
1213
         }
1253
         }
1336
       this.$refs["tableForm"].validate(valid => {
1376
       this.$refs["tableForm"].validate(valid => {
1337
         if (valid) {
1377
         if (valid) {
1338
           const array = this.recordInfo.recordData;
1378
           const array = this.recordInfo.recordData;
1339
-          console.log('array',array)
1379
+
1340
           for (let i = 0; i < array.length; i++) {
1380
           for (let i = 0; i < array.length; i++) {
1341
             if (array[i].good_type_id == 0) {
1381
             if (array[i].good_type_id == 0) {
1342
               this.$message.error("商品类型不能为空");
1382
               this.$message.error("商品类型不能为空");
1483
         id:this.order_id,
1523
         id:this.order_id,
1484
         start_time:this.start_time,
1524
         start_time:this.start_time,
1485
         end_time:this.end_time,
1525
         end_time:this.end_time,
1526
+        storehouse_id:this.storehouse_id,
1486
       }
1527
       }
1487
-      console.log("params",params)
1528
+     
1488
       getExportStockList(params).then(response=>{
1529
       getExportStockList(params).then(response=>{
1489
         if(response.data.state == 1){
1530
         if(response.data.state == 1){
1490
            var list = response.data.data.list
1531
            var list = response.data.data.list
1491
-           console.log("数据导出222222",list)
1532
+          
1492
            for(let i=0;i<this.goodType.length;i++){
1533
            for(let i=0;i<this.goodType.length;i++){
1493
              for(let j=0;j<list.length;j++){
1534
              for(let j=0;j<list.length;j++){
1494
                if(this.goodType[i].id == list[j].good_type_id){
1535
                if(this.goodType[i].id == list[j].good_type_id){
1506
                   list[i].manufacturer = this.manufacturer[j].manufacturer_name
1547
                   list[i].manufacturer = this.manufacturer[j].manufacturer_name
1507
                }
1548
                }
1508
             }
1549
             }
1509
-           console.log("经销⬆商",this.dealer)
1510
            for(let z=0;z<this.dealer.length;z++){
1550
            for(let z=0;z<this.dealer.length;z++){
1511
                if(list[i].dealer == this.dealer[z].id){
1551
                if(list[i].dealer == this.dealer[z].id){
1512
                  list[i].dealer = this.dealer[z].dealer_name
1552
                  list[i].dealer = this.dealer[z].dealer_name
1513
                }
1553
                }
1514
             }
1554
             }
1515
           }
1555
           }
1516
-          console.log("表格2222222",this.exportList)
1517
-          
1518
           this.exportList = list
1556
           this.exportList = list
1519
         }
1557
         }
1520
       })
1558
       })
1545
       const tHeader = ['耗材名称','耗材类型', '规格&单位','批号','入库数量','进货价','总价','生产厂家','生产日期','有效期','经销商','批准文号','备注']
1583
       const tHeader = ['耗材名称','耗材类型', '规格&单位','批号','入库数量','进货价','总价','生产厂家','生产日期','有效期','经销商','批准文号','备注']
1546
       const filterVal = ['good_name', 'good_type_id', 'unit','number','warehousing_count','price','total_price','manufacturer','product_date','expiry_date','dealer','license_number','remark']
1584
       const filterVal = ['good_name', 'good_type_id', 'unit','number','warehousing_count','price','total_price','manufacturer','product_date','expiry_date','dealer','license_number','remark']
1547
 
1585
 
1548
-      console.log("table",this.exportList)
1586
+
1549
      
1587
      
1550
       const data = this.formatJson(filterVal, this.exportList)
1588
       const data = this.formatJson(filterVal, this.exportList)
1551
       excel.export_json_to_excel({
1589
       excel.export_json_to_excel({
1559
     formatJson(filterVal, jsonData) {
1597
     formatJson(filterVal, jsonData) {
1560
     return jsonData.map(v => filterVal.map(j => v[j]));
1598
     return jsonData.map(v => filterVal.map(j => v[j]));
1561
    },
1599
    },
1600
+   getHouseName(id){
1601
+    var storehouse_name = ""
1602
+    for(let i=0;i<this.list.length;i++){
1603
+        if(id == this.list[i].id){
1604
+          storehouse_name = this.list[i].storehouse_name
1605
+        }
1606
+    }
1607
+    return storehouse_name
1608
+    },
1609
+    changeStoreHouse(){
1610
+      this.GetWarehouse();
1611
+      this.getlist()
1612
+    }
1562
   }
1613
   }
1563
 };
1614
 };
1564
 </script>
1615
 </script>

+ 24 - 10
src/xt_pages/stock/stockInOrderAdd.vue 查看文件

20
 
20
 
21
 
21
 
22
       <div class="cell clearfix">
22
       <div class="cell clearfix">
23
+         <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
24
+         <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px">
25
+              <el-option
26
+                v-for="(option, index) in list"
27
+                :key="index"
28
+                :label="option.storehouse_name"
29
+                :value="option.id">
30
+              </el-option>
31
+           </el-select>
23
         <label class="title"><span class="name">入库时间</span> : </label>
32
         <label class="title"><span class="name">入库时间</span> : </label>
24
         <el-date-picker size="small" v-model="warehousing_time" prefix-icon="el-icon-date" :editable="false"
33
         <el-date-picker size="small" v-model="warehousing_time" prefix-icon="el-icon-date" :editable="false"
25
                         style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
34
                         style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
378
         manufacturerList:[],
387
         manufacturerList:[],
379
         goodList:[],
388
         goodList:[],
380
         loading:false,
389
         loading:false,
390
+        list:[],
391
+        storehouse_id:"",
381
       }
392
       }
382
     },
393
     },
383
     methods: {
394
     methods: {
467
             }
478
             }
468
           }
479
           }
469
         })
480
         })
470
-      }, GetConfigInfo: function() {
481
+      },
482
+      GetConfigInfo: function() {
471
         const loading = this.$loading({
483
         const loading = this.$loading({
472
           lock: true,
484
           lock: true,
473
           text: 'Loading',
485
           text: 'Loading',
490
             this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
502
             this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
491
             this.form.manufacturer = 0
503
             this.form.manufacturer = 0
492
             this.form.dealer = 0
504
             this.form.dealer = 0
505
+            this.list = response.data.data.list
506
+            this.storehouse_id = response.data.data.configlist.storehouse_info
493
           }
507
           }
494
           loading.close()
508
           loading.close()
495
 
509
 
660
       }
674
       }
661
       ,
675
       ,
662
       submit() {
676
       submit() {
663
-        console.log("res23322332",this.$refs)
664
         this.$refs['tableForm'].validate((valid) => {
677
         this.$refs['tableForm'].validate((valid) => {
665
           if (valid) {
678
           if (valid) {
666
             this.loading = true
679
             this.loading = true
667
             const array = this.recordInfo.recordData
680
             const array = this.recordInfo.recordData
668
-            console.log("array9999999",array)
681
+            if(this.storehouse_id == 0){
682
+              this.$message.error("仓库不能为空!")
683
+              return
684
+            }
669
             for (let i = 0; i < array.length; i++) {
685
             for (let i = 0; i < array.length; i++) {
670
               if (array[i].good_type_id == 0) {
686
               if (array[i].good_type_id == 0) {
671
                 this.$message.error('商品类型不能为空')
687
                 this.$message.error('商品类型不能为空')
679
               this.$message.success('请添加入库商品')
695
               this.$message.success('请添加入库商品')
680
               return
696
               return
681
             }
697
             }
698
+
682
             for(let i=0;i<this.recordInfo.recordData.length;i++){
699
             for(let i=0;i<this.recordInfo.recordData.length;i++){
683
              if(this.recordInfo.recordData[i].dealer == ""){
700
              if(this.recordInfo.recordData[i].dealer == ""){
684
                 this.recordInfo.recordData[i].dealer = 0
701
                 this.recordInfo.recordData[i].dealer = 0
707
             const params = {
724
             const params = {
708
               'stockIn': this.recordInfo.recordData
725
               'stockIn': this.recordInfo.recordData
709
             }
726
             }
710
-            console.log("stockIn",this.recordInfo.recordData)
711
-            
712
-            postWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type).then(response => {
727
+           
728
+            postWarehouse(params, this.warehousing_time, this.form.manufacturer, this.form.dealer, this.type,this.storehouse_id).then(response => {
713
               if (response.data.state == 0) {
729
               if (response.data.state == 0) {
714
                 this.loading = false
730
                 this.loading = false
715
                 this.$message.error(response.data.msg)
731
                 this.$message.error(response.data.msg)
778
         this.currentIndex = val
794
         this.currentIndex = val
779
       },
795
       },
780
       handleSelect(val){
796
       handleSelect(val){
781
-         console.log("val3232232323",val)
782
          for(let i=0;i<this.recordInfo.recordData.length;i++){
797
          for(let i=0;i<this.recordInfo.recordData.length;i++){
783
            if(this.currentIndex == i){
798
            if(this.currentIndex == i){
784
               this.recordInfo.recordData[i].good_type_id = val.id
799
               this.recordInfo.recordData[i].good_type_id = val.id
812
              
827
              
813
            }
828
            }
814
          }
829
          }
815
-      }
830
+      },
831
+   
816
     }
832
     }
817
     ,
833
     ,
818
     created() {
834
     created() {
846
       this.recordInfo.recordData.push(tempObj)
862
       this.recordInfo.recordData.push(tempObj)
847
       this.GetConfigInfo()
863
       this.GetConfigInfo()
848
       this.propForm.goodUnit = this.$store.getters.good_unit
864
       this.propForm.goodUnit = this.$store.getters.good_unit
849
-
850
-      console.log("单位",this.getDataConfig('hemodialysis','units'))
851
     }
865
     }
852
 
866
 
853
   }
867
   }

+ 37 - 7
src/xt_pages/stock/stockInOrderEdit.vue 查看文件

34
       ></stock-in-dialog>
34
       ></stock-in-dialog>
35
 
35
 
36
       <div class="cell clearfix">
36
       <div class="cell clearfix">
37
+         <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
38
+         <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" :disabled="true">
39
+              <el-option
40
+                v-for="(option, index) in list"
41
+                :key="index"
42
+                :label="option.storehouse_name"
43
+                :value="option.id">
44
+              </el-option>
45
+          </el-select>
37
         <label class="title"><span class="name">入库时间</span> : </label>
46
         <label class="title"><span class="name">入库时间</span> : </label>
38
         <el-date-picker
47
         <el-date-picker
39
           size="small"
48
           size="small"
402
       numberList:[],
411
       numberList:[],
403
       loading:false,
412
       loading:false,
404
       disabled:false,
413
       disabled:false,
414
+      storehouse_id:0,
415
+      list:[],
405
     };
416
     };
406
   },
417
   },
407
   methods: {
418
   methods: {
468
           this.dealer = response.data.data.dealer;
479
           this.dealer = response.data.data.dealer;
469
           this.goodType = response.data.data.goodType;
480
           this.goodType = response.data.data.goodType;
470
           this.goodInfo = response.data.data.goodInfo;
481
           this.goodInfo = response.data.data.goodInfo;
482
+          this.list = response.data.data.list
471
           // this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
483
           // this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
472
           // this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
484
           // this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
473
         }
485
         }
497
         this.$message.error("采购入库数据不能新增!")
509
         this.$message.error("采购入库数据不能新增!")
498
         return false
510
         return false
499
       }
511
       }
512
+      
513
+      if(parseInt(this.$route.query.is_sys) >0){
514
+        this.$message.error("调拨入库数据不能新增!")
515
+        return false
516
+      }
500
       const tempObj = {};
517
       const tempObj = {};
501
       tempObj["id"] = 0;
518
       tempObj["id"] = 0;
502
       tempObj["good_type_id"] = 0;
519
       tempObj["good_type_id"] = 0;
514
       this.recordInfo.recordData.push(tempObj);
531
       this.recordInfo.recordData.push(tempObj);
515
     },
532
     },
516
     handleDelete: function(index, row) {
533
     handleDelete: function(index, row) {
534
+      if(parseInt(this.$route.query.is_sys) >0){
535
+        this.$message.error("调拨入库数据不能删除!")
536
+        return false
537
+      }
517
       if(row.supply_warehouse_id >0){
538
       if(row.supply_warehouse_id >0){
518
         this.$message.error("采购入库数据不能删除!")
539
         this.$message.error("采购入库数据不能删除!")
519
         return false
540
         return false
629
         if (valid) {
650
         if (valid) {
630
           this.loading = true
651
           this.loading = true
631
           const array = this.recordInfo.recordData;
652
           const array = this.recordInfo.recordData;
653
+          if(this.storehouse_id == 0){
654
+            this.$message.error("仓库不能为空!")
655
+            return
656
+          }    
632
           for (let i = 0; i < array.length; i++) {
657
           for (let i = 0; i < array.length; i++) {
633
             if (array[i].good_type_id == 0) {
658
             if (array[i].good_type_id == 0) {
634
               this.$message.error("商品类型不能为空");
659
               this.$message.error("商品类型不能为空");
661
           const params = {
686
           const params = {
662
             stockIn: this.recordInfo.recordData
687
             stockIn: this.recordInfo.recordData
663
           };
688
           };
664
-          console.log("params2222",params)
689
+          
665
           const loading = this.$loading({
690
           const loading = this.$loading({
666
             lock: true,
691
             lock: true,
667
             text: 'Loading',
692
             text: 'Loading',
674
             this.$route.query.id,
699
             this.$route.query.id,
675
             this.$route.query.type,
700
             this.$route.query.type,
676
             this.form.manufacturer,
701
             this.form.manufacturer,
677
-            this.form.dealer
702
+            this.form.dealer,
703
+            this.storehouse_id,
678
           ).then(response => {
704
           ).then(response => {
679
             if (response.data.state == 0) {
705
             if (response.data.state == 0) {
680
               this.loading =false
706
               this.loading =false
697
       const params = {
723
       const params = {
698
         id: order_id
724
         id: order_id
699
       };
725
       };
700
-      console.log("parm2222222222",params)
726
+
701
       getWarehouseInfoList(params).then(response => {
727
       getWarehouseInfoList(params).then(response => {
702
         if (response.data.state == 0) {
728
         if (response.data.state == 0) {
703
           this.$message.error(response.data.msg);
729
           this.$message.error(response.data.msg);
704
           return false;
730
           return false;
705
         } else {
731
         } else {
706
-          console.log("列表2222222",response.data.data.info)
732
+        
707
          
733
          
708
           for (let i = 0; i < response.data.data.info.length; i++) {
734
           for (let i = 0; i < response.data.data.info.length; i++) {
709
             response.data.data.info[i].product_date = this.getTime(
735
             response.data.data.info[i].product_date = this.getTime(
729
            
755
            
730
             this.recordInfo.recordData.push(response.data.data.info[i]);
756
             this.recordInfo.recordData.push(response.data.data.info[i]);
731
            
757
            
732
-            console.log("列表",this.recordInfo.recordData)
758
+           
733
           }
759
           }
734
 
760
 
735
           this.warehouse = response.data.data.warehousing;
761
           this.warehouse = response.data.data.warehousing;
736
-          console.log("jhhahfhh",this.warehouse)
737
- 
762
+          this.storehouse_id = response.data.data.warehousing[0].storehouse_id
763
+       
738
           this.warehousing_time = this.getTime(
764
           this.warehousing_time = this.getTime(
739
             this.warehouse[0].warehousing_time,
765
             this.warehouse[0].warehousing_time,
740
             "{y}-{m}-{d}"
766
             "{y}-{m}-{d}"
835
     this.propForm.goodUnit = this.$store.getters.good_unit;
861
     this.propForm.goodUnit = this.$store.getters.good_unit;
836
     const order_id = this.$route.query.id;
862
     const order_id = this.$route.query.id;
837
     var supply_warehouse_id =  parseInt(this.$route.query.supply_warehouse_id)  
863
     var supply_warehouse_id =  parseInt(this.$route.query.supply_warehouse_id)  
864
+    var is_sys = parseInt(this.$route.query.is_sys)
838
     if(supply_warehouse_id > 0){
865
     if(supply_warehouse_id > 0){
839
       this.disabled = true
866
       this.disabled = true
840
     }
867
     }
868
+    if(is_sys == 12){
869
+      this.disabled = true
870
+    }
841
     this.GetOrderDetail(order_id);
871
     this.GetOrderDetail(order_id);
842
 
872
 
843
   }
873
   }

+ 73 - 10
src/xt_pages/stock/stockOutOrder.vue 查看文件

14
     </div>
14
     </div>
15
     <div class="app-container">
15
     <div class="app-container">
16
       <div class="cell clearfix">
16
       <div class="cell clearfix">
17
+        <label class="title"><span class="name">仓库</span> :</label>
18
+        <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeStoreHouse">
19
+            <el-option
20
+              v-for="(option, index) in houselist"
21
+              :key="index"
22
+              :label="option.storehouse_name"
23
+              :value="option.id">
24
+            </el-option>
25
+        </el-select> 
17
         <el-input
26
         <el-input
18
           size="small"
27
           size="small"
19
-          style="width: 400px;"
28
+          style="width: 200px;"
20
           class="filter-item"
29
           class="filter-item"
21
           v-model.trim="searchKey"
30
           v-model.trim="searchKey"
22
           placeholder="单据编码/制单人/耗材名称"
31
           placeholder="单据编码/制单人/耗材名称"
103
             {{ scope.row.warehouse_out_order_number }}
112
             {{ scope.row.warehouse_out_order_number }}
104
           </template>
113
           </template>
105
         </el-table-column>
114
         </el-table-column>
115
+       
116
+        <el-table-column label="仓库名称" align="center">
117
+          <template slot-scope="scope">
118
+            {{getHouseName(scope.row.storehouse_id)}}
119
+          </template>
120
+        </el-table-column>
106
 
121
 
107
         <el-table-column label="制单人" align="center">
122
         <el-table-column label="制单人" align="center">
108
           <template slot-scope="scope">
123
           <template slot-scope="scope">
114
           <template slot-scope="scope">
129
           <template slot-scope="scope">
115
             <span v-if="scope.row.is_sys == 1">自动出库</span>
130
             <span v-if="scope.row.is_sys == 1">自动出库</span>
116
             <span v-if="scope.row.is_sys == 0">手动出库</span>
131
             <span v-if="scope.row.is_sys == 0">手动出库</span>
132
+            <span v-if="scope.row.is_sys == 12">调拨出库</span>
117
           </template>
133
           </template>
118
         </el-table-column>
134
         </el-table-column>
119
        
135
        
197
               {{ scope.row.social_security_directory_code}}
213
               {{ scope.row.social_security_directory_code}}
198
             </template>
214
             </template>
199
           </el-table-column>
215
           </el-table-column>
216
+
217
+          <el-table-column label="仓库名称" align="center">
218
+            <template slot-scope="scope">
219
+              {{getHouseName(scope.row.storehouse_id)}}
220
+            </template>
221
+          </el-table-column>
200
          
222
          
201
           <el-table-column label="出库数量" align="center">
223
           <el-table-column label="出库数量" align="center">
202
             <template slot-scope="scope">
224
             <template slot-scope="scope">
204
               <span v-if="scope.row.is_sys == 1">{{getOutStockCount(scope.row.good_id)}}{{scope.row.packing_unit}}</span> 
226
               <span v-if="scope.row.is_sys == 1">{{getOutStockCount(scope.row.good_id)}}{{scope.row.packing_unit}}</span> 
205
             </template>
227
             </template>
206
           </el-table-column>
228
           </el-table-column>
229
+          <el-table-column label="出库对象" align="center" v-if="is_sys== 0">
230
+            <template slot-scope="scope">
231
+             {{getXuserName(scope.row.admin_user_id)}}
232
+            </template>
233
+          </el-table-column>
207
           <el-table-column label="出货价" align="center">
234
           <el-table-column label="出货价" align="center">
208
             <template slot-scope="scope">
235
             <template slot-scope="scope">
209
               <span v-if="scope.row.price >0">{{ scope.row.price}}</span> 
236
               <span v-if="scope.row.price >0">{{ scope.row.price}}</span> 
788
       exportList:[],
815
       exportList:[],
789
       is_sys:0,
816
       is_sys:0,
790
       infoList:[],
817
       infoList:[],
791
-      stockFlowList:[]
818
+      stockFlowList:[],
819
+      list:[],
820
+      houselist:[],
821
+      storehouse_id:0,
822
+      is_sys:0,
792
     };
823
     };
793
   },
824
   },
794
   methods: {
825
   methods: {
799
         start_time: this.start_time,
830
         start_time: this.start_time,
800
         end_time: this.end_time,
831
         end_time: this.end_time,
801
         type: this.type,
832
         type: this.type,
802
-        keywords: this.searchKey
833
+        keywords: this.searchKey,
834
+        storehouse_id:this.storehouse_id,
803
       };
835
       };
804
       this.warehouseOutDate = [];
836
       this.warehouseOutDate = [];
805
       getWarehouseOutList(Params).then(response => {
837
       getWarehouseOutList(Params).then(response => {
826
         limit: this.limit,
858
         limit: this.limit,
827
         start_time: this.start_time,
859
         start_time: this.start_time,
828
         end_time: this.end_time,
860
         end_time: this.end_time,
829
-        type: this.type
861
+        type: this.type,
862
+        storehouse_id:this.storehouse_id,
830
       };
863
       };
831
       this.warehouseOutDate = [];
864
       this.warehouseOutDate = [];
832
       getWarehouseOutList(Params).then(response => {
865
       getWarehouseOutList(Params).then(response => {
834
           this.$message.error(response.data.msg);
867
           this.$message.error(response.data.msg);
835
           return false;
868
           return false;
836
         } else {
869
         } else {
837
-          console.log("parsm",response.data.data)
838
-          
870
+         
839
           this.total = response.data.data.total;
871
           this.total = response.data.data.total;
840
           for (let i = 0; i < response.data.data.list.length; i++) {
872
           for (let i = 0; i < response.data.data.list.length; i++) {
841
             
873
             
842
             this.warehouseOutDate.push(response.data.data.list[i]);
874
             this.warehouseOutDate.push(response.data.data.list[i]);
843
           }
875
           }
844
-          console.log("2222222",this.warehouseOutDate)
876
+          var obj = {id:0,storehouse_name:"全部"}
877
+          this.houselist = []
878
+          this.houselist.push(obj)
879
+          for(let i=0;i<response.data.data.houselist.length;i++){
880
+            this.houselist.push(response.data.data.houselist[i])
881
+          }
845
         }
882
         }
846
       });
883
       });
847
     },
884
     },
933
           this.dealer = response.data.data.dealer;
970
           this.dealer = response.data.data.dealer;
934
           this.goodInfo = response.data.data.goodInfo
971
           this.goodInfo = response.data.data.goodInfo
935
           this.goodType = response.data.data.goodType
972
           this.goodType = response.data.data.goodType
973
+          this.list = response.data.data.list
936
           // this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
974
           // this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: "全部" });
937
           // this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
975
           // this.dealer.splice(0, 0, { id: 0, dealer_name: "全部" });
938
           this.getlist()
976
           this.getlist()
958
        
996
        
959
     },
997
     },
960
     handleDelete: function(index, row) {
998
     handleDelete: function(index, row) {
961
-     
999
+      if(row.is_sys == 12){
1000
+        this.$message.error("调拨出库数据不能删除!")
1001
+        return false
1002
+      }
962
       if(row.supply_cancel_out_id >0){
1003
       if(row.supply_cancel_out_id >0){
963
         this.$message.error("采购出库数据不能删除!")
1004
         this.$message.error("采购出库数据不能删除!")
964
         return false
1005
         return false
1034
         if(this.selectedTableData[i].is_sys == 1){
1075
         if(this.selectedTableData[i].is_sys == 1){
1035
           this.$message.error("自动出库数据不能删除!")
1076
           this.$message.error("自动出库数据不能删除!")
1036
           return false
1077
           return false
1078
+        }
1079
+        if(this.selectedTableData[i].is_sys ==12){
1080
+          this.$message.error("调拨出库数据不能删除!")
1081
+          return false
1037
         }
1082
         }
1038
          if(this.selectedTableData[i].is_sys == 0){
1083
          if(this.selectedTableData[i].is_sys == 0){
1039
            ids.push(this.selectedTableData[i].id);
1084
            ids.push(this.selectedTableData[i].id);
1075
               }
1120
               }
1076
             }
1121
             }
1077
           });
1122
           });
1078
-        })
1079
-        .catch(() => {});
1123
+        }).catch(() => {});
1080
     },
1124
     },
1081
 
1125
 
1082
 
1126
 
1083
     handleSearch(val){
1127
     handleSearch(val){
1128
+      this.is_sys = val.is_sys
1084
       this.tableList = []
1129
       this.tableList = []
1085
       this.editdialogVisibleThree = false
1130
       this.editdialogVisibleThree = false
1086
       this.GetOrderDetailOne(val.id)
1131
       this.GetOrderDetailOne(val.id)
1132
+
1087
       this.GetTotalCount(val.warehouse_out_time)
1133
       this.GetTotalCount(val.warehouse_out_time)
1088
     },
1134
     },
1089
   
1135
   
1678
      }
1724
      }
1679
      arr = this.unique(arr)
1725
      arr = this.unique(arr)
1680
      return arr.join(',')
1726
      return arr.join(',')
1727
+   },
1728
+   getHouseName(id){
1729
+    var storehouse_name = ""
1730
+    for(let i=0;i<this.houselist.length;i++){
1731
+        if(id == this.houselist[i].id){
1732
+          storehouse_name = this.houselist[i].storehouse_name
1733
+        }
1734
+    }
1735
+    if(storehouse_name == "全部"){
1736
+      return ""
1737
+    }else{
1738
+       return storehouse_name
1739
+    }
1740
+   
1741
+   },
1742
+   changeStoreHouse(){
1743
+     this.GetWarehouseOut()
1681
    }
1744
    }
1682
   }
1745
   }
1683
 };
1746
 };

+ 58 - 18
src/xt_pages/stock/stockOutOrderAdd.vue 查看文件

37
 
37
 
38
 
38
 
39
       <div class="cell clearfix">
39
       <div class="cell clearfix">
40
+         <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
41
+         <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px">
42
+              <el-option
43
+                v-for="(option, index) in list"
44
+                :key="index"
45
+                :label="option.storehouse_name"
46
+                :value="option.id">
47
+              </el-option>
48
+         </el-select>
40
         <label class="title"><span class="name">出库时间</span> : </label>
49
         <label class="title"><span class="name">出库时间</span> : </label>
41
         <el-date-picker
50
         <el-date-picker
42
           size="small"
51
           size="small"
140
             </template>
149
             </template>
141
           </el-table-column>
150
           </el-table-column>
142
 
151
 
152
+          <el-table-column label="出库对象"  width="150" align="center">
153
+            <template slot-scope="scope">
154
+               <el-select size="small" v-model="scope.row.admin_user_id" filterable placeholder="请选择出库对象">
155
+                <el-option
156
+                  v-for="(option, index) in doctorList"
157
+                  :key="index"
158
+                  :label="option.user_name"
159
+                  :value="option.admin_user_id">
160
+                </el-option>
161
+               </el-select>
162
+            </template>   
163
+          </el-table-column>
164
+
143
           <el-table-column  width="150" align="center">
165
           <el-table-column  width="150" align="center">
144
             <template slot="header" slot-scope="scope">
166
             <template slot="header" slot-scope="scope">
145
               <span>出货单价<span style="color: red">*</span></span>
167
               <span>出货单价<span style="color: red">*</span></span>
339
       goodList:[],
361
       goodList:[],
340
       manufacturerList:[],
362
       manufacturerList:[],
341
       numberList:[],
363
       numberList:[],
364
+      storehouse_id:"",
365
+      list:[],
366
+      doctorList:[],
342
     };
367
     };
343
   },
368
   },
344
   methods: {
369
   methods: {
347
       this.propForm.goods = []
372
       this.propForm.goods = []
348
 
373
 
349
       this.$refs.dialog.hide()
374
       this.$refs.dialog.hide()
350
-      console.log(val)
375
+    
351
       if (val.selectedGoodInfo.length > 0) {
376
       if (val.selectedGoodInfo.length > 0) {
352
         for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
377
         for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
353
           if (i == 0) {
378
           if (i == 0) {
401
           this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
426
           this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
402
           this.manufacturer.splice(0, 0, { id: -1, manufacturer_name: '其他' })
427
           this.manufacturer.splice(0, 0, { id: -1, manufacturer_name: '其他' })
403
           this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
428
           this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
404
-
429
+          this.list = response.data.data.list
430
+          this.storehouse_id = response.data.data.configlist.storehouse_out_info
431
+          this.doctorList =  response.data.data.doctorList
405
         }
432
         }
406
       });
433
       });
407
     },
434
     },
446
       tempObj["product_date"] = ""
473
       tempObj["product_date"] = ""
447
       tempObj["license_number"] = ""
474
       tempObj["license_number"] = ""
448
       tempObj["warehouse_info_id"] = 0
475
       tempObj["warehouse_info_id"] = 0
476
+      tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name
449
       this.recordInfo.recordData.push(tempObj);
477
       this.recordInfo.recordData.push(tempObj);
450
     },
478
     },
451
     handleDelete: function(index, row) {
479
     handleDelete: function(index, row) {
530
             this.propForm.goods.push(goodObj)
558
             this.propForm.goods.push(goodObj)
531
 
559
 
532
           }
560
           }
533
-          console.log( this.propForm.goods)
561
+       
534
         }
562
         }
535
       )
563
       )
536
 
564
 
573
            
601
            
574
              this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
602
              this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
575
           }
603
           }
604
+       
576
           for(let i=0;i<this.recordInfo.recordData.length;i++){
605
           for(let i=0;i<this.recordInfo.recordData.length;i++){
577
             for(let j=0;j<this.manufacturerList.length;j++){
606
             for(let j=0;j<this.manufacturerList.length;j++){
578
               if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
607
               if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
590
                    this.recordInfo.recordData[i].number = this.numberList[y].number
619
                    this.recordInfo.recordData[i].number = this.numberList[y].number
591
                }
620
                }
592
             }
621
             }
622
+            
623
+            for(let s=0;s<this.doctorList.length;s++){
624
+
625
+              if(this.recordInfo.recordData[i].admin_user_id == this.doctorList[s].user_name){
626
+                this.recordInfo.recordData[i].admin_user_id = this.doctorList[s].admin_user_id
627
+              }
628
+
629
+            }
593
           }
630
           }
594
           const params = {
631
           const params = {
595
             stockOut: this.recordInfo.recordData
632
             stockOut: this.recordInfo.recordData
596
           };
633
           };
634
+        
597
           const loading = this.$loading({
635
           const loading = this.$loading({
598
             lock: true,
636
             lock: true,
599
             text: 'Loading',
637
             text: 'Loading',
605
             this.warehouse_out_time,
643
             this.warehouse_out_time,
606
             this.form.dealer,
644
             this.form.dealer,
607
             this.form.manufacturer,
645
             this.form.manufacturer,
608
-            this.type
646
+            this.type,
647
+            this.storehouse_id
609
           ).then(response => {
648
           ).then(response => {
610
             if (response.data.state == 0) {
649
             if (response.data.state == 0) {
611
               this.$message.error("库存不足")
650
               this.$message.error("库存不足")
615
                var msg = response.data.data.msg
654
                var msg = response.data.data.msg
616
                var good_name = response.data.data.good_name
655
                var good_name = response.data.data.good_name
617
                var specification_name = response.data.data.specification_name
656
                var specification_name = response.data.data.specification_name
618
-               var str = good_name +"*" + specification_name +"无库存,请入库"
657
+               var storehose_name = response.data.data.storehose_name
658
+               var str = storehose_name + " " + good_name +"*" + specification_name +"无库存,请入库"
619
              
659
              
620
                if(msg == 1){
660
                if(msg == 1){
621
                   this.$message.error(str)
661
                   this.$message.error(str)
646
       if (keyword != undefined) {
686
       if (keyword != undefined) {
647
         key = keyword
687
         key = keyword
648
       }
688
       }
649
-      console.log("keyrowrd",key)
689
+
650
       postSearchGoodList(key).then(response => {
690
       postSearchGoodList(key).then(response => {
651
         if (response.data.state == 1) {
691
         if (response.data.state == 1) {
652
             var list = response.data.data.list
692
             var list = response.data.data.list
653
-            console.log("33334445555",list)
693
+          
654
             this.goodList = list
694
             this.goodList = list
655
             var manufacturerList = response.data.data.manufacturerList
695
             var manufacturerList = response.data.data.manufacturerList
656
             this.manufacturerList = manufacturerList
696
             this.manufacturerList = manufacturerList
681
       this.currentIndex = val
721
       this.currentIndex = val
682
     },
722
     },
683
     handleSelect(val){
723
     handleSelect(val){
684
-       
724
+       console.log("val232323",val)
685
         var arr = []
725
         var arr = []
686
         for(let i=0;i<this.recordInfo.recordData.length;i++){
726
         for(let i=0;i<this.recordInfo.recordData.length;i++){
687
            arr.push(this.recordInfo.recordData[i].good_id)
727
            arr.push(this.recordInfo.recordData[i].good_id)
688
         }
728
         }
689
        
729
        
690
         var str = arr.join(",")
730
         var str = arr.join(",")
691
-        console.log("str",str,"good_id",val.id)
731
+       
692
         if(str.indexOf(val.id)!=-1){
732
         if(str.indexOf(val.id)!=-1){
693
           this.$message.error("该耗材已存在列表中")
733
           this.$message.error("该耗材已存在列表中")
694
           return
734
           return
703
             this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
743
             this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
704
             this.recordInfo.recordData[i].manufacturer = val.manufacturer
744
             this.recordInfo.recordData[i].manufacturer = val.manufacturer
705
             this.recordInfo.recordData[i].remark = val.remark
745
             this.recordInfo.recordData[i].remark = val.remark
746
+          
706
             if(val.packing_price == 0){
747
             if(val.packing_price == 0){
707
               this.recordInfo.recordData[i].price =""
748
               this.recordInfo.recordData[i].price =""
708
             }else{
749
             }else{
729
       getStockBatchNumber(params).then(response=>{
770
       getStockBatchNumber(params).then(response=>{
730
         if(response.data.state == 1){
771
         if(response.data.state == 1){
731
           var list = response.data.data.list
772
           var list = response.data.data.list
732
-          console.log("list2243444",list)
773
+ 
733
           this.numberList = list
774
           this.numberList = list
734
         }
775
         }
735
      })
776
      })
738
       return getDataConfig(module, filed_name)
779
       return getDataConfig(module, filed_name)
739
     },
780
     },
740
     changeNumberList(val,index){
781
     changeNumberList(val,index){
741
-
742
        for(let i=0;i<this.recordInfo.recordData.length;i++){
782
        for(let i=0;i<this.recordInfo.recordData.length;i++){
743
-        //  if(val.good_id == this.recordInfo.recordData[i].good_id){
744
-        //     this.recordInfo.recordData[i].warehouse_info_id = val.number
745
-        //  }
746
          if(index == i){
783
          if(index == i){
747
           this.recordInfo.recordData[i].warehouse_info_id = val.number
784
           this.recordInfo.recordData[i].warehouse_info_id = val.number
748
          }
785
          }
749
        }  
786
        }  
750
-      console.log("表格",this.recordInfo.recordData)
751
-    }
787
+    
788
+    },
789
+    
752
   },
790
   },
753
   created() {
791
   created() {
792
+   
754
     var nowDate = new Date();
793
     var nowDate = new Date();
755
     var nowYear = nowDate.getFullYear();
794
     var nowYear = nowDate.getFullYear();
756
     var nowMonth = nowDate.getMonth() + 1;
795
     var nowMonth = nowDate.getMonth() + 1;
773
     tempObj["dealer"] = ""
812
     tempObj["dealer"] = ""
774
     tempObj["license_number"] = ""
813
     tempObj["license_number"] = ""
775
     tempObj["warehouse_info_id"] = 0
814
     tempObj["warehouse_info_id"] = 0
776
-    
815
+    tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name
777
     this.recordInfo.recordData.push(tempObj);
816
     this.recordInfo.recordData.push(tempObj);
778
     this.GetConfigInfo();
817
     this.GetConfigInfo();
818
+  
779
     this.propForm.goodUnit = this.$store.getters.good_unit;
819
     this.propForm.goodUnit = this.$store.getters.good_unit;
780
     this.unitList =  getDataConfig('hemodialysis','units')
820
     this.unitList =  getDataConfig('hemodialysis','units')
781
-    console.log("单位",this.unitList)
821
+ 
782
   }
822
   }
783
 };
823
 };
784
 </script>
824
 </script>

+ 105 - 53
src/xt_pages/stock/stockOutOrderEdit.vue 查看文件

13
 
13
 
14
     <div class="app-container">
14
     <div class="app-container">
15
 
15
 
16
-  
16
+
17
       <stock-in-dialog
17
       <stock-in-dialog
18
         ref="dialog"
18
         ref="dialog"
19
         :propForm="propForm"
19
         :propForm="propForm"
24
       </stock-in-dialog>
24
       </stock-in-dialog>
25
 
25
 
26
       <div class="cell clearfix">
26
       <div class="cell clearfix">
27
+         <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
28
+         <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" :disabled="true">
29
+              <el-option
30
+                v-for="(option, index) in storelist"
31
+                :key="index"
32
+                :label="option.storehouse_name"
33
+                :value="option.id">
34
+              </el-option>
35
+         </el-select>
27
         <label class="title"><span class="name">出库时间</span> : </label>
36
         <label class="title"><span class="name">出库时间</span> : </label>
28
         <el-date-picker size="small" v-model="warehouse_out_time" prefix-icon="el-icon-date" :disabled="stockShow"
37
         <el-date-picker size="small" v-model="warehouse_out_time" prefix-icon="el-icon-date" :disabled="stockShow"
29
                         style="width: 200px;"
38
                         style="width: 200px;"
32
       </div>
41
       </div>
33
 
42
 
34
 
43
 
35
-    
44
+
36
 
45
 
37
 
46
 
38
 
47
 
41
                   max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
50
                   max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
42
         >
51
         >
43
 
52
 
44
-       
53
+
45
           <el-table-column width="200" align="center">
54
           <el-table-column width="200" align="center">
46
               <template slot="header" slot-scope="scope">
55
               <template slot="header" slot-scope="scope">
47
                 <span>耗材名称</span>
56
                 <span>耗材名称</span>
60
                       @input="changeGoodName(scope.$index)"
69
                       @input="changeGoodName(scope.$index)"
61
                       style="width:150px;"
70
                       style="width:150px;"
62
                       :disabled="stockShow"
71
                       :disabled="stockShow"
63
-                      
72
+
64
                     >
73
                     >
65
                       <i class="el-icon-search el-input__icon" slot="suffix"></i>
74
                       <i class="el-icon-search el-input__icon" slot="suffix"></i>
66
                     <template slot-scope="{ item }">
75
                     <template slot-scope="{ item }">
86
               </el-form-item>
95
               </el-form-item>
87
             </template>
96
             </template>
88
           </el-table-column>
97
           </el-table-column>
89
-          
90
-             
98
+
99
+
91
           <el-table-column width="140" align="center">
100
           <el-table-column width="140" align="center">
92
             <template slot="header" slot-scope="scope">
101
             <template slot="header" slot-scope="scope">
93
               <span>规格&单位<span style="color: red">*</span></span>
102
               <span>规格&单位<span style="color: red">*</span></span>
116
               </el-form-item>
125
               </el-form-item>
117
             </template>
126
             </template>
118
           </el-table-column> -->
127
           </el-table-column> -->
119
-         
128
+
120
           <el-table-column width="150" align="center">
129
           <el-table-column width="150" align="center">
121
             <template slot="header" slot-scope="scope">
130
             <template slot="header" slot-scope="scope">
122
               <span>单价<span style="color: red">*</span></span>
131
               <span>单价<span style="color: red">*</span></span>
123
             </template>
132
             </template>
124
             <template slot-scope="scope">
133
             <template slot-scope="scope">
125
-         
134
+
126
               <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
135
               <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
127
                             style="padding-top: 17px">
136
                             style="padding-top: 17px">
128
                 <el-input type="number" v-model="scope.row.price"  :disabled="stockShow"></el-input>
137
                 <el-input type="number" v-model="scope.row.price"  :disabled="stockShow"></el-input>
144
             </template>
153
             </template>
145
           </el-table-column>
154
           </el-table-column>
146
 
155
 
156
+          <el-table-column label="出库对象"  width="150" align="center">
157
+            <template slot-scope="scope">
158
+               <el-select size="small" v-model="scope.row.admin_user_id" filterable placeholder="请选择厂商"  :disabled="stockShow">
159
+                <el-option
160
+                  v-for="(option, index) in doctorList"
161
+                  :key="index"
162
+                  :label="option.user_name"
163
+                  :value="option.admin_user_id">
164
+                </el-option>
165
+               </el-select>
166
+            </template>
167
+          </el-table-column>
168
+
147
           <el-table-column label="总价" width="150" align="center">
169
           <el-table-column label="总价" width="150" align="center">
148
             <template slot-scope="scope">
170
             <template slot-scope="scope">
149
               {{calculate(scope.row.price*scope.row.count)}}
171
               {{calculate(scope.row.price*scope.row.count)}}
159
                   :value="option.id">
181
                   :value="option.id">
160
                 </el-option>
182
                 </el-option>
161
                </el-select>
183
                </el-select>
162
-            </template>   
184
+            </template>
163
           </el-table-column>
185
           </el-table-column>
164
          <el-table-column label="生产日期"  width="150" align="center">
186
          <el-table-column label="生产日期"  width="150" align="center">
165
            <template slot-scope="scope">
187
            <template slot-scope="scope">
190
               ></el-date-picker>
212
               ></el-date-picker>
191
             </template>
213
             </template>
192
           </el-table-column>
214
           </el-table-column>
193
-          
215
+
194
         <el-table-column  width="150" align="center">
216
         <el-table-column  width="150" align="center">
195
             <template slot="header" slot-scope="scope">
217
             <template slot="header" slot-scope="scope">
196
             <span>批准文号<span style="color: red"></span></span>
218
             <span>批准文号<span style="color: red"></span></span>
210
                   :value="option.id">
232
                   :value="option.id">
211
                 </el-option>
233
                 </el-option>
212
                </el-select>
234
                </el-select>
213
-            </template>   
235
+            </template>
214
           </el-table-column>
236
           </el-table-column>
215
 
237
 
216
           <el-table-column label="备注" width="150" align="center">
238
           <el-table-column label="备注" width="150" align="center">
322
         numberList:[],
344
         numberList:[],
323
         stockShow:false,
345
         stockShow:false,
324
         stockTrue:true,
346
         stockTrue:true,
325
-       
347
+        storelist:[],
348
+        storehouse_id:"",
349
+        doctorList:[],
326
       }
350
       }
327
     },
351
     },
328
     methods: {
352
     methods: {
364
         this.propForm.goods = [];
388
         this.propForm.goods = [];
365
 
389
 
366
         this.propForm.goodType = [];
390
         this.propForm.goodType = [];
367
-      }, 
391
+      },
368
       GetConfigInfo: function() {
392
       GetConfigInfo: function() {
369
         const loading = this.$loading({
393
         const loading = this.$loading({
370
           lock: true,
394
           lock: true,
400
           }
424
           }
401
         }
425
         }
402
         return name;
426
         return name;
403
-      }, 
427
+      },
404
       handleEdit: function(index, row) {
428
       handleEdit: function(index, row) {
429
+       if(parseInt(this.$route.query.is_sys) == 12){
430
+         this.$message.error("调拨出库数据不能新增!")
431
+          return
432
+       }
405
        if(row.supply_cancel_out_id >0){
433
        if(row.supply_cancel_out_id >0){
406
           this.$message.error("采购出库数据不能新增!")
434
           this.$message.error("采购出库数据不能新增!")
407
-          return 
435
+          return
408
         }
436
         }
409
         this.stockTrue = false
437
         this.stockTrue = false
410
         if(this.stockShow == true){
438
         if(this.stockShow == true){
422
         tempObj['license_number'] = ""
450
         tempObj['license_number'] = ""
423
         tempObj['dealer'] = ""
451
         tempObj['dealer'] = ""
424
         tempObj['manufacturer'] = ""
452
         tempObj['manufacturer'] = ""
453
+        tempObj["admin_user_id"] = this.$store.getters.xt_user.user.user_name
425
         this.recordInfo.recordData.push(tempObj)
454
         this.recordInfo.recordData.push(tempObj)
426
-      }, 
455
+      },
427
       handleDelete: function(index, row) {
456
       handleDelete: function(index, row) {
428
-      
457
+       if(parseInt(this.$route.query.is_sys) == 12){
458
+         this.$message.error("调拨出库数据不能删除!")
459
+          return
460
+       }
429
         if(row.supply_cancel_out_id >0){
461
         if(row.supply_cancel_out_id >0){
430
           this.$message.error("采购出库数据不能删除!")
462
           this.$message.error("采购出库数据不能删除!")
431
-          return 
463
+          return
432
         }
464
         }
433
- 
465
+
434
         if(this.stockShow == true){
466
         if(this.stockShow == true){
435
          this.$message.error("自动出库数据无法删除")
467
          this.$message.error("自动出库数据无法删除")
436
          return
468
          return
534
         this.$router.go(-1)
566
         this.$router.go(-1)
535
       },
567
       },
536
        submit() {
568
        submit() {
537
-       
569
+
538
         this.$refs['tableForm'].validate((valid) => {
570
         this.$refs['tableForm'].validate((valid) => {
539
           if (valid) {
571
           if (valid) {
540
             const array = this.recordInfo.recordData
572
             const array = this.recordInfo.recordData
554
              }
586
              }
555
               if(this.recordInfo.recordData[i].expiry_date == "" || this.recordInfo.recordData[i].expiry_date == undefined){
587
               if(this.recordInfo.recordData[i].expiry_date == "" || this.recordInfo.recordData[i].expiry_date == undefined){
556
                 this.recordInfo.recordData[i].expiry_date = ""
588
                 this.recordInfo.recordData[i].expiry_date = ""
557
-              } 
589
+              }
558
               if(this.recordInfo.recordData[i].product_date == "" || this.recordInfo.recordData[i].product_date == undefined){
590
               if(this.recordInfo.recordData[i].product_date == "" || this.recordInfo.recordData[i].product_date == undefined){
559
                 this.recordInfo.recordData[i].product_date = ""
591
                 this.recordInfo.recordData[i].product_date = ""
560
               }
592
               }
561
                this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
593
                this.recordInfo.recordData[i].price = this.recordInfo.recordData[i].price.toString()
562
-            
594
+
563
               for(let j=0;j<this.manufacturerList.length;j++){
595
               for(let j=0;j<this.manufacturerList.length;j++){
564
                 if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
596
                 if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
565
                   this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
597
                   this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
571
                 }
603
                 }
572
               }
604
               }
573
 
605
 
574
-            for(let y=0;y<this.numberList.length;y++){
606
+             for(let y=0;y<this.numberList.length;y++){
575
                if(this.recordInfo.recordData[i].number == this.numberList[y].id){
607
                if(this.recordInfo.recordData[i].number == this.numberList[y].id){
576
                    this.recordInfo.recordData[i].number = this.numberList[y].number
608
                    this.recordInfo.recordData[i].number = this.numberList[y].number
577
                }
609
                }
578
              }
610
              }
611
+
612
+
613
+              for(let s=0;s<this.doctorList.length;s++){
614
+
615
+                if(this.recordInfo.recordData[i].admin_user_id == this.doctorList[s].user_name){
616
+                  this.recordInfo.recordData[i].admin_user_id = this.doctorList[s].admin_user_id
617
+                }
618
+
619
+              }
579
             }
620
             }
580
               const loading = this.$loading({
621
               const loading = this.$loading({
581
                 lock: true,
622
                 lock: true,
587
               'warehouse_out_time':this.warehouse_out_time,
628
               'warehouse_out_time':this.warehouse_out_time,
588
               'stockOut': this.recordInfo.recordData,
629
               'stockOut': this.recordInfo.recordData,
589
               "warehout_id":parseInt(this.$route.query.id),
630
               "warehout_id":parseInt(this.$route.query.id),
631
+              "storehouse_id":parseInt(this.storehouse_id),
590
             }
632
             }
591
-           
592
-            console.log("stockout",params,this.$route.query.id)
633
+
634
+
593
             var warehout_id = parseInt(this.$route.query.id)
635
             var warehout_id = parseInt(this.$route.query.id)
594
-            editWarehouseoutInfo(params, this.warehouse_out_time, warehout_id, this.$route.query.type, this.form.manufacturer, this.form.dealer).then(response => {
636
+            editWarehouseoutInfo(params, this.warehouse_out_time, warehout_id, this.$route.query.type, this.form.manufacturer, this.form.dealer,this.storehouse_id).then(response => {
595
               if (response.data.state == 0) {
637
               if (response.data.state == 0) {
596
                 this.$message.error(response.data.msg)
638
                 this.$message.error(response.data.msg)
597
                 loading.close()
639
                 loading.close()
611
                   var good_name = response.data.data.good_name
653
                   var good_name = response.data.data.good_name
612
                   var specification_name = response.data.data.specification_name
654
                   var specification_name = response.data.data.specification_name
613
                   var str = good_name +"*" + specification_name +"无库存,请入库"
655
                   var str = good_name +"*" + specification_name +"无库存,请入库"
614
-                
656
+
615
                   if(msg == 7){
657
                   if(msg == 7){
616
                     this.$message.error(str)
658
                     this.$message.error(str)
617
                   }
659
                   }
626
             return false
668
             return false
627
           }
669
           }
628
         })
670
         })
629
-      }, 
671
+      },
630
      calculate: function(val) {
672
      calculate: function(val) {
631
         if (val == 0) {
673
         if (val == 0) {
632
           return ''
674
           return ''
642
       if (keyword != undefined) {
684
       if (keyword != undefined) {
643
         key = keyword
685
         key = keyword
644
       }
686
       }
645
-      console.log("keyrowrd",key)
687
+
646
       postSearchGoodList(key).then(response => {
688
       postSearchGoodList(key).then(response => {
647
         if (response.data.state == 1) {
689
         if (response.data.state == 1) {
648
-          
690
+
649
             var list = response.data.data.list
691
             var list = response.data.data.list
650
             this.goodList = list
692
             this.goodList = list
651
             var manufacturerList = response.data.data.manufacturerList
693
             var manufacturerList = response.data.data.manufacturerList
662
                 }
704
                 }
663
               }
705
               }
664
             }
706
             }
665
-          
707
+
666
             cb(this.goodList)
708
             cb(this.goodList)
667
         } else {
709
         } else {
668
           cb([])
710
           cb([])
678
            arr.push(this.recordInfo.recordData[i].good_id)
720
            arr.push(this.recordInfo.recordData[i].good_id)
679
         }
721
         }
680
         var str = arr.join(",")
722
         var str = arr.join(",")
681
-        console.log("str",str,"good_id",val.id)
723
+
682
         if(str.indexOf(val.id)!=-1){
724
         if(str.indexOf(val.id)!=-1){
683
           this.$message.error("该耗材已存在列表中")
725
           this.$message.error("该耗材已存在列表中")
684
           return
726
           return
699
             }else{
741
             }else{
700
                this.recordInfo.recordData[i].price = val.packing_price
742
                this.recordInfo.recordData[i].price = val.packing_price
701
             }
743
             }
702
-           
744
+
703
             this.recordInfo.recordData[i].specification_name = val.specification_name
745
             this.recordInfo.recordData[i].specification_name = val.specification_name
704
             this.recordInfo.recordData[i].good_id = val.id
746
             this.recordInfo.recordData[i].good_id = val.id
705
              if(val.dealer == 0){
747
              if(val.dealer == 0){
707
              }else{
749
              }else{
708
                this.recordInfo.recordData[i].dealer = val.dealer
750
                this.recordInfo.recordData[i].dealer = val.dealer
709
              }
751
              }
710
-           
752
+
711
          }
753
          }
712
       }
754
       }
713
     },
755
     },
724
         }
766
         }
725
       getSingleOutOrderDetail(params).then(response=>{
767
       getSingleOutOrderDetail(params).then(response=>{
726
         if(response.data.state == 1){
768
         if(response.data.state == 1){
727
-         
769
+
728
           var dealerList = response.data.data.dealerList
770
           var dealerList = response.data.data.dealerList
729
           this.dealerList = dealerList
771
           this.dealerList = dealerList
730
           var manufacturerList = response.data.data.manufacturerList
772
           var manufacturerList = response.data.data.manufacturerList
731
-         
773
+
732
           this.manufacturerList = manufacturerList
774
           this.manufacturerList = manufacturerList
733
           this.goodType = response.data.data.goodType
775
           this.goodType = response.data.data.goodType
776
+          this.doctorList = response.data.data.doctorlist
734
           for (let i = 0; i < response.data.data.list.length; i++) {
777
           for (let i = 0; i < response.data.data.list.length; i++) {
735
-           
778
+
736
             response.data.data.list[i].price = response.data.data.list[i].price.toString()
779
             response.data.data.list[i].price = response.data.data.list[i].price.toString()
737
             response.data.data.list[i].count = response.data.data.list[i].count.toString()
780
             response.data.data.list[i].count = response.data.data.list[i].count.toString()
738
             response.data.data.list[i].good_name = response.data.data.list[i].good_name
781
             response.data.data.list[i].good_name = response.data.data.list[i].good_name
741
             response.data.data.list[i].expiry_date = this.getTime(response.data.data.list[i].expiry_date,"{y}-{m}-{d}")
784
             response.data.data.list[i].expiry_date = this.getTime(response.data.data.list[i].expiry_date,"{y}-{m}-{d}")
742
             response.data.data.list[i].product_date = this.getTime(response.data.data.list[i].product_date,"{y}-{m}-{d}")
785
             response.data.data.list[i].product_date = this.getTime(response.data.data.list[i].product_date,"{y}-{m}-{d}")
743
             response.data.data.list[i].remark = response.data.data.list[i].remark
786
             response.data.data.list[i].remark = response.data.data.list[i].remark
787
+
744
             if(response.data.data.list[i].dealer == 0){
788
             if(response.data.data.list[i].dealer == 0){
745
                response.data.data.list[i].dealer = ""
789
                response.data.data.list[i].dealer = ""
746
             }
790
             }
749
             }
793
             }
750
             this.recordInfo.recordData.push(response.data.data.list[i])
794
             this.recordInfo.recordData.push(response.data.data.list[i])
751
           }
795
           }
796
+          this.storelist = response.data.data.storelist
797
+          this.warehouse_out_time = this.getTime(response.data.data.out.warehouse_out_time,"{y}-{m}-{d}")
798
+          this.storehouse_id = response.data.data.out.storehouse_id
752
           loading.close();
799
           loading.close();
753
         }
800
         }
754
       })
801
       })
760
         getStockBatchNumber(params).then(response=>{
807
         getStockBatchNumber(params).then(response=>{
761
           if(response.data.state == 1){
808
           if(response.data.state == 1){
762
             var list = response.data.data.list
809
             var list = response.data.data.list
763
-           
810
+
811
+
764
             this.numberList = list
812
             this.numberList = list
765
           }
813
           }
766
        })
814
        })
767
       },
815
       },
768
      changeNumberList(val,index){
816
      changeNumberList(val,index){
769
-       
817
+
818
+
770
        for(let i=0;i<this.recordInfo.recordData.length;i++){
819
        for(let i=0;i<this.recordInfo.recordData.length;i++){
771
          if(index == i){
820
          if(index == i){
772
             this.recordInfo.recordData[i].warehouse_info_id = val.number
821
             this.recordInfo.recordData[i].warehouse_info_id = val.number
773
          }
822
          }
774
-       }  
775
-      console.log("表格",this.recordInfo.recordData)
823
+       }
824
+
776
      }
825
      }
777
     },
826
     },
778
     created() {
827
     created() {
779
-      var nowDate = new Date();
780
-      var nowYear = nowDate.getFullYear();
781
-      var nowMonth = nowDate.getMonth() + 1;
782
-      var nowDay = nowDate.getDate();
783
-      this.warehouse_out_time =
784
-        nowYear +
785
-        "-" +
786
-        (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
787
-        "-" +
788
-        (nowDay < 10 ? "0" + nowDay : nowDay);
828
+      // var nowDate = new Date();
829
+      // var nowYear = nowDate.getFullYear();
830
+      // var nowMonth = nowDate.getMonth() + 1;
831
+      // var nowDay = nowDate.getDate();
832
+      // this.warehouse_out_time =
833
+      //   nowYear +
834
+      //   "-" +
835
+      //   (nowMonth < 10 ? "0" + nowMonth : nowMonth) +
836
+      //   "-" +
837
+      //   (nowDay < 10 ? "0" + nowDay : nowDay);
789
       this.propForm.goodUnit = this.$store.getters.good_unit
838
       this.propForm.goodUnit = this.$store.getters.good_unit
790
-      const order_id = this.$route.query.id  
839
+      const order_id = this.$route.query.id
791
       this.getSingleOutOrderDetail(order_id)
840
       this.getSingleOutOrderDetail(order_id)
792
       var is_sys = this.$route.query.is_sys
841
       var is_sys = this.$route.query.is_sys
793
       if(is_sys == 0){
842
       if(is_sys == 0){
796
       if(is_sys == 1){
845
       if(is_sys == 1){
797
         this.stockShow = true
846
         this.stockShow = true
798
       }
847
       }
848
+      if(is_sys == 12){
849
+        this.stockShow = true
850
+      }
799
       if(parseInt(this.$route.query.supply_cancel_out_id) >0){
851
       if(parseInt(this.$route.query.supply_cancel_out_id) >0){
800
         this.stockShow = true
852
         this.stockShow = true
801
       }
853
       }
802
-      
854
+
803
     }
855
     }
804
 
856
 
805
   }
857
   }

+ 381 - 8
src/xt_pages/stock/stockQuery.vue 查看文件

13
         "
13
         "
14
       >
14
       >
15
         <div>
15
         <div>
16
+          <span>仓库名称:</span>
17
+          <el-select v-model="storehouse_id" style="width:200px;margin-right:10px;" placeholder="请选择"
18
+          filterable
19
+           @change="changeStorehouseName">
20
+            <el-option
21
+              v-for="item in houseList"
22
+              :key="item.id"
23
+              :label="item.storehouse_name"
24
+              :value="item.id">
25
+            </el-option>
26
+          </el-select>
27
+          <span>耗材名称:</span>
28
+          <el-select v-model="good_id" style="width:250px;margin-right:10px;" placeholder="请选择"
29
+          filterable
30
+           @change="changeGoodName">
31
+            <el-option
32
+              v-for="item in goodList"
33
+              :key="item.id"
34
+              :label="item.good_name"
35
+              :value="item.id">
36
+            </el-option>
37
+          </el-select>
38
+          <!-- <el-select v-model="type_name" style="width:140px;margin-right:10px;" placeholder="请选择"
39
+          @change="changeTypeName">
16
           <el-select
40
           <el-select
17
             v-model="type_name"
41
             v-model="type_name"
18
             style="width: 140px; margin-right: 10px"
42
             style="width: 140px; margin-right: 10px"
26
               :value="item.id"
50
               :value="item.id"
27
             >
51
             >
28
             </el-option>
52
             </el-option>
29
-          </el-select>
30
-          <el-date-picker
53
+          </el-select> -->
54
+          <!-- <el-date-picker
31
             size="small"
55
             size="small"
32
             v-model="start_time"
56
             v-model="start_time"
33
             prefix-icon="el-icon-date"
57
             prefix-icon="el-icon-date"
55
             @change="endTimeChange"
79
             @change="endTimeChange"
56
           ></el-date-picker>
80
           ></el-date-picker>
57
           <el-input
81
           <el-input
82
+           ></el-date-picker>-
83
+            <el-date-picker
84
+              size="small"
85
+              v-model="end_time"
86
+              prefix-icon="el-icon-date"
87
+              :editable="false"
88
+              style="width: 196px;"
89
+              type="date"
90
+              placeholder="选择日期时间"
91
+              align="right"
92
+              format="yyyy-MM-dd"
93
+              value-format="yyyy-MM-dd"
94
+              @change="endTimeChange"
95
+          ></el-date-picker> -->
96
+          <!-- <el-input
58
             size="small"
97
             size="small"
59
             style="width: 200px; margin-left: 10px"
98
             style="width: 200px; margin-left: 10px"
60
             class="filter-item"
99
             class="filter-item"
61
             v-model.trim="keywords"
100
             v-model.trim="keywords"
62
             placeholder="耗材名称"
101
             placeholder="耗材名称"
63
-          />
64
-          <el-button
102
+          /> -->
103
+          <!-- <el-button
65
             size="small"
104
             size="small"
66
             class="filter-item"
105
             class="filter-item"
67
             type="primary"
106
             type="primary"
68
             icon="el-icon-search"
107
             icon="el-icon-search"
69
             @click="search"
108
             @click="search"
70
             >搜索</el-button
109
             >搜索</el-button
71
-          >
110
+          > -->
72
         </div>
111
         </div>
73
         <div>
112
         <div>
74
           <el-button size="small" type="primary" @click="exportList"
113
           <el-button size="small" type="primary" @click="exportList"
81
       </div>
120
       </div>
82
 
121
 
83
       <el-table
122
       <el-table
123
+       <el-table
124
+        :cell-class-name="cellStyle"
84
         :row-style="{ color: '#303133' }"
125
         :row-style="{ color: '#303133' }"
85
         :header-cell-style="{
126
         :header-cell-style="{
86
           backgroundColor: 'rgb(245, 247, 250)',
127
           backgroundColor: 'rgb(245, 247, 250)',
90
         :class="signAndWeighBoxPatients"
131
         :class="signAndWeighBoxPatients"
91
         border
132
         border
92
         v-loading="WarehouseInfo.loading"
133
         v-loading="WarehouseInfo.loading"
134
+        :span-method="objectOneMethod"
93
       >
135
       >
94
         <el-table-column label="耗材类型" align="center">
136
         <el-table-column label="耗材类型" align="center">
95
           <template slot-scope="scope">
137
           <template slot-scope="scope">
131
             </span>
173
             </span>
132
           </template>
174
           </template>
133
         </el-table-column>
175
         </el-table-column>
176
+       <el-table-column label="仓库名称" align="center" width="150">
177
+          <template slot-scope="scope">
178
+            <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
179
+              <td style="border-right: none; border-inline-end: none;text-align: center" >
180
+               {{getHouseName(item.storehouse_id)}}
181
+              </td>
182
+            </tr>
183
+          </template>
184
+        </el-table-column>
185
+       <el-table-column label="入库数量" align="center">
186
+         <template slot-scope="scope">
187
+
188
+            <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
189
+              <td style="border-right: none; border-inline-end: none;text-align: center">
190
+               {{getWareInfoCount(scope.row.xt_warehouse_info,item.storehouse_id)}}
191
+              </td>
192
+            </tr>
193
+         </template>
194
+       </el-table-column>
195
+       <el-table-column label="出库数量" align="center">
196
+         <template slot-scope="scope">
197
+          <span>
198
+             <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
199
+              <td style="border-right: none; border-inline-end: none;text-align: center">
200
+              {{getWareInfoCount(scope.row.xt_warehouse_info,item.storehouse_id) - getWareInfoCountOne(scope.row.xt_warehouse_info,item.storehouse_id)}}
201
+              </td>
202
+            </tr>
203
+         </span>
204
+
205
+         </template>
206
+       </el-table-column>
207
+
208
+        <el-table-column label="剩余库存量" align="center">
209
+         <template slot-scope="scope">
210
+             <tr style="background: none" v-for="(item,index) in scope.row.warehouse_info" :key="index">
211
+              <td style="border-right: none; border-inline-end: none;text-align: center">
212
+               {{getWareInfoCountOne(scope.row.xt_warehouse_info,item.storehouse_id)}}
213
+              </td>
214
+            </tr>
215
+         </template>
216
+       </el-table-column>
217
+
218
+       <el-table-column label="总库存量" align="center">
219
+         <template slot-scope="scope">
220
+           {{getOverFlushInfo(scope.row.xt_warehouse_info)}}
221
+         </template>
222
+       </el-table-column>
223
+
224
+      <el-table-column label="总库存量" align="center" v-if="showTwo">
225
+         <template slot-scope="scope">
226
+          <span>{{getWareInfoCountTwo(scope.row.xt_warehouse_info)}} </span>
227
+         </template>
228
+       </el-table-column>
134
         <el-table-column label="入库数量" align="center">
229
         <el-table-column label="入库数量" align="center">
135
           <template slot-scope="scope">
230
           <template slot-scope="scope">
136
               <span
231
               <span
139
                 {{ getWareInfo(scope.row.xt_warehouse_info)
234
                 {{ getWareInfo(scope.row.xt_warehouse_info)
140
                 }}{{ scope.row.packing_unit }}
235
                 }}{{ scope.row.packing_unit }}
141
               </span>
236
               </span>
142
-           
237
+
143
             <!-- <span v-if="getWareInfo(scope.row.xt_warehouse_info)>0">{{getWareInfo(scope.row.xt_warehouse_info)}}{{scope.row.packing_unit}}</span> -->
238
             <!-- <span v-if="getWareInfo(scope.row.xt_warehouse_info)>0">{{getWareInfo(scope.row.xt_warehouse_info)}}{{scope.row.packing_unit}}</span> -->
144
           </template>
239
           </template>
145
         </el-table-column>
240
         </el-table-column>
183
 
278
 
184
         <el-table-column label="剩余库存量" align="center" v-if="showThree">
279
         <el-table-column label="剩余库存量" align="center" v-if="showThree">
185
           <template slot-scope="scope">
280
           <template slot-scope="scope">
186
-           
281
+
187
               <span
282
               <span
188
                 v-if="
283
                 v-if="
189
                   org_id == 9671 ||
284
                   org_id == 9671 ||
217
                   getCancelCount(scope.row.id)
312
                   getCancelCount(scope.row.id)
218
                 }}
313
                 }}
219
               </span>
314
               </span>
220
-           
315
+
221
             <!-- <span
316
             <!-- <span
222
               v-if="
317
               v-if="
223
                 org_id == 9671 ||
318
                 org_id == 9671 ||
271
           </template>
366
           </template>
272
         </el-table-column>
367
         </el-table-column>
273
 
368
 
369
+       <el-table-column label="操作" align="center" width="200px">
274
         <el-table-column label="操作" align="center" width="260px">
370
         <el-table-column label="操作" align="center" width="260px">
275
           <template slot-scope="scope">
371
           <template slot-scope="scope">
276
             <el-button size="small" type="primary" @click="toClick(scope.row)"
372
             <el-button size="small" type="primary" @click="toClick(scope.row)"
367
       showTwo: false,
463
       showTwo: false,
368
       showThree: true,
464
       showThree: true,
369
       showFour: false,
465
       showFour: false,
466
+      options:[],
467
+      value:"",
468
+      type_name:0,
469
+      types:[],
470
+      tableList:[],
471
+      manufacturerList:[],
472
+      countList:[],
473
+      outCountList:[],
474
+      autoCountList:[],
475
+      cancelCountList:[],
476
+      org_id:0,
477
+      showOne:true,
478
+      showTwo:false,
479
+      showThree:true,
480
+      showFour:false,
481
+      houseList:[],
482
+      storehouse_id:0,
483
+      goodList:[],
484
+      good_id:0,
485
+      tempArr:[],
486
+      storehouseList:[],
370
     };
487
     };
371
   },
488
   },
372
   methods: {
489
   methods: {
381
             type_name: "全部",
498
             type_name: "全部",
382
           };
499
           };
383
           this.types.push(obj);
500
           this.types.push(obj);
501
+           var obj = {
502
+            id:0,
503
+            type_name:'全部'
504
+          }
505
+          var objOne = {
506
+            id:0,
507
+            storehouse_name:"全部",
508
+          }
509
+          var objTwo = {
510
+            id:0,
511
+            good_name:"全部",
512
+          }
513
+          this.types.push(obj)
514
+          this.houseList.push(objOne)
515
+          this.goodList.push(objTwo)
384
           for (let i = 0; i < response.data.data.goodType.length; i++) {
516
           for (let i = 0; i < response.data.data.goodType.length; i++) {
385
             this.goodType.push(response.data.data.goodType[i]);
517
             this.goodType.push(response.data.data.goodType[i]);
386
             this.types.push(response.data.data.goodType[i]);
518
             this.types.push(response.data.data.goodType[i]);
387
           }
519
           }
520
+          for(let i=0;i<response.data.data.houseList.length;i++){
521
+            this.houseList.push(response.data.data.houseList[i])
522
+          }
523
+          for(let i=0;i<response.data.data.goodInfo.length;i++){
524
+            for(let j=0;j<response.data.data.manufacturerList.length;j++){
525
+                if(response.data.data.goodInfo[i].manufacturer == response.data.data.manufacturerList[j].id){
526
+                   response.data.data.goodInfo[i].manufacturer = response.data.data.manufacturerList[j].manufacturer_name
527
+                }
528
+              }
529
+           response.data.data.goodInfo[i].good_name = response.data.data.goodInfo[i].good_name  + " " + response.data.data.goodInfo[i].specification_name + " " + response.data.data.goodInfo[i].manufacturer
530
+           this.goodList.push(response.data.data.goodInfo[i])
531
+          }
532
+          this.storehouseList = response.data.data.storehouseList
388
         }
533
         }
389
       });
534
       });
390
     },
535
     },
480
         return "spanClass";
625
         return "spanClass";
481
       }
626
       }
482
     },
627
     },
628
+        // 合并单元格样式
629
+    cellStyle({ row, column, rowIndex, columnIndex }) {
630
+      let arr = [6, 7, 8, 9];
631
+      if (arr.indexOf(columnIndex) > -1) {
632
+        return "spanClass";
633
+      }
634
+    },
635
+
483
 
636
 
484
     exportList() {
637
     exportList() {
485
       import("@/vendor/Export2Excel").then((excel) => {
638
       import("@/vendor/Export2Excel").then((excel) => {
660
         start_time: this.start_time,
813
         start_time: this.start_time,
661
         end_time: this.end_time,
814
         end_time: this.end_time,
662
         type: this.type_name,
815
         type: this.type_name,
816
+        start_time:this.start_time,
817
+        end_time:this.end_time,
818
+        type:this.type_name,
819
+        good_id:this.good_id,
820
+        storehouse_id:this.storehouse_id,
663
       };
821
       };
664
       console.log("params232322323", params);
822
       console.log("params232322323", params);
665
       getAllStockList(params).then((response) => {
823
       getAllStockList(params).then((response) => {
686
           this.manufacturerList = manufacturerList;
844
           this.manufacturerList = manufacturerList;
687
         }
845
         }
688
       });
846
       });
847
+    getAllStockList(params).then(response=>{
848
+      if(response.data.state == 1){
849
+          var list = response.data.data.list
850
+          this.tableList = list
851
+          var total = response.data.data.total
852
+          this.total = total
853
+          var manufacturerList = response.data.data.manufacturerList
854
+          this.manufacturerList = manufacturerList
855
+         }
856
+      })
689
     },
857
     },
690
     getManufacture(id) {
858
     getManufacture(id) {
691
       var name = "";
859
       var name = "";
772
           this.cancelCountList = totalCount;
940
           this.cancelCountList = totalCount;
773
         }
941
         }
774
       });
942
       });
943
+    getStockDrugCount(){
944
+        var params ={
945
+           keywords: this.keywords,
946
+           start_time:this.start_time,
947
+           end_time:this.end_time,
948
+        }
949
+      getStockDrugCount(params).then(response=>{
950
+         if(response.data.state == 1){
951
+           var outlist = response.data.data.outList
952
+           this.outCountList = outlist
953
+           var autoCount = response.data.data.autoCount
954
+
955
+           this.autoCountList = autoCount
956
+           var totalCount = response.data.data.totalCount
957
+
958
+           this.cancelCountList = totalCount
959
+         }
960
+      })
775
     },
961
     },
776
     getInCount(id) {
962
     getInCount(id) {
777
       var count = 0;
963
       var count = 0;
870
       return cancle_toal;
1056
       return cancle_toal;
871
     },
1057
     },
872
   },
1058
   },
1059
+     return count
1060
+   },
1061
+   getAutoCount(id){
1062
+     var count= 0
1063
+     for(let i=0;i<this.autoCountList.length;i++){
1064
+       if(id == this.autoCountList[i].good_id){
1065
+         count = this.autoCountList[i].count
1066
+       }
1067
+     }
1068
+     return count
1069
+   },
1070
+   getCancelCount(id){
1071
+     var count = 0
1072
+     for(let i=0;i<this.cancelCountList.length;i++){
1073
+       if(id == this.cancelCountList[i].good_id){
1074
+          count = this.cancelCountList[i].count
1075
+       }
1076
+     }
1077
+     return count
1078
+   },
1079
+   getStockCount(id){
1080
+     var stock_count = 0
1081
+     for(let i=0;i<this.countList.length;i++){
1082
+       if(id == this.countList[i].good_id){
1083
+         stock_count = this.countList[i].stock_count
1084
+       }
1085
+     }
1086
+     return stock_count
1087
+   },
1088
+   getWareInfo(arr){
1089
+     var total = 0
1090
+     if(arr.length > 0){
1091
+       for(let i=0;i<arr.length;i++){
1092
+         total += parseInt(arr[i].warehousing_count)
1093
+       }
1094
+     }else{
1095
+       total = ""
1096
+     }
1097
+     return total
1098
+   },
1099
+   getOverplus(arr){
1100
+     var total = 0
1101
+     if(arr.length > 0){
1102
+      for(let i=0;i<arr.length;i++){
1103
+        total += arr[i].stock_count
1104
+      }
1105
+     }else{
1106
+       total = ""
1107
+     }
1108
+     return total
1109
+   },
1110
+   getCancelInfo(arr){
1111
+     var total = 0
1112
+     if(arr.length > 0){
1113
+      for(let i=0;i<arr.length;i++){
1114
+        total += arr[i].count
1115
+      }
1116
+     }else{
1117
+       total = ""
1118
+     }
1119
+     return total
1120
+   },
1121
+   getOverFlushInfo(arr){
1122
+     var total = 0
1123
+     if(arr.length >0){
1124
+      for(let i=0;i<arr.length;i++){
1125
+        total += arr[i].stock_count
1126
+      }
1127
+     }
1128
+     return total
1129
+   },
1130
+   getCancelSotckInfo(arr){
1131
+
1132
+     var cancle_toal = 0
1133
+     if(arr.length >0){
1134
+      for(let z=0;z<arr.length;z++){
1135
+        cancle_toal += arr[z].count
1136
+      }
1137
+     }
1138
+     return cancle_toal
1139
+   },
1140
+   getHouseName(id){
1141
+     var storehouse_name = ""
1142
+     for(let i=0;i<this.storehouseList.length;i++){
1143
+       if(id == this.storehouseList[i].id){
1144
+         storehouse_name = this.storehouseList[i].storehouse_name
1145
+       }
1146
+     }
1147
+     return storehouse_name
1148
+   },
1149
+   objectOneMethod({ row, column, rowIndex, columnIndex }) {
1150
+     console.log("column",column)
1151
+     console.log("rowindex",rowIndex)
1152
+     console.log("columnninex",columnIndex)
1153
+    //  if(columnIndex === 1){
1154
+    //    if(rowIndex === 1){
1155
+    //      return {
1156
+    //         rowspan: 1,
1157
+    //         colspan: 3
1158
+    //       };
1159
+    //    }
1160
+    //  }
1161
+   },
1162
+   getWareInfoCount(val,storehouse_id){
1163
+     var count = 0
1164
+     if(val.length > 0){
1165
+       for(let i=0;i<val.length;i++){
1166
+         if(val[i].storehouse_id == storehouse_id){
1167
+             count +=val[i].warehousing_count
1168
+         }
1169
+       }
1170
+     }
1171
+     if(count > 0){
1172
+       return count
1173
+     }else{
1174
+       return ""
1175
+     }
1176
+   },
1177
+   getWareInfoCountOne(val,storehouse_id){
1178
+     var count = 0
1179
+     if(val.length > 0){
1180
+       for(let i=0;i<val.length;i++){
1181
+         if(val[i].storehouse_id == storehouse_id){
1182
+             count +=val[i].stock_count
1183
+         }
1184
+       }
1185
+     }
1186
+     if(count > 0){
1187
+       return count
1188
+     }else{
1189
+       return ""
1190
+     }
1191
+   },
1192
+   getWareInfoCountTwo(val,storehouse_id){
1193
+     var count = 0
1194
+     if(val.length > 0){
1195
+       for(let i=0;i<val.length;i++){
1196
+         count +=val[i].stock_count
1197
+       }
1198
+     }
1199
+     if(count > 0){
1200
+       return count
1201
+     }else{
1202
+       return ""
1203
+     }
1204
+   },
1205
+   changeStorehouseName(){
1206
+     this.getlist()
1207
+   },
1208
+   changeGoodName(){
1209
+    this.getlist()
1210
+   },
1211
+   arraySpanMethod({ row, column, rowIndex, columnIndex }) {
1212
+     console.log("当前行",row)
1213
+     console.log("当前列",column)
1214
+     console.log("当前行号",rowIndex)
1215
+     console.log("当前列号",columnIndex)
1216
+     if(rowIndex == 1 && columnIndex === 4){
1217
+       return {
1218
+        rowspan: 2,
1219
+        colspan: 1
1220
+       };
1221
+     }
1222
+   },
1223
+  }
873
 };
1224
 };
874
 </script>
1225
 </script>
875
 
1226
 
944
 .spanClass .cell tr:last-of-type td {
1295
 .spanClass .cell tr:last-of-type td {
945
   border-bottom: none;
1296
   border-bottom: none;
946
 }
1297
 }
1298
+
1299
+/* 合并表格线样式 */
1300
+
1301
+.spanClass .cell {
1302
+  padding: 0 !important;
1303
+}
1304
+
1305
+.spanClass .cell tr {
1306
+  display: inline-block;
1307
+  width: 100%;
1308
+}
1309
+
1310
+.spanClass .cell tr td {
1311
+  padding: 10px 0;
1312
+  border-bottom: 1px solid #ebeef5;
1313
+  display: block;
1314
+  width: 100%;
1315
+}
1316
+.spanClass .cell tr:last-of-type td{
1317
+  border-bottom: none;
1318
+}
1319
+
947
 </style>
1320
 </style>

+ 0 - 2
src/xt_pages/supply/components/addGoodOrder.vue 查看文件

1213
     checkGoodOrder() {
1213
     checkGoodOrder() {
1214
       var id = this.warese_out_id;
1214
       var id = this.warese_out_id;
1215
       var warehousing_id = this.id;
1215
       var warehousing_id = this.id;
1216
-      console.log("采购单ID",id)
1217
-      console.log("采购订单ID",warehousing_id)
1218
       this.loading = true
1216
       this.loading = true
1219
       getGoodOrderCountList(id, warehousing_id).then((response) => {
1217
       getGoodOrderCountList(id, warehousing_id).then((response) => {
1220
         if (response.data.state == 1) {
1218
         if (response.data.state == 1) {

+ 29 - 0
src/xt_pages/supply/components/addGoodReturn.vue 查看文件

1040
                 orderInfo[i].drug.min_number,
1040
                 orderInfo[i].drug.min_number,
1041
                 orderInfo[i].warehouse_out_id
1041
                 orderInfo[i].warehouse_out_id
1042
               );
1042
               );
1043
+              }
1044
+             orderInfo[i].count = this.getWarehoseInfoSix(orderInfo[i].drug_warehouse_info,orderInfo[i].drug.max_unit,orderInfo[i].drug.min_unit,orderInfo[i].drug.min_number,orderInfo[i].warehouse_out_id)
1043
               // orderInfo[i].count = orderInfo[i].count + orderInfo[i].supply_unit
1045
               // orderInfo[i].count = orderInfo[i].count + orderInfo[i].supply_unit
1044
             }
1046
             }
1045
 
1047
 
1065
 
1067
 
1066
           this.recordInfo.tableList = [];
1068
           this.recordInfo.tableList = [];
1067
           console.log("相亲233232322332323223322323", orderInfo);
1069
           console.log("相亲233232322332323223322323", orderInfo);
1070
+          console.log("乡里233232322332323223322323",orderInfo)
1068
           this.recordInfo.tableList = orderInfo;
1071
           this.recordInfo.tableList = orderInfo;
1069
           this.tableDataList = [];
1072
           this.tableDataList = [];
1070
           this.tableDataList = orderInfo;
1073
           this.tableDataList = orderInfo;
1460
           for (let i = 0; i < this.recordInfo.tableList.length; i++) {
1463
           for (let i = 0; i < this.recordInfo.tableList.length; i++) {
1461
             if (index == i) {
1464
             if (index == i) {
1462
               this.recordInfo.tableList[i].supply_count = supply_count;
1465
               this.recordInfo.tableList[i].supply_count = supply_count;
1466
+    getSupplyCount(supply_count,sum_count,supply_unit,type,min_number,max_unit,min_unit,index){
1467
+     console.log("val23322323",sum_count)
1468
+      var total_count = 0
1469
+
1470
+      if(type == 1){
1471
+       if(supply_unit == max_unit){
1472
+          total_count = supply_count * min_number
1473
+       }
1474
+       if(supply_unit == min_unit){
1475
+         total_count = supply_count
1476
+       }
1477
+       console.log("sum_counts",sum_count)
1478
+       console.log("count232232332",total_count)
1479
+       if(total_count > sum_count){
1480
+         this.$message.error("数量不能大于可退数量!")
1481
+         for(let i=0;i<this.recordInfo.tableList.length;i++){
1482
+           if(index == i){
1483
+             this.recordInfo.tableList[i].supply_count = ""
1484
+           }
1485
+         }
1486
+       }else{
1487
+           for(let i=0;i<this.recordInfo.tableList.length;i++){
1488
+            if(index == i){
1489
+              this.recordInfo.tableList[i].supply_count = supply_count
1463
             }
1490
             }
1464
           }
1491
           }
1465
         }
1492
         }
1487
     },
1514
     },
1488
 
1515
 
1489
     getWarehoseInfoSix(arr, max_unit, min_unit, min_number, warehouse_out_id) {
1516
     getWarehoseInfoSix(arr, max_unit, min_unit, min_number, warehouse_out_id) {
1517
+
1518
+   getWarehoseInfoSix(arr, max_unit, min_unit, min_number,warehouse_out_id) {
1490
       var total = 0;
1519
       var total = 0;
1491
       var max_str = "";
1520
       var max_str = "";
1492
       var min_str = "";
1521
       var min_str = "";

+ 2 - 2
src/xt_pages/supply/components/editGoodReturn.vue 查看文件

1004
       this.payment = this.total_price - this.arrearage;
1004
       this.payment = this.total_price - this.arrearage;
1005
     },
1005
     },
1006
     getSupplyCount(supply_count,sum_count,supply_unit,type,min_number,max_unit,min_unit,index){
1006
     getSupplyCount(supply_count,sum_count,supply_unit,type,min_number,max_unit,min_unit,index){
1007
-     console.log("val23322323",supply_count,sum_count,supply_unit,type,min_number,max_unit,min_unit)
1007
+      console.log("sum_count2323232",sum_count)
1008
       var total_count = 0
1008
       var total_count = 0
1009
       
1009
       
1010
       if(type == 1){
1010
       if(type == 1){
1159
                 // orderInfo[i].count = this.getTotalStockCountTwo(goodList[j].good_warehouse_info);
1159
                 // orderInfo[i].count = this.getTotalStockCountTwo(goodList[j].good_warehouse_info);
1160
                // orderInfo[i].supply_total = this.getTotalStockCountTwo(goodList[j].good_warehouse_info);
1160
                // orderInfo[i].supply_total = this.getTotalStockCountTwo(goodList[j].good_warehouse_info);
1161
               }
1161
               }
1162
-              orderInfo[i].sum_count = orderInfo[i].count
1162
+              orderInfo[i].sum_count = orderInfo[i].sum_count
1163
               orderInfo[i].min_number = 0
1163
               orderInfo[i].min_number = 0
1164
               orderInfo[i].count = orderInfo[i].count;
1164
               orderInfo[i].count = orderInfo[i].count;
1165
               orderInfo[i].supply_total = orderInfo[i].supply_total
1165
               orderInfo[i].supply_total = orderInfo[i].supply_total

+ 2 - 1
src/xt_pages/supply/purchaseOrderQuery.vue 查看文件

103
         </el-table-column>
103
         </el-table-column>
104
         <el-table-column label="关联采购单号" align="center" width="150">
104
         <el-table-column label="关联采购单号" align="center" width="150">
105
           <template slot-scope="scope">
105
           <template slot-scope="scope">
106
+            
106
             <tr style="background: none;" v-for="(item,index) in scope.row.orderOut" :key="index">
107
             <tr style="background: none;" v-for="(item,index) in scope.row.orderOut" :key="index">
107
                  <td style="border-right: none;">{{item.good_number}}</td>
108
                  <td style="border-right: none;">{{item.good_number}}</td>
108
-              </tr>
109
+             </tr>
109
           </template>
110
           </template>
110
         </el-table-column>
111
         </el-table-column>
111
         <el-table-column label="采购金额" align="center">
112
         <el-table-column label="采购金额" align="center">

+ 1 - 0
src/xt_pages/supply/supplyQuery.vue 查看文件

201
       tableList: [],
201
       tableList: [],
202
       tyep_name: "",
202
       tyep_name: "",
203
       sType: [],
203
       sType: [],
204
+     
204
     };
205
     };
205
   },
206
   },
206
 
207
 

+ 15 - 3
src/xt_pages/user/components/PatientDetail.vue 查看文件

264
                   </el-checkbox>
264
                   </el-checkbox>
265
                 </el-checkbox-group>
265
                 </el-checkbox-group>
266
               </el-form-item>
266
               </el-form-item>
267
+
268
+              <el-form-item label="疑难内瘘:">
269
+                <el-radio-group v-model="form.troble_shoot">
270
+                  <el-radio :label="1">是</el-radio>
271
+                  <el-radio :label="2">否</el-radio>
272
+                </el-radio-group>
273
+              </el-form-item>
267
             </el-col>
274
             </el-col>
268
 
275
 
269
             <!--<el-col :span="16" >-->
276
             <!--<el-col :span="16" >-->
1080
   expense_kind: "",
1087
   expense_kind: "",
1081
   contact_name: "",
1088
   contact_name: "",
1082
   sch_remark:"",
1089
   sch_remark:"",
1083
-  org_id:0
1090
+  org_id:0,
1091
+  troble_shoot:"",
1084
 };
1092
 };
1085
 
1093
 
1086
 export default {
1094
 export default {
1169
           { required: true, message: "请填写身份证号", trigger: "blur" }
1177
           { required: true, message: "请填写身份证号", trigger: "blur" }
1170
         ],
1178
         ],
1171
         birth: [{ required: true, message: "请填写生日", trigger: "blur" }]
1179
         birth: [{ required: true, message: "请填写生日", trigger: "blur" }]
1172
-      }
1180
+      },
1181
+      shootList:[
1182
+       {id:1,name:"是"},
1183
+       {id:2,name:"否"}
1184
+      ]
1173
     };
1185
     };
1174
   },
1186
   },
1175
   computed: {
1187
   computed: {
1263
             this.form.dialysisNo = patietInfo.dialysis_no;
1275
             this.form.dialysisNo = patietInfo.dialysis_no;
1264
             this.form.gender = patietInfo.gender;
1276
             this.form.gender = patietInfo.gender;
1265
             this.form.is_infectious = patietInfo.is_infectious;
1277
             this.form.is_infectious = patietInfo.is_infectious;
1266
-           
1278
+            this.form.troble_shoot = patietInfo.troble_shoot
1267
             // this.form.record_date = patietInfo.is_infectious
1279
             // this.form.record_date = patietInfo.is_infectious
1268
             this.form.response_result = patietInfo.response_result;
1280
             this.form.response_result = patietInfo.response_result;
1269
             this.form.remind_cycle = patietInfo.remind_cycle;
1281
             this.form.remind_cycle = patietInfo.remind_cycle;

+ 10 - 1
src/xt_pages/user/components/PatientForm.vue 查看文件

335
                     >
335
                     >
336
                   </el-checkbox-group>
336
                   </el-checkbox-group>
337
                 </el-form-item>
337
                 </el-form-item>
338
+
339
+                  <el-form-item label="疑难内瘘:">
340
+                    <el-radio-group v-model="form.troble_shoot">
341
+                      <el-radio :label="1">是</el-radio>
342
+                      <el-radio :label="2">否</el-radio>
343
+                    </el-radio-group>
344
+                   </el-form-item>
338
               </el-col>
345
               </el-col>
339
               
346
               
340
               <!-- <el-col :span="8">
347
               <!-- <el-col :span="8">
1005
   expense_kind: "",
1012
   expense_kind: "",
1006
   contact_name: "",
1013
   contact_name: "",
1007
   user_sys_before_count: "",
1014
   user_sys_before_count: "",
1008
-
1015
+  troble_shoot:2,
1009
   formItem: [
1016
   formItem: [
1010
     {
1017
     {
1011
       id: 0,
1018
       id: 0,
1438
           if (this.isEdit) {
1445
           if (this.isEdit) {
1439
             this.form.age = parseInt(this.form.age);
1446
             this.form.age = parseInt(this.form.age);
1440
             this.form.user_sys_before_count = this.form.user_sys_before_count.toString();
1447
             this.form.user_sys_before_count = this.form.user_sys_before_count.toString();
1448
+            this.form.troble_shoot = parseInt(this.form.troble_shoot)
1441
             if(this.form.avatar.indexOf('?imageView2/2/w/500/h/500/q/90')!=-1){
1449
             if(this.form.avatar.indexOf('?imageView2/2/w/500/h/500/q/90')!=-1){
1442
                this.form.avatar = this.form.avatar
1450
                this.form.avatar = this.form.avatar
1443
             }else{
1451
             }else{
1475
               });
1483
               });
1476
           } else {
1484
           } else {
1477
             this.form.age = parseInt(this.form.age);
1485
             this.form.age = parseInt(this.form.age);
1486
+            this.form.troble_shoot = parseInt(this.form.troble_shoot)
1478
             createPatient(this.form)
1487
             createPatient(this.form)
1479
               .then(response => {
1488
               .then(response => {
1480
                 if (response.data.state == 0) {
1489
                 if (response.data.state == 0) {

+ 1 - 3
src/xt_pages/user/doctorAdvice.vue 查看文件

182
           <template slot-scope="scope">
182
           <template slot-scope="scope">
183
             <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
183
             <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
184
               <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
184
               <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
185
-                {{ scope.row.advice_name
186
-                }}<i class="el-icon-arrow-down el-icon--right"></i>
185
+                {{ scope.row.advice_name}}<i class="el-icon-arrow-down el-icon--right"></i>
187
               </span>
186
               </span>
188
 
187
 
189
               <el-dropdown-menu slot="dropdown">
188
               <el-dropdown-menu slot="dropdown">
3390
             }
3389
             }
3391
           });
3390
           });
3392
           let list = Object.values(dataInfo);
3391
           let list = Object.values(dataInfo);
3393
-          // console.log("list", list);
3394
           list.map(item => {
3392
           list.map(item => {
3395
             for (let i = 0; i < advice.length; i++) {
3393
             for (let i = 0; i < advice.length; i++) {
3396
               if (
3394
               if (