forked from HANYANG/HANYANG_MES
1040 lines
38 KiB
JavaScript
1040 lines
38 KiB
JavaScript
|
|
getRmkStr = async () => {
|
|
let _this = this;
|
|
let data = {
|
|
mode : "getRmkStr",
|
|
}
|
|
let res = null;
|
|
await ajax_json({
|
|
url: './registration.ajax.php',
|
|
data: data,
|
|
success: function (data) {
|
|
if (data.code) {
|
|
res = data.data;
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {}
|
|
});
|
|
return res;
|
|
}
|
|
|
|
const makeSoBook = async (soData, filename, dtData, sInfo) => {
|
|
|
|
let rmkStrArr = await getRmkStr();
|
|
|
|
let today = new Date();
|
|
const year = today.getFullYear();
|
|
const month = ('0' + (today.getMonth() + 1)).slice(-2);
|
|
const day = ('0' + today.getDate()).slice(-2);
|
|
const dateString = year + '-' + month + '-' + day;
|
|
|
|
// 기본 설정
|
|
const workbook = new ExcelJS.Workbook();
|
|
const sheet = workbook.addWorksheet(soData.SO_NO, {
|
|
pageSetup: {paperSize: 9, orientation: 'landscape', fitToWidth: 1}
|
|
});
|
|
const mystyle = {
|
|
algCenter: {horizontal: 'center', vertical: 'middle', wrapText: false},
|
|
algCenter_wtt: {horizontal: 'center', vertical: 'middle', wrapText: true},
|
|
algLeft: {horizontal: 'left', vertical: 'middle', wrapText: false},
|
|
algRight: {horizontal: 'right', vertical: 'middle', wrapText: false},
|
|
}
|
|
const myBorder = {
|
|
aroundThin: {top: {style: 'thin'}, left: {style: 'thin'}, bottom: {style: 'thin'}, right: {style: 'thin'}},
|
|
thin1: {left: {style: 'thin'}, bottom: {style: 'thin'},},
|
|
thin2: {bottom: {style: 'thin'},},
|
|
thin3: {bottom: {style: 'thin'}, right: {style: 'thin'}},
|
|
thin4: {left: {style: 'thin'},},
|
|
thin6: {right: {style: 'thin'}},
|
|
thin7: {top: {style: 'thin'}, left: {style: 'thin'},},
|
|
thin8: {top: {style: 'thin'},},
|
|
thin9: {top: {style: 'thin'}, right: {style: 'thin'}},
|
|
thin123: {left: {style: 'thin'}, bottom: {style: 'thin'}, right: {style: 'thin'}},
|
|
thin789: {top: {style: 'thin'}, left: {style: 'thin'}, right: {style: 'thin'}},
|
|
aroundThick: {top: {style: 'thick'}, left: {style: 'thick'}, bottom: {style: 'thick'}, right: {style: 'thick'}},
|
|
thick1: {left: {style: 'thick'}, bottom: {style: 'thick'},},
|
|
thick2: {bottom: {style: 'thick'},},
|
|
thick3: {bottom: {style: 'thick'}, right: {style: 'thick'}},
|
|
thick4: {left: {style: 'thick'},},
|
|
thick6: {right: {style: 'thick'}},
|
|
thick7: {top: {style: 'thick'}, left: {style: 'thick'},},
|
|
thick8: {top: {style: 'thick'},},
|
|
thick9: {top: {style: 'thick'}, right: {style: 'thick'}},
|
|
aroundMedium: {
|
|
top: {style: 'medium'},
|
|
left: {style: 'medium'},
|
|
bottom: {style: 'medium'},
|
|
right: {style: 'medium'}
|
|
},
|
|
medium1: {left: {style: 'medium'}, bottom: {style: 'medium'},},
|
|
medium2: {bottom: {style: 'medium'},},
|
|
medium3: {bottom: {style: 'medium'}, right: {style: 'medium'}},
|
|
medium4: {left: {style: 'medium'},},
|
|
medium6: {right: {style: 'medium'}},
|
|
medium7: {top: {style: 'medium'}, left: {style: 'medium'},},
|
|
medium8: {top: {style: 'medium'},},
|
|
medium9: {top: {style: 'medium'}, right: {style: 'medium'}},
|
|
medium123: {left: {style: 'medium'}, bottom: {style: 'medium'}, right: {style: 'medium'}},
|
|
medium789: {top: {style: 'medium'}, left: {style: 'medium'}, right: {style: 'medium'}},
|
|
}
|
|
|
|
// 기본 셀 높이 넓이 설정
|
|
for (let i = 0; i < 60; i++) {
|
|
sheet.getColumn(i + 1).width = 2.7;
|
|
}
|
|
for (let i = 0; i < 9; i++) {
|
|
sheet.getRow(i + 1).height = 16;
|
|
}
|
|
|
|
let startRow = 0;
|
|
let startCol = 0;
|
|
|
|
// 타이틀
|
|
sheet.mergeCells(startRow + 1, startCol + 25, startRow + 3, startCol + 36);
|
|
sheet.getCell(startRow + 3, startCol + 36).value = {
|
|
richText: [{
|
|
text: '수 주 대 장',
|
|
font: {size: 26, bold: true}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 3, startCol + 36).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 3, startCol + 36).border = myBorder.medium2;
|
|
|
|
// 결재선
|
|
sheet.mergeCells(startRow + 3, startCol + 44, startRow + 6, startCol + 45);
|
|
sheet.getCell(startRow + 6, startCol + 45).value = {
|
|
richText: [{
|
|
text: `결\r\n\r\n재`,
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 6, startCol + 45).alignment = mystyle.algCenter_wtt;
|
|
sheet.getCell(startRow + 6, startCol + 45).border = myBorder.aroundMedium;
|
|
|
|
sheet.mergeCells(startRow + 3, startCol + 46, startRow + 3, startCol + 48);
|
|
sheet.getCell(startRow + 3, startCol + 48).value = {
|
|
richText: [{
|
|
text: '담 당',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 3, startCol + 48).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 3, startCol + 48).border = {
|
|
top: {style: 'medium'},
|
|
left: {style: 'medium'},
|
|
bottom: {style: 'thin'},
|
|
right: {style: 'thin'}
|
|
};
|
|
sheet.mergeCells(startRow + 4, startCol + 46, startRow + 6, startCol + 48);
|
|
sheet.getCell(startRow + 6, startCol + 48).border = {
|
|
top: {style: 'thin'},
|
|
left: {style: 'medium'},
|
|
bottom: {style: 'medium'},
|
|
right: {style: 'thin'}
|
|
};
|
|
|
|
sheet.mergeCells(startRow + 3, startCol + 49, startRow + 3, startCol + 51);
|
|
sheet.getCell(startRow + 3, startCol + 51).value = {
|
|
richText: [{
|
|
text: '팀 장',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 3, startCol + 51).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 3, startCol + 51).border = {
|
|
top: {style: 'medium'},
|
|
left: {style: 'thin'},
|
|
bottom: {style: 'thin'},
|
|
right: {style: 'medium'}
|
|
};
|
|
sheet.mergeCells(startRow + 4, startCol + 49, startRow + 6, startCol + 51);
|
|
sheet.getCell(startRow + 6, startCol + 51).border = {
|
|
top: {style: 'thin'},
|
|
left: {style: 'thin'},
|
|
bottom: {style: 'medium'},
|
|
right: {style: 'medium'}
|
|
};
|
|
|
|
sheet.mergeCells(startRow + 3, startCol + 52, startRow + 3, startCol + 54);
|
|
sheet.getCell(startRow + 3, startCol + 54).value = {
|
|
richText: [{
|
|
text: '부문장',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 3, startCol + 54).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 3, startCol + 54).border = {
|
|
top: {style: 'medium'},
|
|
left: {style: 'medium'},
|
|
bottom: {style: 'thin'},
|
|
right: {style: 'thin'}
|
|
};
|
|
sheet.mergeCells(startRow + 4, startCol + 52, startRow + 6, startCol + 54);
|
|
sheet.getCell(startRow + 6, startCol + 54).border = {
|
|
top: {style: 'thin'},
|
|
left: {style: 'medium'},
|
|
bottom: {style: 'medium'},
|
|
right: {style: 'thin'}
|
|
};
|
|
|
|
sheet.mergeCells(startRow + 3, startCol + 55, startRow + 3, startCol + 57);
|
|
sheet.getCell(startRow + 3, startCol + 57).value = {
|
|
richText: [{
|
|
text: '본부장',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 3, startCol + 57).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 3, startCol + 57).border = {
|
|
top: {style: 'medium'},
|
|
left: {style: 'thin'},
|
|
bottom: {style: 'thin'},
|
|
right: {style: 'medium'}
|
|
};
|
|
sheet.mergeCells(startRow + 4, startCol + 55, startRow + 6, startCol + 57);
|
|
sheet.getCell(startRow + 6, startCol + 57).border = {
|
|
top: {style: 'thin'},
|
|
left: {style: 'thin'},
|
|
bottom: {style: 'medium'},
|
|
right: {style: 'medium'}
|
|
};
|
|
|
|
sheet.mergeCells(startRow + 3, startCol + 58, startRow + 3, startCol + 60);
|
|
sheet.getCell(startRow + 3, startCol + 60).value = {
|
|
richText: [{
|
|
text: '대 표',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 3, startCol + 60).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 3, startCol + 60).border = {
|
|
top: {style: 'medium'},
|
|
left: {style: 'medium'},
|
|
bottom: {style: 'thin'},
|
|
right: {style: 'medium'}
|
|
};
|
|
sheet.mergeCells(startRow + 4, startCol + 58, startRow + 6, startCol + 60);
|
|
sheet.getCell(startRow + 6, startCol + 60).border = {
|
|
top: {style: 'thin'},
|
|
left: {style: 'medium'},
|
|
bottom: {style: 'medium'},
|
|
right: {style: 'medium'}
|
|
};
|
|
// 결재선 끝
|
|
|
|
sheet.mergeCells(startRow + 5, startCol + 1, startRow + 6, startCol + 16);
|
|
sheet.getCell(startRow + 6, startCol + 16).value = {
|
|
richText: [{
|
|
text: '업체명 : 79743-(주)스틸코리아',
|
|
font: {size: 14, bold: true}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 6, startCol + 16).alignment = mystyle.algLeft;
|
|
|
|
sheet.mergeCells(startRow + 5, startCol + 27, startRow + 5, startCol + 30);
|
|
sheet.getCell(startRow + 5, startCol + 30).value = {
|
|
richText: [{
|
|
text: '화폐단위',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 5, startCol + 30).alignment = mystyle.algCenter;
|
|
|
|
sheet.mergeCells(startRow + 5, startCol + 31, startRow + 5, startCol + 34);
|
|
sheet.getCell(startRow + 5, startCol + 34).value = {
|
|
richText: [{
|
|
text: soData.CURRENCY_CD || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 5, startCol + 34).alignment = mystyle.algLeft;
|
|
|
|
sheet.mergeCells(startRow + 5, startCol + 35, startRow + 5, startCol + 38);
|
|
sheet.getCell(startRow + 5, startCol + 38).value = {
|
|
richText: [{
|
|
text: '출력일자',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 5, startCol + 38).alignment = mystyle.algCenter;
|
|
|
|
sheet.mergeCells(startRow + 5, startCol + 39, startRow + 5, startCol + 42);
|
|
sheet.getCell(startRow + 5, startCol + 42).value = {
|
|
richText: [{
|
|
text: dateString,
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 5, startCol + 42).alignment = mystyle.algLeft;
|
|
|
|
sheet.mergeCells(startRow + 6, startCol + 27, startRow + 6, startCol + 30);
|
|
sheet.getCell(startRow + 6, startCol + 30).value = {
|
|
richText: [{
|
|
text: '환 율',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 6, startCol + 30).alignment = mystyle.algCenter;
|
|
|
|
sheet.mergeCells(startRow + 6, startCol + 31, startRow + 6, startCol + 34);
|
|
sheet.getCell(startRow + 6, startCol + 34).value = {
|
|
richText: [{
|
|
text: (soData.CURRENCY_CD === 'KRW') ? '1.00' : Number(dtData[0].XCH_RATE),
|
|
font: {size: 10},
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 6, startCol + 34).numFmt = '#,##0';
|
|
sheet.getCell(startRow + 6, startCol + 34).alignment = mystyle.algLeft;
|
|
|
|
sheet.mergeCells(startRow + 6, startCol + 35, startRow + 6, startCol + 38);
|
|
sheet.getCell(startRow + 6, startCol + 38).value = {
|
|
richText: [{
|
|
text: '담 당 자',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 6, startCol + 38).alignment = mystyle.algCenter;
|
|
|
|
sheet.mergeCells(startRow + 6, startCol + 39, startRow + 6, startCol + 42);
|
|
sheet.getCell(startRow + 6, startCol + 42).value = {
|
|
richText: [{
|
|
// text: soData.CUST_PRSN_NM || '',
|
|
text: document.querySelector("#so_user_name").value || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 6, startCol + 42).alignment = mystyle.algLeft;
|
|
|
|
// 본문 헤더
|
|
sheet.mergeCells(startRow + 8, startCol + 1, startRow + 8, startCol + 6);
|
|
sheet.getCell(startRow + 8, startCol + 6).value = {
|
|
richText: [{
|
|
text: '관리번호',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 8, startCol + 6).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 8, startCol + 6).border = myBorder.medium789;
|
|
|
|
sheet.mergeCells(startRow + 9, startCol + 1, startRow + 9, startCol + 6);
|
|
sheet.getCell(startRow + 9, startCol + 6).value = {
|
|
richText: [{
|
|
text: '제품구분',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 9, startCol + 6).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 9, startCol + 6).border = myBorder.medium123;
|
|
|
|
sheet.mergeCells(startRow + 8, startCol + 7, startRow + 8, startCol + 8);
|
|
sheet.getCell(startRow + 8, startCol + 8).value = {
|
|
richText: [{
|
|
text: '구분',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 8, startCol + 8).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 8, startCol + 8).border = myBorder.medium789;
|
|
|
|
sheet.mergeCells(startRow + 9, startCol + 7, startRow + 9, startCol + 8);
|
|
sheet.getCell(startRow + 9, startCol + 8).value = {
|
|
richText: [{
|
|
text: '성적서',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 9, startCol + 8).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 9, startCol + 8).border = myBorder.medium123;
|
|
|
|
sheet.mergeCells(startRow + 8, startCol + 9, startRow + 8, startCol + 15);
|
|
sheet.getCell(startRow + 8, startCol + 15).value = {
|
|
richText: [{
|
|
text: '품 명',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 8, startCol + 15).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 8, startCol + 15).border = myBorder.medium789;
|
|
|
|
sheet.mergeCells(startRow + 9, startCol + 9, startRow + 9, startCol + 15);
|
|
sheet.getCell(startRow + 9, startCol + 15).value = {
|
|
richText: [{
|
|
text: '재 질',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 9, startCol + 15).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 9, startCol + 15).border = myBorder.medium123;
|
|
|
|
sheet.mergeCells(startRow + 8, startCol + 16, startRow + 8, startCol + 21);
|
|
sheet.getCell(startRow + 8, startCol + 21).value = {
|
|
richText: [{
|
|
text: '납기일자',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 8, startCol + 21).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 8, startCol + 21).border = myBorder.medium789;
|
|
|
|
sheet.mergeCells(startRow + 9, startCol + 16, startRow + 9, startCol + 21);
|
|
sheet.getCell(startRow + 9, startCol + 21).value = {
|
|
richText: [{
|
|
text: '제품상태',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 9, startCol + 21).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 9, startCol + 21).border = myBorder.medium123;
|
|
|
|
sheet.mergeCells(startRow + 8, startCol + 22, startRow + 8, startCol + 32);
|
|
sheet.getCell(startRow + 8, startCol + 32).value = {
|
|
richText: [{
|
|
text: '수 주 치 수',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 8, startCol + 32).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 8, startCol + 32).border = myBorder.medium789;
|
|
|
|
sheet.mergeCells(startRow + 9, startCol + 22, startRow + 9, startCol + 32);
|
|
sheet.getCell(startRow + 9, startCol + 32).value = {
|
|
richText: [{
|
|
text: '규격/고객요구치수',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 9, startCol + 32).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 9, startCol + 32).border = myBorder.medium123;
|
|
|
|
sheet.mergeCells(startRow + 8, startCol + 33, startRow + 8, startCol + 34);
|
|
sheet.getCell(startRow + 8, startCol + 34).value = {
|
|
richText: [{
|
|
text: '수 량',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 8, startCol + 34).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 8, startCol + 34).border = myBorder.medium789;
|
|
|
|
sheet.mergeCells(startRow + 9, startCol + 33, startRow + 9, startCol + 34);
|
|
sheet.getCell(startRow + 9, startCol + 34).value = {
|
|
richText: [{
|
|
text: '시 편',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 9, startCol + 34).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 9, startCol + 34).border = myBorder.medium123;
|
|
|
|
sheet.mergeCells(startRow + 8, startCol + 35, startRow + 8, startCol + 38);
|
|
sheet.getCell(startRow + 8, startCol + 38).value = {
|
|
richText: [{
|
|
text: '단 중',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 8, startCol + 38).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 8, startCol + 38).border = myBorder.medium789;
|
|
|
|
sheet.mergeCells(startRow + 9, startCol + 35, startRow + 9, startCol + 38);
|
|
sheet.getCell(startRow + 9, startCol + 38).value = {
|
|
richText: [{
|
|
text: '중 량',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 9, startCol + 38).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 9, startCol + 38).border = myBorder.medium123;
|
|
|
|
sheet.mergeCells(startRow + 8, startCol + 39, startRow + 8, startCol + 44);
|
|
sheet.getCell(startRow + 8, startCol + 44).value = {
|
|
richText: [{
|
|
text: '단 가',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 8, startCol + 44).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 8, startCol + 44).border = myBorder.medium789;
|
|
|
|
sheet.mergeCells(startRow + 9, startCol + 39, startRow + 9, startCol + 44);
|
|
sheet.getCell(startRow + 9, startCol + 44).value = {
|
|
richText: [{
|
|
text: '금 액',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 9, startCol + 44).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 9, startCol + 44).border = myBorder.medium123;
|
|
|
|
sheet.mergeCells(startRow + 8, startCol + 45, startRow + 8, startCol + 52);
|
|
sheet.getCell(startRow + 8, startCol + 52).value = {
|
|
richText: [{
|
|
text: '도면번호',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 8, startCol + 52).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 8, startCol + 52).border = myBorder.medium789;
|
|
|
|
sheet.mergeCells(startRow + 9, startCol + 45, startRow + 9, startCol + 52);
|
|
sheet.getCell(startRow + 9, startCol + 52).value = {
|
|
richText: [{
|
|
text: '호 선',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 9, startCol + 52).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 9, startCol + 52).border = myBorder.medium123;
|
|
|
|
sheet.mergeCells(startRow + 8, startCol + 53, startRow + 8, startCol + 60);
|
|
sheet.getCell(startRow + 8, startCol + 60).value = {
|
|
richText: [{
|
|
text: '수주번호',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 8, startCol + 60).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 8, startCol + 60).border = myBorder.medium789;
|
|
|
|
sheet.mergeCells(startRow + 9, startCol + 53, startRow + 9, startCol + 60);
|
|
sheet.getCell(startRow + 9, startCol + 60).value = {
|
|
richText: [{
|
|
text: '견적내역번호',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 9, startCol + 60).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 9, startCol + 60).border = myBorder.medium123;
|
|
// 본문 헤더 끝
|
|
|
|
let editRow = 10;
|
|
let ea_ttl = 0;
|
|
let sum_UNIT_WGT = 0;
|
|
let so_net_amt_str = "";
|
|
let sum_AMT = 0;
|
|
let cSymbol = varsCurrency[soData.CURRENCY_CD] || '';
|
|
//본문 내용 시작
|
|
dtData.forEach((dd, index) => {
|
|
|
|
for (let i = 0; i < 6; i++) {
|
|
sheet.getRow(startRow + 10 + (index * 6) + i).height = 16;
|
|
}
|
|
|
|
sheet.mergeCells(startRow + 10 + (index * 6), startCol + 1, startRow + 10 + (index * 6), startCol + 6);
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 6).value = {
|
|
richText: [{
|
|
text: soData.SO_NO || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 6).alignment = mystyle.algLeft;
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 6).border = {top: {style: 'medium'}, left: {style: 'thin'}};
|
|
|
|
sheet.mergeCells(startRow + 11 + (index * 6), startCol + 1, startRow + 11 + (index * 6), startCol + 6);
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 6).value = {
|
|
richText: [{
|
|
text: '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 6).alignment = mystyle.algLeft;
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 6).border = {left: {style: 'thin'}, bottom: {style: 'thin'}};
|
|
|
|
sheet.mergeCells(startRow + 10 + (index * 6), startCol + 7, startRow + 10 + (index * 6), startCol + 8);
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 8).value = {
|
|
richText: [{
|
|
text: '자체',
|
|
font: {size: 11}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 8).alignment = mystyle.algCenter;
|
|
|
|
sheet.mergeCells(startRow + 11 + (index * 6), startCol + 7, startRow + 11 + (index * 6), startCol + 8);
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 8).value = {
|
|
richText: [{
|
|
text: '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 8).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 8).border = myBorder.thin2;
|
|
|
|
sheet.mergeCells(startRow + 10 + (index * 6), startCol + 9, startRow + 10 + (index * 6), startCol + 15);
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 15).value = {
|
|
richText: [{
|
|
text: Tb_funcs_Detail.shGEdParams()[dd.ITEM_CD] || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 15).alignment = mystyle.algLeft;
|
|
|
|
sheet.mergeCells(startRow + 11 + (index * 6), startCol + 9, startRow + 11 + (index * 6), startCol + 15);
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 15).value = {
|
|
richText: [{
|
|
text: dd.MATR_TYPE || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 15).alignment = mystyle.algLeft;
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 15).border = myBorder.thin2;
|
|
|
|
sheet.mergeCells(startRow + 10 + (index * 6), startCol + 16, startRow + 10 + (index * 6), startCol + 21);
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 21).value = {
|
|
richText: [{
|
|
text: dd.REQ_DLVY_DT || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 21).alignment = mystyle.algLeft;
|
|
|
|
sheet.mergeCells(startRow + 11 + (index * 6), startCol + 16, startRow + 11 + (index * 6), startCol + 21);
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 21).value = {
|
|
richText: [{
|
|
text: varsSALES_GRP[soData.SALES_GRP] || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 21).alignment = mystyle.algLeft;
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 21).border = myBorder.thin2;
|
|
|
|
let sizeArr = [dd.OUT_DIA ? Number(dd.OUT_DIA).toFixed(2) : null
|
|
, dd.IN_DIA ? Number(dd.IN_DIA).toFixed(2) : null
|
|
, dd.THICK ? Number(dd.THICK).toFixed(2) : null
|
|
, dd.WIDTH ? Number(dd.WIDTH).toFixed(2) : null
|
|
, dd.LENGTH ? Number(dd.LENGTH).toFixed(2) : null];
|
|
sizeArr = sizeArr.filter(Boolean);
|
|
let sizeStr = sizeArr.join(' * ');
|
|
sheet.mergeCells(startRow + 10 + (index * 6), startCol + 22, startRow + 10 + (index * 6), startCol + 32);
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 32).value = {
|
|
richText: [{
|
|
text: sizeStr || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 32).alignment = mystyle.algLeft;
|
|
|
|
sheet.mergeCells(startRow + 11 + (index * 6), startCol + 22, startRow + 11 + (index * 6), startCol + 32);
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 32).value = {
|
|
richText: [{
|
|
text: '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 32).alignment = mystyle.algLeft;
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 32).border = myBorder.thin2;
|
|
|
|
sheet.mergeCells(startRow + 10 + (index * 6), startCol + 33, startRow + 10 + (index * 6), startCol + 34);
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 34).value = {
|
|
richText: [{
|
|
text: dd.SO_QTY || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 34).alignment = mystyle.algRight;
|
|
ea_ttl += Number(dd.SO_QTY) || 0;
|
|
|
|
sheet.mergeCells(startRow + 11 + (index * 6), startCol + 33, startRow + 11 + (index * 6), startCol + 34);
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 34).value = {
|
|
richText: [{
|
|
text: dd.SPECIMEN_CNT_TTL || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 34).alignment = mystyle.algRight;
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 34).border = myBorder.thin2;
|
|
|
|
sheet.mergeCells(startRow + 10 + (index * 6), startCol + 35, startRow + 10 + (index * 6), startCol + 38);
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 38).value = {
|
|
richText: [{
|
|
text: currency(dd.UNIT_WGT).format().substring(1) || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 38).alignment = mystyle.algRight;
|
|
|
|
sheet.mergeCells(startRow + 11 + (index * 6), startCol + 35, startRow + 11 + (index * 6), startCol + 38);
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 38).value = {
|
|
richText: [{
|
|
text: currency(Number(dd.UNIT_WGT) * Number(dd.SO_QTY)).format().substring(1) || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 38).alignment = mystyle.algRight;
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 38).border = myBorder.thin2;
|
|
sum_UNIT_WGT += Number(dd.UNIT_WGT) * Number(dd.SO_QTY);
|
|
|
|
if (soData.CURRENCY_CD && soData.CURRENCY_CD !== 'KRW') {
|
|
so_price = dd.SO_PRICE ? currency(Number(dd.SO_PRICE), {
|
|
symbol: cSymbol,
|
|
decimal: ',',
|
|
precision: 0
|
|
}).format() : 0;
|
|
} else {
|
|
so_price = dd.SO_PRICE_LOC ? currency(Number(dd.SO_PRICE_LOC), {
|
|
symbol: cSymbol,
|
|
decimal: ',',
|
|
precision: 0
|
|
}).format() : 0;
|
|
}
|
|
sheet.mergeCells(startRow + 10 + (index * 6), startCol + 39, startRow + 10 + (index * 6), startCol + 44);
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 44).value = {
|
|
richText: [{
|
|
text: so_price || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 44).alignment = mystyle.algRight;
|
|
|
|
let so_net_amt = '';
|
|
if (soData.CURRENCY_CD && soData.CURRENCY_CD !== 'KRW') {
|
|
so_net_amt_str = (dd.SO_NET_AMT ? currency(Number(dd.SO_NET_AMT), {
|
|
symbol: cSymbol,
|
|
decimal: ',',
|
|
precision: 0
|
|
}).format() : 0);
|
|
sum_AMT += Number(dd.SO_NET_AMT) || 0;
|
|
} else {
|
|
so_net_amt_str = dd.SO_NET_AMT_LOC ? currency(Number(dd.SO_NET_AMT_LOC), {
|
|
symbol: cSymbol,
|
|
decimal: ',',
|
|
precision: 0
|
|
}).format() : 0;
|
|
sum_AMT += Number(dd.SO_NET_AMT_LOC) || 0;
|
|
}
|
|
sheet.mergeCells(startRow + 11 + (index * 6), startCol + 39, startRow + 11 + (index * 6), startCol + 44);
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 44).value = {
|
|
richText: [{
|
|
text: so_net_amt_str || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
// sheet.getCell(startRow + 11 + (index * 6), startCol + 44).numFmt = '#,##0.##';
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 44).alignment = mystyle.algRight;
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 44).border = myBorder.thin2;
|
|
|
|
sheet.mergeCells(startRow + 10 + (index * 6), startCol + 45, startRow + 10 + (index * 6), startCol + 52);
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 52).value = {
|
|
richText: [{
|
|
text: dd.ASS_DRAW || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 52).alignment = Object.assign(mystyle.algCenter, {wrapText: false});
|
|
|
|
sheet.mergeCells(startRow + 11 + (index * 6), startCol + 45, startRow + 11 + (index * 6), startCol + 52);
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 52).value = {
|
|
richText: [{
|
|
text: soData.ESTM_NO || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 52).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 52).border = myBorder.thin2;
|
|
|
|
sheet.mergeCells(startRow + 10 + (index * 6), startCol + 53, startRow + 10 + (index * 6), startCol + 60);
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 60).value = {
|
|
richText: [{
|
|
text: dd.MNG_NO || '',
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 60).alignment = mystyle.algLeft;
|
|
sheet.getCell(startRow + 10 + (index * 6), startCol + 60).border = {top: {style: 'medium'}, right: {style: 'thin'}};
|
|
|
|
sheet.mergeCells(startRow + 11 + (index * 6), startCol + 53, startRow + 11 + (index * 6), startCol + 60);
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 60).value = {
|
|
richText: [{
|
|
text: soData.ESTM_NO,
|
|
font: {size: 10}
|
|
}]
|
|
};
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 60).alignment = mystyle.algLeft;
|
|
sheet.getCell(startRow + 11 + (index * 6), startCol + 60).border = {
|
|
bottom: {style: 'thin'},
|
|
right: {style: 'thin'}
|
|
};
|
|
|
|
//세번째 줄 시작
|
|
sheet.mergeCells(startRow + 12 + (index * 6), startCol + 1, startRow + 12 + (index * 6), startCol + 4);
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 4).value = {
|
|
richText: [{
|
|
text: '*특기사항',
|
|
font: {size: 11}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 4).alignment = mystyle.algCenter;
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 4).border = {top: {style: 'thin'}, left: {style: 'thin'}};
|
|
|
|
let rmkNum = 0;
|
|
let rmkStr = '';
|
|
if (dd.RMK1 === 'Y') {rmkNum++; rmkStr += rmkNum + ' ' + rmkStrArr[0].Code_Val}
|
|
if (dd.RMK2 === 'Y') {rmkNum++; rmkStr += ' ' + rmkNum + '. ' + rmkStrArr[1].Code_Val}
|
|
if (dd.RMK3 === 'Y') {rmkNum++; rmkStr += ' ' + rmkNum + '. ' + rmkStrArr[2].Code_Val}
|
|
if (dd.RMK4 === 'Y') {rmkNum++; rmkStr += ' ' + rmkNum + '. ' + rmkStrArr[3].Code_Val}
|
|
if (dd.RMK_ETC) {rmkNum++; rmkStr += ' ' + rmkNum + '. ' + dd.RMK_ETC;}
|
|
|
|
sheet.mergeCells(startRow + 12 + (index * 6), startCol + 5, startRow + 12 + (index * 6), startCol + 46);
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 46).value = {
|
|
richText: [{
|
|
text: rmkStr,
|
|
font: {size: 8}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 60).alignment = mystyle.algLeft;
|
|
|
|
sheet.mergeCells(startRow + 15 + (index * 6), startCol + 1, startRow + 15 + (index * 6), startCol + 4);
|
|
sheet.getCell(startRow + 15 + (index * 6), startCol + 4).value = {
|
|
richText: [{
|
|
text: '변경이력',
|
|
font: {size: 11}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 15 + (index * 6), startCol + 4).alignment = mystyle.algRight;
|
|
sheet.getCell(startRow + 15 + (index * 6), startCol + 4).border = {
|
|
bottom: {style: 'medium'},
|
|
left: {style: 'thin'}
|
|
};
|
|
|
|
sheet.mergeCells(startRow + 15 + (index * 6), startCol + 5, startRow + 15 + (index * 6), startCol + 53);
|
|
sheet.getCell(startRow + 15 + (index * 6), startCol + 53).value = {
|
|
richText: [{
|
|
text: (dd.REVNO || '')+ ' 협조전번호 : '+ (dd.CPRNO || '') +' 변경일자 : '+ (dd.CHANGE_DATE || '') +' 변경내용 : ' + (dd.CHANGE_DTL || ''),
|
|
font: {size: 10}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 15 + (index * 6), startCol + 53).alignment = mystyle.algLeft;
|
|
sheet.getCell(startRow + 15 + (index * 6), startCol + 53).border = myBorder.medium2;
|
|
|
|
sheet.mergeCells(startRow + 12 + (index * 6), startCol + 47, startRow + 12 + (index * 6), startCol + 49);
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 49).value = {
|
|
richText: [{
|
|
text: '관리등급 : ',
|
|
font: {size: 10}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 49).alignment = mystyle.algRight;
|
|
|
|
sheet.mergeCells(startRow + 12 + (index * 6), startCol + 50, startRow + 12 + (index * 6), startCol + 53);
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 53).value = {
|
|
richText: [{
|
|
text: dd.MNG_GRD || '',
|
|
font: {size: 10}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 53).alignment = mystyle.algLeft;
|
|
|
|
sheet.mergeCells(startRow + 12 + (index * 6), startCol + 54, startRow + 12 + (index * 6), startCol + 56);
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 56).value = {
|
|
richText: [{
|
|
text: '선급 : ',
|
|
font: {size: 10}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 56).alignment = mystyle.algRight;
|
|
|
|
sheet.mergeCells(startRow + 12 + (index * 6), startCol + 57, startRow + 12 + (index * 6), startCol + 60);
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 60).value = {
|
|
richText: [{
|
|
text: dd.PROC_GRD || '',
|
|
font: {size: 10}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 60).alignment = mystyle.algLeft;
|
|
sheet.getCell(startRow + 12 + (index * 6), startCol + 60).border = {top: {style: 'thin'}, right: {style: 'thin'}};
|
|
|
|
//빈줄 보더
|
|
sheet.getCell(startRow + 13 + (index * 6), startCol + 1).border = {left: {style: 'thin'}};
|
|
|
|
sheet.mergeCells(startRow + 13 + (index * 6), startCol + 47, startRow + 13 + (index * 6), startCol + 49);
|
|
sheet.getCell(startRow + 13 + (index * 6), startCol + 49).value = {
|
|
richText: [{
|
|
text: '가공등급 : ',
|
|
font: {size: 10}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 13 + (index * 6), startCol + 49).alignment = mystyle.algRight;
|
|
|
|
sheet.mergeCells(startRow + 13 + (index * 6), startCol + 50, startRow + 13 + (index * 6), startCol + 53);
|
|
sheet.getCell(startRow + 13 + (index * 6), startCol + 53).value = {
|
|
richText: [{
|
|
text: dd.CLASSIFICATION || '',
|
|
font: {size: 10}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 13 + (index * 6), startCol + 53).alignment = mystyle.algLeft;
|
|
|
|
sheet.mergeCells(startRow + 13 + (index * 6), startCol + 54, startRow + 13 + (index * 6), startCol + 56);
|
|
sheet.getCell(startRow + 13 + (index * 6), startCol + 56).value = {
|
|
richText: [{
|
|
text: '입회 : ',
|
|
font: {size: 10}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 13 + (index * 6), startCol + 56).alignment = mystyle.algRight;
|
|
|
|
sheet.mergeCells(startRow + 13 + (index * 6), startCol + 57, startRow + 13 + (index * 6), startCol + 60);
|
|
sheet.getCell(startRow + 13 + (index * 6), startCol + 60).value = {
|
|
richText: [{
|
|
text: dd.PRESENCE || '',
|
|
font: {size: 10}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 13 + (index * 6), startCol + 60).alignment = mystyle.algLeft;
|
|
sheet.getCell(startRow + 13 + (index * 6), startCol + 60).border = {right: {style: 'thin'}};
|
|
|
|
// 빈줄 보더
|
|
sheet.getCell(startRow + 14 + (index * 6), startCol + 1).border = {left: {style: 'thin'}};
|
|
|
|
sheet.mergeCells(startRow + 14 + (index * 6), startCol + 54, startRow + 14 + (index * 6), startCol + 56);
|
|
sheet.getCell(startRow + 14 + (index * 6), startCol + 56).value = {
|
|
richText: [{
|
|
text: '열처리 : ',
|
|
font: {size: 10}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 14 + (index * 6), startCol + 56).alignment = mystyle.algRight;
|
|
|
|
sheet.mergeCells(startRow + 14 + (index * 6), startCol + 57, startRow + 14 + (index * 6), startCol + 60);
|
|
sheet.getCell(startRow + 14 + (index * 6), startCol + 60).value = {
|
|
richText: [{
|
|
text: dd.HEAT_TREATMENT || '',
|
|
font: {size: 10}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 14 + (index * 6), startCol + 60).alignment = mystyle.algLeft;
|
|
sheet.getCell(startRow + 14 + (index * 6), startCol + 60).border = {right: {style: 'thin'}};
|
|
|
|
sheet.mergeCells(startRow + 15 + (index * 6), startCol + 54, startRow + 15 + (index * 6), startCol + 56);
|
|
sheet.getCell(startRow + 15 + (index * 6), startCol + 56).value = {
|
|
richText: [{
|
|
text: '승인도 : ',
|
|
font: {size: 10}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 15 + (index * 6), startCol + 56).alignment = mystyle.algRight;
|
|
sheet.getCell(startRow + 15 + (index * 6), startCol + 56).border = myBorder.medium2;
|
|
|
|
sheet.mergeCells(startRow + 15 + (index * 6), startCol + 57, startRow + 15 + (index * 6), startCol + 60);
|
|
sheet.getCell(startRow + 15 + (index * 6), startCol + 60).value = {
|
|
richText: [{
|
|
text: dd.APPROVAL || '',
|
|
font: {size: 10}
|
|
}]
|
|
}
|
|
sheet.getCell(startRow + 15 + (index * 6), startCol + 60).alignment = mystyle.algLeft;
|
|
sheet.getCell(startRow + 15 + (index * 6), startCol + 60).border = {
|
|
bottom: {style: 'medium'},
|
|
right: {style: 'thin'}
|
|
};
|
|
|
|
editRow += 6;
|
|
})
|
|
|
|
// 합계 행
|
|
let sumRow = editRow;
|
|
sheet.getRow(sumRow).height = 20;
|
|
|
|
// sheet.mergeCells(sumRow , startCol + 1, sumRow, startCol + 24);
|
|
// sheet.getCell(sumRow, startCol + 24).border = { top: {style:'thick'}, left: {style:'thin'}, bottom: {style:'thin'}, right: {style:'medium'}};;
|
|
// sheet.getCell(sumRow, startCol + 24).border = { top: {style:'thick'}, left: {style:'thin'}, bottom: {style:'thin'}};
|
|
|
|
sheet.mergeCells(sumRow, startCol + 1, sumRow, startCol + 26);
|
|
sheet.getCell(sumRow, startCol + 26).value = {
|
|
richText: [{
|
|
text: '※ 합 계',
|
|
font: {size: 10, bold: true}
|
|
}]
|
|
}
|
|
sheet.getCell(sumRow, startCol + 26).alignment = mystyle.algRight;
|
|
sheet.getCell(sumRow, startCol + 26).border = {top: {style: 'thick'}, left: {style: 'thin'}, bottom: {style: 'thin'}};
|
|
|
|
sheet.mergeCells(sumRow, startCol + 27, sumRow, startCol + 34);
|
|
sheet.getCell(sumRow, startCol + 34).value = {
|
|
richText: [{
|
|
text: ea_ttl,
|
|
font: {size: 10, bold: true}
|
|
}]
|
|
}
|
|
sheet.getCell(sumRow, startCol + 34).alignment = mystyle.algRight;
|
|
sheet.getCell(sumRow, startCol + 34).border = {top: {style: 'thick'}, bottom: {style: 'thin'}};
|
|
|
|
sheet.mergeCells(sumRow, startCol + 35, sumRow, startCol + 39);
|
|
sheet.getCell(sumRow, startCol + 39).value = {
|
|
richText: [{
|
|
text: currency(sum_UNIT_WGT, {precision: 2}).format().substring(1),
|
|
font: {size: 10, bold: true}
|
|
}]
|
|
}
|
|
sheet.getCell(sumRow, startCol + 39).alignment = mystyle.algRight;
|
|
sheet.getCell(sumRow, startCol + 39).border = {top: {style: 'thick'}, bottom: {style: 'thin'}};
|
|
|
|
sheet.mergeCells(sumRow, startCol + 40, sumRow, startCol + 47);
|
|
sheet.getCell(sumRow, startCol + 47).value = {
|
|
richText: [{
|
|
text: currency(Number(sum_AMT), {symbol: cSymbol, decimal: ',', precision: 0}).format(),
|
|
font: {size: 10, bold: true}
|
|
}]
|
|
}
|
|
sheet.getCell(sumRow, startCol + 47).alignment = mystyle.algRight;
|
|
sheet.getCell(sumRow, startCol + 47).border = {top: {style: 'thick'}, bottom: {style: 'thin'}};
|
|
|
|
sheet.mergeCells(sumRow, startCol + 48, sumRow, startCol + 60);
|
|
sheet.getCell(sumRow, startCol + 60).border = {
|
|
top: {style: 'thick'},
|
|
bottom: {style: 'thin'},
|
|
right: {style: 'thin'}
|
|
};
|
|
|
|
nRow = sheet.getRow(sumRow + 1);
|
|
nCell = nRow.getCell(1);
|
|
nCell.value = {richText: [{text: ' 특기사항', font: {size: 10, bold: true}}]}
|
|
sheet.mergeCells(sumRow + 1, 1, sumRow + 1, 4);
|
|
|
|
nRow = sheet.getRow(sumRow + 2);
|
|
nCell = nRow.getCell(1);
|
|
nCell.value = {richText: [{text: soData.REMK || '', font: {size: 10, bold: true}}]}
|
|
sheet.mergeCells(sumRow + 2, 1, sumRow + 2, 60);
|
|
|
|
|
|
downloadExcel(workbook, filename).then(r => {
|
|
});
|
|
}
|
|
|
|
|
|
const downloadExcel = async (workbook, fileName) => {
|
|
|
|
const buffer = await workbook.xlsx.writeBuffer();
|
|
const blob = new Blob([buffer], {
|
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
});
|
|
const url = window.URL.createObjectURL(blob); // blob으로 객체 URL 생성
|
|
const anchor = document.createElement('a');
|
|
anchor.href = url;
|
|
anchor.download = fileName + '.xlsx';
|
|
anchor.click(); // anchor를 다운로드 링크로 만들고 강제로 클릭 이벤트 발생
|
|
window.URL.revokeObjectURL(url); // 메모리에서 해제
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|