|
@@ -38,95 +38,100 @@ const ZeroNineType = {
|
|
Construction: '09-060', //土建分包费用(包括增值税)
|
|
Construction: '09-060', //土建分包费用(包括增值税)
|
|
};
|
|
};
|
|
|
|
|
|
-const preActConfig = [
|
|
|
|
|
|
+const actConfig = [
|
|
|
|
+ //实际支出
|
|
{
|
|
{
|
|
type: ZeroNineType.Equipment,
|
|
type: ZeroNineType.Equipment,
|
|
- originC: 6,
|
|
|
|
|
|
+ originC: 8,
|
|
originR: { begin: 6, end: 297 }, //总的减上面所有的
|
|
originR: { begin: 6, end: 297 }, //总的减上面所有的
|
|
- fill: { c: 5, r: 36 },
|
|
|
|
- num: 293,
|
|
|
|
|
|
+ fill: { c: 3, r: 36 },
|
|
|
|
+ num: 291,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: ZeroNineType.Production,
|
|
type: ZeroNineType.Production,
|
|
- originC: 6,
|
|
|
|
|
|
+ originC: 8,
|
|
originR: { begin: 17, end: 27 },
|
|
originR: { begin: 17, end: 27 },
|
|
//填充到psr表中的位置
|
|
//填充到psr表中的位置
|
|
- fill: { c: 5, r: 37 },
|
|
|
|
- num: 301,
|
|
|
|
|
|
+ fill: { c: 3, r: 37 },
|
|
|
|
+ num: 299,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: ZeroNineType.UF,
|
|
type: ZeroNineType.UF,
|
|
- originC: 6,
|
|
|
|
|
|
+ originC: 8,
|
|
originR: { begin: 6, end: 16 },
|
|
originR: { begin: 6, end: 16 },
|
|
- fill: { c: 5, r: 38 },
|
|
|
|
- num: 309,
|
|
|
|
|
|
+ fill: { c: 3, r: 38 },
|
|
|
|
+ num: 307,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: ZeroNineType.AI,
|
|
type: ZeroNineType.AI,
|
|
- originC: 6,
|
|
|
|
|
|
+ originC: 8,
|
|
originR: { begin: 172, end: 192 },
|
|
originR: { begin: 172, end: 192 },
|
|
- fill: { c: 5, r: 39 },
|
|
|
|
- num: 317,
|
|
|
|
|
|
+ fill: { c: 3, r: 39 },
|
|
|
|
+ num: 315,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: ZeroNineType.Install,
|
|
type: ZeroNineType.Install,
|
|
- originC: 6,
|
|
|
|
|
|
+ originC: 8,
|
|
originR: { begin: 214, end: 224 },
|
|
originR: { begin: 214, end: 224 },
|
|
- fill: { c: 5, r: 40 },
|
|
|
|
- num: 325,
|
|
|
|
|
|
+ fill: { c: 3, r: 40 },
|
|
|
|
+ num: 323,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: ZeroNineType.Construction,
|
|
type: ZeroNineType.Construction,
|
|
- originC: 6,
|
|
|
|
- originR: { begin: 214, end: 224 },
|
|
|
|
- fill: { c: 5, r: 41 },
|
|
|
|
- num: 333,
|
|
|
|
|
|
+ originC: 8,
|
|
|
|
+ originR: { begin: 225, end: 235 },
|
|
|
|
+ fill: { c: 3, r: 41 },
|
|
|
|
+ num: 331,
|
|
},
|
|
},
|
|
|
|
+];
|
|
|
|
+const preCeConfig = [
|
|
|
|
+ //预测列
|
|
{
|
|
{
|
|
type: ZeroNineType.Equipment,
|
|
type: ZeroNineType.Equipment,
|
|
- originC: 8,
|
|
|
|
|
|
+ originC: 6,
|
|
originR: { begin: 6, end: 297 }, //总的减上面所有的
|
|
originR: { begin: 6, end: 297 }, //总的减上面所有的
|
|
- fill: { c: 3, r: 36 },
|
|
|
|
- num: 291,
|
|
|
|
|
|
+ fill: { c: 5, r: 36 },
|
|
|
|
+ num: 293,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: ZeroNineType.Production,
|
|
type: ZeroNineType.Production,
|
|
- originC: 8,
|
|
|
|
|
|
+ originC: 6,
|
|
originR: { begin: 17, end: 27 },
|
|
originR: { begin: 17, end: 27 },
|
|
//填充到psr表中的位置
|
|
//填充到psr表中的位置
|
|
- fill: { c: 3, r: 37 },
|
|
|
|
- num: 299,
|
|
|
|
|
|
+ fill: { c: 5, r: 37 },
|
|
|
|
+ num: 301,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: ZeroNineType.UF,
|
|
type: ZeroNineType.UF,
|
|
- originC: 8,
|
|
|
|
|
|
+ originC: 6,
|
|
originR: { begin: 6, end: 16 },
|
|
originR: { begin: 6, end: 16 },
|
|
- fill: { c: 3, r: 38 },
|
|
|
|
- num: 307,
|
|
|
|
|
|
+ fill: { c: 5, r: 38 },
|
|
|
|
+ num: 309,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: ZeroNineType.AI,
|
|
type: ZeroNineType.AI,
|
|
- originC: 8,
|
|
|
|
|
|
+ originC: 6,
|
|
originR: { begin: 172, end: 192 },
|
|
originR: { begin: 172, end: 192 },
|
|
- fill: { c: 3, r: 39 },
|
|
|
|
- num: 315,
|
|
|
|
|
|
+ fill: { c: 5, r: 39 },
|
|
|
|
+ num: 317,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: ZeroNineType.Install,
|
|
type: ZeroNineType.Install,
|
|
- originC: 8,
|
|
|
|
|
|
+ originC: 6,
|
|
originR: { begin: 214, end: 224 },
|
|
originR: { begin: 214, end: 224 },
|
|
- fill: { c: 3, r: 40 },
|
|
|
|
- num: 323,
|
|
|
|
|
|
+ fill: { c: 5, r: 40 },
|
|
|
|
+ num: 325,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: ZeroNineType.Construction,
|
|
type: ZeroNineType.Construction,
|
|
- originC: 8,
|
|
|
|
- originR: { begin: 214, end: 224 },
|
|
|
|
- fill: { c: 3, r: 41 },
|
|
|
|
- num: 331,
|
|
|
|
|
|
+ originC: 6,
|
|
|
|
+ originR: { begin: 225, end: 235 },
|
|
|
|
+ fill: { c: 5, r: 41 },
|
|
|
|
+ num: 333,
|
|
},
|
|
},
|
|
];
|
|
];
|
|
const curMonthConfig = [
|
|
const curMonthConfig = [
|
|
|
|
+ //当月发生额
|
|
{
|
|
{
|
|
type: ZeroNineType.Equipment,
|
|
type: ZeroNineType.Equipment,
|
|
originC: null,
|
|
originC: null,
|
|
@@ -165,7 +170,7 @@ const curMonthConfig = [
|
|
{
|
|
{
|
|
type: ZeroNineType.Construction,
|
|
type: ZeroNineType.Construction,
|
|
originC: null,
|
|
originC: null,
|
|
- originR: { begin: 214, end: 224 },
|
|
|
|
|
|
+ originR: { begin: 225, end: 235 },
|
|
fill: { c: 7, r: 41 },
|
|
fill: { c: 7, r: 41 },
|
|
num: 335,
|
|
num: 335,
|
|
},
|
|
},
|
|
@@ -558,9 +563,7 @@ const PSRDetail = () => {
|
|
return { ...item, originC };
|
|
return { ...item, originC };
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- allData = getPsrDataByAct([...preActConfig, ...newMonthConfig]);
|
|
|
|
-
|
|
|
|
- console.log(allData);
|
|
|
|
|
|
+ allData = getPsrDataByAct(actConfig, preCeConfig, newMonthConfig);
|
|
}
|
|
}
|
|
|
|
|
|
const params = {
|
|
const params = {
|
|
@@ -585,32 +588,48 @@ const PSRDetail = () => {
|
|
return originC;
|
|
return originC;
|
|
};
|
|
};
|
|
|
|
|
|
- const getPsrDataByAct = (configList) => {
|
|
|
|
|
|
+ const getPsrDataByAct = (...list) => {
|
|
const luckyData = luckysheetRef.current?.toJson();
|
|
const luckyData = luckysheetRef.current?.toJson();
|
|
- let otherValueTotal = 0; //获取除设备费之外的所有费用的和
|
|
|
|
- const preValues = configList.map((item) => {
|
|
|
|
- const celldata = luckyData.data[0].celldata;
|
|
|
|
- const {
|
|
|
|
- type,
|
|
|
|
- originC,
|
|
|
|
- num,
|
|
|
|
- originR: { begin, end },
|
|
|
|
- } = item;
|
|
|
|
-
|
|
|
|
- let value = 0;
|
|
|
|
- for (let i = begin; i <= end; i++) {
|
|
|
|
- const item = celldata.find((item) => item.c == originC && item.r == i);
|
|
|
|
- if (item?.v?.v) value += item.v.v;
|
|
|
|
- }
|
|
|
|
- if (type !== ZeroNineType.Equipment) otherValueTotal += value;
|
|
|
|
- return { num, value };
|
|
|
|
|
|
+ const fun = (configList) => {
|
|
|
|
+ let otherValueTotal = 0; //获取除设备费之外的所有费用的和
|
|
|
|
+ const preValues = configList.map((item) => {
|
|
|
|
+ const celldata = luckyData.data[0].celldata;
|
|
|
|
+ const {
|
|
|
|
+ type,
|
|
|
|
+ originC,
|
|
|
|
+ num,
|
|
|
|
+ originR: { begin, end },
|
|
|
|
+ } = item;
|
|
|
|
+
|
|
|
|
+ let value = 0;
|
|
|
|
+ for (let i = begin; i <= end; i++) {
|
|
|
|
+ const item = celldata.find(
|
|
|
|
+ (item) => item.c == originC && item.r == i,
|
|
|
|
+ );
|
|
|
|
+ if (item?.v?.v) value += item.v.v;
|
|
|
|
+ }
|
|
|
|
+ if (type !== ZeroNineType.Equipment) otherValueTotal += value;
|
|
|
|
+ return { num, value };
|
|
|
|
+ });
|
|
|
|
+ //获取设备值
|
|
|
|
+ const EquPreItem = preValues.find((item) => {
|
|
|
|
+ const shebeiNum = configList.find(
|
|
|
|
+ (cur) => cur.type == ZeroNineType.Equipment,
|
|
|
|
+ )?.num;
|
|
|
|
+ return item.num == shebeiNum;
|
|
|
|
+ });
|
|
|
|
+ //全部的费用 减去 除设备费之外的所有费用的和 得到设备费
|
|
|
|
+ if (EquPreItem?.value)
|
|
|
|
+ EquPreItem.value = EquPreItem?.value - otherValueTotal;
|
|
|
|
+ return preValues;
|
|
|
|
+ };
|
|
|
|
+ let result = [];
|
|
|
|
+ list.forEach((item) => {
|
|
|
|
+ const list = fun(item);
|
|
|
|
+ result = [...result, ...list];
|
|
});
|
|
});
|
|
- const EquPreItem = preValues.find(
|
|
|
|
- (item) => item.type == ZeroNineType.Equipment,
|
|
|
|
- );
|
|
|
|
- if (EquPreItem?.value)
|
|
|
|
- EquPreItem.value = EquPreItem?.value - otherValueTotal; //全部的费用 减去 除设备费之外的所有费用的和 得到设备费
|
|
|
|
- console.log('------预算列的值---------', preValues);
|
|
|
|
|
|
+
|
|
|
|
+ console.log('------预算列的值---------', result);
|
|
return preValues;
|
|
return preValues;
|
|
};
|
|
};
|
|
|
|
|