XMLWAN 3 anos atrás
pai
commit
b14fbb930e
37 arquivos alterados com 3605 adições e 1005 exclusões
  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 Ver arquivo

6
 module.exports = {
6
 module.exports = {
7
   NODE_ENV: '"development"',
7
   NODE_ENV: '"development"',
8
   ENV_CONFIG: '"dev"',
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
   SSO_HOST: '"http://testsso.sgjyun.com"',
12
   SSO_HOST: '"http://testsso.sgjyun.com"',
13
   SRCM_HOST: '"http://test1.sgjyun.com"',
13
   SRCM_HOST: '"http://test1.sgjyun.com"',
14
   XT_HOST: '"http://xt.test.sgjyun.com"',
14
   XT_HOST: '"http://xt.test.sgjyun.com"',

+ 2 - 2
config/index.js Ver arquivo

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

+ 330 - 219
src/api/drug/drug.js Ver arquivo

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
   return request({
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
   return request({
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
   return request({
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
   return request({
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
   return request({
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
   return request({
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
   return request({
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 Ver arquivo

810
     params: params
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 Ver arquivo

50
       name: 'drugDamaged',
50
       name: 'drugDamaged',
51
       meta: { title: 'drugDamaged', noCache: true }
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
       path: '/stock/drugs/drugWarning',
60
       path: '/stock/drugs/drugWarning',
55
       component: () => import('@/xt_pages/stock/drugs/drugWarning'),
61
       component: () => import('@/xt_pages/stock/drugs/drugWarning'),

+ 17 - 0
src/router/modules/stock.js Ver arquivo

62
       name: 'stockDamaged',
62
       name: 'stockDamaged',
63
       meta: { title: 'stockDamaged', noCache: true }
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
       path: '/stock/stockWarning',
74
       path: '/stock/stockWarning',
67
       component: () => import('@/xt_pages/stock/stockWarning'),
75
       component: () => import('@/xt_pages/stock/stockWarning'),
83
       meta: { title: 'inventoryPrint', noCache: true }
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
     //   path: "/stock/",
104
     //   path: "/stock/",
88
     //   component: Layout,
105
     //   component: Layout,

+ 7 - 0
src/xt_pages/dialysis/details/dialog/AssessmentAfterDislysis.vue Ver arquivo

1250
       if(predialysis.id > 0){
1250
       if(predialysis.id > 0){
1251
         this.form.hypopiesia = predialysis.hypopiesia.toString()
1251
         this.form.hypopiesia = predialysis.hypopiesia.toString()
1252
       }
1252
       }
1253
+      
1253
 
1254
 
1254
 
1255
 
1255
       this.form.leave_office_method = predialysis.leave_office_method
1256
       this.form.leave_office_method = predialysis.leave_office_method
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 Ver arquivo

1040
           }
1040
           }
1041
           var lastMonitorRecord = resp.data.lastMonitorRecord
1041
           var lastMonitorRecord = resp.data.lastMonitorRecord
1042
           var lastAssessmentAfterDislysis = resp.data.lastAssessmentAfterDislysis
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
           var lastDialysisPrescribe = resp.data.lastDialysisPrescribe
1049
           var lastDialysisPrescribe = resp.data.lastDialysisPrescribe
1044
           var lastDryWeightDislysis = resp.data.lastDryWeightDislysis
1050
           var lastDryWeightDislysis = resp.data.lastDryWeightDislysis
1045
 
1051
 

+ 13 - 2
src/xt_pages/dialysis/template/DialysisPrintOrderThirtyEight.vue Ver arquivo

260
             </span>
260
             </span>
261
           </div>
261
           </div>
262
       </div>
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
       <table class="print-table" border="1">
264
       <table class="print-table" border="1">
265
         <tbody>
265
         <tbody>
266
           <tr>
266
           <tr>
572
         url: ""
572
         url: ""
573
       },
573
       },
574
       displaceLiquiPartOptions: [],
574
       displaceLiquiPartOptions: [],
575
-      complicationList:[]
575
+      complicationList:[],
576
+      bloodPressureMmonitoringSite:[]
576
     };
577
     };
577
   },
578
   },
578
   methods: {
579
   methods: {
586
       var gm=(ty-oy)*12+(tm-om); //距今月数
587
       var gm=(ty-oy)*12+(tm-om); //距今月数
587
       return gm
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
     getComplication(id){
599
     getComplication(id){
590
       var name = "";
600
       var name = "";
591
       for(let i=0;i<this.complicationList.length;i++){
601
       for(let i=0;i<this.complicationList.length;i++){
1298
     this.displaceLiquiPartOptions = this.$store.getters.displace_liqui;
1308
     this.displaceLiquiPartOptions = this.$store.getters.displace_liqui;
1299
     // this.bloodAccessParOpera = getDataConfig('hemodialysis', 'vascular_access_desc')
1309
     // this.bloodAccessParOpera = getDataConfig('hemodialysis', 'vascular_access_desc')
1300
     this.complicationList = getDataConfig('hemodialysis','complication')
1310
     this.complicationList = getDataConfig('hemodialysis','complication')
1311
+    this.bloodPressureMmonitoringSite = getDataConfig('hemodialysis','blood_pressure_monitoring_site');
1301
 
1312
 
1302
     var bloodAccessParOpera = getDataConfig(
1313
     var bloodAccessParOpera = getDataConfig(
1303
       "hemodialysis",
1314
       "hemodialysis",

+ 5 - 5
src/xt_pages/hospitalStation/components/deskPrescription.vue Ver arquivo

472
         end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
472
         end_time: moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
473
         register: [
473
         register: [
474
           { value: 11, label: '普通门诊' },
474
           { value: 11, label: '普通门诊' },
475
-          { value: 12, label: '门诊挂号' },
476
-          { value: 13, label: '急诊' },
475
+          // { value: 12, label: '门诊挂号' },
476
+          // { value: 13, label: '急诊' },
477
           { value: 14, label: '门诊特殊病' },
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
         isLastOrNextVisible: false,
483
         isLastOrNextVisible: false,

+ 5 - 5
src/xt_pages/hospitalStation/components/registerDialog.vue Ver arquivo

197
       return {
197
       return {
198
         registers: [
198
         registers: [
199
           {value: 11, label: "普通门诊"},
199
           {value: 11, label: "普通门诊"},
200
-          {value: 12, label: '门诊挂号'},
201
-          {value: 13, label: "急诊"},
200
+          // {value: 12, label: '门诊挂号'},
201
+          // {value: 13, label: "急诊"},
202
           {value: 14, label: "门诊特殊病"},
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
         medical_care:[
207
         medical_care:[
208
           {value: 11, label: "普通门诊"},
208
           {value: 11, label: "普通门诊"},

+ 5 - 5
src/xt_pages/hospitalStation/components/registerDialog9504.vue Ver arquivo

186
         read_loading:false,
186
         read_loading:false,
187
         registers: [
187
         registers: [
188
           {value: 11, label: "普通门诊"},
188
           {value: 11, label: "普通门诊"},
189
-          {value: 12, label: '门诊挂号'},
190
-          {value: 13, label: "急诊"},
189
+          // {value: 12, label: '门诊挂号'},
190
+          // {value: 13, label: "急诊"},
191
           {value: 14, label: "门诊特殊病"},
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
         medical_care:[
196
         medical_care:[
197
           {value: 11, label: "普通门诊"},
197
           {value: 11, label: "普通门诊"},

+ 5 - 5
src/xt_pages/hospitalStation/index.vue Ver arquivo

176
         read_loading: false,
176
         read_loading: false,
177
         registers: [
177
         registers: [
178
           {value: 11, label: '普通门诊'},
178
           {value: 11, label: '普通门诊'},
179
-          {value: 12, label: '门诊挂号'},
180
-          {value: 13, label: '急诊'},
179
+          // {value: 12, label: '门诊挂号'},
180
+          // {value: 13, label: '急诊'},
181
           {value: 14, label: '门诊特殊病'},
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
         sick: [],
187
         sick: [],

+ 5 - 5
src/xt_pages/hospitalStation/outpatientChargesManagement.vue Ver arquivo

402
       return {
402
       return {
403
         register: [
403
         register: [
404
           { value: 11, label: '普通门诊' },
404
           { value: 11, label: '普通门诊' },
405
-          { value: 12, label: '门诊挂号' },
406
-          { value: 13, label: '急诊' },
405
+          // { value: 12, label: '门诊挂号' },
406
+          // { value: 13, label: '急诊' },
407
           { value: 14, label: '门诊特殊病' },
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
         loading: false,
413
         loading: false,

+ 10 - 2
src/xt_pages/medicalScheduling/index.vue Ver arquivo

425
             })
425
             })
426
         },
426
         },
427
         getDoctorList(){
427
         getDoctorList(){
428
+
428
             getDoctorList().then(response=>{
429
             getDoctorList().then(response=>{
429
                 if(response.data.state == 1){
430
                 if(response.data.state == 1){
430
                     var list =  response.data.data.list
431
                     var list =  response.data.data.list
1008
         getNextWeekList(){
1009
         getNextWeekList(){
1009
             const params = {
1010
             const params = {
1010
                 start_time:this.getTimestamp(this.weekDayArr[0]),
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
             getNextWeekList(params).then(response=>{
1016
             getNextWeekList(params).then(response=>{
1014
                 if(response.data.state == 1){
1017
                 if(response.data.state == 1){
1015
                     var staffList = response.data.data.staffList
1018
                     var staffList = response.data.data.staffList
1314
                     obj.user_type = 10
1317
                     obj.user_type = 10
1315
                     obj.list = arr2
1318
                     obj.list = arr2
1316
                     arr.push(obj)
1319
                     arr.push(obj)
1317
-
1320
+                    if(parseInt(this.typeValue) == 2){
1321
+                      newNurse =  []
1322
+                    }
1323
+                    if(parseInt(this.typeValue) == 3){
1324
+                      newDoctor =  []
1325
+                    }
1318
                     let data = []
1326
                     let data = []
1319
                     data.push(...newNurse)
1327
                     data.push(...newNurse)
1320
                     data.push(...newDoctor)
1328
                     data.push(...newDoctor)

+ 5 - 5
src/xt_pages/outpatientCharges/components/registerDialog.vue Ver arquivo

197
       return {
197
       return {
198
         registers: [
198
         registers: [
199
           { value: 11, label: '普通门诊' },
199
           { value: 11, label: '普通门诊' },
200
-          { value: 12, label: '门诊挂号' },
201
-          { value: 13, label: '急诊' },
200
+          // { value: 12, label: '门诊挂号' },
201
+          // { value: 13, label: '急诊' },
202
           { value: 14, label: '门诊特殊病' },
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
         medical_care: [
207
         medical_care: [
208
           { value: 11, label: '普通门诊' },
208
           { value: 11, label: '普通门诊' },

+ 10 - 10
src/xt_pages/outpatientCharges/outpatientChargesManagement.vue Ver arquivo

589
 
589
 
590
         register: [
590
         register: [
591
           { value: 11, label: '普通门诊' },
591
           { value: 11, label: '普通门诊' },
592
-          { value: 12, label: '门诊挂号' },
593
-          { value: 13, label: '急诊' },
592
+          // { value: 12, label: '门诊挂号' },
593
+          // { value: 13, label: '急诊' },
594
           { value: 14, label: '门诊特殊病' },
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
         register_two: [
600
         register_two: [
601
           { value: '11', label: '普通门诊' },
601
           { value: '11', label: '普通门诊' },
602
-          { value: '12', label: '门诊挂号' },
603
-          { value: '13', label: '急诊' },
602
+          // { value: '12', label: '门诊挂号' },
603
+          // { value: '13', label: '急诊' },
604
           { value: '14', label: '门诊特殊病' },
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
         loading: false,
610
         loading: false,

+ 8 - 9
src/xt_pages/outpatientDoctorStation/components/deskPrescription.vue Ver arquivo

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

+ 8 - 8
src/xt_pages/outpatientDoctorStation/prescriptionTemplatedetail.vue Ver arquivo

280
 
280
 
281
         register: [
281
         register: [
282
           { value: 11, label: '普通门诊' },
282
           { value: 11, label: '普通门诊' },
283
-          { value: 12, label: '门诊挂号' },
284
-          { value: 13, label: '急诊' },
283
+          // { value: 12, label: '门诊挂号' },
284
+          // { value: 13, label: '急诊' },
285
           { value: 14, label: '门诊特殊病' },
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
         crumbs: [
291
         crumbs: [
1279
         //   this.$refs.multipleTable.clearSelection()
1279
         //   this.$refs.multipleTable.clearSelection()
1280
         //   return
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
           if (this.$store.getters.xt_user.org_id == 10138) {
1283
           if (this.$store.getters.xt_user.org_id == 10138) {
1284
             for (let i = 0; i < this.curDrugs.length; i++) {
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
                 this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1286
                 this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1287
                 return
1287
                 return
1288
               }
1288
               }
1294
         if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
1294
         if (this.curPrescriptions.advices.length == 0 && this.curPrescriptions.project.length == 0) {
1295
           if (this.$store.getters.xt_user.org_id == 10138) {
1295
           if (this.$store.getters.xt_user.org_id == 10138) {
1296
             for (let i = 0; i < this.curDrugs.length; i++) {
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
                 this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1298
                 this.$message.error('该处方属于特病类型处方,开非特病类型的药')
1299
                 return
1299
                 return
1300
               }
1300
               }

+ 5 - 5
src/xt_pages/outpatientRegistration/index.vue Ver arquivo

446
         read_loading: false,
446
         read_loading: false,
447
         registers: [
447
         registers: [
448
           { value: 11, label: '普通门诊' },
448
           { value: 11, label: '普通门诊' },
449
-          { value: 12, label: '门诊挂号' },
450
-          { value: 13, label: '急诊' },
449
+          // { value: 12, label: '门诊挂号' },
450
+          // { value: 13, label: '急诊' },
451
           { value: 14, label: '门诊特殊病' },
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
         sick: [],
457
         sick: [],

+ 136 - 0
src/xt_pages/stock/drugs/drugDamagePrint.vue Ver arquivo

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 Ver arquivo

23
                 >
23
                 >
24
                 <el-date-picker
24
                 <el-date-picker
25
                 size="small"
25
                 size="small"
26
-                v-model="value1"
26
+                v-model="start_time"
27
                 type="date"
27
                 type="date"
28
                 style="margin-left:5px;width:140px;"
28
                 style="margin-left:5px;width:140px;"
29
                 placeholder="选择日期">
29
                 placeholder="选择日期">
30
                 </el-date-picker>
30
                 </el-date-picker>
31
                 <el-date-picker
31
                 <el-date-picker
32
                 size="small"
32
                 size="small"
33
-                v-model="value2"
33
+                v-model="end_time"
34
                 type="date"
34
                 type="date"
35
                 style="margin-left:5px;width:140px;"
35
                 style="margin-left:5px;width:140px;"
36
                 placeholder="选择日期">
36
                 placeholder="选择日期">
38
             </div>
38
             </div>
39
             <div>
39
             <div>
40
                 <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
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
                 <el-button size="small" type="primary" @click="print">打印</el-button>
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">导出</el-button>
44
             </div>
44
             </div>
45
         </div>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
                 <template slot-scope="scope">
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
                 </template>
88
                 </template>
77
             </el-table-column>
89
             </el-table-column>
78
         </el-table>
90
         </el-table>
79
         <el-pagination
91
         <el-pagination
80
             @size-change="handleSizeChange"
92
             @size-change="handleSizeChange"
81
             @current-change="handleCurrentChange"
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
             background
96
             background
85
             style="margin-top:20px;text-align: right"
97
             style="margin-top:20px;text-align: right"
86
             layout="total, sizes, prev, pager, next, jumper"
98
             layout="total, sizes, prev, pager, next, jumper"
87
-            :total="total"
88
-        >
99
+            :total="total">
89
         </el-pagination>
100
         </el-pagination>
90
     </div>
101
     </div>
91
     <el-dialog
102
     <el-dialog
92
         title="库房调价"
103
         title="库房调价"
93
         :visible.sync="dialogVisible"
104
         :visible.sync="dialogVisible"
94
-        width="1200px"
95
-        :before-close="handleClose">
105
+        width="1200px">
96
         <el-form :model="form" class="modifyDialog" label-width="120px">
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
             </el-form-item>
109
             </el-form-item>
100
             <el-form-item label="药品名称">
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
             </el-form-item>
127
             </el-form-item>
103
-            <el-form-item label="规格">
128
+            <!-- <el-form-item label="规格">
104
                 <el-input v-model="form.name"></el-input>
129
                 <el-input v-model="form.name"></el-input>
105
-            </el-form-item>
130
+            </el-form-item> -->
106
             <el-form-item label="单位">
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
             </el-form-item>
133
             </el-form-item>
109
             <el-form-item label="进货价">
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
             </el-form-item>
136
             </el-form-item>
112
             <el-form-item label="零售价">
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
             </el-form-item>
139
             </el-form-item>
115
             <el-form-item label="报损数量">
140
             <el-form-item label="报损数量">
116
-                <el-input v-model="form.name"></el-input>
141
+                <el-input v-model="form.count"></el-input>
117
             </el-form-item>
142
             </el-form-item>
118
             <el-form-item label="库存">
143
             <el-form-item label="库存">
119
-                <el-input v-model="form.name"></el-input>
144
+                <el-input v-model="form.total"></el-input>
120
             </el-form-item>
145
             </el-form-item>
121
             <el-form-item label="产地">
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
             </el-form-item>
148
             </el-form-item>
124
             <el-form-item label="批准文号">
149
             <el-form-item label="批准文号">
125
-                <el-input v-model="form.name"></el-input>
150
+                <el-input v-model="form.number"></el-input>
126
             </el-form-item>
151
             </el-form-item>
127
             <el-form-item label="生产厂商">
152
             <el-form-item label="生产厂商">
128
-                <el-input v-model="form.name"></el-input>
153
+                <el-input v-model="form.manufacturer"></el-input>
129
             </el-form-item>
154
             </el-form-item>
130
             <el-form-item label="备注">
155
             <el-form-item label="备注">
131
                 <div style="display:flex;">
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
                 </div>
159
                 </div>
135
             </el-form-item>
160
             </el-form-item>
136
         </el-form>
161
         </el-form>
137
         <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
222
             </el-table-column>
198
             <el-table-column
223
             <el-table-column
199
             fixed="right"
224
             fixed="right"
200
             width="100"
225
             width="100"
201
             label="操作">
226
             label="操作">
202
                 <template slot-scope="scope">
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
                 </template>
230
                 </template>
206
             </el-table-column>
231
             </el-table-column>
207
         </el-table>
232
         </el-table>
208
         <span slot="footer" class="dialog-footer">
233
         <span slot="footer" class="dialog-footer">
209
             <el-button @click="dialogVisible = false">取 消</el-button>
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
         </span>
415
         </span>
212
     </el-dialog>
416
     </el-dialog>
213
-  
417
+    
214
   </div>
418
   </div>
215
 </template>
419
 </template>
216
 
420
 
217
 <script>
421
 <script>
218
 import BreadCrumb from "../../components/bread-crumb";
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
 export default {
425
 export default {
221
     name: "stockModifyPrice",
426
     name: "stockModifyPrice",
222
     components:{
427
     components:{
232
             searchKey:'',
437
             searchKey:'',
233
             value1:'',
438
             value1:'',
234
             value2:'',
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
             dialogVisible:false,
441
             dialogVisible:false,
253
             form: {
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
             total: 0,
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
     methods:{
490
     methods:{
261
 
492
 
262
         },
493
         },
263
         print(){
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
     created(){
794
     created(){
795
+      this.getlist()
272
     },
796
     },
273
     mounted() {
797
     mounted() {
274
     },
798
     },

+ 609 - 102
src/xt_pages/stock/drugs/drugModifyPrice.vue Ver arquivo

38
         </div>
38
         </div>
39
         <div>
39
         <div>
40
             <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
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
             <el-button size="small" type="primary" @click="print">打印</el-button>
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
         </div>
44
         </div>
45
       </div>
45
       </div>
46
       <div style="margin-top:10px">
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
                 </el-table-column>
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
                 </el-table-column>
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
                 </el-table-column>
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
                 </el-table-column>
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
                 </el-table-column>
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
                     <template slot-scope="scope">
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
                     </template>
84
                     </template>
74
                 </el-table-column>
85
                 </el-table-column>
75
             </el-table>
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
         </div>
98
         </div>
77
     </div>
99
     </div>
78
     <el-dialog
100
     <el-dialog
79
         title="库房调价"
101
         title="库房调价"
80
         :visible.sync="dialogVisible"
102
         :visible.sync="dialogVisible"
81
-        width="1200px"
82
-        :before-close="handleClose">
103
+        width="1200px">
83
         <el-form :model="form" class="modifyDialog" label-width="120px">
104
         <el-form :model="form" class="modifyDialog" label-width="120px">
84
             <el-form-item label="药品名称">
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
             </el-form-item>
123
             </el-form-item>
87
             <el-form-item label="原价格">
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
             </el-form-item>
126
             </el-form-item>
90
             <el-form-item label="现价格">
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
             </el-form-item>
129
             </el-form-item>
93
             <el-form-item label="调价数量">
130
             <el-form-item label="调价数量">
94
-                <el-input v-model="form.name"></el-input>
131
+                <el-input v-model="form.count"></el-input>
95
             </el-form-item>
132
             </el-form-item>
96
             <el-form-item label="备注" style="width:66%;">
133
             <el-form-item label="备注" style="width:66%;">
97
                 <div style="display:flex;">
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
                 </div>
137
                 </div>
101
             </el-form-item>
138
             </el-form-item>
102
         </el-form>
139
         </el-form>
103
         <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
200
             </el-table-column>
164
             <el-table-column
201
             <el-table-column
165
             fixed="right"
202
             fixed="right"
166
             width="100"
203
             width="100"
167
             label="操作">
204
             label="操作">
168
                 <template slot-scope="scope">
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
                 </template>
208
                 </template>
172
             </el-table-column>
209
             </el-table-column>
173
         </el-table>
210
         </el-table>
211
+
174
         <span slot="footer" class="dialog-footer">
212
         <span slot="footer" class="dialog-footer">
175
             <el-button @click="dialogVisible = false">取 消</el-button>
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
         </span>
368
         </span>
178
     </el-dialog>
369
     </el-dialog>
179
-  
180
   </div>
370
   </div>
181
 </template>
371
 </template>
182
 
372
 
183
 <script>
373
 <script>
374
+import { uParseTime } from '@/utils/tools'
184
 import BreadCrumb from "../../components/bread-crumb";
375
 import BreadCrumb from "../../components/bread-crumb";
185
-
376
+import {postSearchDrugWarehouseList,saveDrugPrice,getDrugPriceList,SaveCheckedDrugPrice,getDrugModiftyPrice,modifyDrugPrice,deleteDrugPrice} from "@/api/drug/drug"
186
 export default {
377
 export default {
187
     name: "stockModifyPrice",
378
     name: "stockModifyPrice",
188
     components:{
379
     components:{
200
             searchKey:'',
391
             searchKey:'',
201
             value1:'',
392
             value1:'',
202
             value2:'',
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
             dialogVisible:false,
395
             dialogVisible:false,
221
             form: {
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
     methods:{
440
     methods:{
228
 
442
 
229
         },
443
         },
230
         print(){
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
     created(){
741
     created(){
236
         let tableHeight = document.body.clientHeight - 200;
742
         let tableHeight = document.body.clientHeight - 200;
237
         this.tableHeight = tableHeight
743
         this.tableHeight = tableHeight
744
+        this.getlist()
238
     },
745
     },
239
     mounted() {
746
     mounted() {
240
       const that = this;
747
       const that = this;

+ 33 - 16
src/xt_pages/stock/drugs/drugModifyPricePrint.vue Ver arquivo

17
                 </div>
17
                 </div>
18
                 <div class="flex">
18
                 <div class="flex">
19
                     <div>单据编号:</div>
19
                     <div>单据编号:</div>
20
-                    <div>打印日期:</div>
20
+                    <div>打印日期:{{nowtime}}</div>
21
                 </div>
21
                 </div>
22
                 <div class="tableTitle">
22
                 <div class="tableTitle">
23
                     <div style="width:8%">货号</div>
23
                     <div style="width:8%">货号</div>
33
                     <div style="width:8%">新零售价</div>
33
                     <div style="width:8%">新零售价</div>
34
                     <div style="width:8%">零售差价</div>
34
                     <div style="width:8%">零售差价</div>
35
                 </div>
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
                 </div>
49
                 </div>
50
                 <div class="tableBottom">
50
                 <div class="tableBottom">
51
                     <div style="width:8%">合计:</div>
51
                     <div style="width:8%">合计:</div>
56
                     <div style="width:8%"></div>
56
                     <div style="width:8%"></div>
57
                     <div style="width:8%"></div>
57
                     <div style="width:8%"></div>
58
                     <div style="width:8%"></div>
58
                     <div style="width:8%"></div>
59
-                    <div style="width:8%">上三差价</div>
60
                     <div style="width:8%"></div>
59
                     <div style="width:8%"></div>
61
                     <div style="width:8%"></div>
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
                 </div>
63
                 </div>
64
                 <div style="display:flex;margin-top:1px;float:right;margin-top:10px;">
64
                 <div style="display:flex;margin-top:1px;float:right;margin-top:10px;">
65
                     <div style="width:80px;">审批:</div><div style="width:100px;"></div>
65
                     <div style="width:80px;">审批:</div><div style="width:100px;"></div>
77
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
77
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
78
 const moment = require('moment');
78
 const moment = require('moment');
79
 import { uParseTime } from '@/utils/tools'
79
 import { uParseTime } from '@/utils/tools'
80
+import { getModifyPricePrint } from "@/api/drug/drug"
80
 export default {
81
 export default {
81
     components:{
82
     components:{
82
         BreadCrumb
83
         BreadCrumb
88
             { path: false, name: '耗材管理' },
89
             { path: false, name: '耗材管理' },
89
             { path: false, name: '药品调价打印' },
90
             { path: false, name: '药品调价打印' },
90
           ],
91
           ],
92
+          ids:"",
93
+          tableData:[],
94
+          nowtime: moment(new Date()).format('YYYY-MM-DD'),
91
         }
95
         }
92
     },
96
     },
93
     methods:{
97
     methods:{
101
             scanStyles: false
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
     created(){
122
     created(){
123
+     this.ids = this.$route.query.ids
124
+     this.getModifyPricePrint(this.ids)
108
     }
125
     }
109
 }
126
 }
110
 </script>
127
 </script>

+ 393 - 91
src/xt_pages/stock/drugs/inventory.vue Ver arquivo

2
     <div>
2
     <div>
3
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
3
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
4
             <div>
4
             <div>
5
-                <el-select v-model="value" size="small" placeholder="请选择">
5
+                <!-- <el-select v-model="value" size="small" placeholder="请选择">
6
                     <el-option
6
                     <el-option
7
                     v-for="item in options"
7
                     v-for="item in options"
8
                     :key="item.value"
8
                     :key="item.value"
9
                     :label="item.label"
9
                     :label="item.label"
10
                     :value="item.value">
10
                     :value="item.value">
11
                     </el-option>
11
                     </el-option>
12
-                </el-select>
12
+                </el-select> -->
13
                 <el-input
13
                 <el-input
14
                 size="small"
14
                 size="small"
15
                 style="width: 200px;margin-left:10px;"
15
                 style="width: 200px;margin-left:10px;"
75
             <el-table-column
75
             <el-table-column
76
             label="操作">
76
             label="操作">
77
                 <template slot-scope="scope">
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
                 </template>
80
                 </template>
81
             </el-table-column>
81
             </el-table-column>
82
         </el-table>
82
         </el-table>
94
         <el-dialog
94
         <el-dialog
95
         title="库房调价"
95
         title="库房调价"
96
         :visible.sync="dialogVisible"
96
         :visible.sync="dialogVisible"
97
-        width="1200px"
98
-        :before-close="handleClose">
97
+        width="1200px">
99
             <el-form :model="form" class="modifyDialog" label-width="120px">
98
             <el-form :model="form" class="modifyDialog" label-width="120px">
100
                 <el-form-item label="耗材ID">
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
                 </el-form-item>
101
                 </el-form-item>
103
                 <el-form-item label="药品名称">
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
                 </el-form-item>
118
                 </el-form-item>
106
                 <el-form-item label="规格">
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
                 </el-form-item>
121
                 </el-form-item>
109
                 <el-form-item label="单位">
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
                 </el-form-item>
124
                 </el-form-item>
112
                 <el-form-item label="进货价">
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
                 </el-form-item>
127
                 </el-form-item>
115
                 <el-form-item label="零售价">
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
                 </el-form-item>
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
                 </el-form-item>
133
                 </el-form-item>
121
                 <el-form-item label="库存">
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
                 </el-form-item>
136
                 </el-form-item>
124
                 <el-form-item label="产地">
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
                 </el-form-item>
139
                 </el-form-item>
127
                 <el-form-item label="批准文号">
140
                 <el-form-item label="批准文号">
128
-                    <el-input v-model="form.name"></el-input>
141
+                    <el-input v-model="form.number"></el-input>
129
                 </el-form-item>
142
                 </el-form-item>
130
                 <el-form-item label="生产厂商">
143
                 <el-form-item label="生产厂商">
131
-                    <el-input v-model="form.name"></el-input>
144
+                    <el-input v-model="form.manufacturer"></el-input>
132
                 </el-form-item>
145
                 </el-form-item>
133
                 <el-form-item label="备注">
146
                 <el-form-item label="备注">
134
                     <div style="display:flex;">
147
                     <div style="display:flex;">
135
                         <el-input v-model="form.name"></el-input>
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
                     </div>
150
                     </div>
138
                 </el-form-item>
151
                 </el-form-item>
139
             </el-form>
152
             </el-form>
140
             <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
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
                 </el-table-column>
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
                 </el-table-column>
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
                 </el-table-column>
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
                 </el-table-column>
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
                 </el-table-column>
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
                 </el-table-column>
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
                 </el-table-column>
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
                 </el-table-column>
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
                 </el-table-column>
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
                 </el-table-column>
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
                 </el-table-column>
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
                 </el-table-column>
213
                 </el-table-column>
201
                 <el-table-column
214
                 <el-table-column
202
                 fixed="right"
215
                 fixed="right"
203
                 width="100"
216
                 width="100"
204
                 label="操作">
217
                 label="操作">
205
                     <template slot-scope="scope">
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
                     </template>
222
                     </template>
209
                 </el-table-column>
223
                 </el-table-column>
210
             </el-table>
224
             </el-table>
211
             <span slot="footer" class="dialog-footer">
225
             <span slot="footer" class="dialog-footer">
212
                 <el-button @click="dialogVisible = false">取 消</el-button>
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
             </span>
293
             </span>
215
         </el-dialog>
294
         </el-dialog>
216
     </div>
295
     </div>
217
 </template>
296
 </template>
218
 
297
 
219
 <script>
298
 <script>
299
+import { uParseTime } from '@/utils/tools'
300
+import { postSearchDrugWarehouseList,getDrugWarehouseInfoList,saveDrugInventory} from "@/api/drug/drug"
220
 export default {
301
 export default {
221
     name: "drugInventory",
302
     name: "drugInventory",
222
     data() {
303
     data() {
224
             searchKey:'',
305
             searchKey:'',
225
             value1:'',
306
             value1:'',
226
             value2:'',
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
             dialogVisible:false,
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
             total: 0,
339
             total: 0,
249
-            
340
+            editdialogVisible:false,
250
         }
341
         }
251
     },
342
     },
252
     methods:{
343
     methods:{
258
             
349
             
259
         },
350
         },
260
         handleSizeChange(){},
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
     created(){
566
     created(){

+ 1 - 17
src/xt_pages/stock/drugs/inventoryDetails.vue Ver arquivo

266
             searchKey:'',
266
             searchKey:'',
267
             value1:'',
267
             value1:'',
268
             value2:'',
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
             dialogVisible:false,
270
             dialogVisible:false,
287
             form: {
271
             form: {
288
                 name: '',
272
                 name: '',

+ 319 - 26
src/xt_pages/stock/inventory.vue Ver arquivo

42
             </div>
42
             </div>
43
             <div>
43
             <div>
44
                 <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
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
                 <el-button size="small" type="primary" @click="print">打印</el-button>
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
             </div>
48
             </div>
49
         </div>
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
             <el-table-column prop="date" label="盘点编号"  align="center">
52
             <el-table-column prop="date" label="盘点编号"  align="center">
52
               <template slot-scope="scope">
53
               <template slot-scope="scope">
53
                 {{scope.row.warehousing_order}}
54
                 {{scope.row.warehousing_order}}
57
               <template slot-scope="scope" >
58
               <template slot-scope="scope" >
58
                 {{getTime(scope.row.start_time)}}
59
                 {{getTime(scope.row.start_time)}}
59
               </template>  
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
             </el-table-column>
66
             </el-table-column>
61
             <el-table-column prop="name" label="盘点人" align="center">
67
             <el-table-column prop="name" label="盘点人" align="center">
62
              <template slot-scope="scope" >
68
              <template slot-scope="scope" >
81
             </el-table-column>
87
             </el-table-column>
82
             <el-table-column label="操作" align="center">
88
             <el-table-column label="操作" align="center">
83
                 <template slot-scope="scope">
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
                 </template>
92
                 </template>
87
             </el-table-column>
93
             </el-table-column>
88
         </el-table>
94
         </el-table>
89
         <el-pagination
95
         <el-pagination
90
             @size-change="handleSizeChange"
96
             @size-change="handleSizeChange"
91
             @current-change="handleCurrentChange"
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
             background
100
             background
95
             style="margin-top:20px;text-align: right"
101
             style="margin-top:20px;text-align: right"
96
             layout="total, sizes, prev, pager, next, jumper"
102
             layout="total, sizes, prev, pager, next, jumper"
158
                 </el-form-item>
164
                 </el-form-item>
159
             </el-form>
165
             </el-form>
160
             <el-table :data="tableData" border :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
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
                  <template slot-scope="scope">
168
                  <template slot-scope="scope">
163
                    {{scope.row.good_id}}
169
                    {{scope.row.good_id}}
164
                  </template>
170
                  </template>
165
                 </el-table-column>
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
                  <template slot-scope="scope">
173
                  <template slot-scope="scope">
168
                    {{scope.row.good_name}}
174
                    {{scope.row.good_name}}
169
                  </template>
175
                  </template>
170
                 </el-table-column>
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
                  <template slot-scope="scope">
178
                  <template slot-scope="scope">
173
                    {{scope.row.specification_name}}
179
                    {{scope.row.specification_name}}
174
                  </template>
180
                  </template>
175
                 </el-table-column>
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
                   <template slot-scope="scope">
183
                   <template slot-scope="scope">
178
                    {{scope.row.warehousing_unit}}
184
                    {{scope.row.warehousing_unit}}
179
                  </template> 
185
                  </template> 
180
                 </el-table-column>
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
                   <template slot-scope="scope">
188
                   <template slot-scope="scope">
183
-                   {{scope.row.warehousing_unit}}
189
+                   {{scope.row.count}}
184
                  </template> 
190
                  </template> 
185
                 </el-table-column>
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
                     <template slot-scope="scope">
193
                     <template slot-scope="scope">
188
                     {{scope.row.buy_price}}
194
                     {{scope.row.buy_price}}
189
                     </template> 
195
                     </template> 
190
                 </el-table-column>
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
                     <template slot-scope="scope">
198
                     <template slot-scope="scope">
193
                     {{scope.row.packing_price}}
199
                     {{scope.row.packing_price}}
194
                     </template> 
200
                     </template> 
195
                 </el-table-column>
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
                     <template slot-scope="scope">
203
                     <template slot-scope="scope">
198
                         {{scope.row.manufacturer}}
204
                         {{scope.row.manufacturer}}
199
                      </template> 
205
                      </template> 
200
                </el-table-column>
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
                     <template slot-scope="scope">
208
                     <template slot-scope="scope">
203
                     {{scope.row.good_origin_place}}
209
                     {{scope.row.good_origin_place}}
204
                     </template> 
210
                     </template> 
205
                 </el-table-column>
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
                    <template slot-scope="scope">
213
                    <template slot-scope="scope">
208
                     {{scope.row.license_number}}
214
                     {{scope.row.license_number}}
209
                     </template> 
215
                     </template> 
210
                 </el-table-column>
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
                      <template slot-scope="scope">
218
                      <template slot-scope="scope">
213
                       {{scope.row.remark}}
219
                       {{scope.row.remark}}
214
                     </template> 
220
                     </template> 
218
                 width="100"
224
                 width="100"
219
                 label="操作">
225
                 label="操作">
220
                     <template slot-scope="scope">
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
                     </template>
229
                     </template>
224
                 </el-table-column>
230
                 </el-table-column>
225
             </el-table>
231
             </el-table>
228
                 <el-button type="primary" @click="saveInventory">确 定</el-button>
234
                 <el-button type="primary" @click="saveInventory">确 定</el-button>
229
             </span>
235
             </span>
230
         </el-dialog>
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
     </div>
359
     </div>
232
 </template>
360
 </template>
233
 
361
 
234
 <script> 
362
 <script> 
235
 import { uParseTime } from '@/utils/tools'
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
 export default {
365
 export default {
238
     name: "inventory",
366
     name: "inventory",
239
     data() {
367
     data() {
243
             value2:'',
371
             value2:'',
244
             tableData: [],
372
             tableData: [],
245
             dialogVisible:false,
373
             dialogVisible:false,
246
-            form: {
247
-                name: '',
248
-            },
249
             total: 0,
374
             total: 0,
250
             inventoryList:[
375
             inventoryList:[
251
               {id:0,name:"全部"},
376
               {id:0,name:"全部"},
285
          doctorList:[],
410
          doctorList:[],
286
          total:0,
411
          total:0,
287
          tableList:[],
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
     methods:{
422
     methods:{
349
 
481
 
350
         },
482
         },
351
         print(){
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
        getTime(val) {
491
        getTime(val) {
355
          if(val < 0){
492
          if(val < 0){
389
            this.tableData.push(obj)
526
            this.tableData.push(obj)
390
         },
527
         },
391
       saveInventory(){
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
         var params = {
538
         var params = {
393
          tableData:this.tableData,
539
          tableData:this.tableData,
394
         }  
540
         }  
429
        }
575
        }
430
        return name
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
     created(){
726
     created(){
434
       this.getlist()
727
       this.getlist()

+ 125 - 0
src/xt_pages/stock/inventoryDetailPrint.vue Ver arquivo

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 Ver arquivo

2
     <div>
2
     <div>
3
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
3
         <div style="display: flex;align-items: center;justify-content: space-between;margin-bottom:10px;">
4
             <div>
4
             <div>
5
-                耗材类别:
5
+                <!-- 耗材类别:
6
                 <el-select v-model="value" size="small" placeholder="请选择">
6
                 <el-select v-model="value" size="small" placeholder="请选择">
7
                     <el-option
7
                     <el-option
8
                     v-for="item in options"
8
                     v-for="item in options"
10
                     :label="item.label"
10
                     :label="item.label"
11
                     :value="item.value">
11
                     :value="item.value">
12
                     </el-option>
12
                     </el-option>
13
-                </el-select>
14
-                停用状态:
13
+                </el-select> -->
14
+                <!-- 停用状态:
15
                 <el-select v-model="value" size="small" placeholder="请选择">
15
                 <el-select v-model="value" size="small" placeholder="请选择">
16
                     <el-option
16
                     <el-option
17
                     v-for="item in options"
17
                     v-for="item in options"
19
                     :label="item.label"
19
                     :label="item.label"
20
                     :value="item.value">
20
                     :value="item.value">
21
                     </el-option>
21
                     </el-option>
22
-                </el-select>
22
+                </el-select> -->
23
                 <el-input
23
                 <el-input
24
                 size="small"
24
                 size="small"
25
                 style="width: 200px;margin-left:10px;"
25
                 style="width: 200px;margin-left:10px;"
38
             </div>
38
             </div>
39
             <div>
39
             <div>
40
                 <el-button size="small" type="primary" @click="print">打印</el-button>
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
             </div>
42
             </div>
43
         </div>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
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
             </el-table-column>
101
             </el-table-column>
124
         </el-table>
102
         </el-table>
125
         <el-pagination
103
         <el-pagination
126
             @size-change="handleSizeChange"
104
             @size-change="handleSizeChange"
127
             @current-change="handleCurrentChange"
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
             background
108
             background
131
             style="margin-top:20px;text-align: right"
109
             style="margin-top:20px;text-align: right"
132
             layout="total, sizes, prev, pager, next, jumper"
110
             layout="total, sizes, prev, pager, next, jumper"
133
             :total="total"
111
             :total="total"
134
         >
112
         >
135
         </el-pagination>
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
     </div>
114
     </div>
259
 </template>
115
 </template>
260
 
116
 
261
 <script>
117
 <script>
118
+import { getInventoryDetailList } from "@/api/stock"
262
 export default {
119
 export default {
263
     name: "inventory",
120
     name: "inventory",
264
     data() {
121
     data() {
266
             searchKey:'',
123
             searchKey:'',
267
             value1:'',
124
             value1:'',
268
             value2:'',
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
             dialogVisible:false,
127
             dialogVisible:false,
287
             form: {
128
             form: {
288
                 name: '',
129
                 name: '',
289
             },
130
             },
290
             total: 0,
131
             total: 0,
291
-            
292
-        }
132
+            limit:10,
133
+            page:1,
134
+            ids:"",
135
+         }
293
     },
136
     },
294
     methods:{
137
     methods:{
295
         search(){
138
         search(){
296
 
139
 
297
         },
140
         },
298
         print(){
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
         handleSizeChange(){},
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
     created(){
194
     created(){
195
+      this.getlist()
307
     },
196
     },
308
     mounted() {
197
     mounted() {
309
     },
198
     },

+ 35 - 9
src/xt_pages/stock/inventoryPrint.vue Ver arquivo

11
         <div class="app-container" style="background-color: white;">
11
         <div class="app-container" style="background-color: white;">
12
             <div id="print_content">
12
             <div id="print_content">
13
                 <div class="printTitle">库存盘点核单数</div>
13
                 <div class="printTitle">库存盘点核单数</div>
14
-                <div style="float:right;">调价日期:</div>
14
+                <div style="float:right;">调价日期:{{getTime(this.tableData[0].start_time)}}</div>
15
                 <table class="printTable" border="1">
15
                 <table class="printTable" border="1">
16
                     <tr>
16
                     <tr>
17
                         <td>序号</td>
17
                         <td>序号</td>
23
                         <td>盘点数</td>
23
                         <td>盘点数</td>
24
                         <td>亏损金额</td>
24
                         <td>亏损金额</td>
25
                     </tr>
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
                         <td></td>
32
                         <td></td>
33
+                        <td>{{item.count}}</td>
34
                         <td></td>
34
                         <td></td>
35
                     </tr>
35
                     </tr>
36
                 </table>
36
                 </table>
54
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
54
 import BreadCrumb from '@/xt_pages/components/bread-crumb'
55
 const moment = require('moment');
55
 const moment = require('moment');
56
 import { uParseTime } from '@/utils/tools'
56
 import { uParseTime } from '@/utils/tools'
57
+import { getInventoryPrintList } from "@/api/stock"
57
 export default {
58
 export default {
58
     components:{
59
     components:{
59
         BreadCrumb
60
         BreadCrumb
65
             { path: false, name: '耗材管理' },
66
             { path: false, name: '耗材管理' },
66
             { path: false, name: '耗材盘点打印' },
67
             { path: false, name: '耗材盘点打印' },
67
           ],
68
           ],
69
+          ids:"",
70
+          tableData:[],
68
         }
71
         }
69
     },
72
     },
70
     methods:{
73
     methods:{
78
             scanStyles: false
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
     created(){
108
     created(){
109
+      this.ids  = this.$route.query.ids
110
+      this.getInventoryPrintList()
85
     }
111
     }
86
 }
112
 }
87
 </script>
113
 </script>

+ 143 - 0
src/xt_pages/stock/stockDamagePrint.vue Ver arquivo

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 Ver arquivo

19
                 type="primary"
19
                 type="primary"
20
                 icon="el-icon-search"
20
                 icon="el-icon-search"
21
                 @click="search"
21
                 @click="search"
22
-                >搜索</el-button
23
-                >
22
+                placeholder="请输入单据编号或操作人姓名">搜索</el-button>
24
                 <el-date-picker
23
                 <el-date-picker
25
                 size="small"
24
                 size="small"
26
                 v-model="start_time"
25
                 v-model="start_time"
40
                 <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
39
                 <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
41
                 <el-button size="small" type="primary" @click="toCheck">核对</el-button>
40
                 <el-button size="small" type="primary" @click="toCheck">核对</el-button>
42
                 <el-button size="small" type="primary" @click="print">打印</el-button>
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
             </div>
43
             </div>
45
         </div>
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
             <el-table-column type="selection" width="55" align="center"> </el-table-column>
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
                <template  slot-scope="scope">
48
                <template  slot-scope="scope">
50
                 {{scope.row.warehousing_order}}
49
                 {{scope.row.warehousing_order}}
51
                </template>    
50
                </template>    
52
             </el-table-column>
51
             </el-table-column>
53
-            <el-table-column prop="date" label="报损日期">
52
+            <el-table-column prop="date" label="报损日期"  align="center">
54
               <template  slot-scope="scope">
53
               <template  slot-scope="scope">
55
                 {{getTime(scope.row.start_time)}}
54
                 {{getTime(scope.row.start_time)}}
56
                </template>    
55
                </template>    
57
             </el-table-column>
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
               <template  slot-scope="scope">
63
               <template  slot-scope="scope">
60
                 {{scope.row.user_name}}
64
                 {{scope.row.user_name}}
61
                </template>     
65
                </template>     
62
             </el-table-column>
66
             </el-table-column>
63
-            <el-table-column prop="name" label="审核日期">
67
+            <el-table-column prop="name" label="审核日期"  align="center">
64
               <template  slot-scope="scope">
68
               <template  slot-scope="scope">
65
                 {{getTime(scope.row.checker_time)}}
69
                 {{getTime(scope.row.checker_time)}}
66
              </template>
70
              </template>
67
             </el-table-column>
71
             </el-table-column>
68
-            <el-table-column prop="name" label="核对人">
72
+            <el-table-column prop="name" label="核对人"  align="center">
69
               <template slot-scope="scope">
73
               <template slot-scope="scope">
70
                 {{getChecker(scope.row.checker)}}
74
                 {{getChecker(scope.row.checker)}}
71
               </template>
75
               </template>
72
             </el-table-column>
76
             </el-table-column>
73
-            <el-table-column prop="name" label="状态">
77
+            <el-table-column prop="name" label="状态"  align="center">
74
              <template slot-scope="scope">
78
              <template slot-scope="scope">
75
                 <span v-if="scope.row.checker_status == 1">已核对</span>
79
                 <span v-if="scope.row.checker_status == 1">已核对</span>
76
                 <span v-if="scope.row.checker_status == 2">未核对</span>
80
                 <span v-if="scope.row.checker_status == 2">未核对</span>
77
               </template>
81
               </template>
78
             </el-table-column>
82
             </el-table-column>
79
-            <el-table-column label="操作">
83
+            <el-table-column label="操作"  align="center">
80
                 <template slot-scope="scope">
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
                 </template>
87
                 </template>
84
             </el-table-column>
88
             </el-table-column>
85
         </el-table>
89
         </el-table>
86
         <el-pagination
90
         <el-pagination
87
             @size-change="handleSizeChange"
91
             @size-change="handleSizeChange"
88
             @current-change="handleCurrentChange"
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
             background
95
             background
92
             style="margin-top:20px;text-align: right"
96
             style="margin-top:20px;text-align: right"
93
             layout="total, sizes, prev, pager, next, jumper"
97
             layout="total, sizes, prev, pager, next, jumper"
135
             <el-form-item label="零售价">
139
             <el-form-item label="零售价">
136
                 <el-input v-model="form.packing_price"></el-input>
140
                 <el-input v-model="form.packing_price"></el-input>
137
             </el-form-item>
141
             </el-form-item>
138
-            <el-form-item label="新零售价">
142
+            <!-- <el-form-item label="新零售价">
139
                 <el-input v-model="form.new_price"></el-input>
143
                 <el-input v-model="form.new_price"></el-input>
140
-            </el-form-item>
144
+            </el-form-item> -->
141
             <el-form-item label="报损数量">
145
             <el-form-item label="报损数量">
142
                 <el-input v-model="form.count"></el-input>
146
                 <el-input v-model="form.count"></el-input>
143
             </el-form-item>
147
             </el-form-item>
196
                 {{scope.row.packing_price}}
200
                 {{scope.row.packing_price}}
197
                </template>
201
                </template>
198
             </el-table-column>
202
             </el-table-column>
199
-            <el-table-column prop="name" label="新零售价" width="100">
203
+            <!-- <el-table-column prop="name" label="新零售价" width="100">
200
                <template  slot-scope="scope">
204
                <template  slot-scope="scope">
201
                 {{scope.row.new_price}}
205
                 {{scope.row.new_price}}
202
                </template>
206
                </template>
203
-            </el-table-column>
207
+            </el-table-column> -->
204
             <el-table-column prop="name" label="生产厂商" width="100">
208
             <el-table-column prop="name" label="生产厂商" width="100">
205
               <template  slot-scope="scope">
209
               <template  slot-scope="scope">
206
                 {{scope.row.manufacturer}}
210
                 {{scope.row.manufacturer}}
223
             </el-table-column>
227
             </el-table-column>
224
             <el-table-column fixed="right" width="100" label="操作">
228
             <el-table-column fixed="right" width="100" label="操作">
225
                 <template  slot-scope="scope">
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
                 </template>
232
                 </template>
229
             </el-table-column>
233
             </el-table-column>
230
         </el-table>
234
         </el-table>
274
             <el-button type="primary" @click="SaveCheckedDamage">保 存</el-button>
278
             <el-button type="primary" @click="SaveCheckedDamage">保 存</el-button>
275
         </span>
279
         </span>
276
     </el-dialog>
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
   </div>
361
   </div>
278
 </template>
362
 </template>
279
 
363
 
280
 <script>
364
 <script>
281
 import BreadCrumb from "../components/bread-crumb";
365
 import BreadCrumb from "../components/bread-crumb";
282
 import { uParseTime } from '@/utils/tools'
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
 export default {
368
 export default {
285
     name: "stockModifyPrice",
369
     name: "stockModifyPrice",
286
     components:{
370
     components:{
318
                 report_count:"",
402
                 report_count:"",
319
                 total:"",
403
                 total:"",
320
             },
404
             },
321
-            total: 0,
322
             currentIndex: 0,
405
             currentIndex: 0,
323
             manufacturerList:[],
406
             manufacturerList:[],
324
             dealerList:[],
407
             dealerList:[],
333
             doctorList:[],
416
             doctorList:[],
334
             checker:this.$store.getters.xt_user.user.id,
417
             checker:this.$store.getters.xt_user.user.id,
335
             check_time:new Date(),
418
             check_time:new Date(),
419
+            tableList:[],
420
+            editPriceDialogVisible:false,
421
+            modifyPriceDialogVisible:false,
422
+            id:0,
336
         }
423
         }
337
     },
424
     },
338
     methods:{
425
     methods:{
340
 
427
 
341
         },
428
         },
342
         print(){
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
         handleSizeChange(val){
438
         handleSizeChange(val){
347
           this.limit = val
439
           this.limit = val
373
                 for(let j=0;j<this.manufacturerList.length;j++){
465
                 for(let j=0;j<this.manufacturerList.length;j++){
374
                 if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
466
                 if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
375
                     this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
467
                     this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
376
-                }
468
+                 }
377
                 }
469
                 }
378
             }
470
             }
379
 
471
 
421
           good_origin_place:this.form.good_origin_place,
513
           good_origin_place:this.form.good_origin_place,
422
           license_number:this.form.license_number,
514
           license_number:this.form.license_number,
423
           remark:this.form.remark,
515
           remark:this.form.remark,
424
-          new_price:this.form.new_price.toString(),
516
+          // new_price:this.form.new_price.toString(),
425
           warehousing_order:this.form.warehousing_order,
517
           warehousing_order:this.form.warehousing_order,
426
           dealer:this.form.dealer,
518
           dealer:this.form.dealer,
427
           start_time:this.getTime(new Date()),
519
           start_time:this.getTime(new Date()),
429
         this.tableData.push(obj)
521
         this.tableData.push(obj)
430
       },
522
       },
431
       saveReportStock(){
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
           var params = {
532
           var params = {
433
             tableData:this.tableData,
533
             tableData:this.tableData,
434
           }
534
           }
438
              var msg = response.data.data.msg
538
              var msg = response.data.data.msg
439
              this.$message.success("保存成功")
539
              this.$message.success("保存成功")
440
              this.dialogVisible = false
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
             var list = response.data.data.list
578
             var list = response.data.data.list
466
             console.log("list",list)
579
             console.log("list",list)
467
             this.total = response.data.data.total
580
             this.total = response.data.data.total
468
-            this.tableData = list
581
+            this.tableList = list
469
            var doctorlist = response.data.data.doctorlist
582
            var doctorlist = response.data.data.doctorlist
470
            this.doctorList = doctorlist
583
            this.doctorList = doctorlist
471
           }
584
           }
518
        }
631
        }
519
        return name
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
     created(){
746
     created(){
523
         // var nowDate = new Date();
747
         // var nowDate = new Date();

+ 170 - 21
src/xt_pages/stock/stockModifyPrice.vue Ver arquivo

11
             style="width: 200px;"
11
             style="width: 200px;"
12
             class="filter-item"
12
             class="filter-item"
13
             v-model.trim="searchKey"
13
             v-model.trim="searchKey"
14
-            placeholder=""
14
+            placeholder="请输入单据编号或操作人姓名"
15
             />
15
             />
16
             <el-button
16
             <el-button
17
             size="small"
17
             size="small"
19
             type="primary"
19
             type="primary"
20
             icon="el-icon-search"
20
             icon="el-icon-search"
21
             @click="search"
21
             @click="search"
22
-            placeholder="请输入单据编号或操作人姓名"
23
             >搜索</el-button
22
             >搜索</el-button
24
             >
23
             >
25
             <el-date-picker
24
             <el-date-picker
41
             <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
40
             <el-button size="small" type="primary" @click="dialogVisible = true">新增</el-button>
42
             <el-button size="small" type="primary" @click="toCheck">核对</el-button>
41
             <el-button size="small" type="primary" @click="toCheck">核对</el-button>
43
             <el-button size="small" type="primary" @click="print">打印</el-button>
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
         </div>
44
         </div>
46
       </div>
45
       </div>
47
       <div>
46
       <div>
58
                            {{scope.row.good_name}}
57
                            {{scope.row.good_name}}
59
                         </template>
58
                         </template>
60
                     </el-table-column>
59
                     </el-table-column>
61
-                    <el-table-column label="规格" width="100">
60
+                    <el-table-column label="规格" width="100" align="center">
62
                       <template slot-scope="scope">
61
                       <template slot-scope="scope">
63
                          {{scope.row.specification_name}}
62
                          {{scope.row.specification_name}}
64
                       </template>
63
                       </template>
65
                     </el-table-column>
64
                     </el-table-column>
66
-                    <el-table-column label="单位" width="100">
65
+                    <el-table-column label="单位" width="100" align="center">
67
                       <template slot-scope="scope">
66
                       <template slot-scope="scope">
68
                          {{scope.row.packing_unit}}
67
                          {{scope.row.packing_unit}}
69
                       </template>
68
                       </template>
70
                     </el-table-column>
69
                     </el-table-column>
71
-                    <el-table-column label="调价数量" width="100">
70
+                    <el-table-column label="调价数量" width="100" align="center">
72
                       <template slot-scope="scope">
71
                       <template slot-scope="scope">
73
                        {{scope.row.count}}
72
                        {{scope.row.count}}
74
                       </template>
73
                       </template>
75
                     </el-table-column>
74
                     </el-table-column>
76
-                    <el-table-column label="原进货价" width="100">
75
+                    <el-table-column label="原进货价" width="100" align="center">
77
                       <template slot-scope="scope">
76
                       <template slot-scope="scope">
78
                        {{scope.row.buy_price}}
77
                        {{scope.row.buy_price}}
79
                       </template>
78
                       </template>
80
                     </el-table-column>
79
                     </el-table-column>
81
-                    <el-table-column label="原零售价" width="100">
80
+                    <el-table-column label="原零售价" width="100" align="center">
82
                       <template slot-scope="scope">
81
                       <template slot-scope="scope">
83
                        {{scope.row.packing_price}}
82
                        {{scope.row.packing_price}}
84
                      </template>
83
                      </template>
85
                     </el-table-column>
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
                       <template slot-scope="scope">
91
                       <template slot-scope="scope">
88
                        {{scope.row.manufacturer}}
92
                        {{scope.row.manufacturer}}
89
                       </template>
93
                       </template>
90
                     </el-table-column>
94
                     </el-table-column>
91
-                    <el-table-column label="经销商" width="100">
95
+                    <el-table-column label="经销商" width="100" align="center">
92
                       <template slot-scope="scope">
96
                       <template slot-scope="scope">
93
                         {{scope.row.dealer}}
97
                         {{scope.row.dealer}}
94
                       </template>
98
                       </template>
95
                     </el-table-column>
99
                     </el-table-column>
96
-                    <el-table-column label="操作人" width="100">
100
+                    <el-table-column label="操作人" width="100" align="center">
97
                       <template slot-scope="scope">
101
                       <template slot-scope="scope">
98
                         {{getDoctor(scope.row.creater)}}
102
                         {{getDoctor(scope.row.creater)}}
99
                       </template>
103
                       </template>
100
                     </el-table-column>
104
                     </el-table-column>
101
-                    <el-table-column label="核对人" width="100">
105
+                    <el-table-column label="核对人" width="100" align="center">
102
                       <template slot-scope="scope">
106
                       <template slot-scope="scope">
103
                          {{getDoctor(scope.row.checker)}}
107
                          {{getDoctor(scope.row.checker)}}
104
                       </template>
108
                       </template>
105
                     </el-table-column>
109
                     </el-table-column>
106
-                    <el-table-column label="状态" width="100">
110
+                    <el-table-column label="状态" width="100" align="center">
107
                       <template slot-scope="scope">
111
                       <template slot-scope="scope">
108
                         <span v-if="scope.row.checker_status == 2">未核对</span>
112
                         <span v-if="scope.row.checker_status == 2">未核对</span>
109
                         <span v-if="scope.row.checker_status == 1">已核对</span>  
113
                         <span v-if="scope.row.checker_status == 1">已核对</span>  
110
                       </template>
114
                       </template>
111
                     </el-table-column>
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
                      <template slot-scope="scope">
117
                      <template slot-scope="scope">
114
                           {{getTime(scope.row.start_time)}}
118
                           {{getTime(scope.row.start_time)}}
115
                      </template> 
119
                      </template> 
116
                     </el-table-column>
120
                     </el-table-column>
117
-                    <el-table-column label="备注" width="100">
121
+                    <el-table-column label="备注" width="100" align="center">
118
                        <template slot-scope="scope">
122
                        <template slot-scope="scope">
119
                          {{scope.row.remark}}
123
                          {{scope.row.remark}}
120
                        </template>
124
                        </template>
121
                     </el-table-column>
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
                 </el-table>
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
             </div>
144
             </div>
124
                 <!-- <el-table :data="tableData" border :height="tableHeight" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
145
                 <!-- <el-table :data="tableData" border :height="tableHeight" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }">
125
                     <el-table-column
146
                     <el-table-column
410
             <el-button type="primary" @click="SaveCheckedPrice">保 存</el-button>
431
             <el-button type="primary" @click="SaveCheckedPrice">保 存</el-button>
411
         </span>
432
         </span>
412
     </el-dialog>
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
   </div>
458
   </div>
414
 </template>
459
 </template>
415
 
460
 
416
 <script>
461
 <script>
417
 import BreadCrumb from "../components/bread-crumb";
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
 import { uParseTime } from '@/utils/tools'
464
 import { uParseTime } from '@/utils/tools'
420
 export default {
465
 export default {
421
     name: "stockModifyPrice",
466
     name: "stockModifyPrice",
466
             check_time:new Date(),
511
             check_time:new Date(),
467
             checker:this.$store.getters.xt_user.user.id,
512
             checker:this.$store.getters.xt_user.user.id,
468
             checkDialogVisible:false,
513
             checkDialogVisible:false,
514
+            limit:10,
515
+            page:1,
516
+            total:0,
517
+            modifyDialogVisible:false,
518
+            id:0,
469
         }
519
         }
470
     },
520
     },
471
     methods:{
521
     methods:{
472
         search(){
522
         search(){
473
-
523
+          this.getAllStockPrice()
474
         },
524
         },
475
         print(){
525
         print(){
476
             if(this.ids == ""){
526
             if(this.ids == ""){
535
           this.form.buy_price = val.buy_price
585
           this.form.buy_price = val.buy_price
536
           this.form.warehousing_unit = val.packing_unit
586
           this.form.warehousing_unit = val.packing_unit
537
          
587
          
538
-      },
539
-      handleClose(){
540
-
541
       },
588
       },
542
       addPrice(){
589
       addPrice(){
543
         var obj = {
590
         var obj = {
589
      editPrice(row){
636
      editPrice(row){
590
       console.log("row232233223",row)
637
       console.log("row232233223",row)
591
       this.form.good_name = row.good_name
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
       this.form.new_price = row.new_price
641
       this.form.new_price = row.new_price
594
       this.form.count = row.count
642
       this.form.count = row.count
595
       this.form.remark = row.remark
643
       this.form.remark = row.remark
607
          }
655
          }
608
        }
656
        }
609
        this.editPriceDialogVisible = false
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
      saveAdjustPrice(){
664
      saveAdjustPrice(){
612
          for(let i=0;i<this.tableData.length;i++){
665
          for(let i=0;i<this.tableData.length;i++){
614
            this.tableData[i].packing_price = this.tableData[i].packing_price.toString()
667
            this.tableData[i].packing_price = this.tableData[i].packing_price.toString()
615
            this.tableData[i].new_price = this.tableData[i].new_price.toString()
668
            this.tableData[i].new_price = this.tableData[i].new_price.toString()
616
            this.tableData[i].count =  parseInt(this.tableData[i].count)
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
          var params= {
677
          var params= {
619
            tableData:this.tableData,
678
            tableData:this.tableData,
625
           console.log("msg",msg)
684
           console.log("msg",msg)
626
           this.$message.success("保存成功!")
685
           this.$message.success("保存成功!")
627
           this.dialogVisible = false
686
           this.dialogVisible = false
687
+          this.getAllStockPrice()
628
         }
688
         }
629
       })  
689
       })  
630
      },
690
      },
633
             keyword:this.searchKey,
693
             keyword:this.searchKey,
634
             start_time:this.start_time,
694
             start_time:this.start_time,
635
             end_time:this.end_time,
695
             end_time:this.end_time,
696
+            limit:this.limit,
697
+            page:this.page,
636
          }
698
          }
637
         console.log("params",params)
699
         console.log("params",params)
638
        getAllStockPrice(params).then(response=>{
700
        getAllStockPrice(params).then(response=>{
643
            var doctor = response.data.data.doctor
705
            var doctor = response.data.data.doctor
644
            console.log("doctor",doctor)
706
            console.log("doctor",doctor)
645
            this.doctorList = doctor
707
            this.doctorList = doctor
708
+           this.total = response.data.data.total
646
          }
709
          }
647
        })  
710
        })  
648
      },
711
      },
694
            this.checkDialogVisible = false
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
     created(){
848
     created(){

+ 16 - 13
src/xt_pages/user/dialysisSolution.vue Ver arquivo

438
             </el-form-item>
438
             </el-form-item>
439
           </el-col>
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
              <el-form-item label="灌流器:">
442
              <el-form-item label="灌流器:">
443
                <el-input v-model="dialysis_irrigation" @focus="showInnerDialog('7')"></el-input>
443
                <el-input v-model="dialysis_irrigation" @focus="showInnerDialog('7')"></el-input>
444
              </el-form-item>
444
              </el-form-item>
1640
     
1640
     
1641
       this.addPlan.remark = row.remark
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
       if(row.dialyzer_perfusion_apparatus!="" ||  row.dialyzer_perfusion_apparatus!=undefined){
1661
       if(row.dialyzer_perfusion_apparatus!="" ||  row.dialyzer_perfusion_apparatus!=undefined){
1659
          this.addPlan.dialyzer_perfusion_apparatus = row.dialyzer_perfusion_apparatus.toString()
1662
          this.addPlan.dialyzer_perfusion_apparatus = row.dialyzer_perfusion_apparatus.toString()

+ 37 - 36
src/xt_pages/user/templateSummary.vue Ver arquivo

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

+ 2 - 2
src/xt_pages/user/templateSummaryPrint.vue Ver arquivo

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

+ 13 - 13
src/xt_permission.js Ver arquivo

12
 
12
 
13
 router.beforeEach((to, from, next) => {
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
   NProgress.start()
30
   NProgress.start()