|
@@ -504,7 +504,7 @@ var projectObj = {
|
|
|
if(value === node.data.calcBase){
|
|
if(value === node.data.calcBase){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- node.updateData.userCalcBase = value;
|
|
|
|
|
|
|
+ node.data.userCalcBase = value;
|
|
|
project.calcBase.calculate(node);
|
|
project.calcBase.calculate(node);
|
|
|
if(!project.calcBase.success){
|
|
if(!project.calcBase.success){
|
|
|
let activeCell = projectObj.mainSpread.getActiveSheet().getSelections()[0];
|
|
let activeCell = projectObj.mainSpread.getActiveSheet().getSelections()[0];
|
|
@@ -1995,46 +1995,6 @@ var projectObj = {
|
|
|
sheetArea: context.sheetArea
|
|
sheetArea: context.sheetArea
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
- /*CommonTotalFeeCellType.prototype.processMouseDown = function (hitinfo) {
|
|
|
|
|
- let me=calcBaseView;
|
|
|
|
|
- me.pmLeave = false;
|
|
|
|
|
- if(me.editingCell==null){
|
|
|
|
|
- var showSelectBtn = true;
|
|
|
|
|
- if(hitinfo.sheet.name()!='calc_detail'){
|
|
|
|
|
- showSelectBtn=me.ifEdit(type, hitinfo.row);
|
|
|
|
|
- }
|
|
|
|
|
- if(showSelectBtn){
|
|
|
|
|
- me.editingCell={
|
|
|
|
|
- row:hitinfo.row,
|
|
|
|
|
- col:hitinfo.col
|
|
|
|
|
- }
|
|
|
|
|
- hitinfo.sheet.invalidateLayout();
|
|
|
|
|
- hitinfo.sheet.repaint();
|
|
|
|
|
- }
|
|
|
|
|
- }else if(hitinfo.row==me.editingCell.row){
|
|
|
|
|
- var offset=hitinfo.cellRect.x+hitinfo.cellRect.width-6;
|
|
|
|
|
- var imageMagin=3;
|
|
|
|
|
- var imageHeight = hitinfo.cellRect.height-2*imageMagin;
|
|
|
|
|
- var imageWidth = hitinfo.cellRect.width*2/7;
|
|
|
|
|
- if(hitinfo.x<offset&&hitinfo.x>offset-imageWidth){
|
|
|
|
|
- if(!projectReadOnly && me.ifEdit(type, hitinfo.row)){
|
|
|
|
|
- calcBaseView.confirmBtn.attr('toggle', 'commonTotalFee');
|
|
|
|
|
- changeCalcBaseFeeRate('commonTotalFee');
|
|
|
|
|
- $('#tabCalcBase').tab('show');
|
|
|
|
|
- calcBaseView.initCalctor(type);
|
|
|
|
|
- feeRateObject.showSelectModal(hitinfo);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
- CommonTotalFeeCellType.prototype.processMouseLeave = function (hitinfo) {
|
|
|
|
|
- if(!calcBaseView.pmLeave){
|
|
|
|
|
- calcBaseView.editingCell=null;
|
|
|
|
|
- hitinfo.sheet.invalidateLayout();
|
|
|
|
|
- hitinfo.sheet.repaint();
|
|
|
|
|
- calcBaseView.pmLeave = true;
|
|
|
|
|
- }
|
|
|
|
|
- };*/
|
|
|
|
|
CommonTotalFeeCellType.prototype.processMouseDown = function (hitinfo) {
|
|
CommonTotalFeeCellType.prototype.processMouseDown = function (hitinfo) {
|
|
|
let me = calcBaseView;
|
|
let me = calcBaseView;
|
|
|
if(me.editingCell && hitinfo.row==me.editingCell.row){
|
|
if(me.editingCell && hitinfo.row==me.editingCell.row){
|
|
@@ -2045,9 +2005,10 @@ var projectObj = {
|
|
|
if(hitinfo.x<offset&&hitinfo.x>offset-imageWidth){
|
|
if(hitinfo.x<offset&&hitinfo.x>offset-imageWidth){
|
|
|
if(!projectReadOnly && me.ifEdit(type, hitinfo.row)){
|
|
if(!projectReadOnly && me.ifEdit(type, hitinfo.row)){
|
|
|
if(hitinfo.sheet.getParent() === projectObj.mainSpread){
|
|
if(hitinfo.sheet.getParent() === projectObj.mainSpread){
|
|
|
- projectObj.project.mainTree.selected = projectObj.project.mainTree.items[hitinfo.row] ? projectObj.project.mainTree.items[hitinfo.row] : null;
|
|
|
|
|
|
|
+ let node = projectObj.project.mainTree.items[hitinfo.row] ? projectObj.project.mainTree.items[hitinfo.row] : null;
|
|
|
|
|
+ projectObj.mainController.setTreeSelected(node);
|
|
|
}
|
|
}
|
|
|
- hitinfo.sheet.setActiveCell(hitinfo.row, hitinfo.col);
|
|
|
|
|
|
|
+ //hitinfo.sheet.setActiveCell(hitinfo.row, hitinfo.col);
|
|
|
calcBaseView.confirmBtn.attr('toggle', 'commonTotalFee');
|
|
calcBaseView.confirmBtn.attr('toggle', 'commonTotalFee');
|
|
|
changeCalcBaseFeeRate('commonTotalFee');
|
|
changeCalcBaseFeeRate('commonTotalFee');
|
|
|
$('#tabCalcBase').tab('show');
|
|
$('#tabCalcBase').tab('show');
|
|
@@ -2348,7 +2309,7 @@ $('#poj-set').on('show.bs.modal', function () {
|
|
|
let ft = (projectObj.project.property.billsCalcMode !== undefined && projectObj.project.property.billsCalcMode !== null) ?
|
|
let ft = (projectObj.project.property.billsCalcMode !== undefined && projectObj.project.property.billsCalcMode !== null) ?
|
|
|
projectObj.project.property.billsCalcMode : defaultCalcMode;
|
|
projectObj.project.property.billsCalcMode : defaultCalcMode;
|
|
|
|
|
|
|
|
- let zg = projectObj.project.property.zanguCalcMode !== undefined &&``
|
|
|
|
|
|
|
+ let zg = projectObj.project.property.zanguCalcMode !== undefined &&
|
|
|
projectObj.project.property.zanguCalcMode !== null ? projectObj.project.property.zanguCalcMode : zanguCalcType.common;
|
|
projectObj.project.property.zanguCalcMode !== null ? projectObj.project.property.zanguCalcMode : zanguCalcType.common;
|
|
|
setCalcFlag($('#rationContent'), leafBillGetFeeType.rationContent, ft);
|
|
setCalcFlag($('#rationContent'), leafBillGetFeeType.rationContent, ft);
|
|
|
setCalcFlag($('#rationPriceConverse'), leafBillGetFeeType.rationPriceConverse, ft);
|
|
setCalcFlag($('#rationPriceConverse'), leafBillGetFeeType.rationPriceConverse, ft);
|
|
@@ -2362,6 +2323,38 @@ $('#poj-set').on('show.bs.modal', function () {
|
|
|
projDisplayView.init();
|
|
projDisplayView.init();
|
|
|
calcOptions.init();
|
|
calcOptions.init();
|
|
|
}
|
|
}
|
|
|
|
|
+ let propertyInfo = projectInfoObj.projectInfo.property;
|
|
|
|
|
+ //关于计算-价差预备费//预算项目才有
|
|
|
|
|
+ if (propertyInfo.valuationType === 'bill') {
|
|
|
|
|
+ $('#jcybf').show();
|
|
|
|
|
+ //年造价增涨率,单位为%
|
|
|
|
|
+ $('#costGrowthRate').val(propertyInfo.costGrowthRate ? propertyInfo.costGrowthRate * 100 : 0);
|
|
|
|
|
+ //增涨计费年限
|
|
|
|
|
+ $('#growthPeriod').val(propertyInfo.growthPeriod ? propertyInfo.growthPeriod : 0);
|
|
|
|
|
+ }
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
|
|
+function isKeyNumber(keyCode) {
|
|
|
|
|
+ // 数字
|
|
|
|
|
+ if (keyCode >= 48 && keyCode <= 57 ) {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ } else if (keyCode >= 96 && keyCode <= 105) { //小键盘数字
|
|
|
|
|
+ return true;
|
|
|
|
|
+ } else if (keyCode == 8 || keyCode == 46 || keyCode == 37 || keyCode == 39 || keyCode == 108 || keyCode == 110) { // Backspace, del, 左右方向键
|
|
|
|
|
+ return true;
|
|
|
|
|
+ } else if (keyCode >= 112 && keyCode <= 123) { //F1 -F12
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//年造价增涨率
|
|
|
|
|
+$('#costGrowthRate').keydown(function (e) {
|
|
|
|
|
+ return isKeyNumber(e.keyCode);
|
|
|
|
|
+});
|
|
|
|
|
+//计费年限
|
|
|
|
|
+$("#growthPeriod").keydown(function (e) {
|
|
|
|
|
+ return isKeyNumber(e.keyCode);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
//恢复默认列设置
|
|
//恢复默认列设置
|
|
@@ -2483,6 +2476,22 @@ $('#property_ok').click(function () {
|
|
|
reCalcRations = true;
|
|
reCalcRations = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ //价差预备费,预算项目才有
|
|
|
|
|
+ if (project.property.valuationType === 'bill') {
|
|
|
|
|
+ let costGrowthRateV = $('#costGrowthRate').val(),
|
|
|
|
|
+ costGrowthRate = costGrowthRateV ? parseFloat(costGrowthRateV / 100) : 0,
|
|
|
|
|
+ growthPeriodV = $('#growthPeriod').val(),
|
|
|
|
|
+ growthPeriod = growthPeriodV ? parseFloat(growthPeriodV) : 0;
|
|
|
|
|
+ if (project.property.costGrowthRate !== costGrowthRate) {
|
|
|
|
|
+ properties['property.costGrowthRate'] = costGrowthRate;
|
|
|
|
|
+ reCalcBills = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (project.property.growthPeriod !== growthPeriod) {
|
|
|
|
|
+ properties['property.growthPeriod'] = growthPeriod;
|
|
|
|
|
+ reCalcBills = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
//基本信息
|
|
//基本信息
|
|
|
if(basicInfoView.toUpdate(basicInfoView.orgDatas, basicInfoView.datas)){
|
|
if(basicInfoView.toUpdate(basicInfoView.orgDatas, basicInfoView.datas)){
|
|
|
let saveData = basicInfoView.toSaveDatas(basicInfoView.datas);
|
|
let saveData = basicInfoView.toSaveDatas(basicInfoView.datas);
|
|
@@ -2559,9 +2568,6 @@ $('#property_ok').click(function () {
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- // for test.
|
|
|
|
|
-/* console.log(mixDatas);
|
|
|
|
|
- return; */
|
|
|
|
|
function hasMixData() {
|
|
function hasMixData() {
|
|
|
return Object.keys(mixDatas.properties).length > 0 || mixDatas.options.updateData ||
|
|
return Object.keys(mixDatas.properties).length > 0 || mixDatas.options.updateData ||
|
|
|
mixDatas.labourCoes.updateData || mixDatas.rations.length > 0 || mixDatas.bills.length > 0;
|
|
mixDatas.labourCoes.updateData || mixDatas.rations.length > 0 || mixDatas.bills.length > 0;
|
|
@@ -2575,6 +2581,8 @@ $('#property_ok').click(function () {
|
|
|
if(mixDatas.properties.hasOwnProperty('property.billsCalcMode') ||
|
|
if(mixDatas.properties.hasOwnProperty('property.billsCalcMode') ||
|
|
|
mixDatas.properties.hasOwnProperty('property.zanguCalcMode') ||
|
|
mixDatas.properties.hasOwnProperty('property.zanguCalcMode') ||
|
|
|
mixDatas.properties.hasOwnProperty('property.calcOptions')||
|
|
mixDatas.properties.hasOwnProperty('property.calcOptions')||
|
|
|
|
|
+ mixDatas.properties.hasOwnProperty('property.costGrowthRate')||
|
|
|
|
|
+ mixDatas.properties.hasOwnProperty('property.growthPeriod')||
|
|
|
mixDatas.properties.hasOwnProperty('property.billsQuantityDecimal')||
|
|
mixDatas.properties.hasOwnProperty('property.billsQuantityDecimal')||
|
|
|
mixDatas.properties.hasOwnProperty('property.decimal')||
|
|
mixDatas.properties.hasOwnProperty('property.decimal')||
|
|
|
mixDatas.properties.hasOwnProperty('property.displaySetting')){
|
|
mixDatas.properties.hasOwnProperty('property.displaySetting')){
|