|
|
@@ -811,12 +811,20 @@ ProjectGLJ.prototype.changeAssistProductionFeeRate = async function (newFeeRate)
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ProjectGLJ.prototype.loadFreightAndOriginalData = function(originalList,freightList){
|
|
|
+ if(freightList) this.datas.freightList = freightList;
|
|
|
+ if(originalList) this.datas.originalList = originalList;
|
|
|
+};
|
|
|
+
|
|
|
ProjectGLJ.prototype.updateMaterialRation = async function (datas){
|
|
|
try {
|
|
|
let lists = datas.type == "freight"?this.datas.freightList:this.datas.originalList;
|
|
|
$.bootstrapLoading.start();
|
|
|
let result = await ajaxPost('/ration/updateMaterialRation',datas);
|
|
|
- if(datas.actionType=="add" && result.projectGLJList) this.loadNewProjectGLJToCaches(result.projectGLJList,true);//这一步已经更新了运费和原价数据
|
|
|
+ if(datas.actionType=="add" && result.projectGLJList){
|
|
|
+ this.loadNewProjectGLJToCaches(result.projectGLJList,true);
|
|
|
+ this.loadFreightAndOriginalData(result.originalList,result.freightList); //这一步已经更新了运费和原价数据
|
|
|
+ }
|
|
|
if(datas.actionType == "delete"){
|
|
|
let parent = _.find(lists,{ID:datas.parentID}) ;
|
|
|
if(parent){
|
|
|
@@ -830,6 +838,7 @@ ProjectGLJ.prototype.updateMaterialRation = async function (datas){
|
|
|
if(ration){
|
|
|
if(datas.field == "code" && result.projectGLJList){
|
|
|
this.loadNewProjectGLJToCaches(result.projectGLJList,true);
|
|
|
+ this.loadFreightAndOriginalData(result.originalList,result.freightList);
|
|
|
}else {
|
|
|
ration[datas.field] = datas.value;
|
|
|
if(datas.ext){
|