Forráskód Böngészése

Merge branch 'dev'

xinyan 5 hónapja
szülő
commit
7690f9403b

+ 8 - 8
src/views/price-approval/Columns.ts

@@ -104,8 +104,8 @@ export const SupplyCheckColumns_Special = [
 	{ field: 'first_cost', title: '头程运费', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'first_cost' },},
 	{ field: 'final_cost', title: '尾程费用', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'final_cost' },},
 
-	{ field: 'VAT_price_daily', title: '日常VAT', width: 'auto', align: 'center', showOverflow: true,slots:{ default: 'VAT_price_daily' },},
-	{ field: 'VAT_price_min', title: '最低VAT', width: 'auto', align: 'center', showOverflow: true,slots:{ default: 'VAT_price_min' },},
+	// { field: 'VAT_price_daily', title: '日常VAT', width: 'auto', align: 'center', showOverflow: true,slots:{ default: 'VAT_price_daily' },},
+	// { field: 'VAT_price_min', title: '最低VAT', width: 'auto', align: 'center', showOverflow: true,slots:{ default: 'VAT_price_min' },},
 	{ field: 'forwarding_fee', title: '转发费', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'forwarding_fee' },},
 	// { field: '', title: '运费(小计)', width: 'auto', align: 'center', showOverflow: true,},
 	{ field: 'ad_budget', title: '广告费', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'ad_budget' },},
@@ -117,18 +117,18 @@ export const SupplyCheckColumns_Special = [
 	{ field: 'sales_mode', title: '销售模式', width: 'auto', align: 'center', showOverflow: true,slots: { default:'sales_mode' }},
 	{ field: 'price_min_cost', title: '最低售价成本', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'price_min_cost' },},
 
-	// { field: '', title: '亚马逊最低售价', width: 'auto', align: 'center', showOverflow: true,},
+	{ field: 'price_amz_min', title: '最低售价(外币)', width: 'auto', align: 'center', showOverflow: true,},
 	{ field: 'price_supply', title: '供货价', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'price_supply' },},
 	// { field: '', title: '卖场参考价格', width: 'auto', align: 'center', showOverflow: true,},
 	// { field: '', title: '卖场价格(不含VAT)', width: 'auto', align: 'center', showOverflow: true,},
 	// { field: '', title: '卖场价格(含VAT)', width: 'auto', align: 'center', showOverflow: true,},
-	{ field: 'gross_profit_margin', title: '毛利率', width: 'auto', align: 'center', showOverflow: true,slots:{default:'gross_profit_margin'},},
+	// { field: 'gross_profit_margin', title: '毛利率', width: 'auto', align: 'center', showOverflow: true,slots:{default:'gross_profit_margin'},},
 	{ field: 'exchange_rate', title: '汇率', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'exchange_rate' },},
-	{ field: 'price_daily_rmb', title: '日常活动售价(人民币)', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'price_daily_rmb' },},
+	// { field: 'price_daily_rmb', title: '日常活动售价(人民币)', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'price_daily_rmb' },},
 
-	{ field: 'average_gross_profit', title: '平均毛利', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'average_gross_profit' },},
-	{ field: 'routine_activity_profit', title: '日常活动销售利润', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'routine_activity_profit' } },
-	{ field: 'gross_margin_daily', title: '日常活动毛利率', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'gross_margin_daily' },},
+	// { field: 'average_gross_profit', title: '平均毛利', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'average_gross_profit' },},
+	// { field: 'routine_activity_profit', title: '日常活动销售利润', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'routine_activity_profit' } },
+	{ field: 'profit_margin', title: '利润率', width: 'auto', align: 'center', showOverflow: true,slots: { default: 'profit_margin' },},
 	{ field: 'operate', fixed: 'right', title: '操 作', align: 'center', width: 90, slots: { default: 'operate' } }
 ]
 

+ 6 - 21
src/views/price-approval/approval-review-supply/components/DataTableSlot.vue

@@ -25,18 +25,9 @@ const color = country ? country.color : '#3875F6';
 const currency = countryInfoStore.CurrencyCodes.find((c) => c.code == row.currency_code);
 const currencyColor = currency ? currency.color : '#626AEF';
 
