|
@@ -45,8 +45,8 @@ materialCalcObj = {
|
|
|
{headerName: "运价增\n加率(%)", headerWidth: 60, dataCode: "freightIncreaseRate", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"
|
|
{headerName: "运价增\n加率(%)", headerWidth: 60, dataCode: "freightIncreaseRate", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"
|
|
|
{headerName: "加权\n系数", headerWidth: 60, dataCode: "weightCoe", hAlign: "right", dataType: "Number",validator:"number"},
|
|
{headerName: "加权\n系数", headerWidth: 60, dataCode: "weightCoe", hAlign: "right", dataType: "Number",validator:"number"},
|
|
|
{headerName: "计算式", headerWidth: 170, dataCode: "exp", hAlign: "left", dataType: "Number",getText:'forExp'},//,decimalField:"glj.unitPrice"
|
|
{headerName: "计算式", headerWidth: 170, dataCode: "exp", hAlign: "left", dataType: "Number",getText:'forExp'},//,decimalField:"glj.unitPrice"
|
|
|
- {headerName: "计算方式", headerWidth: 80, dataCode: "calcType", dataType: "String",cellType:"comboBox",options:["全国","内蒙古"]},
|
|
|
|
|
- {headerName: "材料类型", headerWidth: 80, dataCode: "materialType", dataType: "String",cellType:"comboBox",options:["地方材料","外购材料","沥青、燃料等"]}
|
|
|
|
|
|
|
+ {headerName: "计算方式", headerWidth: 80, dataCode: "calcType",visible: false, dataType: "String",cellType:"comboBox",options:["全国","内蒙古"]},
|
|
|
|
|
+ {headerName: "材料类型", headerWidth: 80, dataCode: "materialType", visible: false,dataType: "String",cellType:"comboBox",options:["","地方材料","外购材料","沥青、燃料等"]}
|
|
|
],
|
|
],
|
|
|
view: {
|
|
view: {
|
|
|
lockColumns: ["exp"],
|
|
lockColumns: ["exp"],
|
|
@@ -55,7 +55,7 @@ materialCalcObj = {
|
|
|
getText:{
|
|
getText:{
|
|
|
forExp:function (item) {
|
|
forExp:function (item) {
|
|
|
let material = materialCalcObj.getMaterialSelected();
|
|
let material = materialCalcObj.getMaterialSelected();
|
|
|
- if(item.calcType == "内蒙古"){
|
|
|
|
|
|
|
+ if(gljUtil.isDef(item.materialType)&&item.materialType != ""){
|
|
|
let uString = materialCalcObj.getNeiMengUnitFreightString(item.kmDistance,item.materialType);
|
|
let uString = materialCalcObj.getNeiMengUnitFreightString(item.kmDistance,item.materialType);
|
|
|
return `((${uString}x(1+${item.freightIncreaseRate}%)+${item.unitLoadingFee}x${item.loadingTimes})/1.09+${item.otherFee})x${material.grossWeightCoe_n}x${item.weightCoe}`;
|
|
return `((${uString}x(1+${item.freightIncreaseRate}%)+${item.unitLoadingFee}x${item.loadingTimes})/1.09+${item.otherFee})x${material.grossWeightCoe_n}x${item.weightCoe}`;
|
|
|
}
|
|
}
|
|
@@ -344,10 +344,10 @@ materialCalcObj = {
|
|
|
}else {
|
|
}else {
|
|
|
let freigth = me.freightDatas[args.row];
|
|
let freigth = me.freightDatas[args.row];
|
|
|
let dataCode = me.freightSetting.header[args.col].dataCode;
|
|
let dataCode = me.freightSetting.header[args.col].dataCode;
|
|
|
- if(dataCode == "calcType" || dataCode=="materialType"){
|
|
|
|
|
|
|
+ if(dataCode=="materialType"){
|
|
|
if(!freigth){
|
|
if(!freigth){
|
|
|
args.cancel = true;
|
|
args.cancel = true;
|
|
|
- }else if(dataCode == "materialType" && freigth.calcType !="内蒙古"){//不是内蒙古的情况下,下拉框不可编辑
|
|
|
|
|
|
|
+ }else if(freigth.conveyance !="汽车"){//只有在汽车的情况下,材料类型列才能编辑
|
|
|
args.cancel = true;
|
|
args.cancel = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -357,7 +357,7 @@ materialCalcObj = {
|
|
|
}
|
|
}
|
|
|
if(dataCode == "unitFreight"){
|
|
if(dataCode == "unitFreight"){
|
|
|
if(freigth.rations && freigth.rations.length > 0) args.cancel = true;
|
|
if(freigth.rations && freigth.rations.length > 0) args.cancel = true;
|
|
|
- if(freigth.calcType == "内蒙古") args.cancel = true;
|
|
|
|
|
|
|
+ if(gljUtil.isDef(freigth.materialType) && freigth.materialType != "") args.cancel = true;//当材料类型有值时,说明是内蒙古计算,运费是能过运距算出来的,不能编辑
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -424,6 +424,7 @@ materialCalcObj = {
|
|
|
freightIncreaseRate:'0',//运价增加率
|
|
freightIncreaseRate:'0',//运价增加率
|
|
|
weightCoe:'1',//加权系数
|
|
weightCoe:'1',//加权系数
|
|
|
connect_key:gljUtil.getIndex(material),
|
|
connect_key:gljUtil.getIndex(material),
|
|
|
|
|
+ materialType:"",
|
|
|
unit_price_file_id:material.unit_price.unit_price_file_id
|
|
unit_price_file_id:material.unit_price.unit_price_file_id
|
|
|
};
|
|
};
|
|
|
return newData;
|
|
return newData;
|
|
@@ -482,8 +483,6 @@ materialCalcObj = {
|
|
|
}else {
|
|
}else {
|
|
|
newData = me.getNewFreightData(material);
|
|
newData = me.getNewFreightData(material);
|
|
|
newData[dataCode] = value;
|
|
newData[dataCode] = value;
|
|
|
- newData.calcType = me.getDefualtCalcType();
|
|
|
|
|
- if(newData.calcType == "内蒙古") newData.materialType = "地方材料";
|
|
|
|
|
}
|
|
}
|
|
|
projectObj.project.projectGLJ.addFreightCalc([newData],material.id);
|
|
projectObj.project.projectGLJ.addFreightCalc([newData],material.id);
|
|
|
}else {//修改
|
|
}else {//修改
|
|
@@ -502,18 +501,20 @@ materialCalcObj = {
|
|
|
doc["loadingTimes"] = '0';
|
|
doc["loadingTimes"] = '0';
|
|
|
doc["freightIncreaseRate"] = '0';
|
|
doc["freightIncreaseRate"] = '0';
|
|
|
}
|
|
}
|
|
|
|
|
+ if(args.oldValue =="汽车") doc["materialType"] = "";//当运输方式从汽车切换成其它方式时,清空材料类型
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
- if(dataCode == "calcType"){
|
|
|
|
|
|
|
+ /* if(dataCode == "calcType"){
|
|
|
if(value == "全国") doc["materialType"] = "";
|
|
if(value == "全国") doc["materialType"] = "";
|
|
|
if(value == "内蒙古"){
|
|
if(value == "内蒙古"){
|
|
|
doc["materialType"] = "地方材料";
|
|
doc["materialType"] = "地方材料";
|
|
|
doc["unitFreight"] = me.calcNeiMengUnitFreight(recode.kmDistance,"地方材料");
|
|
doc["unitFreight"] = me.calcNeiMengUnitFreight(recode.kmDistance,"地方材料");
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- if(recode.calcType == "内蒙古"){
|
|
|
|
|
- if(dataCode == "materialType") doc["unitFreight"] = me.calcNeiMengUnitFreight(recode.kmDistance,value);
|
|
|
|
|
- if(dataCode == "kmDistance") doc["unitFreight"] = me.calcNeiMengUnitFreight(value,recode.materialType);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
|
|
+
|
|
|
|
|
+ if(dataCode == "materialType" && value!="") doc["unitFreight"] = me.calcNeiMengUnitFreight(recode.kmDistance,value);
|
|
|
|
|
+ if(dataCode == "kmDistance" && gljUtil.isDef(recode.materialType)&&recode.materialType!="") doc["unitFreight"] = me.calcNeiMengUnitFreight(value,recode.materialType);
|
|
|
|
|
+
|
|
|
if(dataCode == "start"){
|
|
if(dataCode == "start"){
|
|
|
let t_f = me.getSavedFreight(value,material);
|
|
let t_f = me.getSavedFreight(value,material);
|
|
|
if(t_f) doc = t_f;
|
|
if(t_f) doc = t_f;
|
|
@@ -755,7 +756,7 @@ materialCalcObj = {
|
|
|
name: "内蒙古计算",
|
|
name: "内蒙古计算",
|
|
|
icon: 'fa-sign-in',
|
|
icon: 'fa-sign-in',
|
|
|
visible:function () {
|
|
visible:function () {
|
|
|
- return id == "freightSheet";
|
|
|
|
|
|
|
+ return false;//2019-11-17 改成不需要右键插入功能 id == "freightSheet";
|
|
|
},
|
|
},
|
|
|
disabled: function (){
|
|
disabled: function (){
|
|
|
let material = me.getMaterialSelected();
|
|
let material = me.getMaterialSelected();
|