|
@@ -2725,6 +2725,47 @@ export const useHooks = (t?: any) => {
|
|
|
state.cmpFormulasOri = res.formulas_origin ?? [];
|
|
|
state.cmpFormulasBednet = res.formulas_bednet ?? [];
|
|
|
state.cmpDiffer = res.differ;
|
|
|
+
|
|
|
+ // 更新床网tab大小单单价显示
|
|
|
+ if (state.cmpDiffer.length > 0) {
|
|
|
+ let costArr = [];
|
|
|
+ state.cmpDiffer.forEach(o => {
|
|
|
+ let bednetMatch = o.replace.filter(itm => itm.label.indexOf("床网车间成本") > -1 && itm.label.indexOf("总") == -1);
|
|
|
+ if (!costArr.length) {
|
|
|
+ // 先加入空对象
|
|
|
+ bednetMatch.forEach(itm => {
|
|
|
+ costArr.push({
|
|
|
+ dannum2_cost: 0, // 标准
|
|
|
+ dannum1_cost: 0, // 散单
|
|
|
+ dannum3_cost: 0, // 大单
|
|
|
+ dannum4_cost: 0 // 小单
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 取文本出现的数字
|
|
|
+ let reg = /\d+/g;
|
|
|
+
|
|
|
+ if (bednetMatch.length) {
|
|
|
+ bednetMatch.forEach(itm => {
|
|
|
+ let matchIdx = itm.label.match(reg);
|
|
|
+ if (matchIdx && matchIdx.length) {
|
|
|
+ let idx = Number(matchIdx[0]);
|
|
|
+ costArr[idx - 1][`dannum${o.type}_cost`] = itm.value;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ state.bednetMxData = state.bednetMxData.map((o, idx) => {
|
|
|
+ o.dannum2_cost = costArr[idx]?.dannum2_cost;
|
|
|
+ o.dannum1_cost = costArr[idx]?.dannum1_cost;
|
|
|
+ o.dannum3_cost = costArr[idx]?.dannum3_cost;
|
|
|
+ o.dannum4_cost = costArr[idx]?.dannum4_cost;
|
|
|
+ return o;
|
|
|
+ });
|
|
|
+
|
|
|
+ console.log("床网报价cost :>> ", costArr, state.bednetMxData);
|
|
|
+ }
|
|
|
} else {
|
|
|
setTimeout(() => {
|
|
|
if (res.message) {
|
|
@@ -3752,6 +3793,9 @@ export const useHooks = (t?: any) => {
|
|
|
return userInfo.usermode != 0;
|
|
|
},
|
|
|
render: (scope: any) => {
|
|
|
+ if (scope.row.hasOwnProperty("dannum2_cost")) {
|
|
|
+ return formatCutNumber({ val: scope.row.dannum2_cost });
|
|
|
+ }
|
|
|
return formatCutNumber({ val: floatMul(scope.row.costamt, 1 + scope.row.dannum2_rate) });
|
|
|
}
|
|
|
},
|
|
@@ -3763,6 +3807,9 @@ export const useHooks = (t?: any) => {
|
|
|
return userInfo.usermode != 0;
|
|
|
},
|
|
|
render: (scope: any) => {
|
|
|
+ if (scope.row.hasOwnProperty("dannum1_cost")) {
|
|
|
+ return formatCutNumber({ val: scope.row.dannum1_cost });
|
|
|
+ }
|
|
|
return formatCutNumber({ val: floatMul(scope.row.costamt, 1 + scope.row.dannum1_rate) });
|
|
|
}
|
|
|
},
|
|
@@ -3774,6 +3821,9 @@ export const useHooks = (t?: any) => {
|
|
|
return userInfo.usermode != 0;
|
|
|
},
|
|
|
render: (scope: any) => {
|
|
|
+ if (scope.row.hasOwnProperty("dannum3_cost")) {
|
|
|
+ return formatCutNumber({ val: scope.row.dannum3_cost });
|
|
|
+ }
|
|
|
return formatCutNumber({ val: floatMul(scope.row.costamt, 1 + scope.row.dannum3_rate) });
|
|
|
}
|
|
|
},
|
|
@@ -3785,6 +3835,9 @@ export const useHooks = (t?: any) => {
|
|
|
return userInfo.usermode != 0;
|
|
|
},
|
|
|
render: (scope: any) => {
|
|
|
+ if (scope.row.hasOwnProperty("dannum4_cost")) {
|
|
|
+ return formatCutNumber({ val: scope.row.dannum4_cost });
|
|
|
+ }
|
|
|
return formatCutNumber({ val: floatMul(scope.row.costamt, 1 + scope.row.dannum4_rate) });
|
|
|
}
|
|
|
},
|