
--- client/views/pages/equipment/EquipmentManagementSelect.jsx
+++ client/views/pages/equipment/EquipmentManagementSelect.jsx
... | ... | @@ -16,7 +16,7 @@ |
16 | 16 |
const closeModal = () => { |
17 | 17 |
setModalOpen(false); |
18 | 18 |
}; |
19 |
- |
|
19 |
+ |
|
20 | 20 |
const [modalOpen3, setModalOpen3] = React.useState(false); |
21 | 21 |
const openModal3 = () => { |
22 | 22 |
// equipmentListData(); |
... | ... | @@ -26,9 +26,9 @@ |
26 | 26 |
setModalOpen3(false); |
27 | 27 |
}; |
28 | 28 |
|
29 |
- // 대상자 매칭 삭제 |
|
29 |
+ // 대상자 매칭 반납 |
|
30 | 30 |
const seniorMatchDelete = () => { |
31 |
- if(confirm('등록된 대상자를 삭제하시겠습니까?') == false) { |
|
31 |
+ if (confirm('아니다') == false) { |
|
32 | 32 |
return; |
33 | 33 |
} |
34 | 34 |
// 대상자 매칭 삭제 함수 사용하기 |
... | ... | @@ -48,6 +48,7 @@ |
48 | 48 |
headers: { |
49 | 49 |
'Content-Type': 'application/json; charset=UTF-8' |
50 | 50 |
}, |
51 |
+ body: JSON.stringify({}) |
|
51 | 52 |
}).then((response) => response.json()).then((data) => { |
52 | 53 |
console.log('equipmentSelectList response : ', data); |
53 | 54 |
setEquipmentList(data); |
... | ... | @@ -72,7 +73,7 @@ |
72 | 73 |
"equipment_stock_date", |
73 | 74 |
"equipment_state", |
74 | 75 |
"agency_name", |
75 |
- "user_name", |
|
76 |
+ "senior_name", |
|
76 | 77 |
]; |
77 | 78 |
|
78 | 79 |
const thead2 = [ |
... | ... | @@ -108,7 +109,7 @@ |
108 | 109 |
<Button |
109 | 110 |
className={"btn-small gray-btn"} |
110 | 111 |
btnName={"선택"} |
111 |
- // onClick={openModal2} |
|
112 |
+ // onClick={openModal2} |
|
112 | 113 |
/> |
113 | 114 |
), |
114 | 115 |
}, |
... | ... | @@ -126,7 +127,7 @@ |
126 | 127 |
<Button |
127 | 128 |
className={"btn-small gray-btn"} |
128 | 129 |
btnName={"선택"} |
129 |
- // onClick={openModal2} |
|
130 |
+ // onClick={openModal2} |
|
130 | 131 |
/> |
131 | 132 |
), |
132 | 133 |
}, |
... | ... | @@ -177,22 +178,27 @@ |
177 | 178 |
const [agencySeniorEquipmentList, setAgencySeniorEquipmentList] = React.useState([]); |
178 | 179 |
// 시행기관 재고 장비 목록 |
179 | 180 |
const [agencyStockEquipmentList, setAgencyStockEquipmentList] = React.useState([]); |
180 |
- // 선택 대상자 장비 |
|
181 |
+ // 선택한 대상자 장비 |
|
181 | 182 |
const [seniorEquipment, setSeniorEquipment] = React.useState({}); |
183 |
+ // 대상자 장비 등록 모달창 |
|
184 |
+ const [seniorMatchInsertModal, setSeniorMatchInsertModal] = React.useState(false); |
|
185 |
+ // 대상자 장비 삭제 모달창 |
|
186 |
+ const [seniorMatchDeleteModal, setSeniorMatchDeleteModal] = React.useState(false); |
|
187 |
+ |
|
182 | 188 |
// 대상자 목록 |
183 | 189 |
const [seniorList, setSeniorList] = React.useState([]); |
184 |
- // 대상자 장비 등록 모달창 |
|
185 |
- const [seniorMatchModal, setSeniorMatchModal] = React.useState(false); |
|
186 |
- |
|
190 |
+ // 담당자 목록 |
|
191 |
+ const [workerList, setWorkerList] = React.useState([]); |
|
192 |
+ |
|
187 | 193 |
|
188 | 194 |
// 대상자 장비 등록 모달창 열기 |
189 |
- const seniorMatchModalOpen = (item) => { |
|
195 |
+ const seniorMatchInsertModalOpen = (item) => { |
|
190 | 196 |
setSeniorEquipment(item); // 선택한 장비 데이터 저장 |
191 |
- setSeniorMatchModal(true); |
|
197 |
+ setSeniorMatchInsertModal(true); |
|
192 | 198 |
}; |
193 | 199 |
// 대상자 장비 등록 모달창 닫기 |
194 |
- const seniorMatchModalClose = () => { |
|
195 |
- setSeniorMatchModal(false); |
|
200 |
+ const seniorMatchInsertModalClose = () => { |
|
201 |
+ setSeniorMatchInsertModal(false); |
|
196 | 202 |
}; |
197 | 203 |
|
198 | 204 |
// 대상자 장비 등록 - 대상자 |
... | ... | @@ -239,30 +245,41 @@ |
239 | 245 |
setSeniorEquipment(data); |
240 | 246 |
}; |
241 | 247 |
|
248 |
+ // 대상자 장비 삭제 모달창 열기 |
|
249 |
+ const seniorMatchDeleteModalOpen = (item) => { |
|
250 |
+ setSeniorEquipment(item); // 선택한 장비 데이터 저장 |
|
251 |
+ setSeniorMatchDeleteModal(true); |
|
252 |
+ }; |
|
253 |
+ // 대상자 장비 삭제 모달창 닫기 |
|
254 |
+ const seniorMatchDeleteModalClose = () => { |
|
255 |
+ setSeniorMatchDeleteModal(false); |
|
256 |
+ }; |
|
257 |
+ // 대상자 장비 - 반납일 |
|
258 |
+ const seniorEquipmentRentalReturnDateInsert = (e) => { |
|
259 |
+ // 원본 데이터 복사 및 수정 |
|
260 |
+ let data = { |
|
261 |
+ ...seniorEquipment, |
|
262 |
+ equipment_rental_return_date: e.target.value |
|
263 |
+ } |
|
264 |
+ // 복사 데이터를 원본 데이터에 덮어쓰기 |
|
265 |
+ setSeniorEquipment(data); |
|
266 |
+ }; |
|
267 |
+ // 대상자 장비 - 반납 관리자 |
|
268 |
+ const seniorEquipmentReturnUserIdInsert = (e) => { |
|
269 |
+ // 원본 데이터 복사 및 수정 |
|
270 |
+ let data = { |
|
271 |
+ ...seniorEquipment, |
|
272 |
+ return_user_id: e.target.value |
|
273 |
+ } |
|
274 |
+ // 복사 데이터를 원본 데이터에 덮어쓰기 |
|
275 |
+ setSeniorEquipment(data); |
|
276 |
+ }; |
|
277 |
+ |
|
242 | 278 |
|
243 | 279 |
// 시행기관 전체 장비 목록 조회 |
244 |
- const agencyEquipmentSelectList = () => { |
|
245 |
- console.log('agencyEquipmentSelectList Function Run'); |
|
246 |
- fetch("/equipment/agencyEquipmentSelectList.json", { |
|
247 |
- method: "POST", |
|
248 |
- headers: { |
|
249 |
- 'Content-Type': 'application/json; charset=UTF-8' |
|
250 |
- }, |
|
251 |
- body: JSON.stringify({ |
|
252 |
- agency_id: 'AGENCY01', |
|
253 |
- }), |
|
254 |
- }).then((response) => response.json()).then((data) => { |
|
255 |
- console.log('agencyEquipmentSelectList response : ', data); |
|
256 |
- setAgencyEquipmentList(data); |
|
257 |
- }).catch((error) => { |
|
258 |
- console.log('agencyEquipmentSelectList error : ', error); |
|
259 |
- }); |
|
260 |
- } |
|
261 |
- |
|
262 |
- // 시행기관 대상자 장비 목록 조회 |
|
263 |
- // const agencySeniorEquipmentSelectList = () => { |
|
264 |
- // console.log('agencySeniorEquipmentSelectList Function Run'); |
|
265 |
- // fetch("/equipment/agencySeniorEquipmentSelectList.json", { |
|
280 |
+ // const agencyEquipmentSelectList = () => { |
|
281 |
+ // console.log('agencyEquipmentSelectList Function Run'); |
|
282 |
+ // fetch("/equipment/agencyEquipmentSelectList.json", { |
|
266 | 283 |
// method: "POST", |
267 | 284 |
// headers: { |
268 | 285 |
// 'Content-Type': 'application/json; charset=UTF-8' |
... | ... | @@ -271,12 +288,72 @@ |
271 | 288 |
// agency_id: 'AGENCY01', |
272 | 289 |
// }), |
273 | 290 |
// }).then((response) => response.json()).then((data) => { |
274 |
- // console.log('agencySeniorEquipmentSelectList response : ', data); |
|
275 |
- // setAgencySeniorEquipmentList(data); |
|
291 |
+ // console.log('agencyEquipmentSelectList response : ', data); |
|
292 |
+ // setAgencyEquipmentList(data); |
|
276 | 293 |
// }).catch((error) => { |
277 |
- // console.log('agencySeniorEquipmentSelectList error : ', error); |
|
294 |
+ // console.log('agencyEquipmentSelectList error : ', error); |
|
278 | 295 |
// }); |
279 | 296 |
// } |
297 |
+ |
|
298 |
+ // 시행기관 전체 장비 목록 조회 |
|
299 |
+ const agencyEquipmentSelectList = () => { |
|
300 |
+ console.log('equipmentSelectList Function Run'); |
|
301 |
+ fetch("/equipment/equipmentSelectList.json", { |
|
302 |
+ method: "POST", |
|
303 |
+ headers: { |
|
304 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
305 |
+ }, |
|
306 |
+ body: JSON.stringify({ |
|
307 |
+ agency_id: 'AGENCY01', |
|
308 |
+ searchAll: true |
|
309 |
+ }), |
|
310 |
+ }).then((response) => response.json()).then((data) => { |
|
311 |
+ console.log('equipmentSelectList response : ', data); |
|
312 |
+ setAgencyEquipmentList(data); |
|
313 |
+ }).catch((error) => { |
|
314 |
+ console.log('equipmentSelectList error : ', error); |
|
315 |
+ }); |
|
316 |
+ } |
|
317 |
+ |
|
318 |
+ // 시행기관 대상자 장비 목록 조회 |
|
319 |
+ const agencySeniorEquipmentSelectList = () => { |
|
320 |
+ console.log('agencySeniorEquipmentSelectList Function Run'); |
|
321 |
+ fetch("/equipment/equipmentSelectList.json", { |
|
322 |
+ method: "POST", |
|
323 |
+ headers: { |
|
324 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
325 |
+ }, |
|
326 |
+ body: JSON.stringify({ |
|
327 |
+ agency_id: 'AGENCY01', |
|
328 |
+ seniorCheck: true |
|
329 |
+ }), |
|
330 |
+ }).then((response) => response.json()).then((data) => { |
|
331 |
+ console.log('agencySeniorEquipmentSelectList response : ', data); |
|
332 |
+ setAgencySeniorEquipmentList(data); |
|
333 |
+ }).catch((error) => { |
|
334 |
+ console.log('agencySeniorEquipmentSelectList error : ', error); |
|
335 |
+ }); |
|
336 |
+ } |
|
337 |
+ |
|
338 |
+ // 시행기관 재고 장비 목록 조회 |
|
339 |
+ const agencyStockEquipmentSelectList = () => { |
|
340 |
+ console.log('agencyStockEquipmentList Function Run'); |
|
341 |
+ fetch("/equipment/equipmentSelectList.json", { |
|
342 |
+ method: "POST", |
|
343 |
+ headers: { |
|
344 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
345 |
+ }, |
|
346 |
+ body: JSON.stringify({ |
|
347 |
+ agency_id: 'AGENCY01', |
|
348 |
+ seniorCheck: false |
|
349 |
+ }), |
|
350 |
+ }).then((response) => response.json()).then((data) => { |
|
351 |
+ console.log('agencyStockEquipmentList response : ', data); |
|
352 |
+ setAgencyStockEquipmentList(data); |
|
353 |
+ }).catch((error) => { |
|
354 |
+ console.log('agencyStockEquipmentList error : ', error); |
|
355 |
+ }); |
|
356 |
+ } |
|
280 | 357 |
|
281 | 358 |
// 대상자 장비 등록 |
282 | 359 |
const seniorEquipmentInsert = () => { |
... | ... | @@ -284,9 +361,9 @@ |
284 | 361 |
|
285 | 362 |
// 대상자 아이디 유효성 검사 |
286 | 363 |
let check = 0; |
287 |
- for(let i = 0; i < seniorList.length; i++) { |
|
364 |
+ for (let i = 0; i < seniorList.length; i++) { |
|
288 | 365 |
// 입력한 데이터가 대상자 목록에 있을 경우 |
289 |
- if(seniorList[i]['user_id'] == seniorEquipment['senior_id']) { |
|
366 |
+ if (seniorList[i]['user_id'] == seniorEquipment['senior_id']) { |
|
290 | 367 |
console.log('success: ', seniorList[i]['user_id']); |
291 | 368 |
// 원본 데이터 복사 및 수정 |
292 | 369 |
let data = { |
... | ... | @@ -300,7 +377,7 @@ |
300 | 377 |
} |
301 | 378 |
} |
302 | 379 |
// 입력한 데이터가 대상자 목록에 없을 경우 |
303 |
- if(check != 1) { |
|
380 |
+ if (check != 1) { |
|
304 | 381 |
console.log('fail: ', seniorList, seniorEquipment['senior_id']); |
305 | 382 |
alert('존재하지 않는 대상자입니다.'); |
306 | 383 |
return; |
... | ... | @@ -331,6 +408,7 @@ |
331 | 408 |
headers: { |
332 | 409 |
'Content-Type': 'application/json; charset=UTF-8' |
333 | 410 |
}, |
411 |
+ body: JSON.stringify({}) |
|
334 | 412 |
}).then((response) => response.json()).then((data) => { |
335 | 413 |
console.log('seniorSelectList response : ', data); |
336 | 414 |
setSeniorList(data); |
... | ... | @@ -339,6 +417,24 @@ |
339 | 417 |
}); |
340 | 418 |
} |
341 | 419 |
|
420 |
+ // 담당자 목록 조회 |
|
421 |
+ const workerSelectList = () => { |
|
422 |
+ console.log('workerSelectList Function Run'); |
|
423 |
+ fetch("/user/selectSubjectList.json", { |
|
424 |
+ method: "POST", |
|
425 |
+ headers: { |
|
426 |
+ 'Content-Type': 'application/json; charset=UTF-8' |
|
427 |
+ }, |
|
428 |
+ body: JSON.stringify({}) |
|
429 |
+ }).then((response) => response.json()).then((data) => { |
|
430 |
+ console.log('workerSelectList response : ', data); |
|
431 |
+ setSeniorList(data); |
|
432 |
+ }).catch((error) => { |
|
433 |
+ console.log('workerSelectList error : ', error); |
|
434 |
+ }); |
|
435 |
+ } |
|
436 |
+ |
|
437 |
+ // 시행기관 전체 장비 thead, key |
|
342 | 438 |
const thead11 = [ |
343 | 439 |
"No", |
344 | 440 |
"모델 명", |
... | ... | @@ -347,19 +443,18 @@ |
347 | 443 |
"대상자", |
348 | 444 |
"대여일", |
349 | 445 |
"반납예정일", |
350 |
- "반납일", |
|
351 | 446 |
"관리" |
352 | 447 |
]; |
353 | 448 |
const key11 = [ |
354 | 449 |
"equipment_name", |
355 | 450 |
"equipment_serial_number", |
356 | 451 |
"equipment_state", |
357 |
- "user_name", |
|
452 |
+ "senior_name", |
|
358 | 453 |
"equipment_rental_start_date", |
359 | 454 |
"equipment_rental_end_date", |
360 |
- "equipment_rental_return_date" |
|
361 | 455 |
]; |
362 | 456 |
|
457 |
+ // 시행기관 대상자 장비 thead, key |
|
363 | 458 |
const thead22 = [ |
364 | 459 |
"No", |
365 | 460 |
"모델 명", |
... | ... | @@ -368,100 +463,66 @@ |
368 | 463 |
"대상자", |
369 | 464 |
"대여일", |
370 | 465 |
"반납예정일", |
371 |
- "반납일", |
|
372 | 466 |
"관리" |
373 | 467 |
]; |
374 | 468 |
const key22 = [ |
375 | 469 |
"equipment_name", |
376 | 470 |
"equipment_serial_number", |
377 | 471 |
"equipment_state", |
378 |
- "user_name", |
|
472 |
+ "senior_name", |
|
379 | 473 |
"equipment_rental_start_date", |
380 | 474 |
"equipment_rental_end_date", |
381 |
- "equipment_rental_return_date" |
|
382 | 475 |
]; |
383 | 476 |
|
477 |
+ // 시행기관 재고 장비 thead, key |
|
384 | 478 |
const thead33 = [ |
385 | 479 |
"No", |
386 |
- "장비명", |
|
480 |
+ "모델 명", |
|
387 | 481 |
"시리얼 넘버", |
388 |
- "입고일자", |
|
389 |
- "납품 기관",//관리기관, 올잇메디 |
|
390 |
- "대상자",//시행기관 |
|
482 |
+ "상태", |
|
483 |
+ "대상자", |
|
484 |
+ "대여일", |
|
485 |
+ "반납예정일", |
|
486 |
+ "관리" |
|
391 | 487 |
]; |
392 | 488 |
const key33 = [ |
393 |
- "No", |
|
394 |
- "equipment", |
|
395 |
- "serialNumber", |
|
396 |
- "date", |
|
397 |
- "agency", |
|
398 |
- "senior", |
|
489 |
+ "equipment_name", |
|
490 |
+ "equipment_serial_number", |
|
491 |
+ "equipment_state", |
|
492 |
+ "senior_name", |
|
493 |
+ "equipment_rental_start_date", |
|
494 |
+ "equipment_rental_end_date", |
|
399 | 495 |
]; |
400 |
- const content33 = [ |
|
401 |
- { |
|
402 |
- No: 1, |
|
403 |
- equipment: "스마트약상자", |
|
404 |
- serialNumber: "ABCD-1", |
|
405 |
- date: "2022.12.02", |
|
406 |
- agency: ( |
|
407 |
- <Button |
|
408 |
- className={"btn-small gray-btn"} |
|
409 |
- btnName={"선택"} |
|
410 |
- onClick={openModal} |
|
411 |
- /> |
|
412 |
- ), |
|
413 |
- senior: ( |
|
414 |
- <Button |
|
415 |
- className={"btn-small gray-btn"} |
|
416 |
- btnName={"선택"} |
|
417 |
- // onClick={openModal2} |
|
418 |
- /> |
|
419 |
- ), |
|
420 |
- }, |
|
421 |
- { |
|
422 |
- No: 2, |
|
423 |
- equipment: "스마트약상자", |
|
424 |
- serialNumber: "ABCD-1", |
|
425 |
- date: "2022.12.02", |
|
426 |
- agency: (<Button |
|
427 |
- className={"btn-small gray-btn"} |
|
428 |
- btnName={"선택"} |
|
429 |
- onClick={openModal} |
|
430 |
- />), |
|
431 |
- senior: ( |
|
432 |
- <Button |
|
433 |
- className={"btn-small gray-btn"} |
|
434 |
- btnName={"선택"} |
|
435 |
- // onClick={openModal2} |
|
436 |
- /> |
|
437 |
- ), |
|
438 |
- }, |
|
496 |
+ |
|
497 |
+ // 장비 대상자 등록 모달창 thead |
|
498 |
+ const thead44 = [ |
|
499 |
+ "대상자", |
|
500 |
+ "대여일", |
|
501 |
+ "반납예정일", |
|
502 |
+ "선택", |
|
503 |
+ ]; |
|
504 |
+ |
|
505 |
+ // 장비 대상자 삭제 모달창 thead |
|
506 |
+ const thead55 = [ |
|
507 |
+ "반납일", |
|
508 |
+ "반납자", |
|
439 | 509 |
]; |
440 | 510 |
|
441 | 511 |
// 마운트 시 실행 함수 |
442 | 512 |
React.useEffect(() => { |
513 |
+ seniorSelectList(); |
|
514 |
+ //관리자 |
|
443 | 515 |
equipmentSelectList(); |
444 | 516 |
|
517 |
+ //시행기관 |
|
445 | 518 |
agencyEquipmentSelectList(); |
446 |
- // agencySeniorEquipmentSelectList(); |
|
447 |
- seniorSelectList(); |
|
519 |
+ agencySeniorEquipmentSelectList(); |
|
520 |
+ agencyStockEquipmentSelectList(); |
|
448 | 521 |
}, []) |
449 |
- |
|
450 |
- // 대상자, 재고 장비 목록 |
|
451 |
- React.useEffect(() => { |
|
452 |
- console.log('@@@', agencyEquipmentList); |
|
453 |
- let data = []; |
|
454 |
- for(let i = 0; i < agencyEquipmentList.length; i++) { |
|
455 |
- if(agencyEquipmentList[i]['senior_id'] != null) { |
|
456 |
- data.push(agencyEquipmentList[i]); |
|
457 |
- } |
|
458 |
- } |
|
459 |
- console.log('@@@data', data); |
|
460 |
- setAgencySeniorEquipmentList(data); |
|
461 |
- }, [agencyEquipmentList]) |
|
462 | 522 |
|
463 | 523 |
/********************************** 시행기관 장비 (끝) **********************************/ |
464 | 524 |
|
525 |
+ // 장비 납품 모달창 thead, key |
|
465 | 526 |
const thead4 = [ |
466 | 527 |
"No", |
467 | 528 |
"기관명", |
... | ... | @@ -488,41 +549,8 @@ |
488 | 549 |
|
489 | 550 |
}, |
490 | 551 |
]; |
491 |
- const thead5 = [ |
|
492 |
- "대상자", |
|
493 |
- "대여일", |
|
494 |
- "반납예정일", |
|
495 |
- "선택", |
|
496 |
- ]; |
|
497 |
- const key5 = [ |
|
498 |
- "senior", |
|
499 |
- "date", |
|
500 |
- "choice", |
|
501 |
- ]; |
|
502 |
- const content5 = [ |
|
503 |
- { |
|
504 |
- No: 1, |
|
505 |
- senior: ( |
|
506 |
- <div> |
|
507 |
- <input type="text" list="senior_list" /> |
|
508 |
- <datalist id="senior_list"> |
|
509 |
- <option value="대상자1(ID)"></option> |
|
510 |
- <option value="대상자2(ID)"></option> |
|
511 |
- <option value="대상자3(ID)"></option> |
|
512 |
- </datalist> |
|
513 |
- </div> |
|
514 |
- ) |
|
515 |
- , |
|
516 |
- choice: (<Button |
|
517 |
- className={"btn-small gray-btn"} |
|
518 |
- btnName={"선택"} |
|
519 |
- />) |
|
520 | 552 |
|
521 |
- }, |
|
522 |
- ]; |
|
523 |
- |
|
524 |
- |
|
525 |
- |
|
553 |
+ // 장비 탭별 화면 |
|
526 | 554 |
const data = [ |
527 | 555 |
{ |
528 | 556 |
id: 1, |
... | ... | @@ -548,39 +576,39 @@ |
548 | 576 |
navigate("/EquipmentManagementSelectOne"); |
549 | 577 |
}} |
550 | 578 |
/> */} |
551 |
- <table class = "caregiver-user"> |
|
579 |
+ <table class="caregiver-user"> |
|
552 | 580 |
<thead> |
553 | 581 |
<tr> |
554 |
- {thead1.map((i) => { |
|
555 |
- return <th>{i}</th>; |
|
556 |
- })} |
|
582 |
+ {thead1.map((i) => { |
|
583 |
+ return <th>{i}</th>; |
|
584 |
+ })} |
|
557 | 585 |
</tr> |
558 | 586 |
</thead> |
559 | 587 |
<tbody> |
560 | 588 |
{equipmentList.map((item, index) => { |
561 |
- return ( |
|
562 |
- <tr key={index}> |
|
563 |
- <td>{equipmentList.length - index}</td> |
|
564 |
- {key1.map((kes) => { |
|
565 |
- return <td>{item[kes]}</td> |
|
566 |
- })} |
|
567 |
- <td> |
|
568 |
- { |
|
569 |
- item['senior_id'] == null |
|
570 |
- ? <Button |
|
571 |
- className={"btn-small green-btn"} |
|
572 |
- btnName={"등록"} |
|
573 |
- onClick={() => seniorMatchModalOpen(item)} |
|
574 |
- /> |
|
575 |
- : <Button |
|
576 |
- className={"btn-small green-btn"} |
|
577 |
- btnName={"삭제"} |
|
578 |
- onClick={seniorMatchDelete} |
|
579 |
- /> |
|
580 |
- } |
|
581 |
- </td> |
|
582 |
- </tr> |
|
583 |
- ); |
|
589 |
+ return ( |
|
590 |
+ <tr key={index}> |
|
591 |
+ <td>{equipmentList.length - index}</td> |
|
592 |
+ {key1.map((kes) => { |
|
593 |
+ return <td>{item[kes]}</td> |
|
594 |
+ })} |
|
595 |
+ <td> |
|
596 |
+ { |
|
597 |
+ item['senior_id'] == null |
|
598 |
+ ? <Button |
|
599 |
+ className={"btn-small green-btn"} |
|
600 |
+ btnName={"등록"} |
|
601 |
+ onClick={() => seniorMatchInsertModalOpen(item)} |
|
602 |
+ /> |
|
603 |
+ : <Button |
|
604 |
+ className={"btn-small green-btn"} |
|
605 |
+ btnName={"삭제"} |
|
606 |
+ onClick={seniorMatchDelete} |
|
607 |
+ /> |
|
608 |
+ } |
|
609 |
+ </td> |
|
610 |
+ </tr> |
|
611 |
+ ); |
|
584 | 612 |
})} |
585 | 613 |
</tbody> |
586 | 614 |
</table> |
... | ... | @@ -627,46 +655,41 @@ |
627 | 655 |
btnName={"LOG"} |
628 | 656 |
onClick={logCheck} |
629 | 657 |
/> |
630 |
- <Button |
|
631 |
- className={"btn-small green-btn"} |
|
632 |
- btnName={"등록"} |
|
633 |
- onClick={openModal3} |
|
634 |
- /> |
|
635 | 658 |
</div> |
636 | 659 |
</div> |
637 |
- <table class = "caregiver-user"> |
|
660 |
+ <table class="caregiver-user"> |
|
638 | 661 |
<thead> |
639 | 662 |
<tr> |
640 |
- {thead11.map((i) => { |
|
641 |
- return <th>{i}</th>; |
|
642 |
- })} |
|
663 |
+ {thead11.map((i) => { |
|
664 |
+ return <th>{i}</th>; |
|
665 |
+ })} |
|
643 | 666 |
</tr> |
644 | 667 |
</thead> |
645 | 668 |
<tbody> |
646 | 669 |
{agencyEquipmentList.map((item, index) => { |
647 |
- return ( |
|
648 |
- <tr key={index}> |
|
649 |
- <td>{agencyEquipmentList.length - index}</td> |
|
650 |
- {key11.map((kes) => { |
|
651 |
- return <td>{item[kes]}</td> |
|
652 |
- })} |
|
653 |
- <td> |
|
654 |
- { |
|
655 |
- item['senior_id'] == null |
|
656 |
- ? <Button |
|
657 |
- className={"btn-small green-btn"} |
|
658 |
- btnName={"등록"} |
|
659 |
- onClick={() => seniorMatchModalOpen(item)} |
|
660 |
- /> |
|
661 |
- : <Button |
|
662 |
- className={"btn-small green-btn"} |
|
663 |
- btnName={"삭제"} |
|
664 |
- onClick={seniorMatchDelete} |
|
665 |
- /> |
|
666 |
- } |
|
667 |
- </td> |
|
668 |
- </tr> |
|
669 |
- ); |
|
670 |
+ return ( |
|
671 |
+ <tr key={index}> |
|
672 |
+ <td>{agencyEquipmentList.length - index}</td> |
|
673 |
+ {key11.map((kes) => { |
|
674 |
+ return <td>{item[kes]}</td> |
|
675 |
+ })} |
|
676 |
+ <td> |
|
677 |
+ { |
|
678 |
+ item['senior_id'] == null |
|
679 |
+ ? <Button |
|
680 |
+ className={"btn-small green-btn"} |
|
681 |
+ btnName={"등록"} |
|
682 |
+ onClick={() => seniorMatchInsertModalOpen(item)} |
|
683 |
+ /> |
|
684 |
+ : <Button |
|
685 |
+ className={"btn-small green-btn"} |
|
686 |
+ btnName={"반납"} |
|
687 |
+ onClick={() => seniorMatchDeleteModalOpen(item)} |
|
688 |
+ /> |
|
689 |
+ } |
|
690 |
+ </td> |
|
691 |
+ </tr> |
|
692 |
+ ); |
|
670 | 693 |
})} |
671 | 694 |
</tbody> |
672 | 695 |
</table> |
... | ... | @@ -678,59 +701,36 @@ |
678 | 701 |
title: "대상자 장비(시행기관)" + "(" + agencySeniorEquipmentList.length + ")", |
679 | 702 |
description: ( |
680 | 703 |
<div> |
681 |
- {/* <table class = "caregiver-user"> |
|
704 |
+ <div className="flex"> |
|
705 |
+ <SubTitle explanation={"장비 클릭 시 지난 매칭이력을 확인할 수 있습니다."} /> |
|
706 |
+ </div> |
|
707 |
+ <table class="caregiver-user"> |
|
682 | 708 |
<thead> |
683 | 709 |
<tr> |
684 |
- {thead22.map((i) => { |
|
685 |
- return <th>{i}</th>; |
|
686 |
- })} |
|
710 |
+ {thead22.map((i) => { |
|
711 |
+ return <th>{i}</th>; |
|
712 |
+ })} |
|
687 | 713 |
</tr> |
688 | 714 |
</thead> |
689 | 715 |
<tbody> |
690 | 716 |
{agencySeniorEquipmentList.map((item, index) => { |
691 |
- return ( |
|
692 |
- <tr key={index}> |
|
693 |
- <td>{agencySeniorEquipmentList.length - index}</td> |
|
694 |
- {key22.map((kes) => { |
|
695 |
- return <td>{item[kes]}</td> |
|
696 |
- })} |
|
697 |
- <td> |
|
698 |
- <Button |
|
699 |
- className={"btn-small green-btn"} |
|
700 |
- btnName={"삭제"} |
|
701 |
- onClick={seniorMatchDelete} |
|
702 |
- /> |
|
703 |
- </td> |
|
704 |
- </tr> |
|
705 |
- ); |
|
706 |
- })} |
|
707 |
- </tbody> |
|
708 |
- </table> */} |
|
709 |
- <table class = "caregiver-user"> |
|
710 |
- <thead> |
|
711 |
- <tr> |
|
712 |
- {thead22.map((i) => { |
|
713 |
- return <th>{i}</th>; |
|
714 |
- })} |
|
715 |
- </tr> |
|
716 |
- </thead> |
|
717 |
- <tbody> |
|
718 |
- {agencySeniorEquipmentList.map((item, index) => { |
|
719 |
- return ( |
|
720 |
- <tr key={index}> |
|
721 |
- <td>{agencySeniorEquipmentList.length - index}</td> |
|
722 |
- {key22.map((kes) => { |
|
723 |
- return <td>{item[kes]}</td> |
|
724 |
- })} |
|
725 |
- <td> |
|
726 |
- <Button |
|
727 |
- className={"btn-small green-btn"} |
|
728 |
- btnName={"삭제"} |
|
729 |
- onClick={seniorMatchDelete} |
|
730 |
- /> |
|
731 |
- </td> |
|
732 |
- </tr> |
|
733 |
- ); |
|
717 |
+ return ( |
|
718 |
+ <tr key={index}> |
|
719 |
+ <td>{agencySeniorEquipmentList.length - index}</td> |
|
720 |
+ {key22.map((kes) => { |
|
721 |
+ return <td>{item[kes]}</td> |
|
722 |
+ })} |
|
723 |
+ <td> |
|
724 |
+ { |
|
725 |
+ <Button |
|
726 |
+ className={"btn-small green-btn"} |
|
727 |
+ btnName={"반납"} |
|
728 |
+ onClick={() => seniorMatchDeleteModalOpen(item)} |
|
729 |
+ /> |
|
730 |
+ } |
|
731 |
+ </td> |
|
732 |
+ </tr> |
|
733 |
+ ); |
|
734 | 734 |
})} |
735 | 735 |
</tbody> |
736 | 736 |
</table> |
... | ... | @@ -739,20 +739,50 @@ |
739 | 739 |
}, |
740 | 740 |
{ |
741 | 741 |
id: 6, |
742 |
- title: "재고 장비(시행기관)" + "(" + ")", |
|
742 |
+ title: "재고 장비(시행기관)" + "(" + agencyStockEquipmentList.length + ")", |
|
743 | 743 |
description: ( |
744 |
- <Table |
|
745 |
- className={"caregiver-user"} |
|
746 |
- head={thead33} |
|
747 |
- contents={content33} |
|
748 |
- contentKey={key33} |
|
749 |
- /> |
|
744 |
+ <div> |
|
745 |
+ <div className="flex"> |
|
746 |
+ <SubTitle explanation={"장비 클릭 시 지난 매칭이력을 확인할 수 있습니다."} /> |
|
747 |
+ </div> |
|
748 |
+ <table class="caregiver-user"> |
|
749 |
+ <thead> |
|
750 |
+ <tr> |
|
751 |
+ {thead33.map((i) => { |
|
752 |
+ return <th>{i}</th>; |
|
753 |
+ })} |
|
754 |
+ </tr> |
|
755 |
+ </thead> |
|
756 |
+ <tbody> |
|
757 |
+ {agencyStockEquipmentList.map((item, index) => { |
|
758 |
+ return ( |
|
759 |
+ <tr key={index}> |
|
760 |
+ <td>{agencyStockEquipmentList.length - index}</td> |
|
761 |
+ {key33.map((kes) => { |
|
762 |
+ return <td>{item[kes]}</td> |
|
763 |
+ })} |
|
764 |
+ <td> |
|
765 |
+ { |
|
766 |
+ <Button |
|
767 |
+ className={"btn-small green-btn"} |
|
768 |
+ btnName={"등록"} |
|
769 |
+ onClick={() => seniorMatchInsertModalOpen(item)} |
|
770 |
+ /> |
|
771 |
+ } |
|
772 |
+ </td> |
|
773 |
+ </tr> |
|
774 |
+ ); |
|
775 |
+ })} |
|
776 |
+ </tbody> |
|
777 |
+ </table> |
|
778 |
+ </div> |
|
750 | 779 |
), |
751 | 780 |
}, |
752 | 781 |
]; |
753 | 782 |
|
754 | 783 |
//시작 탭 설정 |
755 | 784 |
const [index, setIndex] = React.useState(4); |
785 |
+ |
|
756 | 786 |
return ( |
757 | 787 |
<main> |
758 | 788 |
<Modal open={modalOpen} close={closeModal} header="납품 기관 선택"> |
... | ... | @@ -774,55 +804,7 @@ |
774 | 804 |
</div> |
775 | 805 |
</div> |
776 | 806 |
</Modal> |
777 |
- <Modal open={seniorMatchModal} close={seniorMatchModalClose} header="대상자 장비 등록"> |
|
778 |
- <div className="board-wrap"> |
|
779 |
- <div> |
|
780 |
- <table className={"caregiver-user"}> |
|
781 |
- <thead> |
|
782 |
- <tr> |
|
783 |
- {thead5.map((i) => { |
|
784 |
- return <th>{i}</th>; |
|
785 |
- })} |
|
786 |
- </tr> |
|
787 |
- </thead> |
|
788 |
- <tbody> |
|
789 |
- <tr> |
|
790 |
- <td> |
|
791 |
- <input type="text" list="senior_list" placeholder="대상자를 입력해 주세요" onChange={seniorEquipmentSeniorInsert}/> |
|
792 |
- <datalist id="senior_list"> |
|
793 |
- {seniorList.map((item) => { |
|
794 |
- // return <option value={item['user_name'] + " (" + item['user_id'] + ")"}></option> |
|
795 |
- return <option value={item['user_id']}>{item['user_name']}</option> |
|
796 | 807 |
|
797 |
- })} |
|
798 |
- </datalist> |
|
799 |
- </td> |
|
800 |
- <td> |
|
801 |
- <input type="date" onChange={seniorEquipmentRentalStartDateInsert}/> |
|
802 |
- </td> |
|
803 |
- <td> |
|
804 |
- <input type="date" onChange={seniorEquipmentRentalEndDateInsert}/> |
|
805 |
- </td> |
|
806 |
- <td> |
|
807 |
- <Button |
|
808 |
- className={"btn-small gray-btn"} |
|
809 |
- btnName={"선택"} |
|
810 |
- onClick={seniorEquipmentInsert} |
|
811 |
- /> |
|
812 |
- </td> |
|
813 |
- </tr> |
|
814 |
- </tbody> |
|
815 |
- </table> |
|
816 |
- </div> |
|
817 |
- <div> |
|
818 |
- <Button |
|
819 |
- className={"btn-100 green-btn"} |
|
820 |
- btnName={"닫기"} |
|
821 |
- onClick={seniorMatchModalClose} |
|
822 |
- /> |
|
823 |
- </div> |
|
824 |
- </div> |
|
825 |
- </Modal> |
|
826 | 808 |
<Modal open={modalOpen3} close={closeModal3} header="장비 등록"> |
827 | 809 |
<div className="board-wrap"> |
828 | 810 |
<div> |
... | ... | @@ -858,6 +840,105 @@ |
858 | 840 |
</div> |
859 | 841 |
</div> |
860 | 842 |
</Modal> |
843 |
+ |
|
844 |
+ <Modal open={seniorMatchInsertModal} close={seniorMatchInsertModalClose} header="대상자 장비 등록"> |
|
845 |
+ <div className="board-wrap"> |
|
846 |
+ <div> |
|
847 |
+ <table className={"caregiver-user"}> |
|
848 |
+ <thead> |
|
849 |
+ <tr> |
|
850 |
+ {thead44.map((i) => { |
|
851 |
+ return <th>{i}</th>; |
|
852 |
+ })} |
|
853 |
+ </tr> |
|
854 |
+ </thead> |
|
855 |
+ <tbody> |
|
856 |
+ <tr> |
|
857 |
+ <td> |
|
858 |
+ <input type="text" list="senior_list" placeholder="대상자를 입력해 주세요" onChange={seniorEquipmentSeniorInsert} /> |
|
859 |
+ <datalist id="senior_list"> |
|
860 |
+ {seniorList.map((item) => { |
|
861 |
+ // return <option value={item['user_name'] + " (" + item['user_id'] + ")"}></option> |
|
862 |
+ return <option value={item['user_id']}>{item['user_name']}</option> |
|
863 |
+ |
|
864 |
+ })} |
|
865 |
+ </datalist> |
|
866 |
+ </td> |
|
867 |
+ <td> |
|
868 |
+ <input type="date" onChange={seniorEquipmentRentalStartDateInsert} /> |
|
869 |
+ </td> |
|
870 |
+ <td> |
|
871 |
+ <input type="date" onChange={seniorEquipmentRentalEndDateInsert} /> |
|
872 |
+ </td> |
|
873 |
+ <td> |
|
874 |
+ <Button |
|
875 |
+ className={"btn-small gray-btn"} |
|
876 |
+ btnName={"선택"} |
|
877 |
+ onClick={seniorEquipmentInsert} |
|
878 |
+ /> |
|
879 |
+ </td> |
|
880 |
+ </tr> |
|
881 |
+ </tbody> |
|
882 |
+ </table> |
|
883 |
+ </div> |
|
884 |
+ <div> |
|
885 |
+ <Button |
|
886 |
+ className={"btn-100 green-btn"} |
|
887 |
+ btnName={"닫기"} |
|
888 |
+ onClick={seniorMatchInsertModalClose} |
|
889 |
+ /> |
|
890 |
+ </div> |
|
891 |
+ </div> |
|
892 |
+ </Modal> |
|
893 |
+ |
|
894 |
+ <Modal open={seniorMatchDeleteModal} close={seniorMatchDeleteModalClose} header="대상자 장비 반납"> |
|
895 |
+ <div className="board-wrap"> |
|
896 |
+ <div> |
|
897 |
+ <table className={"caregiver-user"}> |
|
898 |
+ <thead> |
|
899 |
+ <tr> |
|
900 |
+ {thead55.map((i) => { |
|
901 |
+ return <th>{i}</th>; |
|
902 |
+ })} |
|
903 |
+ </tr> |
|
904 |
+ </thead> |
|
905 |
+ <tbody> |
|
906 |
+ <tr> |
|
907 |
+ <td> |
|
908 |
+ <input type="date" onChange={seniorEquipmentRentalReturnDateInsert} /> |
|
909 |
+ </td> |
|
910 |
+ <td> |
|
911 |
+ <input type="text" list="senior_list" placeholder="반납 관리자를 입력해 주세요" onChange={seniorEquipmentReturnUserIdInsert} /> |
|
912 |
+ <datalist id="senior_list"> |
|
913 |
+ {seniorList.map((item) => { |
|
914 |
+ // return <option value={item['user_name'] + " (" + item['user_id'] + ")"}></option> |
|
915 |
+ return <option value={item['user_id']}>{item['user_name']}</option> |
|
916 |
+ |
|
917 |
+ })} |
|
918 |
+ </datalist> |
|
919 |
+ </td> |
|
920 |
+ <td> |
|
921 |
+ <Button |
|
922 |
+ className={"btn-small gray-btn"} |
|
923 |
+ btnName={"선택"} |
|
924 |
+ onClick={seniorEquipmentInsert} |
|
925 |
+ /> |
|
926 |
+ </td> |
|
927 |
+ </tr> |
|
928 |
+ </tbody> |
|
929 |
+ </table> |
|
930 |
+ </div> |
|
931 |
+ <div> |
|
932 |
+ <Button |
|
933 |
+ className={"btn-100 green-btn"} |
|
934 |
+ btnName={"닫기"} |
|
935 |
+ onClick={seniorMatchInsertModalClose} |
|
936 |
+ /> |
|
937 |
+ </div> |
|
938 |
+ </div> |
|
939 |
+ </Modal> |
|
940 |
+ |
|
941 |
+ |
|
861 | 942 |
<div className="tab-container"> |
862 | 943 |
<ul className="tab-menu"> |
863 | 944 |
{data.map((item) => ( |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?