|
@@ -32,6 +32,7 @@ const ExportView = (() => {
|
|
|
confirming: false //导出确认
|
|
|
};
|
|
|
let spread = null;
|
|
|
+ let sheetData = [];
|
|
|
//初始化设置工程编号表格
|
|
|
function initSpread(datas) {
|
|
|
if (spread) {
|
|
@@ -44,12 +45,15 @@ const ExportView = (() => {
|
|
|
sheetCommonObj.showTreeData(sheet, sheetSetting, datas);
|
|
|
}
|
|
|
//获取设置的工程编号
|
|
|
- function getCodeFromSheet(sheet) {
|
|
|
+ function getCodeFromSheet(sheet, isTwoLevel) {
|
|
|
let codeCol = 1;
|
|
|
let rst = [];
|
|
|
//排除建设项目行
|
|
|
for (let row = 1; row < sheet.getRowCount(); row++) {
|
|
|
- rst.push(sheet.getText(row, codeCol) || '');
|
|
|
+ const rowData = (sheetData||[])[row];
|
|
|
+ if (rowData && (!isTwoLevel || rowData.projType === 'Tender')) {
|
|
|
+ rst.push(sheet.getText(row, codeCol) || '');
|
|
|
+ }
|
|
|
}
|
|
|
return rst;
|
|
|
}
|
|
@@ -234,12 +238,16 @@ const ExportView = (() => {
|
|
|
projectData = _cache.getItem('projectData');
|
|
|
$("#export_index_checkbox").hide();
|
|
|
}
|
|
|
- initSpread(XML_EXPORT_BASE.UTIL.getCodeSheetData(projectData));
|
|
|
+ const shtData = XML_EXPORT_BASE.UTIL.getCodeSheetData(projectData);
|
|
|
+ initSpread(shtData);
|
|
|
+ sheetData = shtData;
|
|
|
});
|
|
|
//设置完工程编号后,导出数据。如果选中多个文件,导出压缩包
|
|
|
$('#exportCode-confirm').click(async function () {
|
|
|
// 工程编号
|
|
|
- let codes = getCodeFromSheet(spread.getSheet(0));
|
|
|
+ const projectData = _cache.getItem('projectData');
|
|
|
+ const isTwoLevel = projectData ? !!projectData.isTwoLevel : false;
|
|
|
+ let codes = getCodeFromSheet(spread.getSheet(0), isTwoLevel);
|
|
|
if (codes.includes('')) {
|
|
|
alert('单项、单位工程工程编号不可为空。');
|
|
|
STATE.confirming = false;
|