| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- /**
- * 配合比相关
- *
- * @author CaiAoLin
- * @date 2017/7/10
- * @version
- */
- let mixRatioHeader = [];
- let mixRatioSheet = null;
- let mixRatioSpread = null;
- $(document).ready(function() {
- mixRatioHeader = [
- {name: '编码', field: 'code', visible: true},
- {name: '名称', field: 'name', visible: true},
- {name: '单位', field: 'unit_price.unit', visible: true},
- {name: 'ID', field: 'id', visible: false},
- {name: '类型', field: 'unit_price.type', visible: false},
- {name: '基价单价', field: "unit_price.base_price", visible: true},
- {name: '调整基价', field: 'adjust_price', visible: true},
- {name: '市场单价', field: "unit_price.market_price", visible: true, validator: 'number'},
- {name: '总消耗量', field: 'quantity', visible: true},
- ];
- let setting = {
- header: []
- };
- for(let tmp of mixRatioHeader) {
- setting.header.push({headerName: tmp.name, headerWidth: 120});
- }
- mixRatioSpread = sheetCommonObj.buildSheet(document.getElementById("mix-ratio"), setting, 3);
- mixRatioSpread.options.scrollbarShowMax = true;
- mixRatioSpread.options.scrollbarMaxAlign = true;
- mixRatioSpread.options.showHorizontalScrollbar = true;
- mixRatioSheet = mixRatioSpread.getActiveSheet();
- // 设置表单不可编辑
- mixRatioSheet.options.isProtected = true;
- // 切换tab触发refresh
- $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
- let tagString = $(e.target).text();
- if (tagString === "配合比表" && mixRatioSpread !== null) {
- // 筛选数据显示(显示混凝土、砂浆、配合比)
- filterDataByType([GLJTypeConst.CONCRETE, GLJTypeConst.MORTAR, GLJTypeConst.MIX_RATIO]);
- // 获取工料机当前选中的行号
- console.log(gljSheet.getActiveRowIndex());
- mixRatioSpread.refresh();
- }
- });
- });
- /**
- * 根据id获取对应的配合比数据
- *
- * @param {Number} id
- * @return {void}
- */
- function getMixRatioData(id) {
- }
|