Index: arms/js/analysisCost.js =================================================================== diff -u -r118afd253ff804ff76f5fb332887917a3c1b5459 -r18b13357c1e7a8d3b7a0a04d28afe68765ccd3ce --- arms/js/analysisCost.js (.../analysisCost.js) (revision 118afd253ff804ff76f5fb332887917a3c1b5459) +++ arms/js/analysisCost.js (.../analysisCost.js) (revision 18b13357c1e7a8d3b7a0a04d28afe68765ccd3ce) @@ -263,12 +263,13 @@ 버전_요구사항_담당자 = apiResponse.response.버전_요구사항_담당자; 전체담당자목록 = apiResponse.response.전체담당자목록; - let 연봉 = 5000; + // let 연봉 = 5000; + // + // Object.keys(전체담당자목록).forEach((key) => { + // 전체담당자목록[key].연봉 = 연봉; + // 전체담당자목록 + // }); - Object.keys(전체담당자목록).forEach((key) => { - 전체담당자목록[key].연봉 = 연봉; - }); - costInput(전체담당자목록, pdServiceVersionLinks); } } @@ -556,8 +557,10 @@ title: "연봉 (입력)", data: "연봉", render: function(data, type, row) { + console.log("dataTable data => "); + console.log(data); var formattedData = parseInt(data).toLocaleString(); - return ' 만원'; + return ' 만원'; }, className: "dt-center", visible: true @@ -634,6 +637,7 @@ let owner = $(this).data('owner'); 전체담당자목록[owner].연봉 = this.value.replace(/,/g, ''); + 전체담당자목록[owner].성과 = 0; }); } @@ -694,7 +698,6 @@ .addQueryParam("c_req_pdservice_versionset_link", selectedVersionId) .build(); - Promise.all([ $.ajax({ url: url, type: "GET", dataType: "json" }), $.ajax({ url: url2, type: "GET", dataType: "json" }) @@ -740,7 +743,14 @@ let startDate, endDate; if (요구사항.reqStateEntity == null) { + startDate = new Date(formatDate(요구사항.c_req_create_date)); + endDate = new Date(formatDate(요구사항.c_req_create_date)); + if (요구사항.c_req_plan_time == null) { + } + else { + endDate.setDate(startDate.getDate() + 요구사항.c_req_plan_time); + } } else { if (요구사항.reqStateEntity.c_id === 11) { @@ -752,28 +762,26 @@ endDate = new Date(formatDate(요구사항.c_req_end_date)); } else { - console.log("요구사항.c_req_create_date -> " + 요구사항.c_req_create_date); - console.log("요구사항.c_req_plan_time -> " + 요구사항.c_req_plan_time); startDate = new Date(formatDate(요구사항.c_req_create_date)); if (요구사항.c_req_plan_time == null) { } else { - endDate = startDate.addDays(요구사항.c_req_plan_time); + endDate = new Date(startDate.setDate(요구사항.c_req_plan_time)); } } + } - if (startDate && endDate) { - startDate.setHours(0,0,0,0); - endDate.setHours(0,0,0,0); + if (startDate && endDate) { + startDate.setHours(0,0,0,0); + endDate.setHours(0,0,0,0); - let 업무일수 = Math.round((endDate.getTime() - startDate.getTime()) / (1000 * 3600 * 24)); - let 일급 = Math.round((전체담당자목록[key].연봉 / 365)) * 10000; + let 업무일수 = Math.round((endDate.getTime() - startDate.getTime()) / (1000 * 3600 * 24)); + let 일급 = Math.round((전체담당자목록[key].연봉 / 365)) * 10000; - 요구사항.단가 += 업무일수 * 일급; - 전체담당자목록[key].성과 += 업무일수 * 일급; - versionListData[버전].소모비용 += 업무일수 * 일급; - } + 요구사항.단가 += 업무일수 * 일급; + 전체담당자목록[key].성과 += 업무일수 * 일급; + versionListData[버전].소모비용 += 업무일수 * 일급; } }); }