|
|
@@ -358,6 +358,7 @@ let locateObject={
|
|
|
}
|
|
|
setBgColour(datas,priceMap);
|
|
|
datas = _.sortByAll(datas,['code']);
|
|
|
+
|
|
|
return datas;
|
|
|
|
|
|
|
|
|
@@ -365,31 +366,26 @@ let locateObject={
|
|
|
let outStd = $("#outstanding").prop("checked");
|
|
|
let outInp = $("#outInp").val();
|
|
|
if(outStd == true && outInp && outInp!=""){
|
|
|
- for(let b of bills){
|
|
|
- if(b.code && b.code.length >= 9){
|
|
|
- let key = b.code.substr(0,9);
|
|
|
- if(map[key] && map[key].count > 1){
|
|
|
- let avg = map[key].total/map[key].count;
|
|
|
- let unitPrice = b.unitPrice?parseFloat(b.unitPrice):0;
|
|
|
- if(unitPrice ==0 ) continue;
|
|
|
- if(Math.abs(unitPrice - avg)/avg * 100 >= parseFloat(outInp)) b.bgColour = "#FFFACD"
|
|
|
- }
|
|
|
- }
|
|
|
+ let key = "smartcost";// 2020-06-02 养护与建筑不同,养护是把所有结果相加取平均
|
|
|
+ if(map[key] && map[key].count > 1){
|
|
|
+ let avg = map[key].total/map[key].count;
|
|
|
+ for(let b of bills){
|
|
|
+ let unitPrice = b.unitPrice?parseFloat(b.unitPrice):0;
|
|
|
+ if(unitPrice ==0 ) continue;
|
|
|
+ if(Math.abs(unitPrice - avg)/avg * 100 >= parseFloat(outInp)) b.bgColour = "#FFFACD"
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- function setPriceMap (bills,map) {
|
|
|
- if(bills.code && bills.code.length >= 9){
|
|
|
- let key = bills.code.substr(0,9);
|
|
|
- let unitPrice = bills.unitPrice?parseFloat(bills.unitPrice):0;
|
|
|
- if(map[key]){
|
|
|
- map[key].total += unitPrice;
|
|
|
- map[key].count ++;
|
|
|
- }else {
|
|
|
- map[key] = {total:unitPrice,count:1}
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+ function setPriceMap (bills,map) { // 2020-06-02 养护与建筑不同,养护是把所有结果相加取平均
|
|
|
+ let key = "smartcost";
|
|
|
+ let unitPrice = bills.unitPrice?parseFloat(bills.unitPrice):0;
|
|
|
+ if(map[key]){
|
|
|
+ map[key].total += unitPrice;
|
|
|
+ map[key].count ++;
|
|
|
+ }else {
|
|
|
+ map[key] = {total:unitPrice,count:1}
|
|
|
+ }
|
|
|
|
|
|
return map;
|
|
|
}
|