-// 日常活动销售利润 = 日常活动售价(人民币)-出口报关价-头程运费-尾程费用-转发费-广告费-退货成本-VAT-仓储费-佣金
-const routine_activity_profit = computed(
-	() =>
-		row.price_daily_rmb -
-		(row.export_tax + row.first_cost + row.final_cost +row.forwarding_fee+ row.ad_budget + row.return_or_refurbishment + row.storage_charges + row.brokerage)
-);
-
-// 日常活动毛利率 = 日常活动销售利润/日常活动售价(人民币)
-const gross_margin_daily = computed(() => routine_activity_profit.value / row.price_daily_rmb);
-
-// 平均毛利 = 0.8*日常活动毛利率 + 0.2*毛利率
-const average_gross_profit = computed(() => 0.8*gross_margin_daily.value +0.2*row.gross_profit_margin);
+const profit_margin = computed(() => {
+	return (row.price_supply - row.price_min_cost)/row.price_min_cost*100;
+})
 
 function handleEdit() {
 	emit('edit-row', row);
@@ -75,15 +66,6 @@ function onConfirm() {
 				</div>
 			</div>
 		</div>
-		<div v-else-if="field === 'average_gross_profit'">
-			{{ average_gross_profit || '-'}}
-		</div>
-		<div v-else-if="field === 'routine_activity_profit'">
-			{{ routine_activity_profit || '-'}}
-		</div>
-		<div v-else-if="field === 'gross_margin_daily'">
-			{{ gross_margin_daily || '-'}}
-		</div>
 		<div v-else-if="field === 'country_code'">
 			<el-tag :disable-transitions="true" :style="{ color: color, borderColor: color }" effect="plain" round>
 				{{ country ? country.name : '-' }}
@@ -94,6 +76,9 @@ function onConfirm() {
 				{{ currency ? currency.code : '-' }}
 			</el-tag>
 		</div>
+		<div v-else-if="field === 'profit_margin'">
+			{{ profit_margin? profit_margin.toFixed(2)+'%' : '-' }}
+		</div>
 		<div v-else>
 			{{ row[field] || '-' }}
 		</div>

+ 15 - 15
src/views/price-approval/direct-sales/component/DataTableSlot.vue

@@ -26,25 +26,25 @@ const currency = countryInfoStore.CurrencyCodes.find((c) => c.code == row.curren
 const currencyColor = currency ? currency.color : '#626AEF';
 
 // 日常活动销售利润 = 日常活动售价(人民币)-出口报关价-头程运费-尾程费用-转发费-广告费-退货成本-VAT-仓储费-佣金
-const routine_activity_profit = computed(
-	() =>
-		row.price_daily_rmb -
-		(row.export_tax +
-			row.first_cost +
-			row.final_cost +
-			row.forwarding_fee +
-			row.ad_budget +
-			row.return_or_refurbishment +
-			row.storage_charges +
-			row.brokerage)
-);
+const totalCosts =
+	parseFloat(row.export_tax) +
+	parseFloat(row.first_cost) +
+	parseFloat(row.final_cost) +
+	parseFloat(row.forwarding_fee) +
+	parseFloat(row.ad_budget) +
+	parseFloat(row.return_or_refurbishment) +
+	parseFloat(row.storage_charges) +
+	parseFloat(row.brokerage);
+const routine_activity_profit = computed(() => row.price_daily_rmb - totalCosts);
 
 // 日常活动毛利率 = 日常活动销售利润/日常活动售价(人民币)
 const gross_margin_daily = computed(() => routine_activity_profit.value / row.price_daily_rmb);
+// console.log("=>(DataTableSlot.vue:44) gross_margin_daily", gross_margin_daily.value);
 
 // 平均毛利 = 0.8*日常活动毛利率 + 0.2*毛利率
 const average_gross_profit = computed(() => 0.8 * gross_margin_daily.value + 0.2 * row.gross_profit_margin);
 
+
 function handleEdit() {
 	emit('edit-row', row);
 }
@@ -83,13 +83,13 @@ function onConfirm() {
 			</div>
 		</div>
 		<div v-else-if="field === 'average_gross_profit'">
-			{{ average_gross_profit && average_gross_profit !== -Infinity ? average_gross_profit : '-' }}
+			{{ average_gross_profit && average_gross_profit !== -Infinity ? average_gross_profit.toFixed(2) : '-' }}
 		</div>
 		<div v-else-if="field === 'routine_activity_profit'">
-			{{ routine_activity_profit && routine_activity_profit !== -Infinity ? routine_activity_profit : '-' }}
+			{{ routine_activity_profit && routine_activity_profit !== -Infinity ? routine_activity_profit .toFixed(2): '-' }}
 		</div>
 		<div v-else-if="field === 'gross_margin_daily'">
-			{{ gross_margin_daily && gross_margin_daily !== -Infinity ? gross_margin_daily : '-' }}
+			{{ gross_margin_daily && gross_margin_daily !== -Infinity ? gross_margin_daily.toFixed(2) : '-' }}
 		</div>
 		<div v-else-if="field === 'country_code'">
 			<el-tag :disable-transitions="true" :style="{ color: color, borderColor: color }" effect="plain" round>