|
@@ -12,8 +12,10 @@ $(document).ready(function() {
|
|
|
|
|
|
// 切换tab触发refresh
|
|
|
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
|
|
+ if($(e.target).data('name')==undefined){
|
|
|
+ return;
|
|
|
+ }
|
|
|
currentTag = $(e.target).data('name');
|
|
|
-
|
|
|
// 获取工料机当前选中的行号
|
|
|
let projectGLJId = 0;
|
|
|
if (currentTag === "mix-ratio") {
|
|
@@ -68,6 +70,7 @@ function compositionSuccess(info) {
|
|
|
let parentData = jsonData[row];
|
|
|
let ratioData = _.find(parentData.ratio_data,{"id":info.id});
|
|
|
let con_key = gljOprObj.getIndex(ratioData,gljKeyArray);
|
|
|
+ let updateNodes=[];
|
|
|
for(let i=0;i< jsonData.length;i++){
|
|
|
let tem_key = gljOprObj.getIndex(jsonData[i],gljKeyArray);
|
|
|
if(con_key == tem_key){
|
|
@@ -76,11 +79,45 @@ function compositionSuccess(info) {
|
|
|
projectGLJSheet.setCellByField('quantity', info.change, true,i);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ //更新ratio 数据
|
|
|
+ ratioData[info.field]=info.newValue;
|
|
|
+ //更新组成物map里的数据
|
|
|
+ let p_key = gljOprObj.getIndex(parentData,gljKeyArray);
|
|
|
+ let m_list = projectObj.project.projectGLJ.datas.mixRatioMap[p_key];
|
|
|
+ let m_ratioData = _.find(m_list,{"id":info.id});
|
|
|
+ if(m_ratioData){
|
|
|
+ m_ratioData[info.field]=info.newValue;
|
|
|
+ }
|
|
|
// 设置父级3个价格
|
|
|
+ parentData.unit_price.market_price = info.parentMarketPrice;
|
|
|
+ parentData.unit_price.base_price = info.parentBasePrice;
|
|
|
+ //更新表格
|
|
|
projectGLJSheet.setCellByField('unit_price.market_price', info.parentMarketPrice, false);
|
|
|
- projectGLJSheet.setCellByField('unit_price.base_price', info.parentBasePrice, false);
|
|
|
+ projectGLJSheet.setCellByField('base_price', info.parentBasePrice, false);
|
|
|
projectGLJSheet.setCellByField('adjust_price', info.parentMarketPrice, false);
|
|
|
// 更新组成物缓存
|
|
|
projectObj.project.composition.loadData();
|
|
|
+ //选查找使用了父项目工料机的定额工料机
|
|
|
+ let ration_gljs = _.filter(projectObj.project.ration_glj.datas,{'projectGLJID':parentData.id});
|
|
|
+ let nodes = projectObj.project.mainTree.nodes;
|
|
|
+ let prefix = projectObj.project.mainTree.prefix;
|
|
|
+ for(let rg of ration_gljs){
|
|
|
+ let node = nodes[prefix+rg.rationID];
|
|
|
+ if(node){
|
|
|
+ updateNodes.push(node);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //或者是使用了父项目工料机的工料机类型的定额
|
|
|
+ let rations = _.filter(projectObj.project.Ration.datas,{'type':3,'projectGLJID':parentData.id});
|
|
|
+ for(let r of rations){
|
|
|
+ let r_node = nodes[prefix+r.ID];
|
|
|
+ if(r_node){
|
|
|
+ r_node.data.marketUnitFee=info.parentMarketPrice;
|
|
|
+ updateNodes.push(r_node);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(updateNodes.length>0){
|
|
|
+ projectObj.project.calcProgram.calcRationsAndSave(updateNodes);
|
|
|
+ }
|
|
|
+ gljOprObj.refreshView();
|
|
|
}
|