|
@@ -53,11 +53,12 @@ $(document).ready(function () {
|
|
|
autoFlashHeight();
|
|
|
// 初始化工程量清单
|
|
|
const gclSpread = SpreadJsObj.createNewSpread($('#gcl-spread')[0]);
|
|
|
+ const gclSheet = gclSpread.getActiveSheet();
|
|
|
gclSpreadSetting.getColor = function (sheet, data, row, col, defaultColor) {
|
|
|
return data
|
|
|
? (data.overRange ? '#f8d7da' : data.differ ? '#FFE699' : defaultColor)
|
|
|
: defaultColor;
|
|
|
- }
|
|
|
+ };
|
|
|
SpreadJsObj.initSheet(gclSpread.getActiveSheet(), gclSpreadSetting);
|
|
|
// 初始化所属项目节
|
|
|
const leafXmjSpread = SpreadJsObj.createNewSpread($('#leaf-xmj-spread')[0]);
|
|
@@ -211,4 +212,78 @@ $(document).ready(function () {
|
|
|
leafXmjSpread.refresh();
|
|
|
}
|
|
|
});
|
|
|
+ $('#exportExcel').click(function () {
|
|
|
+ const data = [];
|
|
|
+ const setting = {
|
|
|
+ cols: [
|
|
|
+ {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 70, formatter: '@'},
|
|
|
+ {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 300, formatter: '@'},
|
|
|
+ {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@'},
|
|
|
+ {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 80, type: 'Number'},
|
|
|
+ {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 100, formatter: '@'},
|
|
|
+ {title: '签约清单|数量', colSpan: '2|1', rowSpan: '1|1', field: 'deal_bills_qty', hAlign: 2, width: 80, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'deal_bills_tp', hAlign: 2, width: 80, type: 'Number'},
|
|
|
+ {title: '台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 80, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 80, type: 'Number'},
|
|
|
+ {title: '本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'contract_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'contract_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '本期数量变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'qc_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'qc_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '本期完成计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'gather_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'gather_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '截止本期合同计量|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_contract_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_contract_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '截止本期数量变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_qc_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_qc_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '截止本期完成计量|数量', colSpan: '3|1', rowSpan: '1|1', field: 'end_gather_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_gather_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|完成率(%)', colSpan: '|1', rowSpan: '|1', field: 'end_gather_percent', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '台账+变更令|数量', colSpan: '2|1', rowSpan: '1|1', field: 'end_final_qty', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'end_final_tp', hAlign: 2, width: 60, type: 'Number'},
|
|
|
+ {title: '单位工程', colSpan: '1', rowSpan: '2', field: 'dwgc', hAlign: 0, width: 80, formatter: '@'},
|
|
|
+ {title: '分部工程', colSpan: '1', rowSpan: '2', field: 'fbgc', hAlign: 0, width: 80, formatter: '@'},
|
|
|
+ {title: '分项工程', colSpan: '1', rowSpan: '2', field: 'fxgc', hAlign: 0, width: 80, formatter: '@'},
|
|
|
+ {title: '细目', colSpan: '1', rowSpan: '2', field: 'jldy', hAlign: 0, width: 80, formatter: '@'},
|
|
|
+ {title: '计量单元', colSpan: '1', rowSpan: '2', field: 'bwmx', hAlign: 0, width: 80, formatter: '@'},
|
|
|
+ {title: '图册号', colSpan: '1', rowSpan: '2', field: 'drawing_code', hAlign: 0, width: 80, formatter: '@'},
|
|
|
+ ],
|
|
|
+ headRows: 2,
|
|
|
+ headRowHeight: [25, 25],
|
|
|
+ defaultRowHeight: 21,
|
|
|
+ headerFont: 'bold 10px 微软雅黑',
|
|
|
+ font: '10px 微软雅黑'
|
|
|
+ };
|
|
|
+ if (!gclSheet.zh_data || gclSheet.zh_data.length === 0) return;
|
|
|
+ for (const gcl of gclSheet.zh_data) {
|
|
|
+ data.push({
|
|
|
+ b_code: gcl.b_code, name: gcl.name, unit: gcl.unit,
|
|
|
+ unit_price: gcl.unit_price,
|
|
|
+ deal_bills_qty: gcl.deal_bills_qty, deal_bills_tp: gcl.deal_bills_tp,
|
|
|
+ quantity: gcl.quantity, total_price: gcl.total_price,
|
|
|
+ contract_qty: gcl.contract_qty, contract_tp: gcl.contract_tp,
|
|
|
+ qc_qty: gcl.qc_qty, qc_tp: gcl.qc_tp,
|
|
|
+ gather_qty: gcl.gather_qty, gather_tp: gcl.gather_tp,
|
|
|
+ end_contract_qty: gcl.end_contract_qty, end_contract_tp: gcl.end_contract_tp,
|
|
|
+ end_qc_qty: gcl.end_qc_qty, end_qc_tp: gcl.end_qc_tp,
|
|
|
+ end_gather_qty: gcl.end_gather_qty, end_gather_tp: gcl.end_gather_tp,
|
|
|
+ end_gather_percent: gcl.end_gather_percent,
|
|
|
+ end_final_qty: gcl.end_final_qty, end_final_tp: gcl.end_final_tp,
|
|
|
+ });
|
|
|
+ if (gcl.leafXmjs && gcl.leafXmjs.length > 0) {
|
|
|
+ for (const xmj of gcl.leafXmjs) {
|
|
|
+ data.push({
|
|
|
+ code: xmj.code,
|
|
|
+ quantity: xmj.quantity,
|
|
|
+ contract_qty: xmj.contract_qty, qc_qty: xmj.qc_qty, gather_qty: xmj.gather_qty,
|
|
|
+ end_contract_qty: xmj.end_contract_qty, end_qc_qty: xmj.end_qc_qty,
|
|
|
+ end_gather_qty: xmj.end_gather_qty, end_gather_percent: xmj.end_gather_percent,
|
|
|
+ dwgc: xmj.dwgc, fbgc: xmj.fbgc, fxgc: xmj.fxgc,
|
|
|
+ jldy: xmj.jldy, bwmx: xmj.bwmx, drawing_code: xmj.drawing_code,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ SpreadExcelObj.exportSimpleXlsxSheet(setting, data, $('h2')[0].innerHTML + "-清单汇总.xlsx");
|
|
|
+ });
|
|
|
});
|