|
|
@@ -327,9 +327,15 @@ let gljUtil = {
|
|
|
let constCoe = scMathUtil.roundForObj(projectGLJDatas.constData.machineConstCoe,feeRate_decimal);
|
|
|
for (let ratio of glj.ratio_data) {
|
|
|
let rIndex = gljUtil.getIndex(ratio);
|
|
|
- let tem = _.find(projectGLJDatas.gljList, function (item) {
|
|
|
- return rIndex == gljUtil.getIndex(item);
|
|
|
- });
|
|
|
+ let tem = null;
|
|
|
+ if(projectGLJDatas.gljMap){
|
|
|
+ tem = projectGLJDatas.gljMap[rIndex]
|
|
|
+ }
|
|
|
+ if(!tem){
|
|
|
+ tem = _.find(projectGLJDatas.gljList, function (item) {
|
|
|
+ return rIndex == gljUtil.getIndex(item);
|
|
|
+ });
|
|
|
+ }
|
|
|
if (tem) {
|
|
|
let tem_marketPrice = this.getMarketPrice(tem, projectGLJDatas, calcOptions, labourCoeDatas, decimalObj, true, _, scMathUtil);
|
|
|
if (ext && ext[tem.id] && this.isDef(ext[tem.id].marketPrice)) { //在修改组成物的价格或消耗量时,影响了父工料机的价格,这时以父工料机的价格应当用组成物的新值来记算
|
|
|
@@ -399,13 +405,16 @@ let gljUtil = {
|
|
|
} else if (this.notEditType.indexOf(glj.unit_price.type) != -1 && glj.ratio_data.length > 0) { //对于混凝土、配合比、砂浆、机械台班,调整价根据组成物计算得出。
|
|
|
let p = 0;
|
|
|
for (let ratio of glj.ratio_data) {
|
|
|
- let tem = _.find(projectGLJDatas.gljList, {
|
|
|
- 'code': ratio.code,
|
|
|
- 'name': ratio.name,
|
|
|
- 'specs': ratio.specs,
|
|
|
- 'type': ratio.type,
|
|
|
- 'unit': ratio.unit
|
|
|
- })
|
|
|
+ let rIndex = gljUtil.getIndex(ratio);
|
|
|
+ let tem = null;
|
|
|
+ if(projectGLJDatas.gljMap){
|
|
|
+ tem = projectGLJDatas.gljMap[rIndex]
|
|
|
+ }
|
|
|
+ if(!tem){
|
|
|
+ tem = _.find(projectGLJDatas.gljList,function(item){
|
|
|
+ return rIndex == gljUtil.getIndex(item);
|
|
|
+ });
|
|
|
+ }
|
|
|
if (tem) {
|
|
|
let priceData = this.getGLJPrice(tem, projectGLJDatas, calcOptions, labourCoeDatas, decimalObj, true, _, scMathUtil);
|
|
|
let temP = scMathUtil.roundForObj(priceData.adjustPrice * scMathUtil.roundForObj(ratio.consumption, quantity_decimal), process_decimal);
|
|
|
@@ -438,13 +447,17 @@ let gljUtil = {
|
|
|
getIndex(obj, pops) {
|
|
|
let t_index = '';
|
|
|
let k_arr = [];
|
|
|
- if (!this.isDef(pops)) pops = this.gljKeyArray;
|
|
|
- for (let p of pops) {
|
|
|
- let tmpK = (obj[p] == undefined || obj[p] == null || obj[p] == '') ? 'null' : obj[p];
|
|
|
- k_arr.push(tmpK);
|
|
|
+ if(!pops) pops = this.gljKeyArray;
|
|
|
+ if(pops.length === 5){
|
|
|
+ return `${obj[pops[0]]}|-|${obj[pops[1]]}|-|${obj[pops[2]]}|-|${obj[pops[3]]}|-|${obj[pops[4]]}`
|
|
|
+ }else{
|
|
|
+ for (let p of pops) {
|
|
|
+ let tmpK = (obj[p] == undefined || obj[p] == null || obj[p] == '') ? 'null' : obj[p];
|
|
|
+ k_arr.push(tmpK);
|
|
|
+ }
|
|
|
+ t_index = k_arr.join("|-|");
|
|
|
+ return t_index;
|
|
|
}
|
|
|
- t_index = k_arr.join("|-|");
|
|
|
- return t_index;
|
|
|
},
|
|
|
|
|
|
getMainType: function (type) {
|