|
@@ -11,10 +11,10 @@ let installationFeeObj={
|
|
|
{headerName: "费用规则", headerWidth: 300, dataCode: "ruleId", hAlign: "left", dataType: "String",getText:'forRule'},
|
|
|
{headerName: "编码", headerWidth: 70, dataCode: "code", hAlign: "left", dataType: "String"},
|
|
|
{headerName: "基数", headerWidth: 150, dataCode: "base", hAlign: "left", dataType: "String",cellType:'comboBox',options:installSectionBase},
|
|
|
- {headerName: "费率(%)", headerWidth: 80, dataCode: "feeRate", hAlign: "right", dataType: "String"},
|
|
|
- {headerName: "其中人工(%)", headerWidth: 100, dataCode: "labour", hAlign: "right", dataType: "String"},
|
|
|
- {headerName: "其中材料(%)", headerWidth: 100, dataCode: "material", hAlign: "right", dataType: "String"},
|
|
|
- {headerName: "其中机械(%)", headerWidth: 100, dataCode: "machine", hAlign: "right", dataType: "String"},
|
|
|
+ {headerName: "费率(%)", headerWidth: 70, dataCode: "feeRate", hAlign: "right", dataType: "String"},
|
|
|
+ {headerName: "人工(%)", headerWidth: 70, dataCode: "labour", hAlign: "right", dataType: "String"},
|
|
|
+ {headerName: "材料(%)", headerWidth: 70, dataCode: "material", hAlign: "right", dataType: "String"},
|
|
|
+ {headerName: "机械(%)", headerWidth: 70, dataCode: "machine", hAlign: "right", dataType: "String"},
|
|
|
{headerName: "费用类型", headerWidth: 100, dataCode: "feeType", hAlign: "center", dataType: "String",cellType:'comboBox',options:installFeeType},
|
|
|
{headerName: "记取位置", headerWidth: 200, dataCode: "position", hAlign: "left", dataType: "String",cellType:'selectButton',getText:'forPosition'}
|
|
|
],
|
|
@@ -39,10 +39,10 @@ let installationFeeObj={
|
|
|
feeItemData:null,
|
|
|
feeItemSetting:{
|
|
|
header: [
|
|
|
- {headerName: "计取", headerWidth: 90, dataCode: "isCal", dataType: "String",cellType: "checkBox"},
|
|
|
+ {headerName: "计取", headerWidth: 50, dataCode: "isCal", dataType: "String",cellType: "checkBox"},
|
|
|
{headerName: "费用项", headerWidth: 300, dataCode: "feeItem", hAlign: "left", dataType: "String"},
|
|
|
{headerName: "费用类型", headerWidth: 100, dataCode: "feeType", hAlign: "center", dataType: "String",cellType:'comboBox',options:installFeeType},
|
|
|
- {headerName: "记取位置", headerWidth: 140, dataCode: "displayPosition", hAlign: "left", dataType: "String",cellType:'selectButton'}
|
|
|
+ {headerName: "记取位置", headerWidth: 180, dataCode: "displayPosition", hAlign: "left", dataType: "String",cellType:'selectButton'}
|
|
|
],
|
|
|
view: {
|
|
|
lockColumns: [0,1]
|
|
@@ -57,11 +57,11 @@ let installationFeeObj={
|
|
|
{headerName: "费用规则", headerWidth: 220, dataCode: "rule", hAlign: "left", dataType: "String",getText:'forRule'},
|
|
|
{headerName: "编码", headerWidth: 70, dataCode: "code", hAlign: "left", dataType: "String"},
|
|
|
{headerName: "基数", headerWidth: 80, dataCode: "base", hAlign: "left", dataType: "String",cellType:'comboBox',options:installSectionBase},
|
|
|
- {headerName: "费率(%)", headerWidth: 80, dataCode: "feeRate", hAlign: "right", dataType: "String"},
|
|
|
- {headerName: "其中人工(%)", headerWidth: 100, dataCode: "labour", hAlign: "right", dataType: "String"},
|
|
|
- {headerName: "其中材料(%)", headerWidth: 100, dataCode: "material", hAlign: "right", dataType: "String"},
|
|
|
- {headerName: "其中机械(%)", headerWidth: 100, dataCode: "machine", hAlign: "right", dataType: "String"},
|
|
|
- {headerName: "记取位置", headerWidth: 100, dataCode: "position", hAlign: "left", dataType: "String",cellType:'selectButton'}
|
|
|
+ {headerName: "费率(%)", headerWidth: 70, dataCode: "feeRate", hAlign: "right", dataType: "String"},
|
|
|
+ {headerName: "人工(%)", headerWidth: 70, dataCode: "labour", hAlign: "right", dataType: "String"},
|
|
|
+ {headerName: "材料(%)", headerWidth: 70, dataCode: "material", hAlign: "right", dataType: "String"},
|
|
|
+ {headerName: "机械(%)", headerWidth: 70, dataCode: "machine", hAlign: "right", dataType: "String"},
|
|
|
+ {headerName: "记取位置", headerWidth: 200, dataCode: "position", hAlign: "left", dataType: "String",cellType:'selectButton'}
|
|
|
],
|
|
|
view: {
|
|
|
lockColumns: [0, 2]
|
|
@@ -388,7 +388,7 @@ let installationFeeObj={
|
|
|
let ri = ration_installation.datas[i];
|
|
|
if(ration.projectID == ri.projectID && ration.ID == ri.rationID){
|
|
|
let tem_ri = _.cloneDeep(ri);
|
|
|
- this.getRIRuleData(tem_ri.ruleId,tem_ri,tem_ri);
|
|
|
+ this.getRIShowData(tem_ri.ruleId,tem_ri,tem_ri);
|
|
|
installationList.push(tem_ri);
|
|
|
}
|
|
|
}
|
|
@@ -410,7 +410,7 @@ let installationFeeObj={
|
|
|
refreshRationInstallationRow:function (row) {
|
|
|
let ri = this.rationInstallData[row];
|
|
|
let tem_ri = _.cloneDeep(projectObj.project.ration_installation.getByID(ri.ID));
|
|
|
- this.rationInstallData[row] = this.getRIRuleData(tem_ri.ruleId,tem_ri,tem_ri);
|
|
|
+ this.rationInstallData[row] = this.getRIShowData(tem_ri.ruleId,tem_ri,tem_ri);
|
|
|
sheetCommonObj.showRowData(this.rationInstallSheet, this.rationInstallSetting,row,this.rationInstallData);
|
|
|
},
|
|
|
refreshFeeDetailRow:function (row) {
|
|
@@ -473,7 +473,9 @@ let installationFeeObj={
|
|
|
if(item.billID&&item.billID!=''){
|
|
|
let node = projectObj.project.mainTree.getNodeByID(item.billID);
|
|
|
if(node){
|
|
|
- return node.data.code +" "+node.data.name;
|
|
|
+ let code = node.data.code?node.data.code:"";
|
|
|
+ let name = node.data.name?node.data.name:"";
|
|
|
+ return code +" "+name;
|
|
|
}
|
|
|
}
|
|
|
return item.position;
|
|
@@ -837,9 +839,11 @@ let installationFeeObj={
|
|
|
let feeRule = me.moreFeeRuleData[row];
|
|
|
let detailSelection = me.feeDetailSheet.getSelections()[0];
|
|
|
let detail = this.feeDetailData[detailSelection.row];
|
|
|
+ let rationInstallations = [];
|
|
|
let updateData = installation_fee.getSectionUpdateData(detail.libID,detail.ID,{"feeRuleId":feeRule.ID});
|
|
|
+ installation_fee.getRIUpdateDataBySectionUpdate(detail.ID,feeRule.ID,rationInstallations);//生成受影响的定额安装增加费并加入到数组中
|
|
|
$.bootstrapLoading.start();
|
|
|
- installation_fee.submitInstallationUpdate(updateData,function (data) {
|
|
|
+ installation_fee.submitInstallationUpdate(updateData,rationInstallations,function (data) {
|
|
|
let section = installation_fee.getInstallSectionByID(detail.libID,detail.ID);
|
|
|
section.feeRuleId = feeRule.ID;
|
|
|
me.refreshFeeDetailRow(detailSelection.row);
|
|
@@ -872,11 +876,11 @@ let installationFeeObj={
|
|
|
if(feeItem.billID ==recode.ID ){//和原来的位置没变
|
|
|
return;
|
|
|
}
|
|
|
- let updateData = projectObj.project.installation_fee.getFeeItemUpdateData(feeItem,{ position: recode.code, billID:recode.ID});
|
|
|
+ let updateData = projectObj.project.installation_fee.getFeeItemUpdateData(feeItem.libID,feeItem.ID,{ position: recode.code, billID:recode.ID});
|
|
|
let [dataArray,impacRules] = me.getFeeRuleUpdateDataByFeeItem(feeItem,recode);
|
|
|
dataArray.push(updateData);
|
|
|
$.bootstrapLoading.start();
|
|
|
- projectObj.project.installation_fee.submitInstallationUpdate(dataArray,function (data) {
|
|
|
+ projectObj.project.installation_fee.submitInstallationUpdate(dataArray,null,function (data) {
|
|
|
//更新缓存
|
|
|
feeItem.position =recode.code;
|
|
|
feeItem.billID = recode.ID;
|
|
@@ -924,13 +928,8 @@ let installationFeeObj={
|
|
|
let header = this.feeItemSetting.header[info.col];
|
|
|
let doc={};
|
|
|
doc[header.dataCode] = info.newValue;
|
|
|
- let updateData = projectObj.project.installation_fee.getFeeItemUpdateData(feeItem,doc);
|
|
|
- $.bootstrapLoading.start();
|
|
|
- projectObj.project.installation_fee.submitInstallationUpdate(updateData,function (data) {
|
|
|
- //更新缓存
|
|
|
- feeItem[header.dataCode]=info.newValue;
|
|
|
+ projectObj.project.installation_fee.updateFeeItem(doc,feeItem.libID,feeItem.ID,function () {
|
|
|
me.feeItemSheet.getCell(info.row, info.col).value(info.newValue);
|
|
|
- $.bootstrapLoading.end();
|
|
|
});
|
|
|
},
|
|
|
onRationInstallValueChange:function (e,info) {
|
|
@@ -1013,6 +1012,7 @@ let installationFeeObj={
|
|
|
let header = this.feeDetailSetting.header[info.col];
|
|
|
let fieldID = header.dataCode;
|
|
|
let updateData = null;
|
|
|
+ let rationInstallations=null;
|
|
|
if(fieldID == 'rule'){//选择新的规则项
|
|
|
if(info.newValue=="more"){//选择的是更多
|
|
|
$("#more_from").val("feeDetail");
|
|
@@ -1024,7 +1024,9 @@ let installationFeeObj={
|
|
|
}else if(info.newValue == feeDetail.ruleName){
|
|
|
return;
|
|
|
}else {
|
|
|
+ rationInstallations=[];
|
|
|
updateData = install_fee.getSectionUpdateData(feeDetail.libID,feeDetail.ID,{"feeRuleId":info.newValue});
|
|
|
+ install_fee.getRIUpdateDataBySectionUpdate(feeDetail.ID,info.newValue,rationInstallations);//生成受影响的定额安装增加费并加入到数组中
|
|
|
}
|
|
|
|
|
|
}else if(fieldID == 'base'){
|
|
@@ -1054,7 +1056,7 @@ let installationFeeObj={
|
|
|
feeDetail[fieldID] = info.newValue;
|
|
|
updateData = install_fee.getFeeRuleUpdateData(feeDetail.libID,feeDetail.feeRuleId,doc);
|
|
|
}
|
|
|
- install_fee.submitInstallationUpdate(updateData,function (data) {
|
|
|
+ install_fee.submitInstallationUpdate(updateData,rationInstallations,function (data) {
|
|
|
if(updateData){
|
|
|
if(updateData.type=="installSection"){
|
|
|
let section = install_fee.getInstallSectionByID(feeDetail.libID,feeDetail.ID);
|
|
@@ -1085,7 +1087,7 @@ let installationFeeObj={
|
|
|
let me = installationFeeObj;
|
|
|
let canChange = true;
|
|
|
let os = null;
|
|
|
- if(info.newSelections[0].row == info.oldSelections[0].row){//没有换行
|
|
|
+ if(info.oldSelections==undefined||info.newSelections[0].row == info.oldSelections[0].row){//没有换行
|
|
|
return canChange;
|
|
|
}
|
|
|
if(info.sheetName=='feeDetailSheet'){
|
|
@@ -1108,7 +1110,7 @@ let installationFeeObj={
|
|
|
}
|
|
|
return canChange;
|
|
|
},
|
|
|
- getRIRuleData : function (ruleID,rationInstallation,data) {
|
|
|
+ getRIShowData : function (ruleID,rationInstallation,data) {
|
|
|
if(ruleID==''){//选择的是无
|
|
|
data.code = '';
|
|
|
data.rule = '';
|
|
@@ -1132,8 +1134,18 @@ let installationFeeObj={
|
|
|
data.position = feeRule.position;
|
|
|
data.billID = feeRule.billID;
|
|
|
}
|
|
|
+ let feeItem = projectObj.project.installation_fee.getFeeItemByID(rationInstallation.libID,rationInstallation.feeItemId);
|
|
|
+ if(feeItem){
|
|
|
+ data.feeType = feeItem.feeType;
|
|
|
+ }
|
|
|
return data;
|
|
|
- }
|
|
|
+ },
|
|
|
+ calcInstallationFee:function(){//计算定额安装费
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
};
|
|
|
|
|
|
|