XMLWAN 3 years ago
parent
commit
b14fbb930e
37 changed files with 3605 additions and 1005 deletions
  1. 3 3
      config/dev.env.js
  2. 2 2
      config/index.js
  3. 330 219
      src/api/drug/drug.js
  4. 112 0
      src/api/stock.js
  5. 6 0
      src/router/modules/drugs.js
  6. 17 0
      src/router/modules/stock.js
  7. 7 0
      src/xt_pages/dialysis/details/dialog/AssessmentAfterDislysis.vue
  8. 6 0
      src/xt_pages/dialysis/details/index.vue
  9. 13 2
      src/xt_pages/dialysis/template/DialysisPrintOrderThirtyEight.vue
  10. 5 5
      src/xt_pages/hospitalStation/components/deskPrescription.vue
  11. 5 5
      src/xt_pages/hospitalStation/components/registerDialog.vue
  12. 5 5
      src/xt_pages/hospitalStation/components/registerDialog9504.vue
  13. 5 5
      src/xt_pages/hospitalStation/index.vue
  14. 5 5
      src/xt_pages/hospitalStation/outpatientChargesManagement.vue
  15. 10 2
      src/xt_pages/medicalScheduling/index.vue
  16. 5 5
      src/xt_pages/outpatientCharges/components/registerDialog.vue
  17. 10 10
      src/xt_pages/outpatientCharges/outpatientChargesManagement.vue
  18. 8 9
      src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue
  19. 8 8
      src/xt_pages/outpatientDoctorStation/prescriptionTemplatedetail.vue
  20. 5 5
      src/xt_pages/outpatientRegistration/index.vue
  21. 136 0
      src/xt_pages/stock/drugs/drugDamagePrint.vue
  22. 645 121
      src/xt_pages/stock/drugs/drugDamaged.vue
  23. 609 102
      src/xt_pages/stock/drugs/drugModifyPrice.vue
  24. 33 16
      src/xt_pages/stock/drugs/drugModifyPricePrint.vue
  25. 393 91
      src/xt_pages/stock/drugs/inventory.vue
  26. 1 17
      src/xt_pages/stock/drugs/inventoryDetails.vue
  27. 319 26
      src/xt_pages/stock/inventory.vue
  28. 125 0
      src/xt_pages/stock/inventoryDetailPrint.vue
  29. 109 220
      src/xt_pages/stock/inventoryDetails.vue
  30. 35 9
      src/xt_pages/stock/inventoryPrint.vue
  31. 143 0
      src/xt_pages/stock/stockDamagePrint.vue
  32. 252 28
      src/xt_pages/stock/stockDamaged.vue
  33. 170 21
      src/xt_pages/stock/stockModifyPrice.vue
  34. 16 13
      src/xt_pages/user/dialysisSolution.vue
  35. 37 36
      src/xt_pages/user/templateSummary.vue
  36. 2 2
      src/xt_pages/user/templateSummaryPrint.vue
  37. 13 13
      src/xt_permission.js

+ 3 - 3
config/dev.env.js View File

