|
@@ -12,47 +12,58 @@ $(document).ready(function() {
|
|
|
|
|
|
// 切换tab触发refresh
|
|
|
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
|
|
- if($(e.target).data('name')==undefined){
|
|
|
- return;
|
|
|
+ let tagName = $(e.target).data('name');
|
|
|
+ if(tagName=='tab_gongliaoji'&&(currentTag!=undefined||currentTag!='')){
|
|
|
+ refreshSheetView();
|
|
|
+ }else if(tagName){
|
|
|
+ currentTag = $(e.target).data('name');
|
|
|
+ refreshSheetView();
|
|
|
}
|
|
|
- currentTag = $(e.target).data('name');
|
|
|
- // 获取工料机当前选中的行号
|
|
|
- let projectGLJId = 0;
|
|
|
- if (currentTag === "mix-ratio") {
|
|
|
- if (mixRatioSpread === null) {
|
|
|
- mixRatioSpread = new CompositionSpread();
|
|
|
- mixRatioSpread.init(currentTag);
|
|
|
- mixRatioSpread.initRightClick(currentTag);
|
|
|
- mixRatioSpread.successCallback = compositionSuccess;
|
|
|
- }
|
|
|
|
|
|
- // 筛选数据显示(显示混凝土、砂浆、配合比)
|
|
|
- projectGLJSheet.filterData('unit_price.type', [GLJTypeConst.CONCRETE, GLJTypeConst.MORTAR, GLJTypeConst.MIX_RATIO,GLJTypeConst.MAIN_MATERIAL]);
|
|
|
+ function refreshSheetView() {
|
|
|
+ // 获取工料机当前选中的行号
|
|
|
+ let projectGLJId = 0;
|
|
|
+ if (currentTag === "mix-ratio") {
|
|
|
+ if (mixRatioSpread === null) {
|
|
|
+ mixRatioSpread = new CompositionSpread();
|
|
|
+ mixRatioSpread.init(currentTag);
|
|
|
+ mixRatioSpread.initRightClick(currentTag);
|
|
|
+ mixRatioSpread.successCallback = compositionSuccess;
|
|
|
+ }
|
|
|
|
|
|
- projectGLJSheet.selectRow(projectGLJSpread.firstMixRatioRow);
|
|
|
- projectGLJId = projectGLJSheet.getActiveDataByField('id');
|
|
|
+ // 筛选数据显示(显示混凝土、砂浆、配合比)
|
|
|
+ projectGLJSheet.filterData('unit_price.type', [GLJTypeConst.CONCRETE, GLJTypeConst.MORTAR, GLJTypeConst.MIX_RATIO,GLJTypeConst.MAIN_MATERIAL]);
|
|
|
|
|
|
- // 获取数据
|
|
|
- mixRatioSpread.getRatioData(projectGLJId);
|
|
|
- }
|
|
|
+ projectGLJSheet.selectRow(projectGLJSpread.firstMixRatioRow);
|
|
|
+ projectGLJId = projectGLJSheet.getActiveDataByField('id');
|
|
|
|
|
|
- if (currentTag === "machine") {
|
|
|
- if (machineSpread === null) {
|
|
|
- machineSpread = new CompositionSpread();
|
|
|
- machineSpread.init(currentTag);
|
|
|
- machineSpread.initRightClick(currentTag);
|
|
|
- machineSpread.successCallback = compositionSuccess;
|
|
|
+ // 获取数据
|
|
|
+ mixRatioSpread.getRatioData(projectGLJId);
|
|
|
}
|
|
|
|
|
|
- // 筛选数据显示(显示普通机械)
|
|
|
- projectGLJSheet.filterData('unit_price.type', [GLJTypeConst.GENERAL_MACHINE]);
|
|
|
- projectGLJSheet.selectRow(projectGLJSpread.firstMachineRow);
|
|
|
- projectGLJId = projectGLJSheet.getActiveDataByField('id');
|
|
|
+ if (currentTag === "machine") {
|
|
|
+ if (machineSpread === null) {
|
|
|
+ machineSpread = new CompositionSpread();
|
|
|
+ machineSpread.init(currentTag);
|
|
|
+ machineSpread.initRightClick(currentTag);
|
|
|
+ machineSpread.successCallback = compositionSuccess;
|
|
|
+ }
|
|
|
|
|
|
- // 获取数据
|
|
|
- machineSpread.getRatioData(projectGLJId);
|
|
|
+ // 筛选数据显示(显示普通机械)
|
|
|
+ projectGLJSheet.filterData('unit_price.type', [GLJTypeConst.GENERAL_MACHINE]);
|
|
|
+ projectGLJSheet.selectRow(projectGLJSpread.firstMachineRow);
|
|
|
+ projectGLJId = projectGLJSheet.getActiveDataByField('id');
|
|
|
+
|
|
|
+ // 获取数据
|
|
|
+ machineSpread.getRatioData(projectGLJId);
|
|
|
+ }
|
|
|
+ if (currentTag === 'ration') {
|
|
|
+ projectGLJSheet.filterData('unit_price.type', []);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
});
|
|
|
|
|
|
});
|
|
@@ -94,7 +105,7 @@ function compositionSuccess(info) {
|
|
|
//更新表格
|
|
|
projectGLJSheet.setCellByField('unit_price.market_price', info.parentMarketPrice, false);
|
|
|
projectGLJSheet.setCellByField('base_price', info.parentBasePrice, false);
|
|
|
- projectGLJSheet.setCellByField('adjust_price', info.parentMarketPrice, false);
|
|
|
+ projectGLJSheet.setCellByField('adjust_price', projectObj.project.projectGLJ.getAdjustPrice(parentData), false);
|
|
|
// 更新组成物缓存
|
|
|
projectObj.project.composition.loadData();
|
|
|
//选查找使用了父项目工料机的定额工料机
|