备货单 采购单
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ref, reactive, watch, onMounted } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { componentSizeMap, ElMessage } from 'element-plus'
|
||||
import { CrmService } from '@/api/crmApi'
|
||||
import { commonService } from '@/api/commonApi'
|
||||
import { vehicleService } from '@/api/vehicleApi'
|
||||
@@ -62,9 +62,19 @@ export interface ItemRow {
|
||||
handling_fee: string
|
||||
fob_transport_fee: number | undefined
|
||||
port_misc_fee: string
|
||||
remark: string
|
||||
ocean_freight: string
|
||||
ocean_freight_currency: string
|
||||
ocean_freight_currency_snapshot: string
|
||||
commission: string
|
||||
commission_currency: string
|
||||
commission_currency_snapshot: string
|
||||
purchase_tax: string
|
||||
purchase_tax_currency: string
|
||||
purchase_tax_currency_snapshot: string
|
||||
tax_refund: string
|
||||
tax_refund_currency: string
|
||||
tax_refund_currency_snapshot: string
|
||||
retrofit_fee: string
|
||||
total_price: number | undefined
|
||||
official_price: number | undefined
|
||||
@@ -195,9 +205,19 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
||||
handling_fee: '',
|
||||
fob_transport_fee: undefined,
|
||||
port_misc_fee: '',
|
||||
remark: '',
|
||||
ocean_freight: '',
|
||||
ocean_freight_currency: 'CNY',
|
||||
ocean_freight_currency_snapshot: '人民币',
|
||||
commission: '',
|
||||
commission_currency: 'CNY',
|
||||
commission_currency_snapshot: '人民币',
|
||||
purchase_tax: '',
|
||||
purchase_tax_currency: 'CNY',
|
||||
purchase_tax_currency_snapshot: '人民币',
|
||||
tax_refund: '',
|
||||
tax_refund_currency: 'CNY',
|
||||
tax_refund_currency_snapshot: '人民币',
|
||||
retrofit_fee: '',
|
||||
total_price: undefined,
|
||||
official_price: undefined,
|
||||
@@ -434,6 +454,21 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
||||
(it as any).ocean_freight_currency,
|
||||
targetCurrency
|
||||
)
|
||||
const commission = convertCurrency(
|
||||
it.commission ?? (it as any).commission,
|
||||
(it as any).commission_currency,
|
||||
targetCurrency
|
||||
)
|
||||
const purchaseTax = convertCurrency(
|
||||
it.purchase_tax ?? (it as any).purchase_tax,
|
||||
(it as any).purchase_tax_currency,
|
||||
targetCurrency
|
||||
)
|
||||
const taxRefund = convertCurrency(
|
||||
it.tax_refund ?? (it as any).tax_refund,
|
||||
(it as any).tax_refund_currency,
|
||||
targetCurrency
|
||||
)
|
||||
const mileageVal = Number(it.mileage ?? 0)
|
||||
if (mileageVal > 0) {
|
||||
// 二手车:用挂牌价与二手减价替代官方指导价与优惠
|
||||
@@ -447,7 +482,19 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
||||
(it as any).reduction_price_currency,
|
||||
targetCurrency
|
||||
)
|
||||
return unit - (retrofit + fob + listing + reduction + handling + port + ocean)
|
||||
return (
|
||||
unit -
|
||||
(retrofit +
|
||||
fob +
|
||||
listing +
|
||||
reduction +
|
||||
handling +
|
||||
port +
|
||||
ocean +
|
||||
commission +
|
||||
purchaseTax) +
|
||||
taxRefund
|
||||
)
|
||||
}
|
||||
|
||||
// 新车/里程<=0:保持原有计算(官方指导价与优惠)
|
||||
@@ -461,7 +508,11 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
||||
(it as any).discount_currency,
|
||||
targetCurrency
|
||||
)
|
||||
return unit - (retrofit + fob + guide + discount + handling + port + ocean)
|
||||
return (
|
||||
unit -
|
||||
(retrofit + fob + guide + discount + handling + port + ocean + commission + purchaseTax) +
|
||||
taxRefund
|
||||
)
|
||||
}
|
||||
|
||||
// 合同文件相关方法
|
||||
@@ -678,9 +729,19 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
||||
handling_fee: it.handling_fee?.amount ?? '',
|
||||
fob_transport_fee: it.fob_transport_fee?.amount ? Number(it.fob_transport_fee.amount) : undefined,
|
||||
port_misc_fee: it.port_misc_fee?.amount ?? '',
|
||||
remark: it.remark || '',
|
||||
ocean_freight: it.ocean_freight?.amount ?? '',
|
||||
ocean_freight_currency: it.ocean_freight?.currency || 'CNY',
|
||||
ocean_freight_currency_snapshot: '',
|
||||
commission: it.commission?.amount ?? '',
|
||||
commission_currency: it.commission?.currency || 'CNY',
|
||||
commission_currency_snapshot: '',
|
||||
purchase_tax: it.purchase_tax?.amount ?? '',
|
||||
purchase_tax_currency: it.purchase_tax?.currency || 'CNY',
|
||||
purchase_tax_currency_snapshot: '',
|
||||
tax_refund: it.tax_refund?.amount ?? '',
|
||||
tax_refund_currency: it.tax_refund?.currency || 'CNY',
|
||||
tax_refund_currency_snapshot: '',
|
||||
retrofit_fee: it.retrofit_fee?.amount ?? '',
|
||||
total_price: it.total_price?.amount ? Number(it.total_price.amount) : undefined,
|
||||
official_price: it.official_price?.amount ? Number(it.official_price.amount) : undefined,
|
||||
@@ -759,6 +820,7 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
||||
color_interior_snapshot: it.color_interior_snapshot,
|
||||
color_exterior_code: it.color_exterior_code,
|
||||
color_exterior_snapshot: it.color_exterior_snapshot,
|
||||
remark: it.remark,
|
||||
unit_price: wrapMoney(it.unit_price, (it as any).unit_price_currency, '单价'),
|
||||
handling_fee: wrapMoney(it.handling_fee, (it as any).helper_fee_currency, '手续费'),
|
||||
fob_transport_fee: wrapMoney(
|
||||
@@ -772,6 +834,9 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
||||
'港杂费'
|
||||
),
|
||||
ocean_freight: wrapMoney(it.ocean_freight, (it as any).ocean_freight_currency, '海运费'),
|
||||
commission: wrapMoney(it.commission, (it as any).commission_currency, '佣金'),
|
||||
purchase_tax: wrapMoney(it.purchase_tax, (it as any).purchase_tax_currency, '购置税'),
|
||||
tax_refund: wrapMoney(it.tax_refund, (it as any).tax_refund_currency, '退税'),
|
||||
retrofit_fee: wrapMoney((it as any).retrofit_fee, (it as any).modify_fee_currency, '改装费'),
|
||||
modify_list: it.modify_list,
|
||||
// total_price: wrapMoney(it.total_price, (it as any).total_price_currency, '总价'),
|
||||
|
||||
Reference in New Issue
Block a user