| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518 | 'use strict';/** * * * @author Mai * @date * @version */const showTools = function (show) {    const left = $('#left-view'), right = $('#right-view'), parent = left.parent();    if (show) {        right.show();        autoFlashHeight();        /**         * right.show()后, parent被撑开成2倍left.height, 导致parent.width减少了10px         * 第一次left.width调整后,parent的缩回left.height, 此时parent.width又增加了10px         * 故需要通过最终的parent.width再计算一次left.width         *         * Q: 为什么不通过先计算left.width的宽度,以避免计算两次left.width?         * A: 右侧工具栏不一定显示,当右侧工具栏显示过一次后,就必须使用parent和right来计算left.width         *         */            //left.css('width', parent.width() - right.outerWidth());            //left.css('width', parent.width() - right.outerWidth());        const percent = 100 - right.outerWidth() /parent.width() * 100;        left.css('width', percent + '%');    } else {        right.hide();        left.css('width', '100%');    }};$(document).ready(() => {    showTools(true);    autoFlashHeight();    const gclSpread = SpreadJsObj.createNewSpread($('#gcl-spread')[0]);    const gclSpreadSetting = {        cols: [            {title: '清单编号', colSpan: '1', rowSpan: '2', field: 'b_code', hAlign: 0, width: 120, formatter: '@'},            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 230, formatter: '@'},            {title: '单位', colSpan: '1', rowSpan: '2', field: 'unit', hAlign: 1, width: 60, formatter: '@', cellType: 'unit'},            {title: '单价', colSpan: '1', rowSpan: '2', field: 'unit_price', hAlign: 2, width: 80, type: 'Number'},            {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: 'compare_qty', hAlign: 2, width: 80, type: 'Number'},            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'compare_tp', hAlign: 2, width: 80, type: 'Number'},        ],        emptyRows: 0,        headRows: 2,        headRowHeight: [25, 25],        headColWidth: [30],        defaultRowHeight: 21,        headerFont: '12px 微软雅黑',        font: '12px 微软雅黑',        readOnly: true,        localCache: {            key: 'ledger-gather-gcl',            colWidth: true,        },        getColor: function (sheet, data, row, col, defaultColor) {            return data                ? $('#compare-tag')[0].checked && data.compare_differ                    ? spreadColor.gcl.calc_differ                    : (data.differ ? spreadColor.gcl.differ : '#FFFFFF')                : '#FFFFFF';        }    };    if (thousandth) sjsSettingObj.setTpThousandthFormat(gclSpreadSetting);    SpreadJsObj.initSheet(gclSpread.getActiveSheet(), gclSpreadSetting);    const gclSheet = gclSpread.getActiveSheet();    const leafXmjSpread = SpreadJsObj.createNewSpread($('#leaf-xmj-spread')[0]);    const leafXmjSpreadSetting = {        cols: [            {title: '项目节编号', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 120, formatter: '@'},            {title: '台账数量', colSpan: '1', rowSpan: '1', field: 'quantity', hAlign: 2, width: 80, type: 'Number'},            {title: '单位工程', colSpan: '1', rowSpan: '1', field: 'dwgc', hAlign: 0, width: 100, formatter: '@'},            {title: '分部工程', colSpan: '1', rowSpan: '1', field: 'fbgc', hAlign: 0, width: 100, formatter: '@'},            {title: '分项工程', colSpan: '1', rowSpan: '1', field: 'fxgc', hAlign: 0, width: 100, formatter: '@'},            {title: '细目', colSpan: '1', rowSpan: '1', field: 'jldy', hAlign: 0, width: 100, formatter: '@'},            {title: '计量单元', colSpan: '1', rowSpan: '1', field: 'bwmx', hAlign: 0, width: 100, formatter: '@'},            {title: '图册号', colSpan: '1', rowSpan: '1', field: 'drawing_code', hAlign: 0, width: 120, formatter: '@'},        ],        emptyRows: 0,        headRows: 1,        headRowHeight: [32],        headColWidth: [30],        defaultRowHeight: 21,        headerFont: '12px 微软雅黑',        font: '12px 微软雅黑',        readOnly: true,        localCache: {            key: 'ledger-gather-leafXmj',            colWidth: true,        },    };    if (!isTz) leafXmjSpreadSetting.cols.splice(1, 1);    if (thousandth) sjsSettingObj.setTpThousandthFormat(leafXmjSpreadSetting);    SpreadJsObj.initSheet(leafXmjSpread.getActiveSheet(), leafXmjSpreadSetting);    const leafXmjSheet = leafXmjSpread.getActiveSheet();    const gatherLeafXmjSpread = SpreadJsObj.createNewSpread($('#leaf-xmj-gather-spread')[0]);    const gatherLeafXmjSpreadSetting = {        cols: [            {title: '单位工程', colSpan: '1', rowSpan: '1', field: 'dwgc', hAlign: 0, width: 100, formatter: '@', visible: false},            {title: '分部工程', colSpan: '1', rowSpan: '1', field: 'fbgc', hAlign: 0, width: 100, formatter: '@', visible: false},            {title: '分项工程', colSpan: '1', rowSpan: '1', field: 'fxgc', hAlign: 0, width: 100, formatter: '@', visible: false},            {title: '细目', colSpan: '1', rowSpan: '1', field: 'jldy', hAlign: 0, width: 100, formatter: '@', visible: false},            {title: '计量单元', colSpan: '1', rowSpan: '1', field: 'bwmx', hAlign: 0, width: 100, formatter: '@'},            {title: '台账数量', colSpan: '1', rowSpan: '1', field: 'quantity', hAlign: 2, width: 80, type: 'Number'},        ],        emptyRows: 0,        headRows: 1,        headRowHeight: [32],        headColWidth: [30],        defaultRowHeight: 21,        headerFont: '12px 微软雅黑',        font: '12px 微软雅黑',        readOnly: true,        localCache: {            key: 'ledger-gather-leafXmj',            colWidth: true,        },    };    if (thousandth) sjsSettingObj.setTpThousandthFormat(gatherLeafXmjSpreadSetting);    const gatherLeafXmjSheet = gatherLeafXmjSpread.getActiveSheet();    SpreadJsObj.initSheet(gatherLeafXmjSheet, gatherLeafXmjSpreadSetting);    const gatherAncGclSpread = SpreadJsObj.createNewSpread($('#anc-gcl-gather-spread')[0]);    const gatherAncGclSpreadSetting = {        cols: [            {title: '单位工程', colSpan: '1', rowSpan: '1', field: 'dwgc', hAlign: 0, width: 100, formatter: '@', visible: false},            {title: '分部工程', colSpan: '1', rowSpan: '1', field: 'fbgc', hAlign: 0, width: 100, formatter: '@', visible: false},            {title: '分项工程', colSpan: '1', rowSpan: '1', field: 'fxgc', hAlign: 0, width: 100, formatter: '@', visible: false},            {title: '细目', colSpan: '1', rowSpan: '1', field: 'jldy', hAlign: 0, width: 100, formatter: '@'},            {title: '辅材', colSpan: '1', rowSpan: '1', field: 'is_aux', hAlign: 1, width: 60, formatter: '@', fixed: 1, cellType: 'checkbox'},            {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 100, formatter: '@', fixed: 1},            {title: '单位', colSpan: '1', rowSpan: '1', field: 'unit', hAlign: 1, width: 50, formatter: '@', fixed: 1},            {title: '设计量', colSpan: '1', rowSpan: '1', field: 'quantity', hAlign: 2, width: 80, type: 'Number', fixed: 1},        ],        emptyRows: 0,        headRows: 1,        headRowHeight: [32],        headColWidth: [30],        defaultRowHeight: 21,        headerFont: '12px 微软雅黑',        font: '12px 微软雅黑',        readOnly: true,        localCache: {            key: 'ledger-gather-ancGcl',            colWidth: true,        },    };    if (thousandth) sjsSettingObj.setTpThousandthFormat(gatherAncGclSpreadSetting);    const gatherAncGclSheet = gatherAncGclSpread.getActiveSheet();    SpreadJsObj.initSheet(gatherAncGclSheet, gatherAncGclSpreadSetting);    const changeSpread = SpreadJsObj.createNewSpread($('#change-spread')[0]);    const changeSpreadSetting = {        cols: [            {title: '变更令号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 200, formatter: '@'},            {title: '变更名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 200, formatter: '@'},            {title: '计价', colSpan: '1', rowSpan: '2', field: 'is_valuation', hAlign: 1, width: 40, cellType: 'checkbox'},            {title: '原设计|数量', colSpan: '2|1', rowSpan: '1|1', field: 'org_qty', hAlign: 2, width: 100, formatter: '@'},            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'org_tp', hAlign: 2, width: 100, formatter: '@'},            {title: '批复变更|数量', colSpan: '2|1', rowSpan: '1|1', field: 'c_qty', hAlign: 2, width: 100, formatter: '@'},            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'c_tp', hAlign: 2, width: 100, formatter: '@'},        ],        emptyRows: 0,        headRows: 2,        headRowHeight: [25, 25],        headColWidth: [30],        defaultRowHeight: 21,        headerFont: '12px 微软雅黑',        font: '12px 微软雅黑',        readOnly: true,        localCache: {            key: 'ledger-gather-change',            colWidth: true,        },    };    if (thousandth) sjsSettingObj.setTpThousandthFormat(changeSpreadSetting);    const changeSheet = changeSpread.getActiveSheet();    SpreadJsObj.initSheet(changeSheet, changeSpreadSetting);    let gclGatherData;    // 获取项目节数据    function loadLeafXmjData(iGclRow) {        const gcl = iGclRow ? gclGatherData[iGclRow] : SpreadJsObj.getSelectObject(gclSheet);        SpreadJsObj.resetTopAndSelect(leafXmjSheet);        if (gcl) {            SpreadJsObj.loadSheetData(leafXmjSheet, SpreadJsObj.DataType.Data, gcl.leafXmjs);        } else {            SpreadJsObj.loadSheetData(leafXmjSheet, SpreadJsObj.DataType.Data, []);        }    }    function loadGatherLeafXmjData(iGclRow) {        const gcl = iGclRow ? gclGatherData[iGclRow] : SpreadJsObj.getSelectObject(gclSheet);        SpreadJsObj.resetTopAndSelect(gatherLeafXmjSheet);        if (gcl) {            SpreadJsObj.loadSheetData(gatherLeafXmjSheet, SpreadJsObj.DataType.Data, gcl.gatherLeafXmjs);        } else {            SpreadJsObj.loadSheetData(gatherLeafXmjSheet, SpreadJsObj.DataType.Data, []);        }    }    function loadGatherAncGclData(iGclRow) {        const gcl = iGclRow ? gclGatherData[iGclRow] : SpreadJsObj.getSelectObject(gclSheet);        SpreadJsObj.resetTopAndSelect(gatherAncGclSheet);        if (gcl) {            SpreadJsObj.loadSheetData(gatherAncGclSheet, SpreadJsObj.DataType.Data, gcl.gatherAncGcl);        } else {            SpreadJsObj.loadSheetData(gatherAncGclSheet, SpreadJsObj.DataType.Data, []);        }    }    function loadChangeData(iGclRow) {        const gcl = iGclRow ? gclGatherData[iGclRow] : SpreadJsObj.getSelectObject(gclSheet);        SpreadJsObj.resetTopAndSelect(changeSheet);        if (gcl) {            SpreadJsObj.loadSheetData(changeSheet, SpreadJsObj.DataType.Data, gcl.change);        } else {            SpreadJsObj.loadSheetData(changeSheet, SpreadJsObj.DataType.Data, []);        }    }    function loadGclGatherRelaData(iGclRow) {        loadLeafXmjData(iGclRow);        loadChangeData(iGclRow);        loadGatherLeafXmjData(iGclRow);        loadGatherAncGclData(iGclRow);    }    function refreshRelaSpread() {        leafXmjSpread.refresh();        gatherLeafXmjSpread.refresh();        gatherAncGclSpread.refresh();        changeSpread.refresh();    }    // 标红显示 签约-台账≠0    function checkCompareData() {        const sheet = gclSheet;        const bCompare = $('#compare-tag')[0].checked;        SpreadJsObj.beginMassOperation(gclSheet);        for (let iRow = 0, iLength = gclSheet.getRowCount(); iRow < iLength; iRow++) {            const node = gclSheet.zh_data[iRow];            if (node) {                const bDiffer = node.compare_qty ? !checkZero(Math.abs(node.compare_qty)) : !checkZero(Math.abs(node.compare_tp));                const color = bCompare && bDiffer ? '#f8d7da' : '';                sheet.getRange(iRow, -1, 1, -1).backColor(color);            }        }        SpreadJsObj.endMassOperation(gclSheet);    }    // 切换清单行,读取所属项目节数据    gclSpread.getActiveSheet().bind(spreadNS.Events.SelectionChanged, function (e, info) {        const iNewRow = info.newSelections[0].row;        if (!info.oldSelections || iNewRow !== info.oldSelections[0].row) {            loadGclGatherRelaData(iNewRow);        }    });    function generateChapterHtml(data) {        const html = [];        if (data) {            for (const d of data) {                if (['1000', '1100', '1200', '1300'].indexOf(d.code) >= 0) {                    if (checkZero(d.total_price) && checkZero(d.deal_bills_tp)) {                        continue;                    }                }                html.push('<tr>');                if (d.code) {                    html.push('<td>', d.code, '</td>');                    html.push('<td>', d.name, '</td>');                } else {                    html.push('<td colspan="2">', d.name, '</td>');                }                html.push('<td class="text-right">', d.deal_bills_tp ? d.deal_bills_tp : '', '</td>');                html.push('<td class="text-right">', d.total_price ? d.total_price : '', '</td>');                html.push('<td class="text-right">', d.compare_tp ? d.compare_tp : '', '</td>');                html.push('</tr>');            }        }        $('#chapter-list').html(html.join(''));    }    postData(window.location.pathname + '/load', {}, function (data) {        gclGatherModel.loadLedgerData(data.bills);        gclGatherModel.loadPosData(data.pos);        gclGatherModel.loadDealBillsData(data.dealBills);        gclGatherModel.loadAncillaryGclData(data.ancGcl);        gclGatherModel.loadChangeData(data.change);        gclGatherData = gclGatherModel.gatherGclData();        gclGatherModel.checkDiffer(gclGatherData);        gclGatherModel.reGatherLeafXmj();        gclGatherModel.reGatherAncillaryGcl();        for (const gcl of gclGatherData) {            gcl.compare_qty = ZhCalc.sub(gcl.quantity, gcl.deal_bills_qty);            gcl.compare_tp = ZhCalc.sub(gcl.total_price, gcl.deal_bills_tp);            gcl.compare_differ = !checkZero(gcl.compare_qty) || !checkZero(gcl.compare_tp);        }        SpreadJsObj.loadSheetData(gclSheet, SpreadJsObj.DataType.Data, gclGatherData);        checkCompareData();        loadGclGatherRelaData(0);        const chapterData = gclGatherModel.gatherChapterData(chapter, data.spec, ['total_price']);        for (const c of chapterData) {            c.compare_tp = ZhCalc.sub(c.total_price, c.deal_bills_tp);        }        generateChapterHtml(chapterData);    }, null, true);    $('#compare-tag').click(() => {        // const rows = [];        // for (let i = 0; i< gclSheet.getRowCount(); ++i) {        //     rows.push(i);        // }        // SpreadJsObj.reloadRowsBackColor(gclSheet, rows);        SpreadJsObj.reLoadSheetData(gclSheet);    });    const searchBills = $.listSearch({        selector: '#search',        searchSpread: gclSpread,        searchRangeStr: '清单编号/名称',        resultSpreadSetting: {            cols: [                {title: '清单编号', field: 'b_code', hAlign: 0, width: 80, formatter: '@'},                {title: '名称', field: 'name', width: 150, hAlign: 0, formatter: '@'},                {title: '单位', field: 'unit', width: 50, hAlign: 1, formatter: '@'},                {title: '单价', field: 'unit_price', hAlign: 2, width: 50},                {title: '台账数量', field: 'quantity', hAlign: 2, width: 60},                {title: '台账金额', field: 'total_price', hAlign: 2, width: 60},            ],            emptyRows: 0,            headRows: 1,            headRowHeight: [32],            headColWidth: [30],            defaultRowHeight: 21,            headerFont: '12px 微软雅黑',            font: '12px 微软雅黑',            selectedBackColor: '#fffacd',            readOnly: true,        },        check: function(data, keyword) {            return !keyword ||                (data.b_code && data.b_code.indexOf(keyword) > -1) ||                (data.name && data.name.indexOf(keyword) > -1);        },        afterLocated: function () {            loadGclGatherRelaData();        },        calcSum: function (result) {            const sum = { name: '合计', searchIndex: -1 };            for (const r of result) {                sum.quantity = ZhCalc.add(r.quantity, sum.quantity);                sum.total_price = ZhCalc.add(r.total_price, sum.total_price);            }            return sum;        }    });    // 展开收起附件    $('a', '#side-menu').bind('click', function (e) {        e.preventDefault();        const tab = $(this), tabPanel = $(tab.attr('content'));        if (!tab.hasClass('active')) {            $('a', '#side-menu').removeClass('active');            $('#right-view .tab-content .tab-pane.active').removeClass('active');            tab.addClass('active');            tabPanel.addClass('active');            showTools(tab.hasClass('active'));            if (tab.attr('content') === '#search') searchBills.spread.refresh();        } else {            tab.removeClass('active');            tabPanel.removeClass('active');            showTools(tab.hasClass('active'));        }        gclSpread.refresh();        refreshRelaSpread();    });    // 下部设置显示相关    $('a', '[name=pos-tab]').click(function() {        const relaTab = this.getAttribute('href');        const optionTab = $('#optionTab').children();        for (const ot of optionTab) {            if (ot.getAttribute('rela-tab') === relaTab) {                $(ot).show();            } else {                $(ot).hide();            }        }        setTimeout(refreshRelaSpread, 100);    });    $('[name=gather-xmj]').change(function() {        const checkOption = $('[name=gather-xmj]:checked');        if (checkOption.length === 0) {            toastr.warning('请至少选择一个汇总条件');            return;        }        const fields = [];        for (const co of checkOption) {            fields.push(co.value);        }        for (const col of gatherLeafXmjSpreadSetting.cols) {            col.visible = col.type === 'Number' || fields.indexOf(col.field) >= 0;        }        gclGatherModel.reGatherLeafXmj(fields);        SpreadJsObj.refreshColumnVisible(gatherLeafXmjSheet);        loadGatherLeafXmjData();    });    $('[name=gather-anc-gcl]').change(function() {        const checkOption = $('[name=gather-anc-gcl]:checked');        // if (checkOption.length === 0) {        //     toastr.warning('请至少选择一个汇总条件');        //     return;        // }        const fields = [];        for (const co of checkOption) {            fields.push(co.value);        }        for (const col of gatherAncGclSpreadSetting.cols) {            col.visible = col.fixed || fields.indexOf(col.field) >= 0;        }        gclGatherModel.reGatherAncillaryGcl(fields);        SpreadJsObj.refreshColumnVisible(gatherAncGclSheet);        loadGatherAncGclData();    });    $.subMenu({        menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',        toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',        key: 'menu.1.0.0',        miniHint: '#sub-mini-hint', hintKey: 'menu.hint.1.0.1',        callback: function (info) {            if (info.mini) {                $('.panel-title').addClass('fluid');                $('#sub-menu').removeClass('panel-sidebar');            } else {                $('.panel-title').removeClass('fluid');                $('#sub-menu').addClass('panel-sidebar');            }            autoFlashHeight();            gclSpread.refresh();            refreshRelaSpread();        }    });    $.divResizer({        select: '#main-resize',        callback: function () {            gclSpread.refresh();            let bcontent = $(".bcontent-wrap") ? $(".bcontent-wrap").height() : 0;            $(".sp-wrap").height(bcontent-30);            refreshRelaSpread();        }    });    $.divResizer({        select: '#right-spr',        callback: function () {            gclSpread.refresh();            refreshRelaSpread();        }    });    $('#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: 'compare_qty', hAlign: 2, width: 80, type: 'Number'},                {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'compare_tp', hAlign: 2, width: 80, 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,                compare_qty: gcl.compare_qty, compare_tp: gcl.compare_tp,            });            if (gcl.leafXmjs && gcl.leafXmjs.length > 0) {                for (const xmj of gcl.leafXmjs) {                    data.push({                        code: xmj.code,                        quantity: xmj.quantity,                        dwgc: xmj.dwgc, fbgc: xmj.fbgc, fxgc: xmj.fxgc,                        jldy: xmj.jldy, bwmx: xmj.bwmx, drawing_code: xmj.drawing_code,                    });                }            }        }        SpreadExcelObj.exportSimpleXlsxSheet(setting, data, $('.sidebar-title').attr('data-original-title') + "-清单对比.xlsx");    });});
 |