|
|
@@ -56,7 +56,7 @@ materialCalcObj = {
|
|
|
},
|
|
|
getText:{
|
|
|
forExp:function (item) {
|
|
|
- return item.exp&&item.exp!=""?item.exp:materialCalcObj.getFreightEXP(item);
|
|
|
+ return gljUtil.isDef(item.exp)?item.exp:materialCalcObj.getFreightEXP(item);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -568,9 +568,10 @@ materialCalcObj = {
|
|
|
if (parseInt(row) >= me.freightDatas.length) {//新增
|
|
|
let tempFreight = null;
|
|
|
if (dataCode == "start") {
|
|
|
- tempFreight = me.getSavedFreight(value, material);
|
|
|
+ tempFreight = me.getSavedFreight(value, material);
|
|
|
}
|
|
|
if (tempFreight) {
|
|
|
+ if (tempFreight.conveyance == "自办运输") tempFreight.exp = "";
|
|
|
newData = tempFreight;
|
|
|
} else {
|
|
|
if(_.isEmpty(newData)) newData = me.getNewFreightData(material);
|
|
|
@@ -817,7 +818,7 @@ materialCalcObj = {
|
|
|
for(let key in record){
|
|
|
if(key == "_id") continue;
|
|
|
f[key] = record[key];
|
|
|
- if(key =="ration" || key == "ration_gljs")f[key] = [];//下面的定额和工料机不用保存
|
|
|
+ if(key =="rations" || key == "ration_gljs")f[key] = [];//下面的定额和工料机不用保存
|
|
|
}
|
|
|
user_freight.freight = f;
|
|
|
projectObj.project.projectGLJ.updateUserFreight({freights:[user_freight],action:"add"});
|
|
|
@@ -825,22 +826,26 @@ materialCalcObj = {
|
|
|
},
|
|
|
|
|
|
updateUserFreight:function (record,userFreight) {
|
|
|
- let t = {};
|
|
|
- for(let t_key in userFreight){
|
|
|
- if(t_key == "ID") continue;
|
|
|
- t[t_key] = userFreight[t_key];
|
|
|
+ let t = {};
|
|
|
+ for (let t_key in userFreight) {
|
|
|
+ if (t_key == "ID") continue;
|
|
|
+ t[t_key] = userFreight[t_key];
|
|
|
}
|
|
|
|
|
|
t.rootProjectID = projectObj.project.projectInfo.property.rootProjectID;
|
|
|
let f = {};
|
|
|
- for(let key in record){
|
|
|
- if(key == "_id") continue;
|
|
|
- f[key] = record[key];
|
|
|
- if(key =="ration" || key == "ration_gljs")f[key] = [];//下面的定额和工料机不用保存
|
|
|
+ for (let key in record) {
|
|
|
+ if (key == "_id") continue;
|
|
|
+ f[key] = record[key];
|
|
|
+ if (key == "rations" || key == "ration_gljs") f[key] = []; //下面的定额和工料机不用保存
|
|
|
}
|
|
|
+ if (record.conveyance == "自办运输") f.exp = '';
|
|
|
t.freight = f;
|
|
|
- projectObj.project.projectGLJ.updateUserFreight({ID:userFreight.ID,doc:t,action:"update"});
|
|
|
-
|
|
|
+ projectObj.project.projectGLJ.updateUserFreight({
|
|
|
+ ID: userFreight.ID,
|
|
|
+ doc: t,
|
|
|
+ action: "update"
|
|
|
+ });
|
|
|
},
|
|
|
|
|
|
|