|
@@ -0,0 +1,110 @@
|
|
|
+'use strict';
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ *
|
|
|
+ * @author Mai
|
|
|
+ * @date
|
|
|
+ * @version
|
|
|
+ */
|
|
|
+
|
|
|
+$(document).ready(() => {
|
|
|
+ autoFlashHeight();
|
|
|
+ const gclSpread = SpreadJsObj.createNewSpread($('#gcl-spread')[0]);
|
|
|
+ SpreadJsObj.initSheet(gclSpread.getActiveSheet(), {
|
|
|
+ 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'},
|
|
|
+ ],
|
|
|
+ emptyRows: 0,
|
|
|
+ headRows: 2,
|
|
|
+ headRowHeight: [25, 25],
|
|
|
+ defaultRowHeight: 21,
|
|
|
+ headerFont: '12px 微软雅黑',
|
|
|
+ font: '12px 微软雅黑',
|
|
|
+ readOnly: true,
|
|
|
+ });
|
|
|
+ const gclSheet = gclSpread.getActiveSheet();
|
|
|
+ const leafXmjSpread = SpreadJsObj.createNewSpread($('#leaf-xmj-spread')[0]);
|
|
|
+ SpreadJsObj.initSheet(leafXmjSpread.getActiveSheet(), {
|
|
|
+ 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],
|
|
|
+ defaultRowHeight: 21,
|
|
|
+ headerFont: '12px 微软雅黑',
|
|
|
+ font: '12px 微软雅黑',
|
|
|
+ readOnly: true,
|
|
|
+ });
|
|
|
+ const leafXmjSheet = leafXmjSpread.getActiveSheet();
|
|
|
+
|
|
|
+ let gclGatherData;
|
|
|
+ // 获取项目节数据
|
|
|
+ function loadLeafXmjData(iGclRow) {
|
|
|
+ const gcl = gclGatherData[iGclRow];
|
|
|
+ if (gcl) {
|
|
|
+ SpreadJsObj.loadSheetData(leafXmjSheet, SpreadJsObj.DataType.Data, gcl.leafXmjs);
|
|
|
+ } else {
|
|
|
+ SpreadJsObj.loadSheetData(leafXmjSheet, SpreadJsObj.DataType.Data, []);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 切换清单行,读取所属项目节数据
|
|
|
+ gclSpread.getActiveSheet().bind(spreadNS.Events.SelectionChanged, function (e, info) {
|
|
|
+ const iNewRow = info.newSelections[0].row;
|
|
|
+ if (!info.oldSelections || iNewRow !== info.oldSelections[0].row) {
|
|
|
+ loadLeafXmjData(iNewRow);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ postData(window.location.pathname + '/load', {}, function (data) {
|
|
|
+ gclGatherModel.loadLedgerData(data.bills);
|
|
|
+ gclGatherModel.loadPosData(data.pos);
|
|
|
+ gclGatherModel.loadDealBillsData(data.dealBills);
|
|
|
+ gclGatherData = gclGatherModel.gatherGclData();
|
|
|
+ SpreadJsObj.loadSheetData(gclSheet, SpreadJsObj.DataType.Data, gclGatherData);
|
|
|
+ loadLeafXmjData(0);
|
|
|
+ }, null, true);
|
|
|
+
|
|
|
+ $.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();
|
|
|
+ leafXmjSpread.refresh();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $.divResizer({
|
|
|
+ select: '#main-resize',
|
|
|
+ callback: function () {
|
|
|
+ gclSpread.refresh();
|
|
|
+ let bcontent = $(".bcontent-wrap") ? $(".bcontent-wrap").height() : 0;
|
|
|
+ $(".sp-wrap").height(bcontent-40);
|
|
|
+ leafXmjSpread.refresh();
|
|
|
+ }
|
|
|
+ });
|
|
|
+});
|