@@ -6,9 +6,9 @@
6 6
 module.exports = {
7 7
   NODE_ENV: '"development"',
8 8
   ENV_CONFIG: '"dev"',
9
-  // BASE_API: '"http://new_mobile.xt.api.sgjyun.com"', // //http://api.xt.test.sgjyun.com http://112.74.16.180:9527,////'"http://localhost:9529"',
10
-  // BASE_API: '"http://api.xt.test.sgjyun.com"',
11
-  BASE_API: '"http://localhost:9529"',
9
+  //BASE_API: '"http://new_mobile.xt.api.sgjyun.com"', // //http://api.xt.test.sgjyun.com http://112.74.16.180:9527,////'"http://localhost:9529"',
10
+  BASE_API: '"http://api.xt.test.sgjyun.com"',
11
+  // BASE_API: '"http://localhost:9529"',
12 12
   SSO_HOST: '"http://testsso.sgjyun.com"',
13 13
   SRCM_HOST: '"http://test1.sgjyun.com"',
14 14
   XT_HOST: '"http://xt.test.sgjyun.com"',

+ 2 - 2
config/index.js View File

@@ -29,8 +29,8 @@ module.exports = {
29 29
 
30 30
     // host: 'xt.test.sgjyun.com',
31 31
     //  host: 'xt.kuyicloud.com',
32
-    // host: 'xt.test.sgjyun.com',
33
-   host: 'localhost',
32
+   host: 'xt.test.sgjyun.com',
33
+  //  host: 'localhost',
34 34
     port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
35 35
     autoOpenBrowser: true,
36 36
     errorOverlay: true,

+ 330 - 219
src/api/drug/drug.js View File

@@ -1,286 +1,397 @@
1
-import request from "@/utils/request";
1
+import request from '@/utils/request'
2 2
 
3
-export function getCurrentPatient(params){
4
-   return request({
5
-      url:"/api/drug/getcurrentpatient",
6
-      methods:"get",
7
-      params:params  
8
-   })
3
+export function getCurrentPatient(params) {
4
+  return request({
5
+    url: '/api/drug/getcurrentpatient',
6
+    methods: 'get',
7
+    params: params
8
+  })
9 9
 }
10 10
 
11
-export function getAllDrugName(params){
12
-   return request({
13
-     url:"/api/drug/getalldrugname",
14
-     methods:"get",
15
-     params:params
16
-   })
11
+export function getAllDrugName(params) {
12
+  return request({
13
+    url: '/api/drug/getalldrugname',
14
+    methods: 'get',
15
+    params: params
16
+  })
17 17
 }
18 18
 
19
+export function saveDrugName(params) {
20
+  return request({
21
+    url: '/api/drug/savedrugname',
22
+    methods: 'get',
23
+    params: params
24
+  })
25
+}
19 26
 
20
-export function saveDrugName(params){
27
+export function getdrugNameList(params) {
21 28
   return request({
22
-     url:"/api/drug/savedrugname",
23
-     methods:"get",
24
-     params:params
29
+    url: '/api/drug/getdrugnamelist',
30
+    methods: 'get',
31
+    params: params
25 32
   })
26 33
 }
27 34
 
28
-export function getdrugNameList(params){ 
35
+export function getRulleName(params) {
29 36
   return request({
30
-     url:"/api/drug/getdrugnamelist",
31
-     methods:"get",
32
-     params:params
37
+    url: '/api/drug/getrullename',
38
+    methods: 'get',
39
+    params: params
33 40
   })
34 41
 }
35 42
 
36
-export function getRulleName(params){
43
+export function getUnitByBaseId(params) {
37 44
   return request({
38
-     url:"/api/drug/getrullename",
39
-     methods:"get",
40
-     params:params 
41
-   })
45
+    url: '/api/drug/getunitbybaseid',
46
+    methods: 'get',
47
+    params: params
48
+  })
42 49
 }
43 50
 
44
-export function getUnitByBaseId(params){
51
+export function saveRulleName(params) {
45 52
   return request({
46
-     url:"/api/drug/getunitbybaseid",
47
-     methods:"get",
48
-     params:params  
53
+    url: '/api/drug/saverullename',
54
+    methods: 'get',
55
+    params: params
49 56
   })
50 57
 }
51 58
 
52
-export function saveRulleName(params){
59
+export function EditRullerName(params) {
53 60
   return request({
54
-     url:"/api/drug/saverullename",
55
-     methods:"get",
56
-     params:params
61
+    url: '/api/drug/editrullername',
62
+    methods: 'get',
63
+    params: params
57 64
   })
58 65
 }
59 66
 
60
-export function EditRullerName(params){
61
-   return request({
62
-     url:"/api/drug/editrullername",
63
-     methods:"get",
64
-     params:params
65
-   })
67
+export function updatedRulleName(params) {
68
+  return request({
69
+    url: '/api/drug/updatedrullername',
70
+    methods: 'get',
71
+    params: params
72
+  })
66 73
 }
67 74
 
75
+export function getAllDrugNameList(params) {
76
+  return request({
77
+    url: '/api/drug/getalldrugnamelist',
78
+    methods: 'Get',
79
+    params: params
80
+  })
81
+}
68 82
 
69
-export function updatedRulleName(params){
70
-  
83
+export function getRullListByDrugName(params) {
71 84
   return request({
72
-    url:"/api/drug/updatedrullername",
73
-    methods:"get",
74
-    params:params
85
+    url: '/api/drug/getrulllistbydrugname',
86
+    methods: 'Get',
87
+    params: params
75 88
   })
76 89
 }
77 90
 
78
-export function getAllDrugNameList(params){
79
-  
91
+export function SaveSelfMedicines(data) {
80 92
   return request({
81
-     url:"/api/drug/getalldrugnamelist",
82
-     methods:"Get",
83
-     params:params
93
+    url: '/api/drug/saveselfmedicines',
94
+    method: 'post',
95
+    data: data
84 96
   })
85 97
 }
86 98
 
87
-export function getRullListByDrugName(params){
88
-  
89
-   return request({
90
-       url:"/api/drug/getrulllistbydrugname",
91
-       methods:"Get",
92
-       params:params
93
-    })
99
+export function getCurrentOrgAllStaff(params) {
100
+  return request({
101
+    url: '/api/drug/getcurrentorgallstaff',
102
+    methods: 'get',
103
+    params: params
104
+  })
94 105
 }
95 106
 
96
-export function SaveSelfMedicines(data){
97
-   
98
-   return request({
99
-      url:"/api/drug/saveselfmedicines",
100
-      method:"post",
101
-      data:data
102
-   })
107
+export function saveStock(data, startime, adminuserid, patientid) {
108
+  return request({
109
+    url: '/api/drug/savestock?start_time=' + startime + '&admin_user_id=' + adminuserid + '&patient_id=' + patientid,
110
+    method: 'post',
111
+    data: data
112
+  })
103 113
 }
104 114
 
105
-export function getCurrentOrgAllStaff(params){
106
-   return request({
107
-      url:"/api/drug/getcurrentorgallstaff",
108
-      methods:"get",
109
-      params:params
110
-   })
115
+export function saveOutStock(data, startime, adminuserid, patientid) {
116
+  return request({
117
+    url: '/api/drug/saveoutstock?start_time=' + startime + '&admin_user_id=' + adminuserid + '&patient_id=' + patientid,
118
+    method: 'post',
119
+    data: data
120
+  })
111 121
 }
112 122
 
123
+export function DeleteDrugById(params) {
124
+  return request({
125
+    url: '/api/drug/deletedrugbyid',
126
+    method: 'get',
127
+    params: params
128
+  })
129
+}
113 130
 
114
-export function saveStock(data,startime,adminuserid,patientid){
115
-  
116
-   return request({
117
-      url:"/api/drug/savestock?start_time="+startime+"&admin_user_id="+adminuserid+"&patient_id="+patientid,
118
-      method:"post",
119
-      data:data
120
-   })
131
+export function saveRadio(params) {
132
+  return request({
133
+    url: '/api/drug/saveradio',
134
+    method: 'get',
135
+    params: params
136
+  })
137
+}
121 138
 
139
+export function DeleteDrugStand(id, name) {
140
+  const params = {
141
+    id: id,
142
+    name: name
143
+  }
144
+  return request({
145
+    url: '/api/drug/deletedrugstand',
146
+    method: 'get',
147
+    params: params
148
+  })
122 149
 }
123 150
 
124
-export function saveOutStock(data,startime,adminuserid,patientid){
125
-   return request({
126
-      url:"/api/drug/saveoutstock?start_time="+startime+"&admin_user_id="+adminuserid+"&patient_id="+patientid,
127
-      method:"post",
128
-      data:data
129
-   })
151
+export function getStockList(params) {
152
+  return request({
153
+    url: '/api/drug/getstocklist',
154
+    method: 'get',
155
+    params: params
156
+  })
130 157
 }
131 158
 
132
-export function DeleteDrugById(params){
133
-   return request({
134
-      url:"/api/drug/deletedrugbyid",
135
-      method:"get",
136
-      params:params
137
-   })
159
+export function DeleteDrugName(params) {
160
+  return request({
161
+    url: '/api/drug/deletedrugname',
162
+    method: 'get',
163
+    params: params
164
+  })
138 165
 }
139 166
 
140
-export function saveRadio(params){
141
-  
142
-   return request({
143
-      url:"/api/drug/saveradio",
144
-      method:"get",
145
-      params:params
146
-   })
167
+export function getDrugDetail(params) {
168
+  return request({
169
+    url: '/api/drug/getdrugdetail',
170
+    method: 'get',
171
+    params: params
172
+  })
147 173
 }
148 174
 
149
-export function DeleteDrugStand(id,name){
150
-    const params = {
151
-      id:id,
152
-      name:name
153
-    }
154
-   return request({
155
-      url:"/api/drug/deletedrugstand",
156
-      method:"get",
157
-      params:params
158
-   })
175
+export function getAllPatientStockList(params) {
176
+  return request({
177
+    url: '/api/drug/getallpatientstocklist',
178
+    method: 'get',
179
+    params: params
180
+  })
181
+}
182
+
183
+export function getDrugDataByPatientId(params) {
184
+  return request({
185
+    url: '/api/drug/getdrugdatabypatientid',
186
+    method: 'get',
187
+    params: params
188
+  })
189
+}
190
+
191
+export function getSelfMedicalList(params) {
192
+  return request({
193
+    url: '/api/drug/getselfmedicallist',
194
+    methods: 'get',
195
+    params: params
196
+  })
159 197
 }
160 198
 
161
-export function getStockList(params){
162
-   
163
-   return request({
164
-      url:"/api/drug/getstocklist",
165
-      method:"get",
166
-      params:params
167
-   })
199
+export function getDrugDescByDrugName(params) {
200
+  return request({
201
+    url: '/api/drug/getdrugdescbydrugname',
202
+    methods: 'get',
203
+    params: params
204
+  })
168 205
 }
169 206
 
170
-export function DeleteDrugName(params){
171
-  
172
-   return request({
173
-      url:"/api/drug/deletedrugname",
174
-      method:"get",
175
-      params:params
176
-   })
207
+export function getDrugSet(params) {
208
+  return request({
209
+    url: '/api/drug/getdrugset',
210
+    methods: 'get',
211
+    params: params
212
+  })
177 213
 }
178 214
 
215
+export function getAllMedicalList(params) {
216
+  return request({
217
+    url: '/api/drug/getallmedicallist',
218
+    methods: 'get',
219
+    params: params
220
+  })
221
+}
179 222
 
180
-export function getDrugDetail(params){
181
-   return request({
182
-      url:"/api/drug/getdrugdetail",
183
-      method:"get",
184
-      params:params
185
-   })
186
-}
187
-
188
-export function getAllPatientStockList(params){
189
-   
190
-   return request({
191
-      url:"/api/drug/getallpatientstocklist",
192
-      method:"get",
193
-      params:params
194
-   })
195
-}
196
-
197
-export function getDrugDataByPatientId(params){
198
-  
199
-   return request({
200
-      url:"/api/drug/getdrugdatabypatientid",
201
-      method:"get",
202
-      params:params
203
-   })
223
+export function getStandName(params) {
224
+  return request({
225
+    url: '/api/drug/getstandname',
226
+    methods: 'get',
227
+    params: params
228
+  })
204 229
 }
205
-
206
-export function getSelfMedicalList(params){
207
-   
208
-   return request({
209
-       url:"/api/drug/getselfmedicallist",
210
-       methods:"get",
211
-       params:params
212
-   })
213
-}
214
-
215
-export function getDrugDescByDrugName(params){
216
-
217
-   return request({
218
-      url:"/api/drug/getdrugdescbydrugname",
219
-      methods:"get",
220
-      params:params
221
-   })
222
-}
223
-
224
-export function getDrugSet(params){
225
-  
226
-   return request({
227
-      url:"/api/drug/getdrugset",
228
-      methods:"get",
229
-      params:params
230
-   })
231
-}
232
-
233
-export function getAllMedicalList(params){
234
-  
235
-   return request({
236
-      url:"/api/drug/getallmedicallist",
237
-      methods:"get",
238
-      params:params,
239
-   })
240
-}
241
-
242
-export function getStandName(params){
243
-  
244
-   return request({
245
-     url:"/api/drug/getstandname",
246
-     methods:"get",
247
-     params:params
248
-   })
249
-}
250
-
251
-export function getRullerList(params){
252
-  
253
-   return request({
254
-      url:"/api/drug/getrullerlist",
255
-      methods:"get",
256
-      params:params
257
-   })
230
+
231
+export function getRullerList(params) {
232
+  return request({
233
+    url: '/api/drug/getrullerlist',
234
+    methods: 'get',
235
+    params: params
236
+  })
258 237
 }
259 238
 
239
+export function DeleteDrugNameById(params) {
240
+  return request({
241
+    url: '/api/drug/deleteDrugNamebyid',
242
+    methods: 'get',
243
+    params: params
244
+  })
245
+}
260 246
 
261
-export function DeleteDrugNameById(params){
262
-   
263
-   return request({
264
-      url:"/api/drug/deleteDrugNamebyid",
265
-      methods:"get",
266
-      params:params
267
-   })
247
+export function getPatientDetail(id, params) {
248
+  return request({
249
+    url: '/api/drug/getpatientdetail?id=' + id,
250
+    methods: 'Get',
251
+    params: params
252
+  })
268 253
 }
269 254
 
270
-export function getPatientDetail(id,params){
271
-
272
-   return request({
273
-      url:"/api/drug/getpatientdetail?id="+id,
274
-      methods:"Get",
275
-      params:params
276
-   })
255
+export function getSelfStockQuery(params) {
256
+  return request({
257
+    url: '/api/drug/getselfstockquery',
258
+    methods: 'get',
259
+    params: params
260
+  })
277 261
 }
278 262
 
279
-export function getSelfStockQuery(params){
280
-   
281
-   return request({
282
-      url:"/api/drug/getselfstockquery",
283
-      methods:"get",
284
-      params:params
285
-   })
286
-}
263
+export function postSearchDrugWarehouseList(params) {
264
+  return request({
265
+    url: '/api/drug/postsearchdrugwarehouselist',
266
+    methods: 'get',
267
+    params: params
268
+  })
269
+}
270
+
271
+export function saveDrugPrice(data) {
272
+  return request({
273
+    url: '/api/drug/savedrugpriceone',
274
+    method: 'post',
275
+    data: data
276
+  })
277
+}
278
+
279
+export function getDrugPriceList(params) {
280
+  return request({
281
+    url: '/api/drug/drugpricelist',
282
+    methods: 'get',
283
+    params: params
284
+  })
285
+}
286
+
287
+export function SaveCheckedDrugPrice(params) {
288
+  return request({
289
+    url: '/api/drug/savecheckdrugprice',
290
+    methods: 'get',
291
+    params: params
292
+  })
293
+}
294
+
295
+export function saveDrugDamage(data) {
296
+  return request({
297
+    url: '/api/drug/savedrugdamageone',
298
+    method: 'post',
299
+    data: data
300
+  })
301
+}
302
+
303
+export function getDrugDamageList(params) {
304
+  return request({
305
+    url: '/api/drug/getdrugdamagelist',
306
+    methods: 'get',
307
+    params: params
308
+  })
309
+}
310
+
311
+export function SaveDrugDamagePrice(params) {
312
+  return request({
313
+    url: '/api/drug/savedrugdamageprice',
314
+    method: 'get',
315
+    params: params
316
+  })
317
+}
318
+
319
+export function getDrugModiftyPrice(id, params) {
320
+  return request({
321
+    url: '/api/drug/getdrugmodifyprice?id=' + id,
322
+    method: 'Get',
323
+    params: params
324
+  })
325
+}
326
+
327
+export function modifyDrugPrice(params) {
328
+  return request({
329
+    url: '/api/drug/modifydrugprice',
330
+    method: 'Get',
331
+    params: params
332
+  })
333
+}
334
+
335
+export function deleteDrugPrice(params) {
336
+  return request({
337
+    url: '/api/drug/deletedrugprice',
338
+    method: 'Get',
339
+    params: params
340
+  })
341
+}
342
+
343
+export function getModifyPricePrint(params) {
344
+  return request({
345
+    url: '/api/drug/getmodifypriceprint',
346
+    method: 'Get',
347
+    params: params
348
+  })
349
+}
350
+
351
+export function getDrugDamageDetail(id, params) {
352
+  return request({
353
+    url: '/api/drug/getdrugdamagedetail?id=' + id,
354
+    method: 'Get',
355
+    params: params
356
+  })
357
+}
358
+
359
+export function modifyDrugDamage(params) {
360
+  return request({
361
+    url: '/api/drug/modifydrugdamage',
362
+    method: 'get',
363
+    params: params
364
+  })
365
+}
366
+
367
+export function deleteDrugDamage(params) {
368
+  return request({
369
+    url: '/api/drug/deletedrugdamage',
370
+    method: 'Get',
371
+    params: params
372
+  })
373
+}
374
+
375
+export function getDrugDamagePrint(params) {
376
+  return request({
377
+    url: '/api/drug/getdrugdamageprint',
378
+    method: 'get',
379
+    params: params
380
+  })
381
+}
382
+
383
+export function getDrugWarehouseInfoList(params) {
384
+  return request({
385
+    url: '/api/drug/warehouseinfobyid',
386
+    method: 'Get',
387
+    params: params
388
+  })
389
+}
390
+
391
+export function saveDrugInventory(data) {
392
+  return request({
393
+    url: '/api/drug/savedruginventory',
394
+    method: 'post',
395
+    data: data
396
+  })
397
+}

+ 112 - 0
src/api/stock.js View File

@@ -810,3 +810,115 @@ export function getInventoryList(params) {
810 810
     params: params
811 811
   })
812 812
 }
813
+
814
+export function SaveCheckedInventory(params) {
815
+  return request({
816
+    url: '/api/stock/savecheckinventory',
817
+    method: 'Get',
818
+    params: params
819
+  })
820
+}
821
+
822
+export function getModifyPriceDetail(id, params) {
823
+  return request({
824
+    url: '/api/stock/getmodifypriceDetail?id=' + id,
825
+    method: 'get',
826
+    params: params
827
+  })
828
+}
829
+
830
+export function updateStockPrice(params) {
831
+  return request({
832
+    url: '/api/stock/updatestockprice',
833
+    method: 'get',
834
+    params: params
835
+  })
836
+}
837
+
838
+export function deleteStockPrice(id, params) {
839
+  return request({
840
+    url: '/api/stock/deletestockprice?id=' + id,
841
+    method: 'Get',
842
+    params: params
843
+  })
844
+}
845
+
846
+export function getStockDamageDetail(id, params) {
847
+  return request({
848
+    url: '/api/stock/getstockdamagedetal?id=' + id,
849
+    method: 'get',
850
+    params: params
851
+  })
852
+}
853
+
854
+export function modifyPrice(params) {
855
+  return request({
856
+    url: '/api/sotck/modifyprice',
857
+    method: 'Get',
858
+    params: params
859
+  })
860
+}
861
+
862
+export function deleteStockDamage(params) {
863
+  return request({
864
+    url: '/api/stock/deletestockdamage',
865
+    method: 'get',
866
+    params: params
867
+  })
868
+}
869
+
870
+export function getStockDamageById(params) {
871
+  return request({
872
+    url: '/api/stock/getstockdamagebyid',
873
+    method: 'get',
874
+    params: params
875
+  })
876
+}
877
+
878
+export function getInventoryDetail(id, params) {
879
+  return request({
880
+    url: 'api/sotck/getinventorydetail?id=' + id,
881
+    method: 'Get',
882
+    params: params
883
+  })
884
+}
885
+
886
+export function modifyInventory(params) {
887
+  return request({
888
+    url: '/api/stock/modifyinventory',
889
+    method: 'Get',
890
+    params: params
891
+  })
892
+}
893
+
894
+export function deleteInventory(id, params) {
895
+  return request({
896
+    url: '/api/stock/deleteinventory?id=' + id,
897
+    method: 'get',
898
+    params: params
899
+  })
900
+}
901
+
902
+export function getInventoryDetailList(params) {
903
+  return request({
904
+    url: '/api/stock/getinventorydetaillist',
905
+    method: 'Get',
906
+    params: params
907
+  })
908
+}
909
+
910
+export function getInventoryPrintList(params) {
911
+  return request({
912
+    url: '/api/stock/getinventoryprintlist',
913
+    method: 'Get',
914
+    params: params
915
+  })
916
+}
917
+
918
+export function getInventoryDetailPrintList(params) {
919
+  return request({
920
+    url: '/api/stock/getinventorydetailprintlist',
921
+    method: 'Get',
922
+    params: params
923
+  })
924
+}

+ 6 - 0
src/router/modules/drugs.js View File

@@ -50,6 +50,12 @@ export default {
50 50
       name: 'drugDamaged',
51 51
       meta: { title: 'drugDamaged', noCache: true }
52 52
     },
53
+    {
54
+      path: '/stock/drugs/drugDamagePrint',
55
+      component: () => import('@/xt_pages/stock/drugs/drugDamagePrint'),
56
+      name: 'drugDamaged',
57
+      meta: { title: 'drugDamaged', noCache: true }
58
+    },
53 59
     {
54 60
       path: '/stock/drugs/drugWarning',
55 61
       component: () => import('@/xt_pages/stock/drugs/drugWarning'),

+ 17 - 0
src/router/modules/stock.js View File

@@ -62,6 +62,14 @@ export default {
62 62
       name: 'stockDamaged',
63 63
       meta: { title: 'stockDamaged', noCache: true }
64 64
     },
65
+    {
66
+      path: '/stock/stockDamagePrint',
67
+      component: () => import('@/xt_pages/stock/stockDamagePrint'),
68
+      name: 'stockModifyPricePrint',
69
+      hidden: true,
70
+      is_menu: false,
71
+      meta: { title: 'stockModifyPricePrint', noCache: true }
72
+    },
65 73
     {
66 74
       path: '/stock/stockWarning',
67 75
       component: () => import('@/xt_pages/stock/stockWarning'),
@@ -83,6 +91,15 @@ export default {
83 91
       meta: { title: 'inventoryPrint', noCache: true }
84 92
     },
85 93
 
94
+    {
95
+      path: '/stock/inventoryDetailPrint',
96
+      component: () => import('@/xt_pages/stock/inventoryDetailPrint'),
97
+      name: 'inventoryPrint',
98
+      hidden: true,
99
+      is_menu: false,
100
+      meta: { title: 'inventoryPrint', noCache: true }
101
+    },
102
+
86 103
     // {
87 104
     //   path: "/stock/",
88 105
     //   component: Layout,

+ 7 - 0
src/xt_pages/dialysis/details/dialog/AssessmentAfterDislysis.vue View File

@@ -1250,6 +1250,7 @@ export default {
1250 1250
       if(predialysis.id > 0){
1251 1251
         this.form.hypopiesia = predialysis.hypopiesia.toString()
1252 1252
       }
1253
+      
1253 1254
 
1254 1255
 
1255 1256
       this.form.leave_office_method = predialysis.leave_office_method
@@ -1269,6 +1270,12 @@ export default {
1269 1270
             }
1270 1271
           }
1271 1272
         }
1273
+        if(last_after.id > 0){
1274
+         this.form.hypertenison = last_after.hypertenison.toString()
1275
+        }
1276
+        if(last_after.id > 0){
1277
+          this.form.hypopiesia = last_after.hypopiesia.toString()
1278
+        }
1272 1279
       }
1273 1280
 
1274 1281
 

+ 6 - 0
src/xt_pages/dialysis/details/index.vue View File

@@ -1040,6 +1040,12 @@ export default {
1040 1040
           }
1041 1041
           var lastMonitorRecord = resp.data.lastMonitorRecord
1042 1042
           var lastAssessmentAfterDislysis = resp.data.lastAssessmentAfterDislysis
1043
+          // if(lastAssessmentAfterDislysis.hypertenison!=""){
1044
+          //   lastAssessmentAfterDislysis.hypertenison = lastAssessmentAfterDislysis.hypertenison.toString()
1045
+          // }
1046
+          //  if(lastAssessmentAfterDislysis.hypopiesia!=""){
1047
+          //   lastAssessmentAfterDislysis.hypopiesia = lastAssessmentAfterDislysis.hypopiesia.toString()
1048
+          // }
1043 1049
           var lastDialysisPrescribe = resp.data.lastDialysisPrescribe
1044 1050
           var lastDryWeightDislysis = resp.data.lastDryWeightDislysis
1045 1051
 

+ 13 - 2
src/xt_pages/dialysis/template/DialysisPrintOrderThirtyEight.vue View File

@@ -260,7 +260,7 @@
260 260
             </span>
261 261
           </div>
262 262
       </div>
263
-      <div class="lineHeight">治疗过程中检测记录:血压检测部位:{{ monitors && monitors[0] ? monitors[0].blood_pressure_monitoring_site : '' }}</div>
263
+      <div class="lineHeight">治疗过程中检测记录:血压检测部位:{{ monitors && monitors[0] ? getBloodPressureMmonitoringSite(monitors[0].blood_pressure_monitoring_site) : '' }}</div>
264 264
       <table class="print-table" border="1">
265 265
         <tbody>
266 266
           <tr>
@@ -572,7 +572,8 @@ export default {
572 572
         url: ""
573 573
       },
574 574
       displaceLiquiPartOptions: [],
575
-      complicationList:[]
575
+      complicationList:[],
576
+      bloodPressureMmonitoringSite:[]
576 577
     };
577 578
   },
578 579
   methods: {
@@ -586,6 +587,15 @@ export default {
586 587
       var gm=(ty-oy)*12+(tm-om); //距今月数
587 588
       return gm
588 589
     },
590
+    getBloodPressureMmonitoringSite(id){
591
+      var name = "";
592
+      for(let i=0;i<this.bloodPressureMmonitoringSite.length;i++){
593
+         if(id == this.bloodPressureMmonitoringSite[i].id){
594
+            name = this.bloodPressureMmonitoringSite[i].name
595
+         }
596
+      }
597
+      return name
598
+    },
589 599
     getComplication(id){
590 600
       var name = "";
591 601
       for(let i=0;i<this.complicationList.length;i++){
@@ -1298,6 +1308,7 @@ export default {
1298 1308
     this.displaceLiquiPartOptions = this.$store.getters.displace_liqui;
1299 1309
     // this.bloodAccessParOpera = getDataConfig('hemodialysis', 'vascular_access_desc')
1300 1310
     this.complicationList = getDataConfig('hemodialysis','complication')
1311
+    this.bloodPressureMmonitoringSite = getDataConfig('hemodialysis','blood_pressure_monitoring_site');
1301 1312
 
1302 1313
     var bloodAccessParOpera = getDataConfig(
1303 1314
       "hemodialysis",

+ 5 - 5
src/xt_pages/hospitalStation/components/deskPrescription.vue View File

@@ -472,12 +472,12 @@
472 472
         end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
473 473
         register: [
474 474
           { value: 11, label: '普通门诊' },
475
-          { value: 12, label: '门诊挂号' },
476
-          { value: 13, label: '急诊' },
475
+          // { value: 12, label: '门诊挂号' },
476
+          // { value: 13, label: '急诊' },
477 477
           { value: 14, label: '门诊特殊病' },
478
-          { value: 15, label: '门诊统筹' },
479
-          { value: 16, label: '门诊慢性病' },
480
-          { value: 21, label: '普通住院' }
478
+          // { value: 15, label: '门诊统筹' },
479
+          // { value: 16, label: '门诊慢性病' },
480
+          // { value: 21, label: '普通住院' }
481 481
 
482 482
         ],
483 483
         isLastOrNextVisible: false,

+ 5 - 5
src/xt_pages/hospitalStation/components/registerDialog.vue View File

@@ -197,12 +197,12 @@
197 197
       return {
198 198
         registers: [
199 199
           {value: 11, label: "普通门诊"},
200
-          {value: 12, label: '门诊挂号'},
201
-          {value: 13, label: "急诊"},
200
+          // {value: 12, label: '门诊挂号'},
201
+          // {value: 13, label: "急诊"},
202 202
           {value: 14, label: "门诊特殊病"},
203
-          {value: 15, label: "门诊统筹"},
204
-          {value: 16, label: "门诊慢性病"},
205
-          {value: 21, label: "普通住院"},
203
+          // {value: 15, label: "门诊统筹"},
204
+          // {value: 16, label: "门诊慢性病"},
205
+          // {value: 21, label: "普通住院"},
206 206
         ],
207 207
         medical_care:[
208 208
           {value: 11, label: "普通门诊"},

+ 5 - 5
src/xt_pages/hospitalStation/components/registerDialog9504.vue View File

@@ -186,12 +186,12 @@
186 186
         read_loading:false,
187 187
         registers: [
188 188
           {value: 11, label: "普通门诊"},
189
-          {value: 12, label: '门诊挂号'},
190
-          {value: 13, label: "急诊"},
189
+          // {value: 12, label: '门诊挂号'},
190
+          // {value: 13, label: "急诊"},
191 191
           {value: 14, label: "门诊特殊病"},
192
-          {value: 15, label: "门诊统筹"},
193
-          {value: 16, label: "门诊慢性病"},
194
-          {value: 21, label: "普通住院"},
192
+          // {value: 15, label: "门诊统筹"},
193
+          // {value: 16, label: "门诊慢性病"},
194
+          // {value: 21, label: "普通住院"},
195 195
         ],
196 196
         medical_care:[
197 197
           {value: 11, label: "普通门诊"},

+ 5 - 5
src/xt_pages/hospitalStation/index.vue View File

@@ -176,12 +176,12 @@
176 176
         read_loading: false,
177 177
         registers: [
178 178
           {value: 11, label: '普通门诊'},
179
-          {value: 12, label: '门诊挂号'},
180
-          {value: 13, label: '急诊'},
179
+          // {value: 12, label: '门诊挂号'},
180
+          // {value: 13, label: '急诊'},
181 181
           {value: 14, label: '门诊特殊病'},
182
-          {value: 15, label: '门诊统筹'},
183
-          {value: 16, label: '门诊慢性病'},
184
-          {value: 21, label: '普通住院'}
182
+          // {value: 15, label: '门诊统筹'},
183
+          // {value: 16, label: '门诊慢性病'},
184
+          // {value: 21, label: '普通住院'}
185 185
 
186 186
         ],
187 187
         sick: [],

+ 5 - 5
src/xt_pages/hospitalStation/outpatientChargesManagement.vue View File

@@ -402,12 +402,12 @@
402 402
       return {
403 403
         register: [
404 404
           { value: 11, label: '普通门诊' },
405
-          { value: 12, label: '门诊挂号' },
406
-          { value: 13, label: '急诊' },
405
+          // { value: 12, label: '门诊挂号' },
406
+          // { value: 13, label: '急诊' },
407 407
           { value: 14, label: '门诊特殊病' },
408
-          { value: 15, label: '门诊统筹' },
409
-          { value: 16, label: '门诊慢性病' },
410
-          { value: 21, label: '普通住院' }
408
+          // { value: 15, label: '门诊统筹' },
409
+          // { value: 16, label: '门诊慢性病' },
410
+          // { value: 21, label: '普通住院' }
411 411
 
412 412
         ],
413 413
         loading: false,

+ 10 - 2
src/xt_pages/medicalScheduling/index.vue View File

@@ -425,6 +425,7 @@ export default {
425 425
             })
426 426
         },
427 427
         getDoctorList(){
428
+
428 429
             getDoctorList().then(response=>{
429 430
                 if(response.data.state == 1){
430 431
                     var list =  response.data.data.list
@@ -1008,8 +1009,10 @@ export default {
1008 1009
         getNextWeekList(){
1009 1010
             const params = {
1010 1011
                 start_time:this.getTimestamp(this.weekDayArr[0]),
1011
-                end_time:this.getTimestamp(this.weekDayArr[6])
1012
+                end_time:this.getTimestamp(this.weekDayArr[6]),
1013
+                doctor_id:parseInt(this.typeValue),
1012 1014
             }
1015
+            console.log("params232323",params)
1013 1016
             getNextWeekList(params).then(response=>{
1014 1017
                 if(response.data.state == 1){
1015 1018
                     var staffList = response.data.data.staffList
@@ -1314,7 +1317,12 @@ export default {
1314 1317
                     obj.user_type = 10
1315 1318
                     obj.list = arr2
1316 1319
                     arr.push(obj)
1317
-
1320
+                    if(parseInt(this.typeValue) == 2){
1321
+                      newNurse =  []
1322
+                    }
1323
+                    if(parseInt(this.typeValue) == 3){
1324
+                      newDoctor =  []
1325
+                    }
1318 1326
                     let data = []
1319 1327
                     data.push(...newNurse)
1320 1328
                     data.push(...newDoctor)

+ 5 - 5
src/xt_pages/outpatientCharges/components/registerDialog.vue View File

@@ -197,12 +197,12 @@
197 197
       return {
198 198
         registers: [
199 199
           { value: 11, label: '普通门诊' },
200
-          { value: 12, label: '门诊挂号' },
201
-          { value: 13, label: '急诊' },
200
+          // { value: 12, label: '门诊挂号' },
201
+          // { value: 13, label: '急诊' },
202 202
           { value: 14, label: '门诊特殊病' },
203
-          { value: 15, label: '门诊统筹' },
204
-          { value: 16, label: '门诊慢性病' },
205
-          { value: 21, label: '普通住院' }
203
+          // { value: 15, label: '门诊统筹' },
204
+          // { value: 16, label: '门诊慢性病' },
205
+          // { value: 21, label: '普通住院' }
206 206
         ],
207 207
         medical_care: [
208 208
           { value: 11, label: '普通门诊' },

+ 10 - 10
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue View File

@@ -589,22 +589,22 @@
589 589
 
590 590
         register: [
591 591
           { value: 11, label: '普通门诊' },
592
-          { value: 12, label: '门诊挂号' },
593
-          { value: 13, label: '急诊' },
592
+          // { value: 12, label: '门诊挂号' },
593
+          // { value: 13, label: '急诊' },
594 594
           { value: 14, label: '门诊特殊病' },
595
-          { value: 15, label: '门诊统筹' },
596
-          { value: 16, label: '门诊慢性病' },
597
-          { value: 21, label: '普通住院' }
595
+          // { value: 15, label: '门诊统筹' },
596
+          // { value: 16, label: '门诊慢性病' },
597
+          // { value: 21, label: '普通住院' }
598 598
 
599 599
         ],
600 600
         register_two: [
601 601
           { value: '11', label: '普通门诊' },
602
-          { value: '12', label: '门诊挂号' },
603
-          { value: '13', label: '急诊' },
602
+          // { value: '12', label: '门诊挂号' },
603
+          // { value: '13', label: '急诊' },
604 604
           { value: '14', label: '门诊特殊病' },
605
-          { value: '15', label: '门诊统筹' },
606
-          { value: '16', label: '门诊慢性病' },
607
-          { value: '21', label: '普通住院' }
605
+          // { value: '15', label: '门诊统筹' },
606
+          // { value: '16', label: '门诊慢性病' },
607
+          // { value: '21', label: '普通住院' }
608 608
 
609 609
         ],
610 610
         loading: false,

+ 8 - 9
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue View File

@@ -517,12 +517,12 @@
517 517
         end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
518 518
         register: [
519 519
           { value: 11, label: '普通门诊' },
520
-          { value: 12, label: '门诊挂号' },
521
-          { value: 13, label: '急诊' },
520
+          // { value: 12, label: '门诊挂号' },
521
+          // { value: 13, label: '急诊' },
522 522
           { value: 14, label: '门诊特殊病' },
523
-          { value: 15, label: '门诊统筹' },
524
-          { value: 16, label: '门诊慢性病' },
525
-          { value: 21, label: '普通住院' }
523
+          // { value: 15, label: '门诊统筹' },
524
+          // { value: 16, label: '门诊慢性病' },
525
+          // { value: 21, label: '普通住院' }
526 526
 
527 527
         ],
528 528
         medical_care:[
@@ -2539,10 +2539,10 @@
2539 2539
         console.log(this.curPrescriptions.advices.length)
2540 2540
         console.log(this.curPrescriptions.project.length)
2541 2541
 
2542
-        if(this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0){
2542
+       if(this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0){
2543 2543
           if(this.$store.getters.xt_user.org_id == 10138) {
2544 2544
             for (let i = 0; i < this.curDrugs.length; i++) {
2545
-              if (this.curPrescriptions.med_type == 13 && this.curDrugs[i].is_special_diseases != 1) {
2545
+              if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
2546 2546
                 this.$message.error('该处方属于特病类型处方,开非特病类型的药')
2547 2547
                 return
2548 2548
               }
@@ -2555,7 +2555,7 @@
2555 2555
         if(this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0){
2556 2556
           if(this.$store.getters.xt_user.org_id == 10138) {
2557 2557
             for (let i = 0; i < this.curDrugs.length; i++) {
2558
-              if (this.curPrescriptions.med_type == 13 && this.curDrugs[i].is_special_diseases != 1) {
2558
+              if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
2559 2559
                 this.$message.error('该处方属于特病类型处方,开非特病类型的药')
2560 2560
                 return
2561 2561
               }
@@ -2565,7 +2565,6 @@
2565 2565
         }
2566 2566
 
2567 2567
 
2568
-
2569 2568
         // if (this.curPrescriptions.order_status == 2) {
2570 2569
         //   this.$message.error('该处方已经结算,无法继续添加药品或者项目')
2571 2570
         //   this.teamList = []

+ 8 - 8
src/xt_pages/outpatientDoctorStation/prescriptionTemplatedetail.vue View File

@@ -280,12 +280,12 @@
280 280
 
281 281
         register: [
282 282
           { value: 11, label: '普通门诊' },
283
-          { value: 12, label: '门诊挂号' },
284
-          { value: 13, label: '急诊' },
283
+          // { value: 12, label: '门诊挂号' },
284
+          // { value: 13, label: '急诊' },
285 285
           { value: 14, label: '门诊特殊病' },
286
-          { value: 15, label: '门诊统筹' },
287
-          { value: 16, label: '门诊慢性病' },
288
-          { value: 21, label: '普通住院' }
286
+          // { value: 15, label: '门诊统筹' },
287
+          // { value: 16, label: '门诊慢性病' },
288
+          // { value: 21, label: '普通住院' }
289 289
 
290 290
         ],
291 291
         crumbs: [
@@ -1279,10 +1279,10 @@
1279 1279
         //   this.$refs.multipleTable.clearSelection()
1280 1280
         //   return
1281 1281
         // }
1282
-        if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
1282
+       if (this.curPrescriptions.advices.length > 0 && this.curPrescriptions.project.length == 0) {
1283 1283
           if (this.$store.getters.xt_user.org_id == 10138) {
1284 1284
             for (let i = 0; i < this.curDrugs.length; i++) {
1285
-              if (this.curPrescriptions.med_type == 13 && this.curDrugs[i].is_special_diseases != 1) {
1285
+              if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
1286 1286
                 this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1287 1287
                 return
1288 1288
               }
@@ -1294,7 +1294,7 @@
1294 1294
         if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
1295 1295
           if (this.$store.getters.xt_user.org_id == 10138) {
1296 1296
             for (let i = 0; i < this.curDrugs.length; i++) {
1297
-              if (this.curPrescriptions.med_type == 13 && this.curDrugs[i].is_special_diseases != 1) {
1297
+              if (this.curPrescriptions.med_type == 14 && this.curDrugs[i].is_special_diseases != 1) {
1298 1298
                 this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1299 1299
                 return
1300 1300
               }

+ 5 - 5
src/xt_pages/outpatientRegistration/index.vue View File

@@ -446,12 +446,12 @@
446 446
         read_loading: false,
447 447
         registers: [
448 448
           { value: 11, label: '普通门诊' },
449
-          { value: 12, label: '门诊挂号' },
450
-          { value: 13, label: '急诊' },
449
+          // { value: 12, label: '门诊挂号' },
450
+          // { value: 13, label: '急诊' },
451 451
           { value: 14, label: '门诊特殊病' },
452
-          { value: 15, label: '门诊统筹' },
453
-          { value: 16, label: '门诊慢性病' },
454
-          { value: 21, label: '普通住院' }
452
+          // { value: 15, label: '门诊统筹' },
453
+          // { value: 16, label: '门诊慢性病' },
454
+          // { value: 21, label: '普通住院' }
455 455
 
456 456
         ],
457 457
         sick: [],

+ 136 - 0
src/xt_pages/stock/drugs/drugDamagePrint.vue View File

@@ -0,0 +1,136 @@
1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        <el-row style="float:right;">
6
+            <el-col :span="24">
7
+            <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
8
+            </el-col>
9
+        </el-row>
10
+        </div>
11
+        <div class="app-container" style="background-color: white;">
12
+            <div id="print_content">
13
+                <div class="printTitle">药品调价登记单</div>
14
+                <div class="flex">
15
+                    <div>药库类别:</div>
16
+                    <div>调价日期:</div>
17
+                </div>
18
+                <div class="flex">
19
+                    <div>单据编号:</div>
20
+                    <div>打印日期:{{nowtime}}</div>
21
+                </div>
22
+                <div class="tableTitle">
23
+                    <div style="width:8%">货号</div>
24
+                    <div style="width:8%">药品名称</div>
25
+                    <div style="width:8%">规格</div>
26
+                    <div style="width:8%">单位</div>
27
+                    <div style="width:8%">批次</div>
28
+                    <div style="width:8%">调价数量</div>
29
+                    <div style="width:8%">原进货价</div>
30
+                    <div style="width:8%">新进货价</div>
31
+                    <div style="width:8%">进货差价</div>
32
+                    <div style="width:8%">原零售价</div>
33
+                    <div style="width:8%">新零售价</div>
34
+                    <div style="width:8%">零售差价</div>
35
+                </div>
36
+                <div class="tableTr" v-for="(item,index) in this.tableData" :key="index">
37
+                    <div style="width:8%"></div>
38
+                    <div style="width:8%">{{item.drug_name}}</div>
39
+                    <div style="width:8%"></div>
40
+                    <div style="width:8%">{{item.warehousing_unit}}</div>
41
+                    <div style="width:8%">{{item.number}}</div>
42
+                    <div style="width:8%">{{item.count}}</div>
43
+                    <div style="width:8%">{{item.retail_price}}</div>
44
+                    <div style="width:8%">{{item.new_price}}</div>
45
+                    <div style="width:8%"></div>
46
+                    <div style="width:8%">{{item.retail_price}}</div>
47
+                    <div style="width:8%">{{item.new_price}}</div>
48
+                    <div style="width:8%"></div>
49
+                </div>
50
+                <div class="tableBottom">
51
+                    <div style="width:8%">合计:</div>
52
+                    <div style="width:8%"></div>
53
+                    <div style="width:8%"></div>
54
+                    <div style="width:8%"></div>
55
+                    <div style="width:8%"></div>
56
+                    <div style="width:8%"></div>
57
+                    <div style="width:8%"></div>
58
+                    <div style="width:8%"></div>
59
+                    <div style="width:8%"></div>
60
+                    <div style="width:8%"></div>
61
+                    <div style="width:8%"></div>
62
+                    <div style="width:8%"></div>
63
+                </div>
64
+                <div style="display:flex;margin-top:1px;float:right;margin-top:10px;">
65
+                    <div style="width:80px;">审批:</div><div style="width:100px;"></div>
66
+                    <div style="width:100px;">药材主任:</div><div style="width:60px;"></div>
67
+                    <div style="width:50px;">会计:</div><div style="width:100px;"></div>
68
+                    <div style="width:50px;">审核:</div><div style="width:100px;"></div>
69
+                    <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
70
+                </div>
71
+            </div>
72
+        </div>
73
+    </div>
74
+</template>
75
+
76
+<script>
77
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
78
+const moment = require('moment');
79
+import { uParseTime } from '@/utils/tools'
80
+import { getDrugDamagePrint } from "@/api/drug/drug"
81
+export default {
82
+    components:{
83
+        BreadCrumb
84
+    },
85
+    data(){
86
+        return{
87
+          crumbs: [
88
+            { path: false, name: '库存管理' },
89
+            { path: false, name: '耗材管理' },
90
+            { path: false, name: '药品调价打印' },
91
+          ],
92
+          ids:"",
93
+          tableData:[],
94
+          nowtime: moment(new Date()).format('YYYY-MM-DD'),
95
+        }
96
+    },
97
+    methods:{
98
+        printAction: function() {
99
+            const style = '@media print { .printTitle{font-size: 22px;text-align: center;}.flex{display: flex;justify-content: space-between;}.tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}.tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}.tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;} }';
100
+            printJS({
101
+            printable: 'print_content',
102
+            type: 'html',
103
+            documentTitle: '  ',
104
+            style: style,
105
+            scanStyles: false
106
+            })
107
+        },
108
+        getDrugDamagePrint(ids){
109
+          var params = {
110
+            ids:ids,
111
+          }
112
+          getDrugDamagePrint(params).then(response=>{
113
+            if(response.data.state == 1){
114
+             console.log("hhhhh",response.data.data.list)
115
+              this.tableData = response.data.data.list
116
+            }
117
+          })
118
+        }
119
+
120
+
121
+    },
122
+    created(){
123
+     this.ids = this.$route.query.ids
124
+     this.getDrugDamagePrint(this.ids)
125
+    }
126
+}
127
+</script>
128
+
129
+
130
+<style rel="stylesheet/scss" lang="scss" scoped>
131
+.printTitle{font-size: 22px;text-align: center;}
132
+.flex{display: flex;justify-content: space-between;}
133
+.tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}
134
+.tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}
135
+.tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}
136
+</style>

+ 645 - 121
src/xt_pages/stock/drugs/drugDamaged.vue View File

@@ -23,14 +23,14 @@
23 23
                 >
24 24
                 <el-date-picker
25 25
                 size="small"
26
-                v-model="value1"
26
+                v-model="start_time"
27 27
                 type="date"
28 28
                 style="margin-left:5px;width:140px;"
29 29
                 placeholder="选择日期">
30 30
                 </el-date-picker>
31 31
                 <el-date-picker
32 32
                 size="small"
33
-                v-model="value2"
33
+                v-model="end_time"
34 34
                 type="date"
35 35
                 style="margin-left:5px;width:140px;"
36 36
                 placeholder="选择日期">
@@ -38,185 +38,390 @@
38 38
             </div>
39 39
             <div>
40 40
                 <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
41
-                <el-button size="small" type="primary">核对</el-button>
41
+                <el-button size="small" type="primary" @click="toCheck">核对</el-button>
42 42
                 <el-button size="small" type="primary" @click="print">打印</el-button>
43 43
                 <el-button size="small" type="primary">导出</el-button>
44 44
             </div>
45 45
         </div>
46
-        <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
47
-            <el-table-column
48
-            prop="date"
49
-            label="报损编码">
46
+        <el-table :data="tableList" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"  @selection-change="changePrice">
47
+            <el-table-column type="selection" width="55" align="center"> </el-table-column>
48
+            <el-table-column prop="date" label="报损编码" align="center">
49
+               <template slot-scope="scope">
50
+                  {{scope.row.warehousing_order}}
51
+                </template>
50 52
             </el-table-column>
51
-            <el-table-column
52
-            prop="date"
53
-            label="报损日期">
53
+            <el-table-column  prop="date" label="报损日期" align="center">
54
+               <template slot-scope="scope">
55
+                  {{getTime(scope.row.start_time)}}
56
+                </template>
54 57
             </el-table-column>
55
-            <el-table-column
56
-            prop="name"
57
-            label="操作人">
58
+            <el-table-column prop="name" label="报损数量" align="center">
59
+               <template slot-scope="scope">
60
+                  {{scope.row.count}}
61
+                </template>
58 62
             </el-table-column>
59
-            <el-table-column
60
-            prop="name"
61
-            label="审核日期">
63
+            <el-table-column prop="name" label="操作人" align="center">
64
+               <template slot-scope="scope">
65
+                  {{getDoctorName(scope.row.creater)}}
66
+                </template>
62 67
             </el-table-column>
63
-            <el-table-column
64
-            prop="name"
65
-            label="核对人">
68
+            <el-table-column prop="name" label="审核日期" align="center">
69
+              <template slot-scope="scope">
70
+                {{getTime(scope.row.checker_time)}}
71
+               </template>
66 72
             </el-table-column>
67
-            <el-table-column
68
-            prop="name"
69
-            label="状态">
73
+            <el-table-column prop="name" label="核对人" align="center">
74
+              <template slot-scope="scope">
75
+                {{getDoctorName(scope.row.checker)}}
76
+              </template>
70 77
             </el-table-column>
71
-            <el-table-column
72
-            label="操作">
78
+            <el-table-column prop="name" label="状态" align="center">
79
+              <template slot-scope="scope">
80
+                <span v-if="scope.row.checker_status == 1">已核对</span>
81
+                <span v-if="scope.row.checker_status == 2">未核对</span>
82
+              </template>   
83
+            </el-table-column>
84
+            <el-table-column label="操作" align="center">
73 85
                 <template slot-scope="scope">
74
-                    <el-button type="text" size="small">删除</el-button>
75
-                    <el-button type="text" size="small">编辑</el-button>
86
+                  <el-button type="primary" size="small" @click="moDrugDamage(scope.row.id,scope.row.checker_status)">编辑</el-button>
87
+                  <el-button type="danger" size="small" @click="deleteDrugDamage(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
76 88
                 </template>
77 89
             </el-table-column>
78 90
         </el-table>
79 91
         <el-pagination
80 92
             @size-change="handleSizeChange"
81 93
             @current-change="handleCurrentChange"
82
-            :page-sizes="[5, 10, 50, 100]"
83
-            :page-size="5"
94
+            :page-sizes="[10, 20, 40, 100]"
95
+            :page-size="10"
84 96
             background
85 97
             style="margin-top:20px;text-align: right"
86 98
             layout="total, sizes, prev, pager, next, jumper"
87
-            :total="total"
88
-        >
99
+            :total="total">
89 100
         </el-pagination>
90 101
     </div>
91 102
     <el-dialog
92 103
         title="库房调价"
93 104
         :visible.sync="dialogVisible"
94
-        width="1200px"
95
-        :before-close="handleClose">
105
+        width="1200px">
96 106
         <el-form :model="form" class="modifyDialog" label-width="120px">
97
-            <el-form-item label="耗材ID">
98
-                <el-input v-model="form.name"></el-input>
107
+            <el-form-item label="药品ID">
108
+                <el-input v-model="form.drug_id"></el-input>
99 109
             </el-form-item>
100 110
             <el-form-item label="药品名称">
101
-                <el-input v-model="form.name"></el-input>
111
+            <el-autocomplete
112
+                class="checkSearch"
113
+                popper-class="my-autocomplete"
114
+                v-model="form.drug_name"
115
+                :fetch-suggestions="querySearchAsync"
116
+                :trigger-on-focus="true"
117
+                placeholder="请输入药品名称"
118
+                @select="handleSelect"
119
+                @input="changeGoodName(scope.$index)"
120
+                style="width:160px;"
121
+                >
122
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
123
+                <template slot-scope="{ item }">
124
+                <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + "  "+item.manufacturer}}</div>
125
+                </template>
126
+                </el-autocomplete>  
102 127
             </el-form-item>
103
-            <el-form-item label="规格">
128
+            <!-- <el-form-item label="规格">
104 129
                 <el-input v-model="form.name"></el-input>
105
-            </el-form-item>
130
+            </el-form-item> -->
106 131
             <el-form-item label="单位">
107
-                <el-input v-model="form.name"></el-input>
132
+                <el-input v-model="form.warehousing_unit"></el-input>
108 133
             </el-form-item>
109 134
             <el-form-item label="进货价">
110
-                <el-input v-model="form.name"></el-input>
135
+                <el-input v-model="form.last_price"></el-input>
111 136
             </el-form-item>
112 137
             <el-form-item label="零售价">
113
-                <el-input v-model="form.name"></el-input>
138
+                <el-input v-model="form.retail_price"></el-input>
114 139
             </el-form-item>
115 140
             <el-form-item label="报损数量">
116
-                <el-input v-model="form.name"></el-input>
141
+                <el-input v-model="form.count"></el-input>
117 142
             </el-form-item>
118 143
             <el-form-item label="库存">
119
-                <el-input v-model="form.name"></el-input>
144
+                <el-input v-model="form.total"></el-input>
120 145
             </el-form-item>
121 146
             <el-form-item label="产地">
122
-                <el-input v-model="form.name"></el-input>
147
+                <el-input v-model="form.drug_origin_place"></el-input>
123 148
             </el-form-item>
124 149
             <el-form-item label="批准文号">
125
-                <el-input v-model="form.name"></el-input>
150
+                <el-input v-model="form.number"></el-input>
126 151
             </el-form-item>
127 152
             <el-form-item label="生产厂商">
128
-                <el-input v-model="form.name"></el-input>
153
+                <el-input v-model="form.manufacturer"></el-input>
129 154
             </el-form-item>
130 155
             <el-form-item label="备注">
131 156
                 <div style="display:flex;">
132
-                    <el-input v-model="form.name"></el-input>
133
-                    <el-button style="margin-left:5px;" type="primary">添加</el-button>
157
+                    <el-input v-model="form.remark"></el-input>
158
+                    <el-button style="margin-left:5px;" type="primary" @click="addPrice">添加</el-button>
134 159
                 </div>
135 160
             </el-form-item>
136 161
         </el-form>
137 162
         <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
138
-            <el-table-column
139
-            prop="date"
140
-            label="耗材ID"
141
-            width="100">
163
+            <el-table-column  prop="date" label="药品ID" width="100">
164
+                <template slot-scope="scope">
165
+                  {{scope.row.drug_id}}
166
+                </template>
142 167
             </el-table-column>
143
-            <el-table-column
144
-            prop="date"
145
-            label="耗材名称"
146
-            width="100">
168
+            <el-table-column prop="date" label="药品名称"  width="100">
169
+                  <template slot-scope="scope">
170
+                  {{scope.row.drug_name}}
171
+                </template>
147 172
             </el-table-column>
148
-            <el-table-column
149
-            prop="name"
150
-            label="规格"
151
-            width="100">
173
+            <el-table-column prop="name" label="规格" width="100">
174
+              <template slot-scope="scope">
175
+                 {{scope.row.dose}}{{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
176
+              </template>
152 177
             </el-table-column>
153
-            <el-table-column
154
-            prop="name"
155
-            label="单位"
156
-            width="100">
178
+            <el-table-column prop="name" label="单位" width="100">
179
+               <template slot-scope="scope">
180
+                 {{scope.row.warehousing_unit}}
181
+              </template> 
157 182
             </el-table-column>
158
-            <el-table-column
159
-            prop="name"
160
-            label="调价数量"
161
-            width="100">
183
+            <el-table-column prop="name" label="报损数量" width="100">
184
+              <template slot-scope="scope">
185
+                 {{scope.row.count}}
186
+              </template> 
162 187
             </el-table-column>
163
-            <el-table-column
164
-            prop="name"
165
-            label="原进货价"
166
-            width="100">
188
+            <el-table-column prop="name" label="原进货价"  width="100">
189
+             <template slot-scope="scope">
190
+                 {{scope.row.last_price}}
191
+              </template> 
167 192
             </el-table-column>
168
-            <el-table-column
169
-            prop="name"
170
-            label="原零售价"
171
-            width="100">
193
+            <el-table-column  prop="name" label="原零售价" width="100">
194
+               <template slot-scope="scope">
195
+                {{scope.row.retail_price}}
196
+              </template>
172 197
             </el-table-column>
173
-            <el-table-column
174
-            prop="name"
175
-            label="新零售价"
176
-            width="100">
198
+            <el-table-column prop="name" label="新零售价" width="100">
199
+                <template slot-scope="scope">
200
+                {{scope.row.new_price}}
201
+               </template>
177 202
             </el-table-column>
178
-            <el-table-column
179
-            prop="name"
180
-            label="生产厂商"
181
-            width="100">
203
+            <el-table-column  prop="name"  label="生产厂商"  width="100">
204
+              <template slot-scope="scope">
205
+                {{scope.row.manufacturer}}
206
+              </template>
182 207
             </el-table-column>
183
-            <el-table-column
184
-            prop="name"
185
-            label="产地"
186
-            width="100">
208
+            <el-table-column prop="name" label="产地" width="100">
209
+              <template slot-scope="scope">
210
+                {{scope.row.drug_origin_place}}
211
+              </template>
187 212
             </el-table-column>
188
-            <el-table-column
189
-            prop="name"
190
-            label="批准文号"
191
-            width="100">
213
+            <el-table-column prop="name" label="批准文号" width="100">
214
+             <template slot-scope="scope">
215
+                {{scope.row.number}}
216
+              </template>
192 217
             </el-table-column>
193
-            <el-table-column
194
-            prop="name"
195
-            label="备注"
196
-            width="100">
218
+            <el-table-column  prop="name" label="备注"  width="100">
219
+               <template slot-scope="scope">
220
+                {{scope.row.remark}}
221
+              </template>
197 222
             </el-table-column>
198 223
             <el-table-column
199 224
             fixed="right"
200 225
             width="100"
201 226
             label="操作">
202 227
                 <template slot-scope="scope">
203
-                    <el-button type="text" size="small">删除</el-button>
204
-                    <el-button type="text" size="small">编辑</el-button>
228
+                    <el-button type="text" size="small" @click="toDel(scope.$index)">删除</el-button>
229
+                    <el-button type="text" size="small" @click="toEdit(scope.row)">编辑</el-button>
205 230
                 </template>
206 231
             </el-table-column>
207 232
         </el-table>
208 233
         <span slot="footer" class="dialog-footer">
209 234
             <el-button @click="dialogVisible = false">取 消</el-button>
210
-            <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
235
+            <el-button type="primary" @click="saveDrugDamage">确 定</el-button>
236
+        </span>
237
+    </el-dialog>
238
+   
239
+
240
+    <el-dialog
241
+        title="耗材盘点核对"
242
+        :visible.sync="checkDialogVisible"
243
+        width="30%"
244
+        >
245
+        <span>
246
+          <el-form :model="form">
247
+            <el-row>
248
+              <el-col>
249
+                <el-form-item label="核对时间">
250
+                 <el-date-picker
251
+                    size="small"
252
+                    v-model="check_time"
253
+                    type="date"
254
+                    style="margin-left:5px;width:140px;"
255
+                    placeholder="选择日期">
256
+                  </el-date-picker>
257
+                </el-form-item>  
258
+              </el-col>
259
+            </el-row>  
260
+             <el-row>
261
+              <el-col>
262
+                <el-form-item label="核对人">
263
+                  <el-select v-model="checker" placeholder="请选择">
264
+                    <el-option
265
+                    v-for="item in doctorList"
266
+                    :key="item.admin_user_id"
267
+                    :label="item.user_name"
268
+                    :value="item.admin_user_id">
269
+                    </el-option>
270
+                 </el-select>
271
+                </el-form-item>  
272
+              </el-col>
273
+            </el-row>  
274
+          </el-form>  
275
+        </span>
276
+        <span slot="footer" class="dialog-footer">
277
+            <el-button @click="checkDialogVisible = false">取 消</el-button>
278
+            <el-button type="primary" @click="SaveDrugDamagePrice">保 存</el-button>
279
+        </span>
280
+    </el-dialog>
281
+
282
+    
283
+     <el-dialog
284
+        title="库房调价"
285
+        :visible.sync="editDialogVisible"
286
+        width="1200px">
287
+        <el-form :model="form" class="modifyDialog" label-width="120px">
288
+            <el-form-item label="药品ID">
289
+                <el-input v-model="form.drug_id"></el-input>
290
+            </el-form-item>
291
+            <el-form-item label="药品名称">
292
+            <el-autocomplete
293
+                class="checkSearch"
294
+                popper-class="my-autocomplete"
295
+                v-model="form.drug_name"
296
+                :fetch-suggestions="querySearchAsync"
297
+                :trigger-on-focus="true"
298
+                placeholder="请输入药品名称"
299
+                @select="handleSelect"
300
+                @input="changeGoodName(scope.$index)"
301
+                style="width:160px;"
302
+                >
303
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
304
+                <template slot-scope="{ item }">
305
+                <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + "  "+item.manufacturer}}</div>
306
+                </template>
307
+                </el-autocomplete>  
308
+            </el-form-item>
309
+            <!-- <el-form-item label="规格">
310
+                <el-input v-model="form.name"></el-input>
311
+            </el-form-item> -->
312
+            <el-form-item label="单位">
313
+                <el-input v-model="form.warehousing_unit"></el-input>
314
+            </el-form-item>
315
+            <el-form-item label="进货价">
316
+                <el-input v-model="form.last_price"></el-input>
317
+            </el-form-item>
318
+            <el-form-item label="零售价">
319
+                <el-input v-model="form.retail_price"></el-input>
320
+            </el-form-item>
321
+            <el-form-item label="报损数量">
322
+                <el-input v-model="form.count"></el-input>
323
+            </el-form-item>
324
+            <el-form-item label="库存">
325
+                <el-input v-model="form.total"></el-input>
326
+            </el-form-item>
327
+            <el-form-item label="产地">
328
+                <el-input v-model="form.drug_origin_place"></el-input>
329
+            </el-form-item>
330
+            <el-form-item label="批准文号">
331
+                <el-input v-model="form.number"></el-input>
332
+            </el-form-item>
333
+            <el-form-item label="生产厂商">
334
+                <el-input v-model="form.manufacturer"></el-input>
335
+            </el-form-item>
336
+            <el-form-item label="备注">
337
+                <div style="display:flex;">
338
+                    <el-input v-model="form.remark"></el-input>
339
+                    <el-button style="margin-left:5px;" type="primary" @click="addPrice">添加</el-button>
340
+                </div>
341
+            </el-form-item>
342
+        </el-form>
343
+        
344
+        <span slot="footer" class="dialog-footer">
345
+            <el-button @click="editDialogVisible = false">取 消</el-button>
346
+            <el-button type="primary" @click="EditDrugDamage">确 定</el-button>
347
+        </span>
348
+    </el-dialog>
349
+
350
+
351
+      <el-dialog
352
+        title="库房调价"
353
+        :visible.sync="modifyDialogVisible"
354
+        width="1200px">
355
+        <el-form :model="form" class="modifyDialog" label-width="120px">
356
+            <el-form-item label="药品ID">
357
+                <el-input v-model="form.drug_id"></el-input>
358
+            </el-form-item>
359
+            <el-form-item label="药品名称">
360
+            <el-autocomplete
361
+                class="checkSearch"
362
+                popper-class="my-autocomplete"
363
+                v-model="form.drug_name"
364
+                :fetch-suggestions="querySearchAsync"
365
+                :trigger-on-focus="true"
366
+                placeholder="请输入药品名称"
367
+                @select="handleSelect"
368
+                @input="changeGoodName(scope.$index)"
369
+                style="width:160px;"
370
+                >
371
+                <i class="el-icon-search el-input__icon" slot="suffix"></i>
372
+                <template slot-scope="{ item }">
373
+                <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + "  "+item.manufacturer}}</div>
374
+                </template>
375
+                </el-autocomplete>  
376
+            </el-form-item>
377
+            <!-- <el-form-item label="规格">
378
+                <el-input v-model="form.name"></el-input>
379
+            </el-form-item> -->
380
+            <el-form-item label="单位">
381
+                <el-input v-model="form.warehousing_unit"></el-input>
382
+            </el-form-item>
383
+            <el-form-item label="进货价">
384
+                <el-input v-model="form.last_price"></el-input>
385
+            </el-form-item>
386
+            <el-form-item label="零售价">
387
+                <el-input v-model="form.retail_price"></el-input>
388
+            </el-form-item>
389
+            <el-form-item label="报损数量">
390
+                <el-input v-model="form.count"></el-input>
391
+            </el-form-item>
392
+            <el-form-item label="库存">
393
+                <el-input v-model="form.total"></el-input>
394
+            </el-form-item>
395
+            <el-form-item label="产地">
396
+                <el-input v-model="form.drug_origin_place"></el-input>
397
+            </el-form-item>
398
+            <el-form-item label="批准文号">
399
+                <el-input v-model="form.number"></el-input>
400
+            </el-form-item>
401
+            <el-form-item label="生产厂商">
402
+                <el-input v-model="form.manufacturer"></el-input>
403
+            </el-form-item>
404
+            <el-form-item label="备注">
405
+                <div style="display:flex;">
406
+                    <el-input v-model="form.remark"></el-input>
407
+                    <el-button style="margin-left:5px;" type="primary" @click="addPrice">添加</el-button>
408
+                </div>
409
+            </el-form-item>
410
+        </el-form>
411
+        
412
+        <span slot="footer" class="dialog-footer">
413
+            <el-button @click="modifyDialogVisible = false">取 消</el-button>
414
+            <el-button type="primary" @click="modifyDrugDamage">确 定</el-button>
211 415
         </span>
212 416
     </el-dialog>
213
-  
417
+    
214 418
   </div>
215 419
 </template>
216 420
 
217 421
 <script>
218 422
 import BreadCrumb from "../../components/bread-crumb";
219
-
423
+import { postSearchDrugWarehouseList,saveDrugDamage,getDrugDamageList,SaveDrugDamagePrice,getDrugDamageDetail,modifyDrugDamage,deleteDrugDamage } from "@/api/drug/drug"
424
+import { uParseTime } from '@/utils/tools'
220 425
 export default {
221 426
     name: "stockModifyPrice",
222 427
     components:{
@@ -232,28 +437,54 @@ export default {
232 437
             searchKey:'',
233 438
             value1:'',
234 439
             value2:'',
235
-            tableData: [{
236
-                date: '2016-05-02',
237
-                name: '王小虎',
238
-                address: '上海市普陀区金沙江路 1518 弄'
239
-                }, {
240
-                date: '2016-05-04',
241
-                name: '王小虎',
242
-                address: '上海市普陀区金沙江路 1517 弄'
243
-                }, {
244
-                date: '2016-05-01',
245
-                name: '王小虎',
246
-                address: '上海市普陀区金沙江路 1519 弄'
247
-                }, {
248
-                date: '2016-05-03',
249
-                name: '王小虎',
250
-                address: '上海市普陀区金沙江路 1516 弄'
251
-            }],
440
+            tableData: [],
252 441
             dialogVisible:false,
253 442
             form: {
254
-                name: '',
443
+                id:"",
444
+                drug_name: '',
445
+                retail_price :'',
446
+                new_price:"",
447
+                count:"",
448
+                remark:"",
449
+                warehousing_order:"",
450
+                manufacturer:"",
451
+                dealer:"",
452
+                number:"",
453
+                warehousing_unit:"",
454
+                specification_name:"",
455
+                buy_price:"",
456
+                drug_id:"",
457
+                packing_unit:"",
458
+                drug_origin_place:"",
459
+                report_count:"",
460
+                total:"",
461
+                dose:"",
462
+                dose_unit:"",
463
+                min_number:"",
464
+                min_unit:"",
465
+                max_unit:"",
466
+                batch_number:"",
467
+                last_price:"",
468
+                batch_number:"",
255 469
             },
470
+            drugList:[],
471
+            manufacturerList:[],
472
+            dealerList:[],
473
+            currentIndex: 0,
474
+            limit:10,
475
+            page:1,
476
+            tableList:[],
256 477
             total: 0,
478
+            start_time:"",
479
+            end_time:"",
480
+            doctorList:[],
481
+            ids:"",
482
+            checkDialogVisible:false,
483
+            checker:this.$store.getters.xt_user.user.id,
484
+            check_time:new Date(),
485
+            editDialogVisible:false,
486
+            modifyDialogVisible:false,
487
+            id:"",
257 488
         }
258 489
     },
259 490
     methods:{
@@ -261,14 +492,307 @@ export default {
261 492
 
262 493
         },
263 494
         print(){
264
-            this.$router.push({path:'/stock/stockModifyPricePrint'})
495
+          if(this.ids == ""){
496
+            this.$message.error("请勾选打印数据")
497
+            return false
498
+          }else{
499
+            this.$router.push({path:'/stock/drugs/drugDamagePrint?ids='+this.ids})
500
+          }  
501
+        },
502
+        handleSizeChange(val){
503
+          this.limit = val
504
+          this.getlist()
505
+        },
506
+        handleCurrentChange(val){
507
+          this.page = val
508
+          this.getlist()
509
+        },
510
+          querySearchAsync(keyword, cb) {
511
+            let key = '';
512
+            if (keyword != undefined) {
513
+                key = keyword
514
+            }
515
+            postSearchDrugWarehouseList(key).then(response => {
516
+            if (response.data.state == 1) {
517
+            
518
+                var list = response.data.data.list
519
+                console.log("列表数据",list)
520
+                this.drugList = list
521
+                var manufacturerList = response.data.data.manufacturerList
522
+                this.manufacturerList = manufacturerList
523
+                var dealer =  response.data.data.dealerList
524
+                this.dealerList = dealer
525
+                for(let i=0;i<this.drugList.length;i++){
526
+                    for(let j=0;j<this.manufacturerList.length;j++){
527
+                    if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
528
+                        this.drugList[i].manufacturer = this.manufacturerList[j].manufacturer_name
529
+                    }
530
+                    }
531
+                }
532
+
533
+                for(let i=0;i<this.drugList.length;i++){
534
+                    for(let j=0;j<this.dealerList.length;j++){
535
+                        if(this.drugList[i].dealer == this.dealerList[j].id){
536
+                        this.drugList[i].dealer = this.dealerList[j].dealer_name
537
+                        }
538
+                    }
539
+                }
265 540
             
541
+                cb(this.drugList)
542
+            } else {
543
+                cb([])
544
+             }
545
+          })
546
+         },
547
+        
548
+        changeGoodName(val){
549
+          this.currentIndex = val
266 550
         },
267
-        handleSizeChange(){},
268
-        handleCurrentChange(){}
551
+         handleSelect(val){
552
+            console.log("val232323223",val)
553
+            this.form.id = val.id
554
+            this.form.drug_id = val.drug_id,
555
+            this.form.drug_name = val.drug_name
556
+            this.form.retail_price = val.retail_price
557
+            this.form.warehousing_order = val.warehousing_order
558
+            this.form.number = val.number
559
+            this.form.dealer = val.dealer
560
+            this.form.manufacturer = val.manufacturer
561
+            this.form.remark = val.remark
562
+            this.form.warehousing_unit = val.warehouseing_unit  
563
+            this.form.total = val.total
564
+            this.form.batch_number = val.batch_number
565
+            this.form.last_price = val.last_price
566
+           
567
+        },
568
+        getTime(val) {
569
+         if(val < 0){
570
+            return ""
571
+          }
572
+         if(val == ""){
573
+            return ""
574
+          }else {
575
+            return uParseTime(val, '{y}-{m}-{d}')
576
+         }
577
+        },
578
+        addPrice(){
579
+          var obj = {
580
+            drug_id:this.form.drug_id,
581
+            drug_name:this.form.drug_name,
582
+            warehousing_unit:this.form.warehousing_unit,
583
+            count:parseInt(this.form.count),
584
+            retail_price:this.form.retail_price.toString(),
585
+            manufacturer:this.form.manufacturer,
586
+            drug_origin_place:this.form.drug_origin_place,
587
+            number:this.form.number,
588
+            remark:this.form.remark,
589
+            new_price:this.form.new_price.toString(),
590
+            warehousing_order:this.form.warehousing_order,
591
+            dealer:this.form.dealer,
592
+            last_price:this.form.last_price,
593
+            start_time:this.getTime(new Date()),
594
+            number:this.form.number,
595
+            } 
596
+          this.tableData.push(obj)     
597
+        },
598
+        saveDrugDamage(){
599
+            for(let i=0;i<this.tableData.length;i++){
600
+            this.tableData[i].retail_price = this.tableData[i].retail_price.toString()
601
+            this.tableData[i].last_price = this.tableData[i].last_price.toString()
602
+            this.tableData[i].new_price = this.tableData[i].new_price.toString()
603
+            this.tableData[i].count =  parseInt(this.tableData[i].count)
604
+            }
605
+            var params= {
606
+            tableData:this.tableData,
607
+            }
608
+            console.log("parasm222",params)
609
+        saveDrugDamage(params).then(response=>{
610
+            if(response.data.state == 1){
611
+            var msg =  response.data.data.msg
612
+            console.log("msg",msg)
613
+            this.$message.success("保存成功!")
614
+            this.dialogVisible = false
615
+            this.getlist()
616
+          }
617
+         })  
618
+      },
619
+      getlist(){
620
+        var params = {
621
+          limit:this.limit,
622
+          page:this.page, 
623
+          start_time:this.start_time,
624
+          end_time:this.end_time,
625
+        }
626
+        getDrugDamageList(params).then(response=>{
627
+           if(response.data.state == 1){
628
+             this.tableList = response.data.data.list
629
+             this.total = response.data.data.total
630
+             this.doctorList = response.data.data.doctorList
631
+           }
632
+        })
633
+      },
634
+      getDoctorName(id){
635
+        var user_name = ""
636
+        for(let i=0;i<this.doctorList.length;i++){
637
+          if(id == this.doctorList[i].admin_user_id){
638
+            user_name = this.doctorList[i].user_name
639
+          }
640
+        } 
641
+        return user_name
642
+     },
643
+    changePrice(val){  
644
+       var arr = []
645
+      
646
+       for(let i=0;i<val.length;i++){
647
+         arr.push(val[i].id)
648
+       }
649
+      var str = arr.join(",")
650
+    
651
+      console.log("str",str)
652
+      this.ids = str
653
+     
654
+     },
655
+     toCheck(){
656
+      if(this.ids.length <=0){
657
+         this.$message.error("请勾选核对数据")
658
+         return
659
+       }else{
660
+         this.checkDialogVisible = true
661
+       }
662
+     },
663
+      SaveDrugDamagePrice(){
664
+         var params = {
665
+            ids:this.ids,
666
+            check_time:this.getTime(this.check_time),
667
+            checker:this.checker,
668
+         }
669
+       console.log("params",params)
670
+       SaveDrugDamagePrice(params).then(response=>{
671
+         if(response.data.state == 1){
672
+           this.$message.success("保存成功")
673
+           var damage = response.data.data.damage
674
+           this.checkDialogVisible = false
675
+           this.getlist()
676
+         }
677
+       })
678
+     },
679
+     toDel(index){
680
+       this.tableList.splice(index,1)
681
+     },
682
+     toEdit(val){
683
+       this.form.drug_name = val.drug_name
684
+       this.form.drug_origin_place = val.drug_origin_place
685
+       this.form.last_price = val.last_price
686
+       this.form.drug_id = val.drug_id,
687
+       this.form.manufacturer = val.manufacturer
688
+       this.form.new_price = val.new_price
689
+       this.form.number = val.number
690
+       this.form.retail_price = val.retail_price
691
+       this.form.remark = val.remark
692
+       this.form.id = val.id
693
+       this.form.count = val.count
694
+       this.editDialogVisible = true
695
+     },
696
+     EditDrugDamage(){
697
+       for(let i=0;i<this.tableData.length;i++){
698
+          if(this.form.id == this.tableData[i].id){
699
+            this.tableData[i].drug_name = this.form.drug_name
700
+            this.tableData[i].drug_origin_place = this.form.drug_origin_place
701
+            this.tableData[i].last_price = this.form.last_price
702
+            this.tableData[i].new_price = this.form.new_price
703
+            this.tableData[i].number = this.form.number
704
+            this.tableData[i].retail_price = this.form.retail_price
705
+            this.tableData[i].remark = this.form.remark
706
+            this.tableData[i].count = this.form.count
707
+          }
708
+       }
709
+       this.editDialogVisible = false
710
+       this.form.drug_name = ""
711
+       this.form.drug_origin_place = ""
712
+       this.form.last_price = ""
713
+       this.form.manufacturer = ""
714
+       this.form.new_price = ""
715
+       this.form.number = ""
716
+       this.form.retail_price = ""
717
+       this.form.remark = ""
718
+       this.form.count = ""
719
+     },
720
+     moDrugDamage(id,checker_status){
721
+         if(checker_status == 1){
722
+          this.$message.error("已核对不能编辑")
723
+          return false
724
+         }
725
+       getDrugDamageDetail(id).then(response=>{
726
+         if(response.data.state ==1){
727
+           var detail = response.data.data.detail
728
+           this.form.drug_id = detail.drug_id
729
+           this.form.drug_name = detail.drug_name
730
+           this.form.drug_origin_place = detail.drug_origin_place
731
+           this.form.last_price = detail.last_price
732
+           this.form.manufacturer = detail.manufacturer
733
+           this.form.new_price = detail.new_price
734
+           this.form.number = detail.number
735
+           this.form.retail_price = detail.retail_price
736
+           this.form.remark = detail.remark
737
+           this.form.count = detail.count
738
+           this.id = detail.id
739
+           this.form.warehousing_unit = detail.warehouseing_unit
740
+           this.modifyDialogVisible = true
741
+         }
742
+       })
743
+     },
744
+     modifyDrugDamage(){
745
+         var params = {
746
+           drug_id:this.form.drug_id,
747
+           drug_name:this.form.drug_name,
748
+           drug_origin_place:this.form.drug_origin_place,
749
+           last_price:this.form.last_price,
750
+           manufacturer:this.form.manufacturer,
751
+           new_price:this.form.new_price.toString(),
752
+           number:this.form.number,
753
+           retail_price:this.form.retail_price,
754
+           remark:this.form.remark,
755
+           count:parseInt(this.form.count),
756
+           warehousing_unit:this.form.warehousing_unit,
757
+           id:this.id,
758
+         }
759
+       modifyDrugDamage(params).then(response=>{
760
+          if(response.data.state == 1){
761
+            var damage =  response.data.data.damage
762
+            this.$message.success("保存成功")
763
+            this.modifyDialogVisible = false
764
+            this.getlist()
765
+          }
766
+       })
767
+     },
269 768
 
769
+     deleteDrugDamage(id,checker_status,index){
770
+       if(checker_status == 1){
771
+         this.$message.error("已核对不能删除")
772
+         return false
773
+       }
774
+       this.$confirm('是否删除所选内容?', '提示', {
775
+          confirmButtonText: '确定',
776
+          cancelButtonText: '取消',
777
+          type: 'warning'
778
+        }).then(() => {
779
+          let params = {
780
+            id:id,
781
+          }
782
+         deleteDrugDamage(params).then(response => {
783
+            if (response.data.state == 1) {
784
+              var msg = response.data.data.msg
785
+              this.$message.success("保存成功")
786
+              this.tableList.splice(index,1)
787
+            } 
788
+          })
789
+        }).catch(() => {
790
+          this.loading = false
791
+        });
792
+     }
270 793
     },
271 794
     created(){
795
+      this.getlist()
272 796
     },
273 797
     mounted() {
274 798
     },

+ 609 - 102
src/xt_pages/stock/drugs/drugModifyPrice.vue View File

@@ -38,151 +38,342 @@
38 38
         </div>
39 39
         <div>
40 40
             <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
41
-            <el-button size="small" type="primary">核对</el-button>
41
+            <el-button size="small" type="primary" @click="toCheck">核对</el-button>
42 42
             <el-button size="small" type="primary" @click="print">打印</el-button>
43
-            <el-button size="small" type="primary">导出</el-button>
43
+            <el-button size="small" type="primary" @click="toExport">导出</el-button>
44 44
         </div>
45 45
       </div>
46 46
       <div style="margin-top:10px">
47
-            <el-table :data="tableData" border :height="tableHeight" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
48
-                <el-table-column
49
-                prop="date"
50
-                label="单据编码">
47
+            <el-table :data="tableList" border :height="tableHeight" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"  @selection-change="changePrice">
48
+                <el-table-column type="selection" width="55" align="center"> </el-table-column>
49
+                <el-table-column prop="date" label="单据编码" width="200px" align="center">
50
+                  <template slot-scope="scope">
51
+                    {{scope.row.warehousing_order}}
52
+                  </template>
51 53
                 </el-table-column>
52
-                <el-table-column
53
-                prop="date"
54
-                label="调价日期">
54
+                <el-table-column prop="date" label="调价日期" width="200px"  align="center">
55
+                   <template slot-scope="scope">
56
+                    {{getTime(scope.row.start_time)}}
57
+                  </template>  
55 58
                 </el-table-column>
56
-                <el-table-column
57
-                prop="name"
58
-                label="操作人">
59
+                 <el-table-column prop="date" label="现价格" width="200px"  align="center">
60
+                   <template slot-scope="scope">
61
+                    {{scope.row.new_price}}
62
+                  </template>  
59 63
                 </el-table-column>
60
-                <el-table-column
61
-                prop="name"
62
-                label="状态">
64
+                <el-table-column prop="name" label="操作人" width="200px"  align="center">
65
+                 <template slot-scope="scope">
66
+                    {{getDoctorName(scope.row.creater)}}
67
+                  </template>  
63 68
                 </el-table-column>
64
-                <el-table-column
65
-                prop="name"
66
-                label="核对人">
69
+                <el-table-column prop="name" label="状态"  align="center">
70
+                  <template slot-scope="scope">
71
+                     <span v-if="scope.row.checker_status == 1">已核对</span>
72
+                     <span v-if="scope.row.checker_status == 2">未核对</span>
73
+                  </template>  
67 74
                 </el-table-column>
68
-                <el-table-column
69
-                label="操作">
75
+                <el-table-column prop="name" label="核对人"  align="center">
76
+                  <template slot-scope="scope">
77
+                    {{getDoctorName(scope.row.checker)}}
78
+                  </template>  
79
+                </el-table-column>
80
+                <el-table-column label="操作" align="center" width="200px">
70 81
                     <template slot-scope="scope">
71
-                        <el-button type="text" size="small">删除</el-button>
72
-                        <el-button type="text" size="small">编辑</el-button>
82
+                      <el-button type="primary" size="small" @click="modifty(scope.row.id,scope.row.checker_status)">编辑</el-button>
83
+                      <el-button type="danger" size="small" @click="deleteDrugPrice(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
73 84
                     </template>
74 85
                 </el-table-column>
75 86
             </el-table>
87
+
88
+          <el-pagination
89
+              @size-change="handleSizeChange"
90
+              @current-change="handleCurrentChange"
91
+              :page-sizes="[10, 20, 40, 100]"
92
+              :page-size="10"
93
+              background
94
+              style="margin-top:20px;text-align: right"
95
+              layout="total, sizes, prev, pager, next, jumper"
96
+              :total="total">
97
+            </el-pagination>
76 98
         </div>
77 99
     </div>
78 100
     <el-dialog
79 101
         title="库房调价"
80 102
         :visible.sync="dialogVisible"
81
-        width="1200px"
82
-        :before-close="handleClose">
103
+        width="1200px">
83 104
         <el-form :model="form" class="modifyDialog" label-width="120px">
84 105
             <el-form-item label="药品名称">
85
-                <el-input v-model="form.name"></el-input>
106
+              
107
+                 <el-autocomplete
108
+                    class="checkSearch"
109
+                    popper-class="my-autocomplete"
110
+                    v-model="form.drug_name"
111
+                    :fetch-suggestions="querySearchAsync"
112
+                    :trigger-on-focus="true"
113
+                    placeholder="请输入药品名称"
114
+                    @select="handleSelect"
115
+                    @input="changeGoodName(scope.$index)"
116
+                    style="width:160px;"
117
+                  >
118
+                    <i class="el-icon-search el-input__icon" slot="suffix"></i>
119
+                  <template slot-scope="{ item }">
120
+                    <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + "  "+item.manufacturer}}</div>
121
+                  </template>
122
+                 </el-autocomplete>  
86 123
             </el-form-item>
87 124
             <el-form-item label="原价格">
88
-                <el-input v-model="form.name"></el-input>
125
+                <el-input v-model="form.retail_price"></el-input>
89 126
             </el-form-item>
90 127
             <el-form-item label="现价格">
91
-                <el-input v-model="form.name"></el-input>
128
+                <el-input v-model="form.new_price"></el-input>
92 129
             </el-form-item>
93 130
             <el-form-item label="调价数量">
94
-                <el-input v-model="form.name"></el-input>
131
+                <el-input v-model="form.count"></el-input>
95 132
             </el-form-item>
96 133
             <el-form-item label="备注" style="width:66%;">
97 134
                 <div style="display:flex;">
98
-                    <el-input v-model="form.name"></el-input>
99
-                    <el-button style="margin-left:5px;" type="primary">添加</el-button>
135
+                    <el-input v-model="form.remark"></el-input>
136
+                    <el-button style="margin-left:5px;" type="primary" @click="addPrice">添加</el-button>
100 137
                 </div>
101 138
             </el-form-item>
102 139
         </el-form>
103 140
         <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
104
-            <el-table-column
105
-            prop="date"
106
-            label="单据编号"
107
-            width="100">
141
+            <el-table-column prop="date" label="单据编号" width="100">
142
+               <template slot-scope="scope">
143
+                 {{scope.row.warehousing_order}}
144
+                </template>  
108 145
             </el-table-column>
109
-            <el-table-column
110
-            prop="date"
111
-            label="药品名称"
112
-            width="100">
146
+            <el-table-column prop="date"label="药品名称" width="100">
147
+              <template slot-scope="scope">
148
+                 {{scope.row.drug_name}}
149
+                </template>  
113 150
             </el-table-column>
114
-            <el-table-column
115
-            prop="name"
116
-            label="规格"
117
-            width="100">
151
+            <el-table-column prop="name"label="规格" width="100">
152
+              <template slot-scope="scope">
153
+                  {{scope.row.dose}}{{scope.row.dose_unit}}*{{scope.row.min_number}}{{scope.row.min_unit}}/{{scope.row.max_unit}}
154
+              </template>
118 155
             </el-table-column>
119
-            <el-table-column
120
-            prop="name"
121
-            label="单位"
122
-            width="100">
156
+            <el-table-column prop="name" label="单位" width="100">
157
+              <template slot-scope="scope">
158
+              {{scope.row.warehousing_unit}}
159
+              </template>
123 160
             </el-table-column>
124
-            <el-table-column
125
-            prop="name"
126
-            label="调价数量"
127
-            width="100">
161
+            <el-table-column prop="name" label="调价数量" width="100">
162
+              <template slot-scope="scope">
163
+              {{scope.row.count}}
164
+              </template>
128 165
             </el-table-column>
129
-            <el-table-column
130
-            prop="name"
131
-            label="原进货价"
132
-            width="100">
166
+            <el-table-column prop="name" label="原进货价" width="100">
167
+                <template slot-scope="scope">
168
+                {{scope.row.retail_price}}
169
+                </template>
133 170
             </el-table-column>
134
-            <el-table-column
135
-            prop="name"
136
-            label="原零售价"
137
-            width="100">
171
+            <el-table-column prop="name" label="原零售价" width="100">
172
+                 <template slot-scope="scope">
173
+                  {{scope.row.retail_price}}
174
+                </template>
138 175
             </el-table-column>
139
-            <el-table-column
140
-            prop="name"
141
-            label="新零售价"
142
-            width="100">
176
+            <el-table-column  prop="name" label="新零售价" width="100">
177
+                <template slot-scope="scope">
178
+                  {{scope.row.new_price}}
179
+                </template>  
143 180
             </el-table-column>
144
-            <el-table-column
145
-            prop="name"
146
-            label="生产厂商"
147
-            width="100">
181
+            <el-table-column prop="name" label="生产厂商" width="100">
182
+                <template slot-scope="scope">
183
+                  {{scope.row.manufacturer}}
184
+                </template>   
148 185
             </el-table-column>
149
-            <el-table-column
150
-            prop="name"
151
-            label="批准文号"
152
-            width="100">
186
+            <el-table-column prop="name" label="批准文号" width="100">
187
+                 <template slot-scope="scope">
188
+                  {{scope.row.number}}
189
+                </template>    
153 190
             </el-table-column>
154
-            <el-table-column
155
-            prop="name"
156
-            label="供应商"
157
-            width="100">
191
+            <el-table-column prop="name" label="供应商" width="100">
192
+                <template slot-scope="scope">
193
+                  {{scope.row.manufacturer}}
194
+                </template>    
158 195
             </el-table-column>
159
-            <el-table-column
160
-            prop="name"
161
-            label="备注"
162
-            width="100">
196
+            <el-table-column prop="name" label="备注"  width="100">
197
+               <template slot-scope="scope">
198
+                  {{scope.row.remark}}
199
+                </template>      
163 200
             </el-table-column>
164 201
             <el-table-column
165 202
             fixed="right"
166 203
             width="100"
167 204
             label="操作">
168 205
                 <template slot-scope="scope">
169
-                    <el-button type="text" size="small">删除</el-button>
170
-                    <el-button type="text" size="small">编辑</el-button>
206
+                    <el-button type="text" size="small" @click="toDel(scope.$index)">删除</el-button>
207
+                    <el-button type="text" size="small" @click="toEdit(scope.row)">编辑</el-button>
171 208
                 </template>
172 209
             </el-table-column>
173 210
         </el-table>
211
+
174 212
         <span slot="footer" class="dialog-footer">
175 213
             <el-button @click="dialogVisible = false">取 消</el-button>
176
-            <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
214
+            <el-button type="primary" @click="saveDrugPrice">确 定</el-button>
215
+        </span>
216
+    </el-dialog>
217
+   
218
+     <el-dialog
219
+        title="耗材盘点核对"
220
+        :visible.sync="checkDialogVisible"
221
+        width="30%"
222
+        >
223
+        <span>
224
+          <el-form :model="form">
225
+            <el-row>
226
+              <el-col>
227
+                <el-form-item label="核对时间">
228
+                 <el-date-picker
229
+                    size="small"
230
+                    v-model="check_time"
231
+                    type="date"
232
+                    style="margin-left:5px;width:140px;"
233
+                    placeholder="选择日期">
234
+                  </el-date-picker>
235
+                </el-form-item>  
236
+              </el-col>
237
+            </el-row>  
238
+             <el-row>
239
+              <el-col>
240
+                <el-form-item label="核对人">
241
+                  <el-select v-model="checker" placeholder="请选择">
242
+                    <el-option
243
+                    v-for="item in doctorList"
244
+                    :key="item.admin_user_id"
245
+                    :label="item.user_name"
246
+                    :value="item.admin_user_id">
247
+                    </el-option>
248
+                 </el-select>
249
+                </el-form-item>  
250
+              </el-col>
251
+            </el-row>  
252
+          </el-form>  
253
+        </span>
254
+        <span slot="footer" class="dialog-footer">
255
+            <el-button @click="checkDialogVisible = false">取 消</el-button>
256
+            <el-button type="primary" @click="SaveCheckedDrugPrice">保 存</el-button>
257
+        </span>
258
+    </el-dialog>
259
+
260
+
261
+      <!-- 编辑调价 -->
262
+    <el-dialog
263
+        title="编辑"
264
+        :visible.sync="editPriceDialogVisible"
265
+        width="50%">
266
+        <span>
267
+          <el-form  :model="form">
268
+            <el-row>
269
+               <el-col>
270
+                <el-form-item label="药品名称">
271
+                 <el-autocomplete
272
+                    class="checkSearch"
273
+                    popper-class="my-autocomplete"
274
+                    v-model="form.drug_name"
275
+                    :fetch-suggestions="querySearchAsync"
276
+                    :trigger-on-focus="true"
277
+                    placeholder="请输入药品名称"
278
+                    @select="handleSelect"
279
+                    @input="changeGoodName(scope.$index)"
280
+                    style="width:160px;"
281
+                  >
282
+                    <i class="el-icon-search el-input__icon" slot="suffix"></i>
283
+                  <template slot-scope="{ item }">
284
+                    <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + "  "+item.manufacturer}}</div>
285
+                  </template>
286
+                 </el-autocomplete>  
287
+              </el-form-item>
288
+               <el-form-item label="原价格:">
289
+                 <el-input v-model="form.retail_price" style="width:200px"></el-input>
290
+               </el-form-item>
291
+               <el-form-item label="现价格:">
292
+                    <el-input v-model="form.new_price" style="width:200px"></el-input>
293
+                </el-form-item>
294
+             </el-col> 
295
+            </el-row>
296
+            <el-row>
297
+             <el-col>
298
+               <el-form-item label="调价数量:">
299
+                    <el-input v-model="form.count"  style="width:200px"></el-input>
300
+                </el-form-item>
301
+                <el-form-item label="备注:">
302
+                    <div style="display:flex;">
303
+                        <el-input v-model="form.remark"  style="width:200px"></el-input>
304
+                    </div>
305
+                </el-form-item>
306
+              </el-col>  
307
+            </el-row>
308
+          </el-form>
309
+        </span>
310
+        <span slot="footer" class="dialog-footer">
311
+            <el-button @click="editPriceDialogVisible = false">取 消</el-button>
312
+            <el-button type="primary" @click="upatePrice">保存</el-button>
313
+        </span>
314
+    </el-dialog>
315
+
316
+
317
+      <el-dialog
318
+        title="编辑"
319
+        :visible.sync="modifyPriceDialogVisible"
320
+        width="50%">
321
+        <span>
322
+          <el-form  :model="form">
323
+            <el-row>
324
+               <el-col>
325
+                <el-form-item label="药品名称">
326
+                 <el-autocomplete
327
+                    class="checkSearch"
328
+                    popper-class="my-autocomplete"
329
+                    v-model="form.drug_name"
330
+                    :fetch-suggestions="querySearchAsync"
331
+                    :trigger-on-focus="true"
332
+                    placeholder="请输入药品名称"
333
+                    @select="handleSelect"
334
+                    @input="changeGoodName(scope.$index)"
335
+                    style="width:160px;"
336
+                  >
337
+                    <i class="el-icon-search el-input__icon" slot="suffix"></i>
338
+                  <template slot-scope="{ item }">
339
+                    <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + "  "+item.manufacturer}}</div>
340
+                  </template>
341
+                 </el-autocomplete>  
342
+              </el-form-item>
343
+               <el-form-item label="原价格:">
344
+                 <el-input v-model="form.retail_price" style="width:200px"></el-input>
345
+               </el-form-item>
346
+               <el-form-item label="现价格:">
347
+                    <el-input v-model="form.new_price" style="width:200px"></el-input>
348
+                </el-form-item>
349
+             </el-col> 
350
+            </el-row>
351
+            <el-row>
352
+             <el-col>
353
+               <el-form-item label="调价数量:">
354
+                    <el-input v-model="form.count"  style="width:200px"></el-input>
355
+                </el-form-item>
356
+                <el-form-item label="备注:">
357
+                    <div style="display:flex;">
358
+                        <el-input v-model="form.remark"  style="width:200px"></el-input>
359
+                    </div>
360
+                </el-form-item>
361
+              </el-col>  
362
+            </el-row>
363
+          </el-form>
364
+        </span>
365
+        <span slot="footer" class="dialog-footer">
366
+            <el-button @click="modifyPriceDialogVisible = false">取 消</el-button>
367
+            <el-button type="primary" @click="modifyDrugPrice">保存</el-button>
177 368
         </span>
178 369
     </el-dialog>
179
-  
180 370
   </div>
181 371
 </template>
182 372
 
183 373
 <script>
374
+import { uParseTime } from '@/utils/tools'
184 375
 import BreadCrumb from "../../components/bread-crumb";
185
-
376
+import {postSearchDrugWarehouseList,saveDrugPrice,getDrugPriceList,SaveCheckedDrugPrice,getDrugModiftyPrice,modifyDrugPrice,deleteDrugPrice} from "@/api/drug/drug"
186 377
 export default {
187 378
     name: "stockModifyPrice",
188 379
     components:{
@@ -200,27 +391,50 @@ export default {
200 391
             searchKey:'',
201 392
             value1:'',
202 393
             value2:'',
203
-            tableData: [{
204
-                date: '2016-05-02',
205
-                name: '王小虎',
206
-                address: '上海市普陀区金沙江路 1518 弄'
207
-                }, {
208
-                date: '2016-05-04',
209
-                name: '王小虎',
210
-                address: '上海市普陀区金沙江路 1517 弄'
211
-                }, {
212
-                date: '2016-05-01',
213
-                name: '王小虎',
214
-                address: '上海市普陀区金沙江路 1519 弄'
215
-                }, {
216
-                date: '2016-05-03',
217
-                name: '王小虎',
218
-                address: '上海市普陀区金沙江路 1516 弄'
219
-            }],
394
+            tableData: [],
220 395
             dialogVisible:false,
221 396
             form: {
222
-                name: '',
397
+                id:"",
398
+                drug_name: '',
399
+                retail_price :'',
400
+                new_price:"",
401
+                count:"",
402
+                remark:"",
403
+                warehousing_order:"",
404
+                manufacturer:"",
405
+                dealer:"",
406
+                license_number:"",
407
+                warehousing_unit:"",
408
+                specification_name:"",
409
+                buy_price:"",
410
+                drug_id:"",
411
+                packing_unit:"",
412
+                drug_origin_place:"",
413
+                report_count:"",
414
+                total:"",
415
+                dose:"",
416
+                dose_unit:"",
417
+                min_number:"",
418
+                min_unit:"",
419
+                max_unit:"",
420
+                batch_number:"",
421
+                last_price:"",
223 422
             },
423
+            drugList:[],
424
+            manufacturerList:[],
425
+            dealerList:[],
426
+            currentIndex: 0,
427
+            limit:10,
428
+            page:1,
429
+            tableList:[],
430
+            ids:"",
431
+            checkDialogVisible:false,
432
+            checker:this.$store.getters.xt_user.user.id,
433
+            check_time:new Date(),
434
+            doctorList:[],
435
+            editPriceDialogVisible:false,
436
+            modifyPriceDialogVisible:false,
437
+            id:0,
224 438
         }
225 439
     },
226 440
     methods:{
@@ -228,13 +442,306 @@ export default {
228 442
 
229 443
         },
230 444
         print(){
231
-            this.$router.push({path:'/stock/drugs/drugModifyPricePrint'})
445
+           if(this.ids == ""){
446
+             this.$message.error("请勾选打印数据")
447
+             return false
448
+           }else{
449
+            this.$router.push({path:'/stock/drugs/drugModifyPricePrint?ids='+this.ids})
450
+           }  
451
+        },
452
+        addPrice(){
453
+          var obj = {
454
+            drug_id:this.form.drug_id,
455
+            drug_name:this.form.drug_name,
456
+            warehousing_unit:this.form.warehousing_unit,
457
+            count:parseInt(this.form.count),
458
+            retail_price:this.form.retail_price.toString(),
459
+            manufacturer:this.form.manufacturer,
460
+            drug_origin_place:this.form.drug_origin_place,
461
+            number:this.form.number,
462
+            remark:this.form.remark,
463
+            new_price:this.form.new_price.toString(),
464
+            warehousing_order:this.form.warehousing_order,
465
+            dealer:this.form.dealer,
466
+            last_price:this.form.last_price,
467
+            start_time:this.getTime(new Date()),
468
+            } 
469
+          this.tableData.push(obj)     
470
+        },
471
+        querySearchAsync(keyword, cb) {
472
+            let key = '';
473
+            if (keyword != undefined) {
474
+                key = keyword
475
+            }
476
+            postSearchDrugWarehouseList(key).then(response => {
477
+            if (response.data.state == 1) {
232 478
             
479
+                var list = response.data.data.list
480
+                console.log("列表数据",list)
481
+                this.drugList = list
482
+                var manufacturerList = response.data.data.manufacturerList
483
+                this.manufacturerList = manufacturerList
484
+                var dealer =  response.data.data.dealerList
485
+                this.dealerList = dealer
486
+                for(let i=0;i<this.drugList.length;i++){
487
+                    for(let j=0;j<this.manufacturerList.length;j++){
488
+                    if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
489
+                        this.drugList[i].manufacturer = this.manufacturerList[j].manufacturer_name
490
+                    }
491
+                    }
492
+                }
493
+
494
+                for(let i=0;i<this.drugList.length;i++){
495
+                    for(let j=0;j<this.dealerList.length;j++){
496
+                        if(this.drugList[i].dealer == this.dealerList[j].id){
497
+                        this.drugList[i].dealer = this.dealerList[j].dealer_name
498
+                        }
499
+                    }
500
+                }
501
+            
502
+                cb(this.drugList)
503
+            } else {
504
+                cb([])
505
+             }
506
+          })
507
+         },
508
+        changeGoodName(val){
509
+          this.currentIndex = val
510
+        },
511
+         handleSelect(val){
512
+            console.log("val232323223",val)
513
+            this.form.id = val.id
514
+            this.form.drug_id = val.drug_id,
515
+            this.form.drug_name = val.drug_name
516
+            this.form.retail_price = val.retail_price
517
+            this.form.warehousing_order = val.warehousing_order
518
+            this.form.number = val.number
519
+            this.form.dealer = val.dealer
520
+            this.form.manufacturer = val.manufacturer
521
+            this.form.remark = val.remark
522
+            this.form.warehousing_unit = val.warehouseing_unit  
523
+            this.form.total = val.total
524
+            this.form.batch_number = val.batch_number
525
+            this.form.last_price = val.last_price
526
+        },
527
+        getTime(val) {
528
+         if(val < 0){
529
+            return ""
530
+          }
531
+         if(val == ""){
532
+            return ""
533
+          }else {
534
+            return uParseTime(val, '{y}-{m}-{d}')
535
+         }
536
+        },
537
+       saveDrugPrice(){
538
+         for(let i=0;i<this.tableData.length;i++){
539
+           this.tableData[i].retail_price = this.tableData[i].retail_price.toString()
540
+           this.tableData[i].last_price = this.tableData[i].last_price.toString()
541
+           this.tableData[i].new_price = this.tableData[i].new_price.toString()
542
+           this.tableData[i].count =  parseInt(this.tableData[i].count)
543
+           if(this.tableData[i].dealer == 0){
544
+             this.tableData[i].dealer = ""
545
+           }
546
+           if(this.tableData[i].manufacturer == 0){
547
+             this.tableData[i].manufacturer = ""
548
+           }
549
+         }
550
+         var params= {
551
+           tableData:this.tableData,
552
+         }
553
+        console.log("parasm222",params)
554
+       saveDrugPrice(params).then(response=>{
555
+        if(response.data.state == 1){
556
+          var msg =  response.data.data.msg
557
+          console.log("msg",msg)
558
+          this.$message.success("保存成功!")
559
+          this.dialogVisible = false
560
+          this.getlist()
561
+        }
562
+      })  
563
+     },
564
+     getlist(){
565
+         var params = {
566
+            keyword:this.searchKey,
567
+            start_time:"",
568
+            end_time:"",
569
+            limit:this.limit,
570
+            page:this.page,
571
+         }
572
+       getDrugPriceList(params).then(response=>{
573
+          if(response.data.state == 1){
574
+           var list =  response.data.data.list
575
+           this.total = response.data.data.total
576
+           this.tableList = list
577
+           this.doctorList = response.data.data.doctorList
578
+          }
579
+       })   
580
+     },
581
+     getDoctorName(id){
582
+        var user_name = ""
583
+        for(let i=0;i<this.doctorList.length;i++){
584
+          if(id == this.doctorList[i].admin_user_id){
585
+            user_name = this.doctorList[i].user_name
586
+          }
587
+        } 
588
+        return user_name
589
+     },
590
+     changePrice(val){  
591
+       var arr = []
592
+      
593
+       for(let i=0;i<val.length;i++){
594
+         arr.push(val[i].id)
595
+       }
596
+      var str = arr.join(",")
597
+    
598
+      console.log("str",str)
599
+      this.ids = str
600
+     
601
+     },
602
+     toCheck(){
603
+      if(this.ids.length <=0){
604
+         this.$message.error("请勾选核对数据")
605
+         return
606
+       }else{
607
+         this.checkDialogVisible = true
608
+       }
609
+     },
610
+     SaveCheckedDrugPrice(){
611
+         var params = {
612
+            ids:this.ids,
613
+            check_time:this.getTime(this.check_time),
614
+            checker:this.checker,
615
+         }
616
+       console.log("params",params)
617
+       SaveCheckedDrugPrice(params).then(response=>{
618
+         if(response.data.state == 1){
619
+           this.$message.success("保存成功")
620
+           var adjustPrice = response.data.data.adjustPrice
621
+           this.checkDialogVisible = false
622
+           this.getlist()
623
+         }
624
+       })
625
+     },
626
+     toDel(index){
627
+       this.tableData.splice(index,1)
628
+     },
629
+     toEdit(row){
630
+      this.form.drug_name = row.drug_name
631
+      this.form.retail_price = row.retail_price
632
+      this.form.new_price = row.new_price
633
+      this.form.count = row.count
634
+      this.form.remark = row.remark
635
+      this.form.id = row.id
636
+      this.editPriceDialogVisible = true  
637
+     },
638
+     upatePrice(){
639
+       for(let i=0;i<this.tableData.length;i++){
640
+         if(this.form.id == this.tableData[i].id){
641
+            this.tableData[i].drug_name = this.form.drug_name
642
+            this.tableData[i].retail_price = this.form.retail_price
643
+            this.tableData[i].new_price = this.form.new_price
644
+            this.tableData[i].count = this.form.count
645
+            this.tableData[i].remark = this.form.remark
646
+         }
647
+       }
648
+       this.editPriceDialogVisible = false
649
+       this.form.drug_name = ""
650
+       this.form.retail_price = ""
651
+       this.form.new_price = ""
652
+       this.form.count = ""
653
+       this.form.remark = ""
654
+     },
655
+     modifty(id,checker_status){
656
+        if(checker_status == 1){
657
+         this.$message.error("已核对,无法编辑")
658
+         return false
233 659
         }
660
+       getDrugModiftyPrice(id).then(response=>{
661
+          if(response.data.state == 1){
662
+             var detail = response.data.data.detail
663
+             this.form.drug_name = detail.drug_name
664
+             this.form.retail_price = detail.retail_price
665
+             this.form.new_price = detail.new_price
666
+             this.form.count = detail.count
667
+             this.form.remark = detail.remark
668
+             this.id = detail.id
669
+             this.modifyPriceDialogVisible = true
670
+          }
671
+       })
672
+     },
673
+     modifyDrugPrice(){
674
+        var params = {
675
+          drug_name:this.form.drug_name,
676
+          retail_price:this.form.retail_price.toString(),
677
+          new_price:this.form.new_price.toString(),
678
+          count:parseInt(this.form.count),
679
+          remark:this.form.remark,
680
+          id:this.id
681
+        }
682
+      modifyDrugPrice(params).then(response=>{
683
+         if(response.data.state == 1){
684
+           var adjustPrice = response.data.data.adjustPrice
685
+           this.$message.success("保存成功")
686
+           this.modifyPriceDialogVisible = false
687
+         }
688
+      })
689
+     },
690
+     deleteDrugPrice(id,checker_status,index){
691
+       if(checker_status == 1){
692
+         this.$message.error("已核对,无法编辑")
693
+         return false
694
+        }
695
+        this.$confirm('是否删除所选内容?', '提示', {
696
+          confirmButtonText: '确定',
697
+          cancelButtonText: '取消',
698
+          type: 'warning'
699
+        }).then(() => {
700
+          let params = {
701
+            id:id,
702
+          }
703
+         deleteDrugPrice(params).then(response => {
704
+            if (response.data.state == 1) {
705
+              var msg = response.data.data.msg
706
+              this.$message.success("保存成功")
707
+              this.tableList.splice(index,1)
708
+            } 
709
+          })
710
+        }).catch(() => {
711
+          this.loading = false
712
+        });
713
+     },
714
+     handleSizeChange(val){
715
+       this.limit = val
716
+       this.getlist()
717
+      },
718
+     handleCurrentChange(val){
719
+        this.page = val
720
+        this.getlist()
721
+      },
722
+     toExport(){
723
+      import('@/vendor/Export2Excel').then(excel => {
724
+        const tHeader = ['药品名称','规格','单位','批次','调价数量','原进货价','新进货价','进货差价','原零售价','新零售价','零售差价',]
725
+        const filterVal = ['drug_name', '','warehousing_unit','number','count','retail_price','new_price','','new_price','']
726
+        console.log("table",this.tableList)
727
+      
728
+        const data = this.formatJson(filterVal, this.tableList)
729
+        excel.export_json_to_excel({
730
+          header: tHeader,
731
+          data,
732
+          filename: '药品调价'
733
+        })
734
+      this.downloadLoading = false
735
+     })
736
+    },
737
+    formatJson(filterVal, jsonData) {
738
+      return jsonData.map(v => filterVal.map(j => v[j]));
739
+     },
234 740
     },
235 741
     created(){
236 742
         let tableHeight = document.body.clientHeight - 200;
237 743
         this.tableHeight = tableHeight
744
+        this.getlist()
238 745
     },
239 746
     mounted() {
240 747
       const that = this;

+ 33 - 16
src/xt_pages/stock/drugs/drugModifyPricePrint.vue View File

@@ -17,7 +17,7 @@
17 17
                 </div>
18 18
                 <div class="flex">
19 19
                     <div>单据编号:</div>
20
-                    <div>打印日期:</div>
20
+                    <div>打印日期:{{nowtime}}</div>
21 21
                 </div>
22 22
                 <div class="tableTitle">
23 23
                     <div style="width:8%">货号</div>
@@ -33,19 +33,19 @@
33 33
                     <div style="width:8%">新零售价</div>
34 34
                     <div style="width:8%">零售差价</div>
35 35
                 </div>
36
-                <div class="tableTr" v-for="item in 3">
37
-                    <div style="width:8%">上三</div>
38
-                    <div style="width:8%">上三名称</div>
39
-                    <div style="width:8%">上三</div>
40
-                    <div style="width:8%">上三</div>
41
-                    <div style="width:8%">上三</div>
42
-                    <div style="width:8%">上三数量</div>
43
-                    <div style="width:8%">上三货价</div>
44
-                    <div style="width:8%">上三货价</div>
45
-                    <div style="width:8%">上三差价</div>
46
-                    <div style="width:8%">上三售价</div>
47
-                    <div style="width:8%">上三售价</div>
48
-                    <div style="width:8%">上三差价</div>
36
+                <div class="tableTr" v-for="(item,index) in this.tableData" :key="index">
37
+                    <div style="width:8%"></div>
38
+                    <div style="width:8%">{{item.drug_name}}</div>
39
+                    <div style="width:8%"></div>
40
+                    <div style="width:8%">{{item.warehousing_unit}}</div>
41
+                    <div style="width:8%">{{item.number}}</div>
42
+                    <div style="width:8%">{{item.count}}</div>
43
+                    <div style="width:8%">{{item.retail_price}}</div>
44
+                    <div style="width:8%">{{item.new_price}}</div>
45
+                    <div style="width:8%"></div>
46
+                    <div style="width:8%">{{item.retail_price}}</div>
47
+                    <div style="width:8%">{{item.new_price}}</div>
48
+                    <div style="width:8%"></div>
49 49
                 </div>
50 50
                 <div class="tableBottom">
51 51
                     <div style="width:8%">合计:</div>
@@ -56,10 +56,10 @@
56 56
                     <div style="width:8%"></div>
57 57
                     <div style="width:8%"></div>
58 58
                     <div style="width:8%"></div>
59
-                    <div style="width:8%">上三差价</div>
60 59
                     <div style="width:8%"></div>
61 60
                     <div style="width:8%"></div>
62
-                    <div style="width:8%">上三差价</div>
61
+                    <div style="width:8%"></div>
62
+                    <div style="width:8%"></div>
63 63
                 </div>
64 64
                 <div style="display:flex;margin-top:1px;float:right;margin-top:10px;">
65 65
                     <div style="width:80px;">审批:</div><div style="width:100px;"></div>
@@ -77,6 +77,7 @@
77 77
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
78 78
 const moment = require('moment');
79 79
 import { uParseTime } from '@/utils/tools'
80
+import { getModifyPricePrint } from "@/api/drug/drug"
80 81
 export default {
81 82
     components:{
82 83
         BreadCrumb
@@ -88,6 +89,9 @@ export default {
88 89
             { path: false, name: '耗材管理' },
89 90
             { path: false, name: '药品调价打印' },
90 91
           ],
92
+          ids:"",
93
+          tableData:[],
94
+          nowtime: moment(new Date()).format('YYYY-MM-DD'),
91 95
         }
92 96
     },
93 97
     methods:{
@@ -101,10 +105,23 @@ export default {
101 105
             scanStyles: false
102 106
             })
103 107
         },
108
+        getModifyPricePrint(ids){
109
+          var params = {
110
+            ids:ids,
111
+          }
112
+          getModifyPricePrint(params).then(response=>{
113
+            if(response.data.state == 1){
114
+             console.log("hhhhh",response.data.data.list)
115
+              this.tableData = response.data.data.list
116
+            }
117
+          })
118
+        }
104 119
 
105 120
 
106 121
     },
107 122
     created(){
123
+     this.ids = this.$route.query.ids
124
+     this.getModifyPricePrint(this.ids)
108 125
     }
109 126
 }
110 127
 </script>

+ 393 - 91
src/xt_pages/stock/drugs/inventory.vue View File

@@ -2,14 +2,14 @@
2 2
     <div>
3 3
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
4 4
             <div>
5
-                <el-select v-model="value" size="small" placeholder="请选择">
5
+                <!-- <el-select v-model="value" size="small" placeholder="请选择">
6 6
                     <el-option
7 7
                     v-for="item in options"
8 8
                     :key="item.value"
9 9
                     :label="item.label"
10 10
                     :value="item.value">
11 11
                     </el-option>
12
-                </el-select>
12
+                </el-select> -->
13 13
                 <el-input
14 14
                 size="small"
15 15
                 style="width: 200px;margin-left:10px;"
@@ -75,8 +75,8 @@
75 75
             <el-table-column
76 76
             label="操作">
77 77
                 <template slot-scope="scope">
78
-                    <el-button type="text" size="small">删除</el-button>
79
-                    <el-button type="text" size="small">编辑</el-button>
78
+                  <el-button type="text" size="small" >编辑</el-button>
79
+                  <el-button type="text" size="small" >删除</el-button>
80 80
                 </template>
81 81
             </el-table-column>
82 82
         </el-table>
@@ -94,129 +94,210 @@
94 94
         <el-dialog
95 95
         title="库房调价"
96 96
         :visible.sync="dialogVisible"
97
-        width="1200px"
98
-        :before-close="handleClose">
97
+        width="1200px">
99 98
             <el-form :model="form" class="modifyDialog" label-width="120px">
100 99
                 <el-form-item label="耗材ID">
101
-                    <el-input v-model="form.name"></el-input>
100
+                    <el-input v-model="form.drug_id"></el-input>
102 101
                 </el-form-item>
103 102
                 <el-form-item label="药品名称">
104
-                    <el-input v-model="form.name"></el-input>
103
+                  <el-autocomplete
104
+                    class="checkSearch"
105
+                    popper-class="my-autocomplete"
106
+                    v-model="form.drug_name"
107
+                    :fetch-suggestions="querySearchAsync"
108
+                    :trigger-on-focus="true"
109
+                    placeholder="请输入药品名称"
110
+                    @select="handleSelect"
111
+                    style="width:160px;"
112
+                  >
113
+                    <i class="el-icon-search el-input__icon" slot="suffix"></i>
114
+                  <template slot-scope="{ item }">
115
+                    <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + "  "+item.manufacturer}}</div>
116
+                  </template>
117
+                 </el-autocomplete>  
105 118
                 </el-form-item>
106 119
                 <el-form-item label="规格">
107
-                    <el-input v-model="form.name"></el-input>
120
+                    <el-input v-model="form.specification_name" :disabled="true"></el-input>
108 121
                 </el-form-item>
109 122
                 <el-form-item label="单位">
110
-                    <el-input v-model="form.name"></el-input>
123
+                    <el-input v-model="form.warehousing_unit"></el-input>
111 124
                 </el-form-item>
112 125
                 <el-form-item label="进货价">
113
-                    <el-input v-model="form.name"></el-input>
126
+                    <el-input v-model="form.last_price"></el-input>
114 127
                 </el-form-item>
115 128
                 <el-form-item label="零售价">
116
-                    <el-input v-model="form.name"></el-input>
129
+                    <el-input v-model="form.retail_price"></el-input>
117 130
                 </el-form-item>
118
-                <el-form-item label="报损数量">
119
-                    <el-input v-model="form.name"></el-input>
131
+                <el-form-item label="盘点数量">
132
+                    <el-input v-model="form.count"></el-input>
120 133
                 </el-form-item>
121 134
                 <el-form-item label="库存">
122
-                    <el-input v-model="form.name"></el-input>
135
+                    <el-input v-model="form.total" :disabled="true"></el-input>
123 136
                 </el-form-item>
124 137
                 <el-form-item label="产地">
125
-                    <el-input v-model="form.name"></el-input>
138
+                    <el-input v-model="form.drug_origin_place"></el-input>
126 139
                 </el-form-item>
127 140
                 <el-form-item label="批准文号">
128
-                    <el-input v-model="form.name"></el-input>
141
+                    <el-input v-model="form.number"></el-input>
129 142
                 </el-form-item>
130 143
                 <el-form-item label="生产厂商">
131
-                    <el-input v-model="form.name"></el-input>
144
+                    <el-input v-model="form.manufacturer"></el-input>
132 145
                 </el-form-item>
133 146
                 <el-form-item label="备注">
134 147
                     <div style="display:flex;">
135 148
                         <el-input v-model="form.name"></el-input>
136
-                        <el-button style="margin-left:5px;" type="primary">添加</el-button>
149
+                        <el-button style="margin-left:5px;" type="primary" @click="addInventory">添加</el-button>
137 150
                     </div>
138 151
                 </el-form-item>
139 152
             </el-form>
140 153
             <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
141
-                <el-table-column
142
-                prop="date"
143
-                label="耗材ID"
144
-                width="100">
154
+                <el-table-column prop="date" label="耗材ID" width="100">
155
+                    <template slot-scope="scope">
156
+                       {{scope.row.drug_id}}
157
+                    </template>
145 158
                 </el-table-column>
146
-                <el-table-column
147
-                prop="date"
148
-                label="耗材名称"
149
-                width="100">
159
+                <el-table-column prop="date" label="耗材名称" width="100">
160
+                   <template slot-scope="scope">
161
+                       {{scope.row.drug_name}}
162
+                    </template>
150 163
                 </el-table-column>
151
-                <el-table-column
152
-                prop="name"
153
-                label="规格"
154
-                width="100">
164
+                <el-table-column prop="name" label="规格" width="100">
165
+                   <template slot-scope="scope">
166
+                       {{scope.row.specification_name}}
167
+                    </template>
155 168
                 </el-table-column>
156
-                <el-table-column
157
-                prop="name"
158
-                label="单位"
159
-                width="100">
169
+                <el-table-column prop="name" label="单位" width="100">
170
+                     <template slot-scope="scope">
171
+                       {{scope.row.warehousing_unit}}
172
+                    </template>
160 173
                 </el-table-column>
161
-                <el-table-column
162
-                prop="name"
163
-                label="调价数量"
164
-                width="100">
174
+                <el-table-column prop="name"  label="盘点数量" width="100">
175
+                     <template slot-scope="scope">
176
+                       {{scope.row.count}}
177
+                    </template>
165 178
                 </el-table-column>
166
-                <el-table-column
167
-                prop="name"
168
-                label="原进货价"
169
-                width="100">
179
+                <el-table-column prop="name" label="原进货价" width="100">
180
+                   <template slot-scope="scope">
181
+                       {{scope.row.last_price}}
182
+                    </template>
170 183
                 </el-table-column>
171
-                <el-table-column
172
-                prop="name"
173
-                label="原零售价"
174
-                width="100">
184
+                <el-table-column prop="name" label="原零售价" width="100">
185
+                    <template slot-scope="scope">
186
+                       {{scope.row.retail_price}}
187
+                    </template>
175 188
                 </el-table-column>
176
-                <el-table-column
177
-                prop="name"
178
-                label="新零售价"
179
-                width="100">
189
+                <el-table-column prop="name" label="新零售价" width="100">
190
+                     <template slot-scope="scope">
191
+                       {{scope.row.new_price}}
192
+                    </template>
180 193
                 </el-table-column>
181
-                <el-table-column
182
-                prop="name"
183
-                label="生产厂商"
184
-                width="100">
194
+                <el-table-column  prop="name" label="生产厂商" width="100">
195
+                    <template slot-scope="scope">
196
+                       {{scope.row.manufacturer}}
197
+                    </template> 
185 198
                 </el-table-column>
186
-                <el-table-column
187
-                prop="name"
188
-                label="产地"
189
-                width="100">
199
+                <el-table-column prop="name" label="产地"  width="100">
200
+                  <template slot-scope="scope">
201
+                       {{scope.row.drug_origin_place}}
202
+                  </template> 
190 203
                 </el-table-column>
191
-                <el-table-column
192
-                prop="name"
193
-                label="批准文号"
194
-                width="100">
204
+                <el-table-column prop="name" label="批准文号" width="100">
205
+                 <template slot-scope="scope">
206
+                       {{scope.row.number}}
207
+                  </template> 
195 208
                 </el-table-column>
196
-                <el-table-column
197
-                prop="name"
198
-                label="备注"
199
-                width="100">
209
+                <el-table-column prop="name" label="备注" width="100">
210
+                    <template slot-scope="scope">
211
+                       {{scope.row.remark}}
212
+                    </template> 
200 213
                 </el-table-column>
201 214
                 <el-table-column
202 215
                 fixed="right"
203 216
                 width="100"
204 217
                 label="操作">
205 218
                     <template slot-scope="scope">
206
-                        <el-button type="text" size="small">删除</el-button>
207
-                        <el-button type="text" size="small">编辑</el-button>
219
+                        <el-button type="text" size="small" @click="toEdit(scope.row)">编辑</el-button>
220
+                        <el-button type="text" size="small" @click="toDelete(scope.$index)">删除</el-button>
221
+                       
208 222
                     </template>
209 223
                 </el-table-column>
210 224
             </el-table>
211 225
             <span slot="footer" class="dialog-footer">
212 226
                 <el-button @click="dialogVisible = false">取 消</el-button>
213
-                <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
227
+                <el-button type="primary" @click="saveDrugInventory">确 定</el-button>
228
+            </span>
229
+        </el-dialog>
230
+
231
+
232
+          <el-dialog
233
+            title="库房调价"
234
+            :visible.sync="editdialogVisible"
235
+            width="1200px">
236
+            <el-form :model="form" class="modifyDialog" label-width="120px">
237
+                <el-form-item label="耗材ID">
238
+                    <el-input v-model="form.drug_id"></el-input>
239
+                </el-form-item>
240
+                <el-form-item label="药品名称">
241
+                  <el-autocomplete
242
+                    class="checkSearch"
243
+                    popper-class="my-autocomplete"
244
+                    v-model="form.drug_name"
245
+                    :fetch-suggestions="querySearchAsync"
246
+                    :trigger-on-focus="true"
247
+                    placeholder="请输入药品名称"
248
+                    @select="handleSelect"
249
+                    style="width:160px;"
250
+                  >
251
+                    <i class="el-icon-search el-input__icon" slot="suffix"></i>
252
+                  <template slot-scope="{ item }">
253
+                    <div class="name">{{ item.drug_name + item.dose + item.dose_unit + "*" +item.min_number + item.min_unit +"/" + item.max_unit + "  "+item.manufacturer}}</div>
254
+                  </template>
255
+                 </el-autocomplete>  
256
+                </el-form-item>
257
+                <el-form-item label="规格">
258
+                    <el-input v-model="form.specification_name" :disabled="true"></el-input>
259
+                </el-form-item>
260
+                <el-form-item label="单位">
261
+                    <el-input v-model="form.warehousing_unit"></el-input>
262
+                </el-form-item>
263
+                <el-form-item label="进货价">
264
+                    <el-input v-model="form.last_price"></el-input>
265
+                </el-form-item>
266
+                <el-form-item label="零售价">
267
+                    <el-input v-model="form.retail_price"></el-input>
268
+                </el-form-item>
269
+                <el-form-item label="盘点数量">
270
+                    <el-input v-model="form.count"></el-input>
271
+                </el-form-item>
272
+                <el-form-item label="库存">
273
+                    <el-input v-model="form.total" :disabled="true"></el-input>
274
+                </el-form-item>
275
+                <el-form-item label="产地">
276
+                    <el-input v-model="form.drug_origin_place"></el-input>
277
+                </el-form-item>
278
+                <el-form-item label="批准文号">
279
+                    <el-input v-model="form.number"></el-input>
280
+                </el-form-item>
281
+                <el-form-item label="生产厂商">
282
+                    <el-input v-model="form.manufacturer"></el-input>
283
+                </el-form-item>
284
+                <el-form-item label="备注">
285
+                    <div style="display:flex;">
286
+                        <el-input v-model="form.remark"></el-input>
287
+                    </div>
288
+                </el-form-item>
289
+            </el-form>
290
+            <span slot="footer" class="dialog-footer">
291
+                <el-button @click="editdialogVisible = false">取 消</el-button>
292
+                <el-button type="primary" @click="saveInventory">确 定</el-button>
214 293
             </span>
215 294
         </el-dialog>
216 295
     </div>
217 296
 </template>
218 297
 
219 298
 <script>
299
+import { uParseTime } from '@/utils/tools'
300
+import { postSearchDrugWarehouseList,getDrugWarehouseInfoList,saveDrugInventory} from "@/api/drug/drug"
220 301
 export default {
221 302
     name: "drugInventory",
222 303
     data() {
@@ -224,29 +305,39 @@ export default {
224 305
             searchKey:'',
225 306
             value1:'',
226 307
             value2:'',
227
-            tableData: [{
228
-                date: '2016-05-02',
229
-                name: '王小虎',
230
-                address: '上海市普陀区金沙江路 1518 弄'
231
-                }, {
232
-                date: '2016-05-04',
233
-                name: '王小虎',
234
-                address: '上海市普陀区金沙江路 1517 弄'
235
-                }, {
236
-                date: '2016-05-01',
237
-                name: '王小虎',
238
-                address: '上海市普陀区金沙江路 1519 弄'
239
-                }, {
240
-                date: '2016-05-03',
241
-                name: '王小虎',
242
-                address: '上海市普陀区金沙江路 1516 弄'
243
-            }],
308
+            tableData: [],
244 309
             dialogVisible:false,
245
-            form: {
246
-                name: '',
310
+           form: {
311
+                id:"",
312
+                drug_name: '',
313
+                retail_price :'',
314
+                new_price:"",
315
+                count:"",
316
+                remark:"",
317
+                warehousing_order:"",
318
+                manufacturer:"",
319
+                dealer:"",
320
+                number:"",
321
+                warehousing_unit:"",
322
+                specification_name:"",
323
+                buy_price:"",
324
+                drug_id:"",
325
+                packing_unit:"",
326
+                drug_origin_place:"",
327
+                report_count:"",
328
+                total:"",
329
+                dose:"",
330
+                dose_unit:"",
331
+                min_number:"",
332
+                min_unit:"",
333
+                max_unit:"",
334
+                last_price:"",
335
+                batch_number:"",
336
+                product_date:"",
337
+                expiry_date:"",
247 338
             },
248 339
             total: 0,
249
-            
340
+            editdialogVisible:false,
250 341
         }
251 342
     },
252 343
     methods:{
@@ -258,7 +349,218 @@ export default {
258 349
             
259 350
         },
260 351
         handleSizeChange(){},
261
-        handleCurrentChange(){}
352
+        handleCurrentChange(){},
353
+        querySearchAsync(keyword, cb) {
354
+            let key = '';
355
+            if (keyword != undefined) {
356
+                key = keyword
357
+            }
358
+            postSearchDrugWarehouseList(key).then(response => {
359
+            if (response.data.state == 1) {
360
+            
361
+                var list = response.data.data.list
362
+                console.log("列表数据",list)
363
+                this.drugList = list
364
+                var manufacturerList = response.data.data.manufacturerList
365
+                this.manufacturerList = manufacturerList
366
+                var dealer =  response.data.data.dealerList
367
+                this.dealerList = dealer
368
+                for(let i=0;i<this.drugList.length;i++){
369
+                    for(let j=0;j<this.manufacturerList.length;j++){
370
+                    if(this.drugList[i].manufacturer == this.manufacturerList[j].id){
371
+                        this.drugList[i].manufacturer = this.manufacturerList[j].manufacturer_name
372
+                    }
373
+                    }
374
+                }
375
+
376
+                for(let i=0;i<this.drugList.length;i++){
377
+                    for(let j=0;j<this.dealerList.length;j++){
378
+                        if(this.drugList[i].dealer == this.dealerList[j].id){
379
+                        this.drugList[i].dealer = this.dealerList[j].dealer_name
380
+                        }
381
+                    }
382
+                }
383
+            
384
+                cb(this.drugList)
385
+            } else {
386
+                cb([])
387
+             }
388
+          })
389
+         },
390
+         handleSelect(val){
391
+            console.log("999999",val)
392
+            var params = {
393
+              id:val.drug_id
394
+            }
395
+           getDrugWarehouseInfoList(params).then(response=>{
396
+             if(response.data.state == 1){
397
+                var list =  response.data.data.list
398
+                for(let i=0;i<list.length;i++){
399
+                  list[i].stock_max_number = val.min_number * list[i].stock_max_number
400
+                }
401
+                var total = 0
402
+                for(let i=0;i<list.length;i++){
403
+                   total += (list[i].stock_max_number+list[i].stock_min_number)
404
+                }
405
+                console.log("total",total)
406
+               
407
+
408
+                console.log("库存",list)
409
+                this.form.id = val.id
410
+                this.form.drug_id = val.drug_id,
411
+                this.form.drug_name = val.drug_name
412
+                this.form.retail_price = val.retail_price
413
+                this.form.warehousing_order = val.warehousing_order
414
+                this.form.number = val.number
415
+                this.form.dealer = val.dealer
416
+                this.form.manufacturer = val.manufacturer
417
+                this.form.remark = val.remark
418
+                this.form.warehousing_unit = val.warehouseing_unit  
419
+                this.form.total = this.getTotal(total,val.max_unit,val.min_unit,val.min_number)
420
+                this.form.batch_number = val.batch_number
421
+                this.form.last_price = val.last_price
422
+                this.form.specification_name =  val.dose + val.dose_unit +"*"+val.min_number+val.min_unit+"/"+val.max_unit
423
+                this.form.expiry_date = val.expiry_date
424
+                this.form.product_date =val.product_date
425
+             }
426
+           })
427
+        },
428
+        getTime(val) {
429
+         if(val < 0){
430
+            return ""
431
+          }
432
+         if(val == ""){
433
+            return ""
434
+          }else {
435
+            return uParseTime(val, '{y}-{m}-{d}')
436
+         }
437
+        },
438
+        getTotal(total,max_unit,min_unit,min_number){
439
+            var str = ""
440
+            var min_str = ""
441
+            if(total<min_number){
442
+            str = ""
443
+            min_str = total + min_unit
444
+            }
445
+            if(total >= min_number){
446
+            if(parseInt(total/min_number)!=0){
447
+                str = parseInt(total/min_number)+ max_unit
448
+            }
449
+            if((total%min_number)!=0){
450
+                min_str =  total%min_number + min_unit
451
+            }
452
+            }
453
+        
454
+            return str + min_str
455
+        },
456
+        addInventory(){
457
+          var obj = {
458
+            drug_id:this.form.drug_id,
459
+            drug_name:this.form.drug_name,
460
+            warehousing_unit:this.form.warehousing_unit,
461
+            count:this.form.count,
462
+            retail_price:this.form.retail_price.toString(),
463
+            manufacturer:this.form.manufacturer,
464
+            drug_origin_place:this.form.drug_origin_place,
465
+            number:this.form.number,
466
+            remark:this.form.remark,
467
+            new_price:this.form.new_price.toString(),
468
+            warehousing_order:this.form.warehousing_order,
469
+            dealer:this.form.dealer,
470
+            last_price:this.form.last_price,
471
+            start_time:this.getTime(new Date()),
472
+            number:this.form.number,  
473
+            total:this.form.total,
474
+            specification_name:this.form.specification_name,
475
+            batch_number:this.form.batch_number,
476
+            expiry_date:this.form.expiry_date,
477
+            product_date:this.form.product_date
478
+         } 
479
+         this.tableData.push(obj)   
480
+        },
481
+        toDelete(index){
482
+          this.tableData.splice(index,1)
483
+        },
484
+        toEdit(val){
485
+            console.log("val2323223",val)
486
+           this.form.id= val.id
487
+           this.form.drug_id = val.drug_id,
488
+           this.form.drug_name = val.drug_name
489
+           this.form.retail_price = val.retail_price
490
+           this.form.warehousing_order = val.warehousing_order
491
+           this.form.number = val.number
492
+           this.form.dealer = val.dealer
493
+           this.form.manufacturer = val.manufacturer
494
+           this.form.remark = val.remark
495
+           this.form.warehousing_unit = val.warehouseing_unit  
496
+           this.form.total = val.total
497
+           this.form.batch_number = val.batch_number
498
+           this.form.last_price = val.last_price
499
+           this.form.specification_name =  val.specification_name
500
+           this.form.expiry_date = val.expiry_date
501
+           this.form.product_date =val.product_date  
502
+           this.form.count = val.count
503
+           this.editdialogVisible = true
504
+        },
505
+        saveInventory(){
506
+          for(let i=0;i<this.tableData.length;i++){
507
+             if(this.form.id == this.tableData[i].id){
508
+               this.tableData[i].drug_id = this.form.drug_id
509
+               this.tableData[i].drug_name = this.form.drug_name
510
+               this.tableData[i].retail_price = this.form.retail_price
511
+               this.tableData[i].warehousing_order = this.form.warehousing_order
512
+               this.tableData[i].number = this.form.number
513
+               this.tableData[i].dealer = this.form.dealer
514
+               this.tableData[i].manufacturer = this.form.manufacturer
515
+               this.tableData[i].remark = this.form.remark
516
+               this.tableData[i].warehouseing_unit = this.form.warehousing_unit
517
+               this.tableData[i].total = this.form.total
518
+               this.tableData[i].batch_number = this.form.batch_number
519
+               this.tableData[i].last_price = this.form.last_price
520
+               this.tableData[i].specification_name = this.form.specification_name
521
+               this.tableData[i].expiry_date = this.form.expiry_date
522
+               this.tableData[i].product_date = this.form.product_date
523
+               this.tableData[i].count =this.form.count
524
+             }
525
+          }   
526
+          this.editdialogVisible = false
527
+        },
528
+        saveDrugInventory(){
529
+           for(let i=0;i<this.tableData.length;i++){
530
+              this.tableData[i].retail_price = this.tableData[i].retail_price.toString()
531
+              this.tableData[i].last_price = this.tableData[i].last_price.toString()
532
+              this.tableData[i].count = parseInt(this.tableData[i].count)
533
+              if(this.tableData[i].expiry_date == undefined){
534
+                this.tableData[i].expiry_date  = 0
535
+              }else{
536
+               this.tableData[i].expiry_date = this.tableData[i].expiry_date
537
+              }
538
+              if( this.tableData[i].product_date  == undefined){
539
+                this.tableData[i].product_date = 0
540
+              }else{
541
+               this.tableData[i].product_date = this.tableData[i].product_date
542
+              }
543
+              
544
+             
545
+              if(this.tableData[i].dealer == 0){
546
+                this.tableData[i].dealer = ""
547
+              }
548
+               if(this.tableData[i].manufacturer == 0){
549
+                this.tableData[i].manufacturer = ""
550
+              }
551
+           }
552
+           var params = {
553
+              tableData:this.tableData
554
+           }
555
+           console.log("parasm222",params)
556
+          saveDrugInventory(params).then(response=>{
557
+            if(response.data.state == 1){
558
+              var msg = response.data.data.msg
559
+              this.$message.success("保存成功")
560
+              this.editdialogVisible = false
561
+            }
562
+          })
563
+        }
262 564
 
263 565
     },
264 566
     created(){

+ 1 - 17
src/xt_pages/stock/drugs/inventoryDetails.vue View File

@@ -266,23 +266,7 @@ export default {
266 266
             searchKey:'',
267 267
             value1:'',
268 268
             value2:'',
269
-            tableData: [{
270
-                date: '2016-05-02',
271
-                name: '王小虎',
272
-                address: '上海市普陀区金沙江路 1518 弄'
273
-                }, {
274
-                date: '2016-05-04',
275
-                name: '王小虎',
276
-                address: '上海市普陀区金沙江路 1517 弄'
277
-                }, {
278
-                date: '2016-05-01',
279
-                name: '王小虎',
280
-                address: '上海市普陀区金沙江路 1519 弄'
281
-                }, {
282
-                date: '2016-05-03',
283
-                name: '王小虎',
284
-                address: '上海市普陀区金沙江路 1516 弄'
285
-            }],
269
+            tableData: [],
286 270
             dialogVisible:false,
287 271
             form: {
288 272
                 name: '',

+ 319 - 26
src/xt_pages/stock/inventory.vue View File

@@ -42,12 +42,13 @@
42 42
             </div>
43 43
             <div>
44 44
                 <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
45
-                <el-button size="small" type="primary">核对</el-button>
45
+                <el-button size="small" type="primary" @click="toCheck">核对</el-button>
46 46
                 <el-button size="small" type="primary" @click="print">打印</el-button>
47
-                <el-button size="small" type="primary">导出</el-button>
47
+                <el-button size="small" type="primary" @click="exportList">导出</el-button>
48 48
             </div>
49 49
         </div>
50
-        <el-table :data="tableList" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
50
+        <el-table :data="tableList" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"  @selection-change="changePrice">>
51
+            <el-table-column type="selection" width="55" align="center"> </el-table-column>
51 52
             <el-table-column prop="date" label="盘点编号"  align="center">
52 53
               <template slot-scope="scope">
53 54
                 {{scope.row.warehousing_order}}
@@ -57,6 +58,11 @@
57 58
               <template slot-scope="scope" >
58 59
                 {{getTime(scope.row.start_time)}}
59 60
               </template>  
61
+            </el-table-column>
62
+             <el-table-column  prop="date" label="盘点数量" align="center">
63
+              <template slot-scope="scope" >
64
+                {{scope.row.count}}
65
+              </template>  
60 66
             </el-table-column>
61 67
             <el-table-column prop="name" label="盘点人" align="center">
62 68
              <template slot-scope="scope" >
@@ -81,16 +87,16 @@
81 87
             </el-table-column>
82 88
             <el-table-column label="操作" align="center">
83 89
                 <template slot-scope="scope">
84
-                    <el-button type="text" size="small">删除</el-button>
85
-                    <el-button type="text" size="small">编辑</el-button>
90
+                  <el-button type="primary" size="small" @click="getInventoryDetail(scope.row.id,scope.row.checker_status)">编辑</el-button>
91
+                  <el-button type="danger" size="small" @click="deleteInventory(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
86 92
                 </template>
87 93
             </el-table-column>
88 94
         </el-table>
89 95
         <el-pagination
90 96
             @size-change="handleSizeChange"
91 97
             @current-change="handleCurrentChange"
92
-            :page-sizes="[5, 10, 50, 100]"
93
-            :page-size="5"
98
+            :page-sizes="[10, 20, 40, 100]"
99
+            :page-size="10"
94 100
             background
95 101
             style="margin-top:20px;text-align: right"
96 102
             layout="total, sizes, prev, pager, next, jumper"
@@ -158,57 +164,57 @@
158 164
                 </el-form-item>
159 165
             </el-form>
160 166
             <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
161
-                <el-table-column prop="date" label="耗材ID" width="100">
167
+                <el-table-column prop="date" label="耗材ID" width="100" align="center">
162 168
                  <template slot-scope="scope">
163 169
                    {{scope.row.good_id}}
164 170
                  </template>
165 171
                 </el-table-column>
166
-                <el-table-column prop="date" label="耗材名称" width="100">
172
+                <el-table-column prop="date" label="耗材名称" width="100" align="center">
167 173
                  <template slot-scope="scope">
168 174
                    {{scope.row.good_name}}
169 175
                  </template>
170 176
                 </el-table-column>
171
-                <el-table-column prop="name" label="规格" width="100">
177
+                <el-table-column prop="name" label="规格" width="100" align="center">
172 178
                  <template slot-scope="scope">
173 179
                    {{scope.row.specification_name}}
174 180
                  </template>
175 181
                 </el-table-column>
176
-                <el-table-column prop="name" label="单位" width="100">
182
+                <el-table-column prop="name" label="单位" width="100" align="center">
177 183
                   <template slot-scope="scope">
178 184
                    {{scope.row.warehousing_unit}}
179 185
                  </template> 
180 186
                 </el-table-column>
181
-                <el-table-column prop="name" label="盘点数量" width="100">
187
+                <el-table-column prop="name" label="盘点数量" width="100" align="center">
182 188
                   <template slot-scope="scope">
183
-                   {{scope.row.warehousing_unit}}
189
+                   {{scope.row.count}}
184 190
                  </template> 
185 191
                 </el-table-column>
186
-                <el-table-column prop="name" label="原进货价" width="100">
192
+                <el-table-column prop="name" label="原进货价" width="100" align="center">
187 193
                     <template slot-scope="scope">
188 194
                     {{scope.row.buy_price}}
189 195
                     </template> 
190 196
                 </el-table-column>
191
-                <el-table-column prop="name" label="原零售价" width="100">
197
+                <el-table-column prop="name" label="原零售价" width="100" align="center">
192 198
                     <template slot-scope="scope">
193 199
                     {{scope.row.packing_price}}
194 200
                     </template> 
195 201
                 </el-table-column>
196
-                <el-table-column prop="name" label="生产厂商" width="100">
202
+                <el-table-column prop="name" label="生产厂商" width="100" align="center">
197 203
                     <template slot-scope="scope">
198 204
                         {{scope.row.manufacturer}}
199 205
                      </template> 
200 206
                </el-table-column>
201
-                <el-table-column  prop="name"  label="产地" width="100">
207
+                <el-table-column  prop="name"  label="产地" width="100" align="center">
202 208
                     <template slot-scope="scope">
203 209
                     {{scope.row.good_origin_place}}
204 210
                     </template> 
205 211
                 </el-table-column>
206
-                <el-table-column prop="name" label="批准文号" width="100">
212
+                <el-table-column prop="name" label="批准文号" width="100" align="center">
207 213
                    <template slot-scope="scope">
208 214
                     {{scope.row.license_number}}
209 215
                     </template> 
210 216
                 </el-table-column>
211
-                <el-table-column  prop="name" label="备注" width="100">
217
+                <el-table-column  prop="name" label="备注" width="100" align="center">
212 218
                      <template slot-scope="scope">
213 219
                       {{scope.row.remark}}
214 220
                     </template> 
@@ -218,8 +224,8 @@
218 224
                 width="100"
219 225
                 label="操作">
220 226
                     <template slot-scope="scope">
221
-                        <el-button type="text" size="small">编辑</el-button>
222
-                        <el-button type="text" size="small">删除</el-button>
227
+                        <el-button type="text" size="small" @click="toEdit(scope.row)">编辑</el-button>
228
+                        <el-button type="text" size="small" @click="toDelete(scope.$index)">删除</el-button>
223 229
                     </template>
224 230
                 </el-table-column>
225 231
             </el-table>
@@ -228,12 +234,134 @@
228 234
                 <el-button type="primary" @click="saveInventory">确 定</el-button>
229 235
             </span>
230 236
         </el-dialog>
237
+
238
+      <el-dialog
239
+        title="耗材盘点核对"
240
+        :visible.sync="checkDialogVisible"
241
+        width="30%"
242
+        >
243
+        <span>
244
+          <el-form :model="form">
245
+            <el-row>
246
+              <el-col>
247
+                <el-form-item label="核对时间">
248
+                 <el-date-picker
249
+                    size="small"
250
+                    v-model="check_time"
251
+                    type="date"
252
+                    style="margin-left:5px;width:140px;"
253
+                    placeholder="选择日期">
254
+                  </el-date-picker>
255
+                </el-form-item>  
256
+              </el-col>
257
+            </el-row>  
258
+             <el-row>
259
+              <el-col>
260
+                <el-form-item label="核对人">
261
+                  <el-select v-model="checker" placeholder="请选择">
262
+                    <el-option
263
+                    v-for="item in doctorList"
264
+                    :key="item.admin_user_id"
265
+                    :label="item.user_name"
266
+                    :value="item.admin_user_id">
267
+                    </el-option>
268
+                 </el-select>
269
+                </el-form-item>  
270
+              </el-col>
271
+            </el-row>  
272
+          </el-form>  
273
+        </span>
274
+        <span slot="footer" class="dialog-footer">
275
+            <el-button @click="checkDialogVisible = false">取 消</el-button>
276
+            <el-button type="primary" @click="SaveCheckedInventory">保 存</el-button>
277
+        </span>
278
+    </el-dialog>
279
+
280
+
281
+     <el-dialog
282
+        title="编辑"
283
+        :visible.sync="editPriceDialogVisible"
284
+        width="50%">
285
+        <span>
286
+          <el-form  :model="form">
287
+            <el-row>
288
+               <el-col>
289
+                <el-form-item label="耗材名称:">
290
+                    <el-autocomplete
291
+                        class="checkSearch"
292
+                        popper-class="my-autocomplete"
293
+                        v-model="form.good_name"
294
+                        :fetch-suggestions="querySearchAsync"
295
+                        :trigger-on-focus="true"
296
+                        placeholder="请输入耗材名称"
297
+                        @select="handleSelect"
298
+                        @input="changeGoodName(scope.$index)"
299
+                        style="width:160px;"
300
+                    >
301
+                        <i class="el-icon-search el-input__icon" slot="suffix"></i>
302
+                    <template slot-scope="{ item }">
303
+                        <div class="name">{{ item.good_name +"  " +item.specification_name + "  "+item.manufacturer }}</div>
304
+                    </template>
305
+                    </el-autocomplete>
306
+                </el-form-item>
307
+               <el-form-item label="盘点数量:">
308
+                 <el-input v-model="form.count" style="width:200px"></el-input>
309
+               </el-form-item>
310
+             </el-col> 
311
+            </el-row>
312
+            <el-row>
313
+             <el-col>
314
+                <el-form-item label="备注:">
315
+                    <div style="display:flex;">
316
+                        <el-input v-model="form.remark"  style="width:200px"></el-input>
317
+                    </div>
318
+                </el-form-item>
319
+              </el-col>  
320
+            </el-row>
321
+          </el-form>
322
+        </span>
323
+        <span slot="footer" class="dialog-footer">
324
+            <el-button @click="editPriceDialogVisible = false">取 消</el-button>
325
+            <el-button type="primary" @click="upateInventory">保存</el-button>
326
+        </span>
327
+    </el-dialog>
328
+
329
+
330
+       <el-dialog
331
+        title="编辑"
332
+        :visible.sync="modefiyePriceDialogVisible"
333
+        width="50%">
334
+        <span>
335
+          <el-form  :model="form">
336
+            <el-row>
337
+               <el-col>
338
+               <el-form-item label="盘点数量:">
339
+                 <el-input v-model="form.count" style="width:200px"></el-input>
340
+               </el-form-item>
341
+             </el-col> 
342
+            </el-row>
343
+            <el-row>
344
+             <el-col>
345
+                <el-form-item label="备注:">
346
+                    <div style="display:flex;">
347
+                        <el-input v-model="form.remark"  style="width:200px"></el-input>
348
+                    </div>
349
+                </el-form-item>
350
+              </el-col>  
351
+            </el-row>
352
+          </el-form>
353
+        </span>
354
+        <span slot="footer" class="dialog-footer">
355
+            <el-button @click="modefiyePriceDialogVisible = false">取 消</el-button>
356
+            <el-button type="primary" @click="modifyInventory">保存</el-button>
357
+        </span>
358
+    </el-dialog>
231 359
     </div>
232 360
 </template>
233 361
 
234 362
 <script> 
235 363
 import { uParseTime } from '@/utils/tools'
236
-import { postSearchGoodWarehouseList,saveInventory,getInventoryList } from "@/api/stock"
364
+import { postSearchGoodWarehouseList,saveInventory,getInventoryList,SaveCheckedInventory,getInventoryDetail,modifyInventory,deleteInventory } from "@/api/stock"
237 365
 export default {
238 366
     name: "inventory",
239 367
     data() {
@@ -243,9 +371,6 @@ export default {
243 371
             value2:'',
244 372
             tableData: [],
245 373
             dialogVisible:false,
246
-            form: {
247
-                name: '',
248
-            },
249 374
             total: 0,
250 375
             inventoryList:[
251 376
               {id:0,name:"全部"},
@@ -285,6 +410,13 @@ export default {
285 410
          doctorList:[],
286 411
          total:0,
287 412
          tableList:[],
413
+         ids:"",
414
+         checker:this.$store.getters.xt_user.user.id,
415
+         check_time:new Date(),
416
+         checkDialogVisible:false,
417
+         editPriceDialogVisible:false,
418
+         modefiyePriceDialogVisible:false,
419
+         id:0,
288 420
         }
289 421
     },
290 422
     methods:{
@@ -349,7 +481,12 @@ export default {
349 481
 
350 482
         },
351 483
         print(){
352
-            this.$router.push({path:'/stock/stockModifyPricePrint'})   
484
+          if(this.ids == ""){
485
+            this.$message.error("请勾选打印数据")
486
+            return
487
+          }else{
488
+           this.$router.push({path:'/stock/inventoryPrint?ids='+this.ids})   
489
+          } 
353 490
         },
354 491
        getTime(val) {
355 492
          if(val < 0){
@@ -389,6 +526,15 @@ export default {
389 526
            this.tableData.push(obj)
390 527
         },
391 528
       saveInventory(){
529
+        for(let i=0;i<this.tableData.length;i++){
530
+          this.tableData[i].count = parseInt(this.tableData[i].count)
531
+          if(this.tableData[i].manufacturer == 0){
532
+            this.tableData[i].manufacturer = ""
533
+          }
534
+          if(this.tableData[i].dealer == 0){
535
+            this.tableData[i].dealer = ""
536
+          }
537
+        }
392 538
         var params = {
393 539
          tableData:this.tableData,
394 540
         }  
@@ -429,6 +575,153 @@ export default {
429 575
        }
430 576
        return name
431 577
      },
578
+    toCheck(){
579
+      if(this.ids.length <=0){
580
+         this.$message.error("请勾选核对数据")
581
+         return
582
+       }else{
583
+         this.checkDialogVisible = true
584
+       }
585
+     },
586
+    changePrice(val){  
587
+       var arr = []
588
+      
589
+       for(let i=0;i<val.length;i++){
590
+         arr.push(val[i].id)
591
+       }
592
+      var str = arr.join(",")
593
+    
594
+      console.log("str",str)
595
+      this.ids = str
596
+     
597
+     },
598
+     SaveCheckedInventory(){
599
+         var params = {
600
+            ids:this.ids,
601
+            check_time:this.getTime(this.check_time),
602
+            checker:this.checker,
603
+         }
604
+       console.log("params",params)
605
+       SaveCheckedInventory(params).then(response=>{
606
+         if(response.data.state == 1){
607
+           this.$message.success("保存成功")
608
+           var inventory = response.data.data.inventory
609
+           this.checkDialogVisible = false
610
+           this.getlist()
611
+         }
612
+       })
613
+     },
614
+      toDelete(index){
615
+       this.tableData.splice(index,1)
616
+     },
617
+     toEdit(row){
618
+      this.form.good_name = row.good_name
619
+      this.form.count = row.count
620
+      this.form.remark = row.remark
621
+      this.form.id = row.id
622
+      this.editPriceDialogVisible = true  
623
+     },
624
+     upateInventory(){
625
+       for(let i=0;i<this.tableData.length;i++){
626
+         if(this.form.id == this.tableData[i].id){
627
+            this.tableData[i].good_name = this.form.good_name
628
+            // this.tableData[i].packing_price = this.form.packing_price
629
+            this.tableData[i].count = this.form.count
630
+            this.tableData[i].remark = this.form.remark
631
+         }
632
+       }
633
+       this.editPriceDialogVisible = false
634
+       this.form.good_name = ""
635
+      //  this.form.packing_price = ""
636
+       this.form.count = ""
637
+       this.form.remark = ""
638
+     },
639
+     getInventoryDetail(id,check_status){
640
+        if(check_status == 1){
641
+          this.$message.error("已核对的不能编辑")
642
+          return
643
+        }
644
+       getInventoryDetail(id).then(response=>{
645
+          if(response.data.state == 1){
646
+            var detail =  response.data.data.detail
647
+            console.log("detial",detail)
648
+            this.form.count = detail.count
649
+            this.form.remark = detail.remark
650
+            this.id = detail.id
651
+            this.modefiyePriceDialogVisible = true
652
+
653
+          }
654
+       })
655
+     },
656
+     modifyInventory(){
657
+         var params = {
658
+           id:this.id,
659
+           count:parseInt(this.form.count),
660
+           remark:this.form.remark,
661
+         }
662
+       modifyInventory(params).then(response=>{
663
+          if(response.data.state == 1){
664
+            var inventory =  response.data.data.inventory
665
+            this.$message.success("保存成功")
666
+            this.modefiyePriceDialogVisible = false
667
+            this.getlist()
668
+          }
669
+       })
670
+     },
671
+     deleteInventory(id,check_status,index){
672
+        if(check_status == 1){
673
+          this.$message.error("已核对的不能编辑")
674
+          return
675
+        }
676
+        this.$confirm('是否删除所选内容?', '提示', {
677
+          confirmButtonText: '确定',
678
+          cancelButtonText: '取消',
679
+          type: 'warning'
680
+        }).then(() => {
681
+          let params = {
682
+            id:id,
683
+          }
684
+       deleteInventory(params).then(response => {
685
+            if (response.data.state == 1) {
686
+              var msg = response.data.data.msg
687
+              this.$message.success("保存成功")
688
+              this.tableList.splice(index,1)
689
+            } 
690
+          })
691
+        }).catch(() => {
692
+          this.loading = false
693
+        });
694
+     },
695
+      exportList(){
696
+       
697
+         import('@/vendor/Export2Excel').then(excel => {
698
+         const tHeader = ['盘点编码', '盘点日期', '盘点数量','盘点人','审核日期','核对人','状态']
699
+         const filterVal = ['warehousing_order', 'start_time', 'count','user_name','check_time','checker','checker_status']
700
+       
701
+          for(let i=0;i<this.tableList.length;i++){
702
+           this.tableList[i].start_time = this.getTime(this.tableList[i].start_time)
703
+           this.tableList[i].check_time =  this.getTime(this.tableList[i].check_time)
704
+           this.tableList[i].checker = this.getChecker(this.tableList[i].checker)
705
+           if(this.tableList[i].checker_status == 1){
706
+             this.tableList[i].checker_status = "已核对"
707
+           }
708
+          if(this.tableList[i].checker_status == 2){
709
+             this.tableList[i].checker_status = "未核对"
710
+           }
711
+         }
712
+         const data = this.formatJson(filterVal, this.tableList)
713
+      
714
+         excel.export_json_to_excel({
715
+           header: tHeader,
716
+           data,
717
+           filename: '耗材盘点'
718
+         })
719
+          this.downloadLoading = false
720
+        })
721
+       },
722
+       formatJson(filterVal, jsonData) {
723
+        return jsonData.map(v => filterVal.map(j => v[j]));
724
+      },
432 725
     },
433 726
     created(){
434 727
       this.getlist()

+ 125 - 0
src/xt_pages/stock/inventoryDetailPrint.vue View File

@@ -0,0 +1,125 @@
1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        <el-row style="float:right;">
6
+            <el-col :span="24">
7
+            <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
8
+            </el-col>
9
+        </el-row>
10
+        </div>
11
+        <div class="app-container" style="background-color: white;">
12
+            <div id="print_content">
13
+                <div class="printTitle">库存盘点核单数</div>
14
+                <div style="float:right;">调价日期:{{getTime(this.tableData[0].start_time)}}</div>
15
+                <table class="printTable" border="1">
16
+                    <tr>
17
+                        <td>序号</td>
18
+                        <td>耗材名称</td>
19
+                        <td>规格</td>
20
+                        <td>单位</td>
21
+                        <td>零售价</td>
22
+                        <td>当前库存</td>
23
+                        <td>盘点数</td>
24
+                        <td>亏损金额</td>
25
+                    </tr>
26
+                    <tr v-for="(item,index) in tableData" :key="index">
27
+                        <td>{{index+1}}</td>
28
+                        <td>{{item.good_name}}</td>
29
+                        <td>{{item.specification_name}}</td>
30
+                        <td>{{item.warehousing_unit}}</td>
31
+                        <td>{{item.packing_price}}</td>
32
+                        <td></td>
33
+                        <td>{{item.count}}</td>
34
+                        <td></td>
35
+                    </tr>
36
+                </table>
37
+                <div style="margin-top:10px;">
38
+                    <span>合计:库存金额</span>
39
+                    <span>    库存盘点金额:亏损总计</span>
40
+                </div>
41
+                <div style="display:flex;float:right;margin-top:10px;border-top:1px solid #000;padding-top:10px;width:100%;">
42
+                    <div style="width:80px;">审批:</div><div style="width:100px;"></div>
43
+                    <div style="width:100px;">药材主任:</div><div style="width:60px;"></div>
44
+                    <div style="width:50px;">会计:</div><div style="width:100px;"></div>
45
+                    <div style="width:50px;">审核:</div><div style="width:100px;"></div>
46
+                    <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
47
+                </div>
48
+            </div>
49
+        </div>
50
+    </div>
51
+</template>
52
+
53
+<script>
54
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
55
+const moment = require('moment');
56
+import { uParseTime } from '@/utils/tools'
57
+import { getInventoryDetailPrintList } from "@/api/stock"
58
+export default {
59
+    components:{
60
+        BreadCrumb
61
+    },
62
+    data(){
63
+        return{
64
+          crumbs: [
65
+            { path: false, name: '库存管理' },
66
+            { path: false, name: '耗材管理' },
67
+            { path: false, name: '耗材盘点打印' },
68
+          ],
69
+          ids:"",
70
+          tableData:[],
71
+        }
72
+    },
73
+    methods:{
74
+        printAction: function() {
75
+            const style = '@media print { .printTitle{font-size: 22px;text-align: center;}.flex{display: flex;justify-content: space-between;}.tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}.tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}.tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}.printTable td{padding:5px;} }';
76
+            printJS({
77
+            printable: 'print_content',
78
+            type: 'html',
79
+            documentTitle: '  ',
80
+            style: style,
81
+            scanStyles: false
82
+            })
83
+        },
84
+        
85
+        getInventoryDetailPrintList(){
86
+            var params = {
87
+                ids:this.ids,
88
+            }
89
+         getInventoryDetailPrintList(params).then(response=>{
90
+           if(response.data.state == 1){
91
+             var list = response.data.data.list
92
+             console.log("list",list)
93
+             this.tableData = list
94
+           }
95
+         })
96
+        },
97
+        getTime(val) {
98
+         if(val < 0){
99
+            return ""
100
+          }
101
+         if(val == ""){
102
+            return ""
103
+          }else {
104
+            return uParseTime(val, '{y}-{m}-{d}')
105
+         }
106
+        },
107
+
108
+    },
109
+    created(){
110
+      this.ids = this.$route.query.ids
111
+      this.getInventoryDetailPrintList()
112
+    }
113
+}
114
+</script>
115
+
116
+
117
+<style rel="stylesheet/scss" lang="scss" scoped>
118
+.printTitle{font-size: 22px;text-align: center;}
119
+.flex{display: flex;justify-content: space-between;}
120
+.tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}
121
+.tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}
122
+.tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}
123
+.printTable{width:100%;border-collapse: collapse;}
124
+.printTable td{padding:5px;}
125
+</style>

+ 109 - 220
src/xt_pages/stock/inventoryDetails.vue View File

@@ -2,7 +2,7 @@
2 2
     <div>
3 3
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
4 4
             <div>
5
-                耗材类别:
5
+                <!-- 耗材类别:
6 6
                 <el-select v-model="value" size="small" placeholder="请选择">
7 7
                     <el-option
8 8
                     v-for="item in options"
@@ -10,8 +10,8 @@
10 10
                     :label="item.label"
11 11
                     :value="item.value">
12 12
                     </el-option>
13
-                </el-select>
14
-                停用状态:
13
+                </el-select> -->
14
+                <!-- 停用状态:
15 15
                 <el-select v-model="value" size="small" placeholder="请选择">
16 16
                     <el-option
17 17
                     v-for="item in options"
@@ -19,7 +19,7 @@
19 19
                     :label="item.label"
20 20
                     :value="item.value">
21 21
                     </el-option>
22
-                </el-select>
22
+                </el-select> -->
23 23
                 <el-input
24 24
                 size="small"
25 25
                 style="width: 200px;margin-left:10px;"
@@ -38,227 +38,84 @@
38 38
             </div>
39 39
             <div>
40 40
                 <el-button size="small" type="primary" @click="print">打印</el-button>
41
-                <el-button size="small" type="primary">导出</el-button>
41
+                <el-button size="small" type="primary" @click="exportList">导出</el-button>
42 42
             </div>
43 43
         </div>
44
-        <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
45
-            <el-table-column
46
-            prop="date"
47
-            label="耗材名称"
48
-            width="100">
49
-            </el-table-column>
50
-            <el-table-column
51
-            prop="date"
52
-            label="类别"
53
-            width="100">
54
-            </el-table-column>
55
-            <el-table-column
56
-            prop="name"
57
-            label="规格"
58
-            width="100">
59
-            </el-table-column>
60
-            <el-table-column
61
-            prop="name"
62
-            label="单位"
63
-            width="100">
44
+        <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }" @selection-change="changePrice">
45
+            <el-table-column type="selection" width="55" align="center"> </el-table-column>
46
+            <el-table-column prop="date" label="耗材名称"  width="100" align="center">
47
+                <template slot-scope="scope">
48
+                  {{scope.row.good_name}}
49
+                </template>
64 50
             </el-table-column>
65
-            <el-table-column
66
-            prop="name"
67
-            label="库存数量"
68
-            width="100">
51
+            <!-- <el-table-column prop="date" label="类别" width="100">
52
+            </el-table-column> -->
53
+            <el-table-column prop="name" label="规格" width="100" align="center">
54
+               <template slot-scope="scope">
55
+                  {{scope.row.specification_name}}
56
+                </template>
69 57
             </el-table-column>
70
-            <el-table-column
71
-            prop="name"
72
-            label="进价"
73
-            width="100">
58
+            <el-table-column prop="name" label="单位" width="100" align="center">
59
+                <template slot-scope="scope">
60
+                  {{scope.row.warehousing_unit}}
61
+                </template>
74 62
             </el-table-column>
75
-            <el-table-column
76
-            prop="name"
77
-            label="零售价"
78
-            width="100">
63
+            <el-table-column prop="name" label="库存数量" width="100" align="center">
64
+              <template slot-scope="scope">
65
+                  {{scope.row.total}}
66
+                </template>
79 67
             </el-table-column>
80
-            <el-table-column
81
-            prop="name"
82
-            label="零售总价"
83
-            width="100">
68
+            <el-table-column prop="name" label="进价" width="100" align="center">
69
+              <template slot-scope="scope">
70
+                {{scope.row.buy_price}}
71
+             </template>
84 72
             </el-table-column>
85
-            <el-table-column
86
-            prop="name"
87
-            label="产地"
88
-            width="100">
73
+            <el-table-column prop="name" label="零售价" width="100" align="center">
74
+                <template slot-scope="scope">
75
+                 {{scope.row.packing_price}}
76
+                </template>
89 77
             </el-table-column>
90
-            <el-table-column
91
-            prop="name"
92
-            label="生产厂商"
93
-            width="100">
78
+            <el-table-column prop="name"  label="零售总价"  width="100" align="center">
79
+                <template slot-scope="scope">
80
+                  {{scope.row.total * scope.row.packing_price}}
81
+                </template>
94 82
             </el-table-column>
95
-            <el-table-column
96
-            prop="name"
97
-            label="实盘点"
98
-            width="100">
83
+            <!-- <el-table-column prop="name" label="产地"  width="100">
84
+              {{scope.row.now_g}}
85
+            </el-table-column> -->
86
+            <el-table-column  prop="name" label="生产厂商" width="100" align="center">
87
+              <template slot-scope="scope">
88
+                {{scope.row.manufacturer}}
89
+             </template>
99 90
             </el-table-column>
100
-            <el-table-column
101
-            prop="name"
102
-            label="亏损价格"
103
-            width="100">
91
+            <el-table-column prop="name" label="实盘点"  width="100" align="center">
92
+                <template slot-scope="scope">
93
+                    {{scope.row.count}}
94
+                </template>
104 95
             </el-table-column>
105
-            <el-table-column
106
-            prop="name"
107
-            label="生产日期"
108
-            width="100">
96
+            <el-table-column  prop="name" label="亏损价格" width="100" align="center">
109 97
             </el-table-column>
110
-            <el-table-column
111
-            prop="name"
112
-            label="有效日期"
113
-            width="100">
98
+            <el-table-column prop="name" label="生产日期" width="100" align="center">
114 99
             </el-table-column>
115
-            <el-table-column
116
-            fixed="right"
117
-            width="100"
118
-            label="操作">
119
-                <template slot-scope="scope">
120
-                    <el-button type="text" size="small">删除</el-button>
121
-                    <el-button type="text" size="small">编辑</el-button>
122
-                </template>
100
+            <el-table-column  prop="name" label="有效日期" width="100" align="center">
123 101
             </el-table-column>
124 102
         </el-table>
125 103
         <el-pagination
126 104
             @size-change="handleSizeChange"
127 105
             @current-change="handleCurrentChange"
128
-            :page-sizes="[5, 10, 50, 100]"
129
-            :page-size="5"
106
+            :page-sizes="[10, 20, 40, 100]"
107
+            :page-size="10"
130 108
             background
131 109
             style="margin-top:20px;text-align: right"
132 110
             layout="total, sizes, prev, pager, next, jumper"
133 111
             :total="total"
134 112
         >
135 113
         </el-pagination>
136
-        <el-dialog
137
-        title="库房调价"
138
-        :visible.sync="dialogVisible"
139
-        width="1200px"
140
-        :before-close="handleClose">
141
-            <el-form :model="form" class="modifyDialog" label-width="120px">
142
-                <el-form-item label="耗材ID">
143
-                    <el-input v-model="form.name"></el-input>
144
-                </el-form-item>
145
-                <el-form-item label="药品名称">
146
-                    <el-input v-model="form.name"></el-input>
147
-                </el-form-item>
148
-                <el-form-item label="规格">
149
-                    <el-input v-model="form.name"></el-input>
150
-                </el-form-item>
151
-                <el-form-item label="单位">
152
-                    <el-input v-model="form.name"></el-input>
153
-                </el-form-item>
154
-                <el-form-item label="进货价">
155
-                    <el-input v-model="form.name"></el-input>
156
-                </el-form-item>
157
-                <el-form-item label="零售价">
158
-                    <el-input v-model="form.name"></el-input>
159
-                </el-form-item>
160
-                <el-form-item label="报损数量">
161
-                    <el-input v-model="form.name"></el-input>
162
-                </el-form-item>
163
-                <el-form-item label="库存">
164
-                    <el-input v-model="form.name"></el-input>
165
-                </el-form-item>
166
-                <el-form-item label="产地">
167
-                    <el-input v-model="form.name"></el-input>
168
-                </el-form-item>
169
-                <el-form-item label="批准文号">
170
-                    <el-input v-model="form.name"></el-input>
171
-                </el-form-item>
172
-                <el-form-item label="生产厂商">
173
-                    <el-input v-model="form.name"></el-input>
174
-                </el-form-item>
175
-                <el-form-item label="备注">
176
-                    <div style="display:flex;">
177
-                        <el-input v-model="form.name"></el-input>
178
-                        <el-button style="margin-left:5px;" type="primary">添加</el-button>
179
-                    </div>
180
-                </el-form-item>
181
-            </el-form>
182
-            <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
183
-                <el-table-column
184
-                prop="date"
185
-                label="耗材ID"
186
-                width="100">
187
-                </el-table-column>
188
-                <el-table-column
189
-                prop="date"
190
-                label="耗材名称"
191
-                width="100">
192
-                </el-table-column>
193
-                <el-table-column
194
-                prop="name"
195
-                label="规格"
196
-                width="100">
197
-                </el-table-column>
198
-                <el-table-column
199
-                prop="name"
200
-                label="单位"
201
-                width="100">
202
-                </el-table-column>
203
-                <el-table-column
204
-                prop="name"
205
-                label="调价数量"
206
-                width="100">
207
-                </el-table-column>
208
-                <el-table-column
209
-                prop="name"
210
-                label="原进货价"
211
-                width="100">
212
-                </el-table-column>
213
-                <el-table-column
214
-                prop="name"
215
-                label="原零售价"
216
-                width="100">
217
-                </el-table-column>
218
-                <el-table-column
219
-                prop="name"
220
-                label="新零售价"
221
-                width="100">
222
-                </el-table-column>
223
-                <el-table-column
224
-                prop="name"
225
-                label="生产厂商"
226
-                width="100">
227
-                </el-table-column>
228
-                <el-table-column
229
-                prop="name"
230
-                label="产地"
231
-                width="100">
232
-                </el-table-column>
233
-                <el-table-column
234
-                prop="name"
235
-                label="批准文号"
236
-                width="100">
237
-                </el-table-column>
238
-                <el-table-column
239
-                prop="name"
240
-                label="备注"
241
-                width="100">
242
-                </el-table-column>
243
-                <el-table-column
244
-                fixed="right"
245
-                width="100"
246
-                label="操作">
247
-                    <template slot-scope="scope">
248
-                        <el-button type="text" size="small">删除</el-button>
249
-                        <el-button type="text" size="small">编辑</el-button>
250
-                    </template>
251
-                </el-table-column>
252
-            </el-table>
253
-            <span slot="footer" class="dialog-footer">
254
-                <el-button @click="dialogVisible = false">取 消</el-button>
255
-                <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
256
-            </span>
257
-        </el-dialog>
258 114
     </div>
259 115
 </template>
260 116
 
261 117
 <script>
118
+import { getInventoryDetailList } from "@/api/stock"
262 119
 export default {
263 120
     name: "inventory",
264 121
     data() {
@@ -266,44 +123,76 @@ export default {
266 123
             searchKey:'',
267 124
             value1:'',
268 125
             value2:'',
269
-            tableData: [{
270
-                date: '2016-05-02',
271
-                name: '王小虎',
272
-                address: '上海市普陀区金沙江路 1518 弄'
273
-                }, {
274
-                date: '2016-05-04',
275
-                name: '王小虎',
276
-                address: '上海市普陀区金沙江路 1517 弄'
277
-                }, {
278
-                date: '2016-05-01',
279
-                name: '王小虎',
280
-                address: '上海市普陀区金沙江路 1519 弄'
281
-                }, {
282
-                date: '2016-05-03',
283
-                name: '王小虎',
284
-                address: '上海市普陀区金沙江路 1516 弄'
285
-            }],
126
+            tableData: [],
286 127
             dialogVisible:false,
287 128
             form: {
288 129
                 name: '',
289 130
             },
290 131
             total: 0,
291
-            
292
-        }
132
+            limit:10,
133
+            page:1,
134
+            ids:"",
135
+         }
293 136
     },
294 137
     methods:{
295 138
         search(){
296 139
 
297 140
         },
298 141
         print(){
299
-            this.$router.push({path:'/stock/inventoryPrint'})
300
-            
142
+           if(this.ids == ""){
143
+             this.$message.error("请勾选打印数据")
144
+             return false
145
+           }
146
+          this.$router.push({path:'/stock/inventoryDetailPrint?ids='+this.ids})
301 147
         },
302 148
         handleSizeChange(){},
303
-        handleCurrentChange(){}
304
-
149
+        handleCurrentChange(){},
150
+        getlist(){
151
+         var params = {
152
+            keyword:this.searchKey,
153
+            limit:this.limit,
154
+            page:this.page,
155
+          }
156
+          getInventoryDetailList(params).then(response=>{
157
+             if(response.data.state == 1){
158
+               var list =  response.data.data.list
159
+               this.tableData = list
160
+               this.total = response.data.data.total
161
+             }
162
+          })
163
+        },
164
+      changePrice(val){  
165
+        console.log("val2323323322323",val)
166
+        var arr = []
167
+        for(let i=0;i<val.length;i++){
168
+            arr.push(val[i].id)
169
+        }
170
+        var str = arr.join(",")
171
+        
172
+        console.log("str",str)
173
+        this.ids = str  
174
+     },
175
+      exportList(){
176
+       
177
+         import('@/vendor/Export2Excel').then(excel => {
178
+         const tHeader = ['耗材名称', '规格', '单位','零售价','当前库存','盘点数','亏损金额']
179
+         const filterVal = ['good_name', 'specification_name', 'warehousing_unit','packing_price','total','count','']
180
+         const data = this.formatJson(filterVal, this.tableData)
181
+      
182
+         excel.export_json_to_excel({
183
+           header: tHeader,
184
+           data,
185
+           filename: '耗材盘点明细'
186
+         })
187
+          this.downloadLoading = false
188
+        })
189
+       },
190
+       formatJson(filterVal, jsonData) {
191
+        return jsonData.map(v => filterVal.map(j => v[j]));
192
+      },
305 193
     },
306 194
     created(){
195
+      this.getlist()
307 196
     },
308 197
     mounted() {
309 198
     },

+ 35 - 9
src/xt_pages/stock/inventoryPrint.vue View File

@@ -11,7 +11,7 @@
11 11
         <div class="app-container" style="background-color: white;">
12 12
             <div id="print_content">
13 13
                 <div class="printTitle">库存盘点核单数</div>
14
-                <div style="float:right;">调价日期:</div>
14
+                <div style="float:right;">调价日期:{{getTime(this.tableData[0].start_time)}}</div>
15 15
                 <table class="printTable" border="1">
16 16
                     <tr>
17 17
                         <td>序号</td>
@@ -23,14 +23,14 @@
23 23
                         <td>盘点数</td>
24 24
                         <td>亏损金额</td>
25 25
                     </tr>
26
-                    <tr v-for="item in 3">
27
-                        <td></td>
28
-                        <td></td>
29
-                        <td></td>
30
-                        <td></td>
31
-                        <td></td>
32
-                        <td></td>
26
+                    <tr v-for="(item,index) in tableData" :key="index">
27
+                        <td>{{index+1}}</td>
28
+                        <td>{{item.good_name}}</td>
29
+                        <td>{{item.specification_name}}</td>
30
+                        <td>{{item.warehousing_unit}}</td>
31
+                        <td>{{item.packing_price}}</td>
33 32
                         <td></td>
33
+                        <td>{{item.count}}</td>
34 34
                         <td></td>
35 35
                     </tr>
36 36
                 </table>
@@ -54,6 +54,7 @@
54 54
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
55 55
 const moment = require('moment');
56 56
 import { uParseTime } from '@/utils/tools'
57
+import { getInventoryPrintList } from "@/api/stock"
57 58
 export default {
58 59
     components:{
59 60
         BreadCrumb
@@ -65,6 +66,8 @@ export default {
65 66
             { path: false, name: '耗材管理' },
66 67
             { path: false, name: '耗材盘点打印' },
67 68
           ],
69
+          ids:"",
70
+          tableData:[],
68 71
         }
69 72
     },
70 73
     methods:{
@@ -78,10 +81,33 @@ export default {
78 81
             scanStyles: false
79 82
             })
80 83
         },
81
-
84
+        
85
+        getInventoryPrintList(){
86
+            var params = {
87
+                ids:this.ids,
88
+            }
89
+         getInventoryPrintList(params).then(response=>{
90
+           if(response.data.state == 1){
91
+             var list = response.data.data.list
92
+             this.tableData = list
93
+           }
94
+         })
95
+        },
96
+        getTime(val) {
97
+         if(val < 0){
98
+            return ""
99
+          }
100
+         if(val == ""){
101
+            return ""
102
+          }else {
103
+            return uParseTime(val, '{y}-{m}-{d}')
104
+         }
105
+        },
82 106
 
83 107
     },
84 108
     created(){
109
+      this.ids  = this.$route.query.ids
110
+      this.getInventoryPrintList()
85 111
     }
86 112
 }
87 113
 </script>

+ 143 - 0
src/xt_pages/stock/stockDamagePrint.vue View File

@@ -0,0 +1,143 @@
1
+<template>
2
+    <div class="main-contain">
3
+        <div class="position">
4
+        <bread-crumb :crumbs="crumbs"></bread-crumb>
5
+        <el-row style="float:right;">
6
+            <el-col :span="24">
7
+            <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
8
+            </el-col>
9
+        </el-row>
10
+        </div>
11
+        <div class="app-container" style="background-color: white;" v-for="(item,index) in tableList">
12
+            <div id="print_content">
13
+                <div class="printTitle">耗材报损登记单</div>
14
+                <div class="flex">
15
+                    <div>药库类别:</div>
16
+                    <div>报损日期:{{getTime(item.start_time)}}</div>
17
+                </div>
18
+                <div class="flex">
19
+                    <div>单据编号:{{item.warehousing_order}}</div>
20
+                    <div>打印日期:{{nowtime}}</div>
21
+                </div>
22
+                <div class="tableTitle">
23
+                    <div style="width:8%">货号</div>
24
+                    <div style="width:8%">耗材名称</div>
25
+                    <div style="width:8%">规格</div>
26
+                    <div style="width:8%">单位</div>
27
+                    <div style="width:8%">批次</div>
28
+                    <div style="width:8%">报损数量</div>
29
+                    <div style="width:8%">进货价</div>
30
+                    <div style="width:8%">进货金额</div>
31
+                    <div style="width:8%">零售价</div>
32
+                    <div style="width:8%">零售金额</div>
33
+                </div>
34
+                <div class="tableTr">
35
+                    <div style="width:8%"></div>
36
+                    <div style="width:8%">{{item.good_name}}</div>
37
+                    <div style="width:8%">{{item.specification_name}}</div>
38
+                    <div style="width:8%">{{item.warehousing_unit}}</div>
39
+                    <div style="width:8%">{{item.license_number}}</div>
40
+                    <div style="width:8%">{{item.count}}</div>
41
+                    <div style="width:8%">{{item.buy_price}}</div>
42
+                    <div style="width:8%">{{item.buy_price}}</div>
43
+                    <div style="width:8%">{{item.packing_price}}</div>
44
+                    <div style="width:8%">{{item.packing_price}}</div>
45
+                </div>
46
+                <div class="tableBottom">
47
+                    <div style="width:8%">合计:</div>
48
+                    <div style="width:8%"></div>
49
+                    <div style="width:8%"></div>
50
+                    <div style="width:8%"></div>
51
+                    <div style="width:8%"></div>
52
+                    <div style="width:8%"></div>
53
+                    <div style="width:8%"></div>
54
+                    <div style="width:8%"></div>
55
+                    <div style="width:8%">{{item.buy_price}}</div>
56
+                    <div style="width:8%"></div>
57
+                    <div style="width:8%"></div>
58
+                    <div style="width:8%">{{item.buy_price *item.count}}</div>
59
+                </div>
60
+                <div style="display:flex;margin-top:1px;float:right;margin-top:10px;">
61
+                    <div style="width:80px;">审批:</div><div style="width:100px;"></div>
62
+                    <div style="width:100px;">药材主任:</div><div style="width:60px;"></div>
63
+                    <div style="width:50px;">会计:</div><div style="width:100px;"></div>
64
+                    <div style="width:50px;">审核:</div><div style="width:100px;"></div>
65
+                    <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
66
+                </div>
67
+            </div>
68
+        </div>
69
+    </div>
70
+</template>
71
+
72
+<script>
73
+import BreadCrumb from '@/xt_pages/components/bread-crumb'
74
+const moment = require('moment');
75
+import { uParseTime } from '@/utils/tools'
76
+import { getStockDamageById} from "@/api/stock"
77
+
78
+export default {
79
+    components:{
80
+        BreadCrumb
81
+    },
82
+    data(){
83
+        return{
84
+          crumbs: [
85
+            { path: false, name: '库存管理' },
86
+            { path: false, name: '耗材管理' },
87
+            { path: false, name: '耗材调价打印' },
88
+          ],
89
+          tableList:[],
90
+          nowtime: moment(new Date()).format('YYYY-MM-DD'),
91
+        }
92
+    },
93
+    methods:{
94
+        printAction: function() {
95
+            const style = '@media print { .printTitle{font-size: 22px;text-align: center;}.flex{display: flex;justify-content: space-between;}.tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}.tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}.tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;} }';
96
+            printJS({
97
+            printable: 'print_content',
98
+            type: 'html',
99
+            documentTitle: '  ',
100
+            style: style,
101
+            scanStyles: false
102
+            })
103
+        },
104
+       getStockDamageById(ids){
105
+           var params = {
106
+            ids:ids,
107
+           }
108
+         getStockDamageById(params).then(response=>{
109
+           if(response.data.state == 1){
110
+             var list = response.data.data.list
111
+             console.log("打印列表",list)
112
+             this.tableList = list
113
+           }
114
+         })
115
+       },
116
+       getTime(val) {
117
+         if(val < 0){
118
+           return ""
119
+         }
120
+         if(val == ""){
121
+          return ""
122
+         }else {
123
+          return uParseTime(val, '{y}-{m}-{d}')
124
+         }
125
+      },
126
+
127
+    },
128
+    created(){
129
+      var ids = this.$route.query.ids
130
+      console.log("ids",ids)
131
+      this.getStockDamageById(ids)
132
+    }
133
+}
134
+</script>
135
+
136
+
137
+<style rel="stylesheet/scss" lang="scss" scoped>
138
+.printTitle{font-size: 22px;text-align: center;}
139
+.flex{display: flex;justify-content: space-between;}
140
+.tableTitle{display: flex;border-top:1px solid #000;border-bottom: 1px solid #000;padding: 10px 0;}
141
+.tableTr{display: flex;border-bottom: 1px dashed #000;padding: 10px 0;}
142
+.tableBottom{display: flex;border-bottom: 1px solid #000;padding: 10px 0;}
143
+</style>

+ 252 - 28
src/xt_pages/stock/stockDamaged.vue View File

@@ -19,8 +19,7 @@
19 19
                 type="primary"
20 20
                 icon="el-icon-search"
21 21
                 @click="search"
22
-                >搜索</el-button
23
-                >
22
+                placeholder="请输入单据编号或操作人姓名">搜索</el-button>
24 23
                 <el-date-picker
25 24
                 size="small"
26 25
                 v-model="start_time"
@@ -40,54 +39,59 @@
40 39
                 <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
41 40
                 <el-button size="small" type="primary" @click="toCheck">核对</el-button>
42 41
                 <el-button size="small" type="primary" @click="print">打印</el-button>
43
-                <el-button size="small" type="primary">导出</el-button>
42
+                <el-button size="small" type="primary" @click="exportList">导出</el-button>
44 43
             </div>
45 44
         </div>
46
-        <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }" @selection-change="changePrice">
45
+        <el-table :data="tableList" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }" @selection-change="changePrice">
47 46
             <el-table-column type="selection" width="55" align="center"> </el-table-column>
48
-            <el-table-column prop="date" label="报损编码">
47
+            <el-table-column prop="date" label="报损编码" align="center">
49 48
                <template  slot-scope="scope">
50 49
                 {{scope.row.warehousing_order}}
51 50
                </template>    
52 51
             </el-table-column>
53
-            <el-table-column prop="date" label="报损日期">
52
+            <el-table-column prop="date" label="报损日期"  align="center">
54 53
               <template  slot-scope="scope">
55 54
                 {{getTime(scope.row.start_time)}}
56 55
                </template>    
57 56
             </el-table-column>
58
-            <el-table-column prop="name" label="操作人">
57
+             <el-table-column prop="date" label="报损数量"  align="center">
58
+              <template  slot-scope="scope">
59
+                {{scope.row.count}}
60
+               </template>    
61
+            </el-table-column>
62
+            <el-table-column prop="name" label="操作人"  align="center">
59 63
               <template  slot-scope="scope">
60 64
                 {{scope.row.user_name}}
61 65
                </template>     
62 66
             </el-table-column>
63
-            <el-table-column prop="name" label="审核日期">
67
+            <el-table-column prop="name" label="审核日期"  align="center">
64 68
               <template  slot-scope="scope">
65 69
                 {{getTime(scope.row.checker_time)}}
66 70
              </template>
67 71
             </el-table-column>
68
-            <el-table-column prop="name" label="核对人">
72
+            <el-table-column prop="name" label="核对人"  align="center">
69 73
               <template slot-scope="scope">
70 74
                 {{getChecker(scope.row.checker)}}
71 75
               </template>
72 76
             </el-table-column>
73
-            <el-table-column prop="name" label="状态">
77
+            <el-table-column prop="name" label="状态"  align="center">
74 78
              <template slot-scope="scope">
75 79
                 <span v-if="scope.row.checker_status == 1">已核对</span>
76 80
                 <span v-if="scope.row.checker_status == 2">未核对</span>
77 81
               </template>
78 82
             </el-table-column>
79
-            <el-table-column label="操作">
83
+            <el-table-column label="操作"  align="center">
80 84
                 <template slot-scope="scope">
81
-                <el-button type="primary" size="small">编辑</el-button>
82
-                <el-button type="primary" size="small">删除</el-button>
85
+                <el-button type="primary" size="small" @click="editStockDamage(scope.row.id,scope.row.checker_status)">编辑</el-button>
86
+                <el-button type="danger" size="small" @click="deleteStockDamage(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
83 87
                 </template>
84 88
             </el-table-column>
85 89
         </el-table>
86 90
         <el-pagination
87 91
             @size-change="handleSizeChange"
88 92
             @current-change="handleCurrentChange"
89
-            :page-sizes="[5, 10, 50, 100]"
90
-            :page-size="5"
93
+            :page-sizes="[10, 20, 40, 100]"
94
+            :page-size="10"
91 95
             background
92 96
             style="margin-top:20px;text-align: right"
93 97
             layout="total, sizes, prev, pager, next, jumper"
@@ -135,9 +139,9 @@
135 139
             <el-form-item label="零售价">
136 140
                 <el-input v-model="form.packing_price"></el-input>
137 141
             </el-form-item>
138
-            <el-form-item label="新零售价">
142
+            <!-- <el-form-item label="新零售价">
139 143
                 <el-input v-model="form.new_price"></el-input>
140
-            </el-form-item>
144
+            </el-form-item> -->
141 145
             <el-form-item label="报损数量">
142 146
                 <el-input v-model="form.count"></el-input>
143 147
             </el-form-item>
@@ -196,11 +200,11 @@
196 200
                 {{scope.row.packing_price}}
197 201
                </template>
198 202
             </el-table-column>
199
-            <el-table-column prop="name" label="新零售价" width="100">
203
+            <!-- <el-table-column prop="name" label="新零售价" width="100">
200 204
                <template  slot-scope="scope">
201 205
                 {{scope.row.new_price}}
202 206
                </template>
203
-            </el-table-column>
207
+            </el-table-column> -->
204 208
             <el-table-column prop="name" label="生产厂商" width="100">
205 209
               <template  slot-scope="scope">
206 210
                 {{scope.row.manufacturer}}
@@ -223,8 +227,8 @@
223 227
             </el-table-column>
224 228
             <el-table-column fixed="right" width="100" label="操作">
225 229
                 <template  slot-scope="scope">
226
-                    <el-button type="text" size="small">删除</el-button>
227
-                    <el-button type="text" size="small">编辑</el-button>
230
+                    <el-button type="text" size="small" @click="toDelete(scope.row.$index)">删除</el-button>
231
+                    <el-button type="text" size="small" @click="toEdit(scope.row)">编辑</el-button>
228 232
                 </template>
229 233
             </el-table-column>
230 234
         </el-table>
@@ -274,13 +278,93 @@
274 278
             <el-button type="primary" @click="SaveCheckedDamage">保 存</el-button>
275 279
         </span>
276 280
     </el-dialog>
281
+
282
+<!-- 编辑 -->
283
+      <el-dialog
284
+        title="编辑"
285
+        :visible.sync="editPriceDialogVisible"
286
+        width="50%">
287
+        <span>
288
+          <el-form  :model="form">
289
+            <el-row>
290
+               <el-col>
291
+                <el-form-item label="耗材名称:">
292
+                    <el-autocomplete
293
+                        class="checkSearch"
294
+                        popper-class="my-autocomplete"
295
+                        v-model="form.good_name"
296
+                        :fetch-suggestions="querySearchAsync"
297
+                        :trigger-on-focus="true"
298
+                        placeholder="请输入耗材名称"
299
+                        @select="handleSelect"
300
+                        @input="changeGoodName(scope.$index)"
301
+                        style="width:160px;"
302
+                    >
303
+                        <i class="el-icon-search el-input__icon" slot="suffix"></i>
304
+                    <template slot-scope="{ item }">
305
+                        <div class="name">{{ item.good_name +"  " +item.specification_name + "  "+item.manufacturer }}</div>
306
+                    </template>
307
+                    </el-autocomplete>
308
+                </el-form-item>
309
+               <el-form-item label="报损数量:">
310
+                 <el-input v-model="form.count" style="width:200px"></el-input>
311
+               </el-form-item>
312
+             </el-col> 
313
+            </el-row>
314
+            <el-row>
315
+             <el-col>
316
+                <el-form-item label="备注:">
317
+                    <div style="display:flex;">
318
+                        <el-input v-model="form.remark"  style="width:200px"></el-input>
319
+                    </div>
320
+                </el-form-item>
321
+              </el-col>  
322
+            </el-row>
323
+          </el-form>
324
+        </span>
325
+        <span slot="footer" class="dialog-footer">
326
+            <el-button @click="editPriceDialogVisible = false">取 消</el-button>
327
+            <el-button type="primary" @click="upatePrice">保存</el-button>
328
+        </span>
329
+    </el-dialog>
330
+
331
+
332
+     <el-dialog
333
+        title="编辑"
334
+        :visible.sync="modifyPriceDialogVisible"
335
+        width="50%">
336
+        <span>
337
+          <el-form  :model="form">
338
+            <el-row>
339
+               <el-col>
340
+               <el-form-item label="报损数量:">
341
+                 <el-input v-model="form.count" style="width:200px"></el-input>
342
+               </el-form-item>
343
+             </el-col> 
344
+            </el-row>
345
+            <el-row>
346
+             <el-col>
347
+                <el-form-item label="备注:">
348
+                    <div style="display:flex;">
349
+                        <el-input v-model="form.remark"  style="width:200px"></el-input>
350
+                    </div>
351
+                </el-form-item>
352
+              </el-col>  
353
+            </el-row>
354
+          </el-form>
355
+        </span>
356
+        <span slot="footer" class="dialog-footer">
357
+            <el-button @click="modifyPriceDialogVisible = false">取 消</el-button>
358
+            <el-button type="primary" @click="modifyPrice">保存</el-button>
359
+        </span>
360
+    </el-dialog>
277 361
   </div>
278 362
 </template>
279 363
 
280 364
 <script>
281 365
 import BreadCrumb from "../components/bread-crumb";
282 366
 import { uParseTime } from '@/utils/tools'
283
-import { postSearchGoodWarehouseList,saveReportStock,getReportStockList,SaveCheckedDamage} from "@/api/stock"
367
+import { postSearchGoodWarehouseList,saveReportStock,getReportStockList,SaveCheckedDamage,getStockDamageDetail,modifyPrice,deleteStockDamage} from "@/api/stock"
284 368
 export default {
285 369
     name: "stockModifyPrice",
286 370
     components:{
@@ -318,7 +402,6 @@ export default {
318 402
                 report_count:"",
319 403
                 total:"",
320 404
             },
321
-            total: 0,
322 405
             currentIndex: 0,
323 406
             manufacturerList:[],
324 407
             dealerList:[],
@@ -333,6 +416,10 @@ export default {
333 416
             doctorList:[],
334 417
             checker:this.$store.getters.xt_user.user.id,
335 418
             check_time:new Date(),
419
+            tableList:[],
420
+            editPriceDialogVisible:false,
421
+            modifyPriceDialogVisible:false,
422
+            id:0,
336 423
         }
337 424
     },
338 425
     methods:{
@@ -340,8 +427,13 @@ export default {
340 427
 
341 428
         },
342 429
         print(){
343
-            this.$router.push({path:'/stock/stockModifyPricePrint'})
344
-            
430
+          if(this.ids == ""){
431
+            this.$message.error("请勾选打印数据")
432
+            return false
433
+          }else{
434
+            this.$router.push({path:'/stock/stockDamagePrint?ids='+this.ids})
435
+          }
436
+         
345 437
         },
346 438
         handleSizeChange(val){
347 439
           this.limit = val
@@ -373,7 +465,7 @@ export default {
373 465
                 for(let j=0;j<this.manufacturerList.length;j++){
374 466
                 if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
375 467
                     this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
376
-                }
468
+                 }
377 469
                 }
378 470
             }
379 471
 
@@ -421,7 +513,7 @@ export default {
421 513
           good_origin_place:this.form.good_origin_place,
422 514
           license_number:this.form.license_number,
423 515
           remark:this.form.remark,
424
-          new_price:this.form.new_price.toString(),
516
+          // new_price:this.form.new_price.toString(),
425 517
           warehousing_order:this.form.warehousing_order,
426 518
           dealer:this.form.dealer,
427 519
           start_time:this.getTime(new Date()),
@@ -429,6 +521,14 @@ export default {
429 521
         this.tableData.push(obj)
430 522
       },
431 523
       saveReportStock(){
524
+         for(let i = 0;i<this.tableData.length;i++){
525
+           if(this.tableData[i].manufacturer == 0){
526
+              this.tableData[i].manufacturer = ""   
527
+           }
528
+           if(this.tableData[i].dealer == 0){
529
+              this.tableData[i].dealer = ""   
530
+           }
531
+         }
432 532
           var params = {
433 533
             tableData:this.tableData,
434 534
           }
@@ -438,6 +538,19 @@ export default {
438 538
              var msg = response.data.data.msg
439 539
              this.$message.success("保存成功")
440 540
              this.dialogVisible = false
541
+             this.getlist()
542
+            this.form.good_name = ""
543
+            this.form.packing_price = ""
544
+            this.form.warehousing_order = ""
545
+            this.form.license_number = ""
546
+            this.form.dealer = ""
547
+            this.form.manufacturer = ""
548
+            this.form.specification_name = ""
549
+            this.form.remark =""
550
+            this.form.buy_price = ""
551
+            this.form.warehousing_unit = ""
552
+            this.form.total = ""
553
+           
441 554
            }
442 555
         })
443 556
       },
@@ -465,7 +578,7 @@ export default {
465 578
             var list = response.data.data.list
466 579
             console.log("list",list)
467 580
             this.total = response.data.data.total
468
-            this.tableData = list
581
+            this.tableList = list
469 582
            var doctorlist = response.data.data.doctorlist
470 583
            this.doctorList = doctorlist
471 584
           }
@@ -518,6 +631,117 @@ export default {
518 631
        }
519 632
        return name
520 633
      },
634
+     toDelete(index){
635
+       this.tableData.splice(index,1)
636
+     },
637
+     toEdit(row){
638
+      this.form.good_name = row.good_name
639
+      this.form.packing_unit = row.packing_unit
640
+      this.form.packing_price = row.packing_price
641
+      this.form.count = row.count
642
+      this.form.remark = row.remark
643
+      this.form.id = row.id
644
+      this.editPriceDialogVisible = true  
645
+     },
646
+     upatePrice(){
647
+       for(let i=0;i<this.tableData.length;i++){
648
+         if(this.form.id == this.tableData[i].id){
649
+            this.tableData[i].good_name = this.form.good_name
650
+            this.tableData[i].packing_price = this.form.packing_price
651
+            this.tableData[i].count = this.form.count
652
+            this.tableData[i].remark = this.form.remark
653
+         }
654
+       }
655
+       this.editPriceDialogVisible = false
656
+       this.form.good_name = ""
657
+       this.form.packing_price = ""
658
+       this.form.count = ""
659
+       this.form.remark = ""
660
+     },
661
+     editStockDamage(id,check_status){
662
+        if(check_status == 1){
663
+          this.$message.error("已核对,不能编辑")
664
+          return
665
+        }
666
+       getStockDamageDetail(id).then(response=>{
667
+         if(response.data.state == 1){
668
+           var detail = response.data.data.detail
669
+           this.form.count = detail.count
670
+           this.id = detail.id
671
+           this.modifyPriceDialogVisible = true
672
+         }
673
+       })
674
+     },
675
+     modifyPrice(){
676
+        var params = {
677
+          count:parseInt(this.form.count),
678
+          id:this.id,
679
+        }
680
+        console.log("param2323",params)
681
+       modifyPrice(params).then(response=>{
682
+         if(response.data.state ==1){
683
+           var adjust = response.data.data.adjust
684
+
685
+           this.modifyPriceDialogVisible = false
686
+           this.$message.success("保存成功")
687
+           this.getlist()
688
+         }
689
+       })
690
+     },
691
+     deleteStockDamage(id,check_status,index){
692
+       if(check_status == 1){
693
+         this.$message.error("已核对不能编辑")
694
+         return
695
+       }
696
+        this.$confirm('是否删除所选内容?', '提示', {
697
+          confirmButtonText: '确定',
698
+          cancelButtonText: '取消',
699
+          type: 'warning'
700
+        }).then(() => {
701
+          let params = {
702
+            id:id,
703
+          }
704
+          deleteStockDamage(params).then(response => {
705
+            if (response.data.state == 1) {
706
+              var msg = response.data.data.msg
707
+              this.$message.success("保存成功")
708
+              this.tableList.splice(index,1)
709
+            } 
710
+          })
711
+        }).catch(() => {
712
+          this.loading = false
713
+        });
714
+     },
715
+     exportList(){
716
+       
717
+         import('@/vendor/Export2Excel').then(excel => {
718
+         const tHeader = ['报损编码', '报损日期', '报损数量','操作人','审核日期','核对人','状态']
719
+         const filterVal = ['warehousing_order', 'start_time', 'count','user_name','check_time','checker','checker_status']
720
+       
721
+          for(let i=0;i<this.tableList.length;i++){
722
+           this.tableList[i].start_time = this.getTime(this.tableList[i].start_time)
723
+           this.tableList[i].check_time =  this.getTime(this.tableList[i].check_time)
724
+           this.tableList[i].checker = this.getChecker(this.tableList[i].checker)
725
+           if(this.tableList[i].checker_status == 1){
726
+             this.tableList[i].checker_status = "已核对"
727
+           }
728
+          if(this.tableList[i].checker_status == 2){
729
+             this.tableList[i].checker_status = "未核对"
730
+           }
731
+         }
732
+         const data = this.formatJson(filterVal, this.tableList)
733
+      
734
+         excel.export_json_to_excel({
735
+           header: tHeader,
736
+           data,
737
+           filename: '耗材报损'
738
+         })
739
+          this.downloadLoading = false
740
+        })
741
+       },
742
+       formatJson(filterVal, jsonData) {
743
+        return jsonData.map(v => filterVal.map(j => v[j]));
744
+      },
521 745
     },
522 746
     created(){
523 747
         // var nowDate = new Date();

+ 170 - 21
src/xt_pages/stock/stockModifyPrice.vue View File

@@ -11,7 +11,7 @@
11 11
             style="width: 200px;"
12 12
             class="filter-item"
13 13
             v-model.trim="searchKey"
14
-            placeholder=""
14
+            placeholder="请输入单据编号或操作人姓名"
15 15
             />
16 16
             <el-button
17 17
             size="small"
@@ -19,7 +19,6 @@
19 19
             type="primary"
20 20
             icon="el-icon-search"
21 21
             @click="search"
22
-            placeholder="请输入单据编号或操作人姓名"
23 22
             >搜索</el-button
24 23
             >
25 24
             <el-date-picker
@@ -41,7 +40,7 @@
41 40
             <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
42 41
             <el-button size="small" type="primary" @click="toCheck">核对</el-button>
43 42
             <el-button size="small" type="primary" @click="print">打印</el-button>
44
-            <el-button size="small" type="primary">导出</el-button>
43
+            <el-button size="small" type="primary" @click="toExport">导出</el-button>
45 44
         </div>
46 45
       </div>
47 46
       <div>
@@ -58,68 +57,90 @@
58 57
                            {{scope.row.good_name}}
59 58
                         </template>
60 59
                     </el-table-column>
61
-                    <el-table-column label="规格" width="100">
60
+                    <el-table-column label="规格" width="100" align="center">
62 61
                       <template slot-scope="scope">
63 62
                          {{scope.row.specification_name}}
64 63
                       </template>
65 64
                     </el-table-column>
66
-                    <el-table-column label="单位" width="100">
65
+                    <el-table-column label="单位" width="100" align="center">
67 66
                       <template slot-scope="scope">
68 67
                          {{scope.row.packing_unit}}
69 68
                       </template>
70 69
                     </el-table-column>
71
-                    <el-table-column label="调价数量" width="100">
70
+                    <el-table-column label="调价数量" width="100" align="center">
72 71
                       <template slot-scope="scope">
73 72
                        {{scope.row.count}}
74 73
                       </template>
75 74
                     </el-table-column>
76
-                    <el-table-column label="原进货价" width="100">
75
+                    <el-table-column label="原进货价" width="100" align="center">
77 76
                       <template slot-scope="scope">
78 77
                        {{scope.row.buy_price}}
79 78
                       </template>
80 79
                     </el-table-column>
81
-                    <el-table-column label="原零售价" width="100">
80
+                    <el-table-column label="原零售价" width="100" align="center">
82 81
                       <template slot-scope="scope">
83 82
                        {{scope.row.packing_price}}
84 83
                      </template>
85 84
                     </el-table-column>
86
-                    <el-table-column label="生产厂商" width="100">
85
+                    <el-table-column label="现零价" width="100" align="center">
86
+                      <template slot-scope="scope">
87
+                       {{scope.row.new_price}}
88
+                     </template>
89
+                    </el-table-column>
90
+                    <el-table-column label="生产厂商" width="100" align="center">
87 91
                       <template slot-scope="scope">
88 92
                        {{scope.row.manufacturer}}
89 93
                       </template>
90 94
                     </el-table-column>
91
-                    <el-table-column label="经销商" width="100">
95
+                    <el-table-column label="经销商" width="100" align="center">
92 96
                       <template slot-scope="scope">
93 97
                         {{scope.row.dealer}}
94 98
                       </template>
95 99
                     </el-table-column>
96
-                    <el-table-column label="操作人" width="100">
100
+                    <el-table-column label="操作人" width="100" align="center">
97 101
                       <template slot-scope="scope">
98 102
                         {{getDoctor(scope.row.creater)}}
99 103
                       </template>
100 104
                     </el-table-column>
101
-                    <el-table-column label="核对人" width="100">
105
+                    <el-table-column label="核对人" width="100" align="center">
102 106
                       <template slot-scope="scope">
103 107
                          {{getDoctor(scope.row.checker)}}
104 108
                       </template>
105 109
                     </el-table-column>
106
-                    <el-table-column label="状态" width="100">
110
+                    <el-table-column label="状态" width="100" align="center">
107 111
                       <template slot-scope="scope">
108 112
                         <span v-if="scope.row.checker_status == 2">未核对</span>
109 113
                         <span v-if="scope.row.checker_status == 1">已核对</span>  
110 114
                       </template>
111 115
                     </el-table-column>
112
-                    <el-table-column prop="date" label="调价日期" width="100">
116
+                    <el-table-column prop="date" label="调价日期" width="100" align="center">
113 117
                      <template slot-scope="scope">
114 118
                           {{getTime(scope.row.start_time)}}
115 119
                      </template> 
116 120
                     </el-table-column>
117
-                    <el-table-column label="备注" width="100">
121
+                    <el-table-column label="备注" width="100" align="center">
118 122
                        <template slot-scope="scope">
119 123
                          {{scope.row.remark}}
120 124
                        </template>
121 125
                     </el-table-column>
126
+                   <el-table-column label="操作" align="center" width="200">
127
+                    <template slot-scope="scope">
128
+                      <el-button type="primary" size="small" @click="modifyPrice(scope.row.id,scope.row.checker_status)">编辑</el-button>
129
+                      <el-button  type="danger" size="small" @click="deleteStockPrice(scope.row.id,scope.row.checker_status,scope.$index)">删除</el-button>
130
+                    </template>
131
+                  </el-table-column>
122 132
                 </el-table>
133
+
134
+                <el-pagination
135
+                  @size-change="handleSizeChange"
136
+                  @current-change="handleCurrentChange"
137
+                  :page-sizes="[10, 20, 40, 100]"
138
+                  :page-size="10"
139
+                  background
140
+                  style="margin-top:20px;text-align: right"
141
+                  layout="total, sizes, prev, pager, next, jumper"
142
+                  :total="total">
143
+               </el-pagination>
123 144
             </div>
124 145
                 <!-- <el-table :data="tableData" border :height="tableHeight" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
125 146
                     <el-table-column
@@ -410,12 +431,36 @@
410 431
             <el-button type="primary" @click="SaveCheckedPrice">保 存</el-button>
411 432
         </span>
412 433
     </el-dialog>
434
+
435
+
436
+
437
+    <el-dialog
438
+        title="耗材调价核对"
439
+        :visible.sync="modifyDialogVisible"
440
+        width="30%"
441
+        >
442
+        <span>
443
+          <el-form :model="form">
444
+            <el-row>
445
+              <el-col>
446
+                <el-form-item label="现价格">
447
+                  <el-input v-model="form.new_price" style="width:100px"></el-input>
448
+                </el-form-item>  
449
+              </el-col>
450
+            </el-row>  
451
+          </el-form>  
452
+        </span>
453
+        <span slot="footer" class="dialog-footer">
454
+            <el-button @click="modifyDialogVisible = false">取 消</el-button>
455
+            <el-button type="primary" @click="updateStockPrice">保 存</el-button>
456
+        </span>
457
+    </el-dialog>
413 458
   </div>
414 459
 </template>
415 460
 
416 461
 <script>
417 462
 import BreadCrumb from "../components/bread-crumb";
418
-import { postSearchGoodWarehouseList,saveAdjustPrice,getAllStockPrice,SaveCheckedPrice} from "@/api/stock"
463
+import { postSearchGoodWarehouseList,saveAdjustPrice,getAllStockPrice,SaveCheckedPrice,getModifyPriceDetail,updateStockPrice,deleteStockPrice} from "@/api/stock"
419 464
 import { uParseTime } from '@/utils/tools'
420 465
 export default {
421 466
     name: "stockModifyPrice",
@@ -466,11 +511,16 @@ export default {
466 511
             check_time:new Date(),
467 512
             checker:this.$store.getters.xt_user.user.id,
468 513
             checkDialogVisible:false,
514
+            limit:10,
515
+            page:1,
516
+            total:0,
517
+            modifyDialogVisible:false,
518
+            id:0,
469 519
         }
470 520
     },
471 521
     methods:{
472 522
         search(){
473
-
523
+          this.getAllStockPrice()
474 524
         },
475 525
         print(){
476 526
             if(this.ids == ""){
@@ -535,9 +585,6 @@ export default {
535 585
           this.form.buy_price = val.buy_price
536 586
           this.form.warehousing_unit = val.packing_unit
537 587
          
538
-      },
539
-      handleClose(){
540
-
541 588
       },
542 589
       addPrice(){
543 590
         var obj = {
@@ -589,7 +636,8 @@ export default {
589 636
      editPrice(row){
590 637
       console.log("row232233223",row)
591 638
       this.form.good_name = row.good_name
592
-      this.form.packing_price = row.packing_unit
639
+      this.form.packing_price = row.packing_price
640
+      this.form.packing_unit = row.packing_unit
593 641
       this.form.new_price = row.new_price
594 642
       this.form.count = row.count
595 643
       this.form.remark = row.remark
@@ -607,6 +655,11 @@ export default {
607 655
          }
608 656
        }
609 657
        this.editPriceDialogVisible = false
658
+       this.form.good_name = ""
659
+       this.form.packing_price = ""
660
+       this.form.new_price = ""
661
+       this.form.count = ""
662
+       this.form.remark = ""
610 663
      },
611 664
      saveAdjustPrice(){
612 665
          for(let i=0;i<this.tableData.length;i++){
@@ -614,6 +667,12 @@ export default {
614 667
            this.tableData[i].packing_price = this.tableData[i].packing_price.toString()
615 668
            this.tableData[i].new_price = this.tableData[i].new_price.toString()
616 669
            this.tableData[i].count =  parseInt(this.tableData[i].count)
670
+           if(this.tableData[i].dealer == 0){
671
+             this.tableData[i].dealer = ""
672
+           }
673
+           if(this.tableData[i].manufacturer == 0){
674
+             this.tableData[i].manufacturer = ""
675
+           }
617 676
          }
618 677
          var params= {
619 678
            tableData:this.tableData,
@@ -625,6 +684,7 @@ export default {
625 684
           console.log("msg",msg)
626 685
           this.$message.success("保存成功!")
627 686
           this.dialogVisible = false
687
+          this.getAllStockPrice()
628 688
         }
629 689
       })  
630 690
      },
@@ -633,6 +693,8 @@ export default {
633 693
             keyword:this.searchKey,
634 694
             start_time:this.start_time,
635 695
             end_time:this.end_time,
696
+            limit:this.limit,
697
+            page:this.page,
636 698
          }
637 699
         console.log("params",params)
638 700
        getAllStockPrice(params).then(response=>{
@@ -643,6 +705,7 @@ export default {
643 705
            var doctor = response.data.data.doctor
644 706
            console.log("doctor",doctor)
645 707
            this.doctorList = doctor
708
+           this.total = response.data.data.total
646 709
          }
647 710
        })  
648 711
      },
@@ -694,6 +757,92 @@ export default {
694 757
            this.checkDialogVisible = false
695 758
          }
696 759
        })
760
+     },
761
+     handleSizeChange(val){
762
+       this.limit = val
763
+       this.getAllStockPrice()
764
+      },
765
+     handleCurrentChange(val){
766
+        this.page = val
767
+        this.getAllStockPrice()
768
+      },
769
+     toExport(){
770
+      import('@/vendor/Export2Excel').then(excel => {
771
+        for(let i=0;i<this.tableList.length;i++){
772
+          this.tableList[i].start_time = this.getTime(this.tableList[i].start_time)
773
+          this.tableList[i].creater =  this.getDoctor(this.tableList[i].creater)
774
+          this.tableList[i].checker = this.getDoctor(this.tableList[i].checker)
775
+        }
776
+        console.log("表格",this.tableList)
777
+        const tHeader = ['单据编码','调价日期','操作人','审核人','耗材名称','规格','生产厂家','批注文书','经销商','数量','原零价','现零价','进货价','零售总价','批号','生产日期','有效日期']
778
+        const filterVal = ['warehousing_order', 'start_time','creater','checker','good_name','specification_name','manufacturer','license_number','dealer','count','packing_price','new_price','buy_price','','','','']
779
+        console.log("table",this.tableList)
780
+      
781
+        const data = this.formatJson(filterVal, this.tableList)
782
+        excel.export_json_to_excel({
783
+          header: tHeader,
784
+          data,
785
+          filename: '调价明细表'
786
+        })
787
+      this.downloadLoading = false
788
+     })
789
+    },
790
+    formatJson(filterVal, jsonData) {
791
+      return jsonData.map(v => filterVal.map(j => v[j]));
792
+     },
793
+     modifyPrice(id,check_status){
794
+       if(check_status == 1){
795
+         this.$message.error("已核对不能编辑")
796
+         return
797
+       }
798
+       getModifyPriceDetail(id).then(response=>{
799
+         if(response.data.state == 1){
800
+           var info =  response.data.data.detail
801
+           console.log("info",info)
802
+           this.id = info.id
803
+           this.form.new_price = info.new_price
804
+           this.modifyDialogVisible = true
805
+         }
806
+       })
807
+     },
808
+     updateStockPrice(){
809
+         var params = {
810
+           new_price:this.form.new_price.toString(),
811
+           id:this.id
812
+         }
813
+         console.log("params",params)
814
+       updateStockPrice(params).then(response=>{
815
+          if(response.data.state == 1){
816
+            var adjust = response.data.data.adjust
817
+            this.$message.success("保存成功")
818
+             this.modifyDialogVisible = false
819
+             this.getAllStockPrice()
820
+          }
821
+       })
822
+     },
823
+     deleteStockPrice(id,check_status,index){
824
+       if(check_status == 1){
825
+         this.$message.error("已核对不能编辑")
826
+         return
827
+       }
828
+        this.$confirm('是否删除所选内容?', '提示', {
829
+          confirmButtonText: '确定',
830
+          cancelButtonText: '取消',
831
+          type: 'warning'
832
+        }).then(() => {
833
+          let params = {
834
+            id:id,
835
+          }
836
+          deleteStockPrice(params).then(response => {
837
+            if (response.data.state == 1) {
838
+              var msg = response.data.data.msg
839
+              this.$message.success("保存成功")
840
+              this.tableList.splice(index,1)
841
+            } 
842
+          })
843
+        }).catch(() => {
844
+          this.loading = false
845
+        });
697 846
      }
698 847
     },
699 848
     created(){

+ 16 - 13
src/xt_pages/user/dialysisSolution.vue View File

@@ -438,7 +438,7 @@
438 438
             </el-form-item>
439 439
           </el-col>
440 440
 
441
-          <el-col :span="8" v-if="isShows('灌流器')">
441
+          <el-col :span="8" v-if="isShows('灌流器') && (addPlan.mode_id == 2 || addPlan.mode_id == 12 || addPlan.mode_id == 5)">
442 442
              <el-form-item label="灌流器:">
443 443
                <el-input v-model="dialysis_irrigation" @focus="showInnerDialog('7')"></el-input>
444 444
              </el-form-item>
@@ -1640,20 +1640,23 @@ export default {
1640 1640
     
1641 1641
       this.addPlan.remark = row.remark
1642 1642
 
1643
-      this.addPlan.hemodialysis_pipelines  = row.hemodialysis_pipelines
1644
-      if(row.hemodialysis_pipelines_count!="" || row.hemodialysis_pipelines_count!=undefined){
1645
-        this.addPlan.hemodialysis_pipelines_count  = row.hemodialysis_pipelines_count.toString()
1646
-      }
1643
+      // this.addPlan.hemodialysis_pipelines  = row.hemodialysis_pipelines
1644
+
1645
+      // if(row.hemodialysis_pipelines_count!="" || row.hemodialysis_pipelines_count!=undefined){
1646
+      //   this.addPlan.hemodialysis_pipelines_count  = row.hemodialysis_pipelines_count.toString()
1647
+      // }
1647 1648
      
1648
-      this.addPlan.puncture_needle  = row.puncture_needle
1649
-      if(row.puncture_needle_count!=null || row.puncture_needle_count!=undefined){
1650
-        this.addPlan.puncture_needle_count = row.puncture_needle_count.toString()
1651
-      }
1649
+      // this.addPlan.puncture_needle  = row.puncture_needle
1650
+
1651
+      // if(row.puncture_needle_count!=null || row.puncture_needle_count!=undefined){
1652
+      //   this.addPlan.puncture_needle_count = row.puncture_needle_count.toString()
1653
+      // }
1652 1654
      
1653
-      this.addPlan.epo  = row.epo
1654
-      if(row.epo_count!="" || row.epo_count!=undefined){
1655
-        this.addPlan.epo_count  = row.epo_count.toString()
1656
-      }
1655
+      // this.addPlan.epo  = row.epo
1656
+
1657
+      // if(row.epo_count!="" || row.epo_count!=undefined){
1658
+      //   this.addPlan.epo_count  = row.epo_count.toString()
1659
+      // }
1657 1660
     
1658 1661
       if(row.dialyzer_perfusion_apparatus!="" ||  row.dialyzer_perfusion_apparatus!=undefined){
1659 1662
          this.addPlan.dialyzer_perfusion_apparatus = row.dialyzer_perfusion_apparatus.toString()

+ 37 - 36
src/xt_pages/user/templateSummary.vue View File

@@ -61,7 +61,7 @@
61 61
               <div class="record_content_panel">
62 62
                 <div style="background-color:rgb(245, 247, 250)" class="title">阶段小结内容</div>
63 63
                 <div style="padding:10px;border-bottom:1px solid #DCDFE6;"><span v-if="editObj.record_time!=''">阶段小结时间:{{getTime(editObj.record_time)}}</span></div>  
64
-                <div style="padding: 10px 10px 0;">阶段小结概要:</div>  
64
+                <!-- <div style="padding: 10px 10px 0;">阶段小结概要:</div>  
65 65
                 <div style="padding:10px;border-bottom:1px solid #DCDFE6;">
66 66
                   <span style="margin-right:10px;line-height:30px;">干体重(kg):{{editObj.dry_weight}}</span>
67 67
                   <span style="margin-right:10px;line-height:30px;">共透析:{{editObj.dialysis_count}}次</span>
@@ -85,7 +85,7 @@
85 85
                   <br>
86 86
                   <span style="margin-right:10px;line-height:30px;">透前血压(mmHg):{{editObj.befor_pressure}}</span>
87 87
                   <span style="margin-right:10px;line-height:30px;">透后血压(mmHg):{{editObj.after_pressure}}</span>
88
-                </div>
88
+                </div> -->
89 89
                  <div style="padding:10px;border-bottom:1px solid #DCDFE6;line-height:20px;">阶段小结总结:
90 90
                    {{editObj.template_summary_content}}
91 91
                  </div>
@@ -128,7 +128,7 @@
128 128
                     </el-form-item>
129 129
                   </el-col>
130 130
                 </el-row>
131
-                 <el-row :gutter="24">
131
+                 <!-- <el-row :gutter="24">
132 132
                   <el-col :span="8">
133 133
                     <el-form-item label="阶段小结时间:">
134 134
                         <el-date-picker
@@ -151,14 +151,6 @@
151 151
                   
152 152
                   <el-col :span="8" v-if="form.radio == 1">
153 153
                     <el-form-item>
154
-                       <!-- <el-select v-model="form.start_month" placeholder="请选择" @change="changeStartMonth">
155
-                        <el-option
156
-                          v-for="item in monthType"
157
-                          :key="item.id"
158
-                          :label="item.name"
159
-                          :value="item.id">
160
-                        </el-option>
161
-                      </el-select> -->
162 154
                       <el-date-picker
163 155
                         @change="changeStartMonth"
164 156
                         value-format="MM"
@@ -180,15 +172,15 @@
180 172
                       </el-select>
181 173
                     </el-form-item> 
182 174
                   </el-col> 
183
-                 </el-row>  
175
+                 </el-row>   -->
184 176
                 
185 177
               </el-form>
186 178
             </div>
187 179
 
188 180
             <div class="cell clearfix" style="margin-top: 10px">
189
-              <label class="title"><span class="name">阶段小结摘要</span> : </label>
181
+              <!-- <label class="title"><span class="name">阶段小结摘要</span> : </label> -->
190 182
               <el-form>
191
-                  <el-row :gutter="24">
183
+                  <!-- <el-row :gutter="24">
192 184
                     <el-col :span="8">
193 185
                      <el-form-item label="干体重">
194 186
                       <el-input v-model="form.dry_weight"></el-input>
@@ -299,7 +291,7 @@
299 291
                       <el-input v-model="form.after_pressure"></el-input>
300 292
                      </el-form-item>  
301 293
                     </el-col>
302
-                  </el-row>
294
+                  </el-row> -->
303 295
                  
304 296
                   <el-row>
305 297
                     <label class="title"><span class="name">阶段小结总结</span> : </label>
@@ -396,7 +388,7 @@
396 388
                     </el-form-item>
397 389
                   </el-col>
398 390
                 </el-row>
399
-                 <el-row :gutter="24">
391
+                 <!-- <el-row :gutter="24">
400 392
                   <el-col :span="8">
401 393
                     <el-form-item label="阶段小结时间:">
402 394
                         <el-date-picker
@@ -439,15 +431,15 @@
439 431
                       </el-select>
440 432
                     </el-form-item> 
441 433
                   </el-col> 
442
-                 </el-row>  
434
+                 </el-row>   -->
443 435
                 
444 436
               </el-form>
445 437
             </div>
446 438
 
447 439
             <div class="cell clearfix" style="margin-top: 10px">
448
-              <label class="title"><span class="name">阶段小结摘要</span> : </label>
440
+              <!-- <label class="title"><span class="name">阶段小结摘要</span> : </label> -->
449 441
               <el-form>
450
-                  <el-row :gutter="24">
442
+                  <!-- <el-row :gutter="24">
451 443
                     <el-col :span="8">
452 444
                      <el-form-item label="干体重">
453 445
                       <el-input v-model="form.dry_weight"></el-input>
@@ -463,8 +455,8 @@
463 455
                       <el-input v-model="form.hd_count"></el-input>
464 456
                      </el-form-item>  
465 457
                     </el-col>
466
-                  </el-row>
467
-                  <el-row :gutter="24">
458
+                  </el-row> -->
459
+                  <!-- <el-row :gutter="24">
468 460
                     <el-col :span="8">
469 461
                      <el-form-item label="HDF(次)">
470 462
                       <el-input v-model="form.hdf_count"></el-input>
@@ -480,8 +472,8 @@
480 472
                       <el-input v-model="form.other_count"></el-input>
481 473
                      </el-form-item>  
482 474
                     </el-col>
483
-                  </el-row>
484
-                   <el-row :gutter="24">
475
+                  </el-row> -->
476
+                   <!-- <el-row :gutter="24">
485 477
                     <el-col :span="8">
486 478
                      <el-form-item label="透析器">
487 479
                        <el-input v-model="form.dialzer_apparatus" @focus="showInnerDialog('7')"></el-input>
@@ -495,7 +487,6 @@
495 487
 
496 488
                     <el-col :span="8">
497 489
                      <el-form-item label="抗凝剂">
498
-                      <!-- <el-input v-model="form.anticoagulant"></el-input> -->
499 490
                        <el-select v-model="form.anticoagulant" placeholder="请选择" style="width:100%;">
500 491
                           <el-option :key="0" label="请选择" :value="0"></el-option>
501 492
                           <el-option v-for="(item, index) in anticoagulantList" :label="item.name" :key="index + 'e'"
@@ -503,8 +494,8 @@
503 494
                        </el-select>
504 495
                      </el-form-item>  
505 496
                     </el-col>
506
-                  </el-row>
507
-                   <div>透析液</div>
497
+                  </el-row> -->
498
+                   <!-- <div>透析液</div>
508 499
                    <el-row :gutter="24">
509 500
                     <el-col :span="8">
510 501
                      <el-form-item label="钾">
@@ -521,8 +512,8 @@
521 512
                       <el-input v-model="form.natrium"></el-input>
522 513
                      </el-form-item>  
523 514
                     </el-col>
524
-                  </el-row>
525
-                   <div>透析时长</div>
515
+                  </el-row> -->
516
+                   <!-- <div>透析时长</div>
526 517
                    <el-row :gutter="24">
527 518
                     <el-col :span="8">
528 519
                      <el-form-item label="时">
@@ -534,8 +525,8 @@
534 525
                       <el-input v-model="form.minute"></el-input>
535 526
                      </el-form-item>  
536 527
                     </el-col>
537
-                  </el-row>
538
-                  <el-row :gutter="24">
528
+                  </el-row> -->
529
+                  <!-- <el-row :gutter="24">
539 530
                     <el-col :span="8">
540 531
                      <el-form-item label="透前体重(kg)">
541 532
                       <el-input v-model="form.befor_weight"></el-input>
@@ -546,8 +537,8 @@
546 537
                       <el-input v-model="form.after_weight"></el-input>
547 538
                      </el-form-item>  
548 539
                     </el-col>
549
-                  </el-row>
550
-                   <el-row :gutter="24">
540
+                  </el-row> -->
541
+                   <!-- <el-row :gutter="24">
551 542
                     <el-col :span="8">
552 543
                      <el-form-item label="透前血压(mmHg)">
553 544
                       <el-input v-model="form.befor_pressure"></el-input>
@@ -558,7 +549,7 @@
558 549
                       <el-input v-model="form.after_pressure"></el-input>
559 550
                      </el-form-item>  
560 551
                     </el-col>
561
-                  </el-row>
552
+                  </el-row> -->
562 553
                  
563 554
                   <el-row>
564 555
                     <label class="title"><span class="name">阶段小结总结</span> : </label>
@@ -587,7 +578,7 @@
587 578
                   <el-row>
588 579
                     <label class="title"><span class="name">阶段小结化验结果</span> : </label>
589 580
                     <el-button type="primary" @click="toInspection">选择检验检查</el-button>
590
-                     <!-- <el-input style="margin:10px 0;" type="textarea" v-model="form.template_inspection_content"></el-input> -->
581
+                   
591 582
                      <div class="borderBox">
592 583
                        <div v-for="item in form.template_inspection_content">
593 584
                         <p>{{ item.project_name }}</p>
@@ -1465,9 +1456,19 @@
1465 1456
                this.form.perfusion_apparatus= list.perfusion_apparatus
1466 1457
                this.form.record_time = this.getTimeTwo(list.record_time)
1467 1458
                console.log("时间232233232",list.record_time)
1468
-               this.form.template_inspection_id = list.template_inspection_id
1459
+               if(list.template_inspection_id == 0){
1460
+                  list.template_inspection_id = ""
1461
+               }else{
1462
+                 this.form.template_inspection_id = list.template_inspection_id
1463
+               }
1464
+              
1469 1465
                this.form.template_plan_content = list.template_plan_content
1470
-               this.form.template_plan_id = list.template_plan_id,
1466
+               if(list.template_plan_id == 0){
1467
+                 this.form.template_plan_id  = ""
1468
+               }else{
1469
+                 this.form.template_plan_id = list.template_plan_id
1470
+               }
1471
+             
1471 1472
                console.log("hhhhhhhhh",list.template_plan_id)
1472 1473
                this.form.template_summary_content =list.template_summary_content
1473 1474
                if(list.template_summary_id == 0){

+ 2 - 2
src/xt_pages/user/templateSummaryPrint.vue View File

@@ -20,7 +20,7 @@
20 20
       <div style="padding:20px 0;border-bottom:1px solid #000;font-weight:bold;">
21 21
         <span>阶段评估时间:{{getTime(patientList.record_time)}}</span>  
22 22
       </div>
23
-       <div style="padding:20px 0;border-bottom:1px solid #000;">
23
+       <!-- <div style="padding:20px 0;border-bottom:1px solid #000;">
24 24
         <span style="font-weight:bold;">阶段小结概要:</span>  
25 25
         <div style="margin-top:20px;">
26 26
           <div style="display:flex;justify-content: space-between;">
@@ -45,7 +45,7 @@
45 45
             <span>透后血压(mmHg):{{patientList.after_pressure}}</span>
46 46
           </div>
47 47
         </div>
48
-      </div>
48
+      </div> -->
49 49
       <div style="padding:20px 0;border-bottom:1px solid #000;min-height:200px;">
50 50
         <span style="font-weight:bold;">阶段小结总结:</span><div>{{patientList.template_summary_content}}</div>  
51 51
       </div>

+ 13 - 13
src/xt_permission.js View File

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