|
@@ -636,6 +636,50 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // 把价格数据全部乘上margin比例.
|
|
|
+ for(const key in priceList) {
|
|
|
+ if (Object.hasOwn(priceList, key)) {
|
|
|
+ for (const k in priceList[key]) {
|
|
|
+ if (Object.hasOwn(priceList[key], k)) {
|
|
|
+ priceList[key][k] = priceList[key][k].map(item => {
|
|
|
+ const temp = {...item}
|
|
|
+ for(let i = 1; i<=8; i++) {
|
|
|
+ if (temp[`website_qty${i}`] && !this.POA_Config.includes(temp[`website_qty${i}`])) {
|
|
|
+ temp[`website_qty${i}`] = this.multiplyWithMargin(parseFloat(temp[`website_qty${i}`]) || 0, margin).toString()
|
|
|
+ }
|
|
|
+ if (temp[`supplier_qty${i}`] && !this.POA_Config.includes(temp[`supplier_qty${i}`])) {
|
|
|
+ temp[`supplier_qty${i}`] = this.multiplyWithMargin(parseFloat(temp[`supplier_qty${i}`]) || 0, margin).toString()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ temp.website_setup = this.multiplyWithMargin(parseFloat(temp.website_setup) || 0, setupMargin).toString()
|
|
|
+ if (temp.supplier_setup) {
|
|
|
+ temp.supplier_setup = this.multiplyWithMargin(parseFloat(temp.supplier_setup) || 0, setupMargin).toString()
|
|
|
+ }
|
|
|
+
|
|
|
+ if (k === 'decoration') {
|
|
|
+ temp.decoration_addition = temp.decoration_addition.map(deco => {
|
|
|
+ const d = {...deco}
|
|
|
+ for(let i = 1; i<=8; i++) {
|
|
|
+ if (d[`website_qty${i}`] && !this.POA_Config.includes(d[`website_qty${i}`])) {
|
|
|
+ d[`website_qty${i}`] = this.multiplyWithMargin(parseFloat(d[`website_qty${i}`]) || 0, margin).toString()
|
|
|
+ }
|
|
|
+ if (d[`supplier_qty${i}`] && !this.POA_Config.includes(d[`supplier_qty${i}`])) {
|
|
|
+ d[`supplier_qty${i}`] = this.multiplyWithMargin(parseFloat(d[`supplier_qty${i}`]) || 0, margin).toString()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ d.website_setup = this.multiplyWithMargin(parseFloat(d.website_setup) || 0, setupMargin).toString()
|
|
|
+ if (d.supplier_setup) {
|
|
|
+ d.supplier_setup = this.multiplyWithMargin(parseFloat(d.supplier_setup) || 0, setupMargin).toString()
|
|
|
+ }
|
|
|
+ return d
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return temp
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
// 格式化数据,对象改成数组
|
|
|
for (const keys in priceList) {
|
|
|
const vals = {}
|
|
@@ -661,16 +705,6 @@ export default {
|
|
|
for (const k in remaining) {
|
|
|
const o = {}
|
|
|
o.name = k
|
|
|
- remaining[k] = remaining[k].map(item => {
|
|
|
- const temp = {...item}
|
|
|
- for(let i = 1; i<=8; i++) {
|
|
|
- if (item[`website_qty${i}`] && !this.POA_Config.includes(item[`website_qty${i}`])) {
|
|
|
- temp[`website_qty${i}`] = this.multiplyWithMargin(parseFloat(item[`website_qty${i}`]) || 0, margin).toString()
|
|
|
- }
|
|
|
- }
|
|
|
- temp.website_setup = this.multiplyWithMargin(parseFloat(item.website_setup) || 0, setupMargin).toString()
|
|
|
- return temp
|
|
|
- })
|
|
|
o.data = remaining[k]
|
|
|
o.attributeList = this.copyData(attributeList)
|
|
|
if (remaining[k]?.length>1) {
|