利润 退税 计算保留两位小数
This commit is contained in:
@@ -541,12 +541,21 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
|||||||
(it as any).reduction_price_currency,
|
(it as any).reduction_price_currency,
|
||||||
targetCurrency
|
targetCurrency
|
||||||
)
|
)
|
||||||
return (
|
const profit =
|
||||||
unit -
|
unit -
|
||||||
(retrofit + fob + listing + handling + port + ocean + commission + purchaseTax + retention + accessory) +
|
(retrofit +
|
||||||
|
fob +
|
||||||
|
listing +
|
||||||
|
handling +
|
||||||
|
port +
|
||||||
|
ocean +
|
||||||
|
commission +
|
||||||
|
purchaseTax +
|
||||||
|
retention +
|
||||||
|
accessory) +
|
||||||
taxRefund +
|
taxRefund +
|
||||||
reduction
|
reduction
|
||||||
)
|
return Number(profit.toFixed(2))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新车/里程<=0:保持原有计算(官方指导价与优惠)
|
// 新车/里程<=0:保持原有计算(官方指导价与优惠)
|
||||||
@@ -560,12 +569,21 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
|||||||
(it as any).discount_currency,
|
(it as any).discount_currency,
|
||||||
targetCurrency
|
targetCurrency
|
||||||
)
|
)
|
||||||
return (
|
const profit =
|
||||||
unit -
|
unit -
|
||||||
(retrofit + fob + guide + handling + port + ocean + commission + purchaseTax + retention + accessory) +
|
(retrofit +
|
||||||
|
fob +
|
||||||
|
guide +
|
||||||
|
handling +
|
||||||
|
port +
|
||||||
|
ocean +
|
||||||
|
commission +
|
||||||
|
purchaseTax +
|
||||||
|
retention +
|
||||||
|
accessory) +
|
||||||
taxRefund +
|
taxRefund +
|
||||||
discount
|
discount
|
||||||
)
|
return Number(profit.toFixed(2))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算报关价 = 收款价 - 挂账
|
// 计算报关价 = 收款价 - 挂账
|
||||||
@@ -597,7 +615,7 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
|||||||
)
|
)
|
||||||
const base = official - discount
|
const base = official - discount
|
||||||
const refund = base * 0.115
|
const refund = base * 0.115
|
||||||
return refund < 0 ? 0 : refund
|
return refund < 0 ? 0 : Number(refund.toFixed(2))
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算车价:车价 = 报关价 - FOB运费 - 港杂费 - 海运费
|
// 计算车价:车价 = 报关价 - FOB运费 - 港杂费 - 海运费
|
||||||
@@ -857,7 +875,9 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
|||||||
// 合同字段兼容字符串或数组
|
// 合同字段兼容字符串或数组
|
||||||
baseForm.contract = Array.isArray(res.contract)
|
baseForm.contract = Array.isArray(res.contract)
|
||||||
? res.contract
|
? res.contract
|
||||||
: (res.contract ? String(res.contract).split(',') : [])
|
: res.contract
|
||||||
|
? String(res.contract).split(',')
|
||||||
|
: []
|
||||||
baseForm.biz_date = res.biz_date || ''
|
baseForm.biz_date = res.biz_date || ''
|
||||||
baseForm.clearance_country_id = res.clearance_country_id || ''
|
baseForm.clearance_country_id = res.clearance_country_id || ''
|
||||||
baseForm.clearance_country_snapshot = res.clearance_country_snapshot || ''
|
baseForm.clearance_country_snapshot = res.clearance_country_snapshot || ''
|
||||||
@@ -995,7 +1015,9 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
|||||||
: String(res.contract).split(',')
|
: String(res.contract).split(',')
|
||||||
const contractUrlsArr: string[] = Array.isArray(res.contract_url)
|
const contractUrlsArr: string[] = Array.isArray(res.contract_url)
|
||||||
? (res.contract_url as string[])
|
? (res.contract_url as string[])
|
||||||
: (res.contract_url ? String(res.contract_url).split(',') : [])
|
: res.contract_url
|
||||||
|
? String(res.contract_url).split(',')
|
||||||
|
: []
|
||||||
baseForm.contract = contractNamesArr
|
baseForm.contract = contractNamesArr
|
||||||
baseForm.contract_url = contractUrlsArr
|
baseForm.contract_url = contractUrlsArr
|
||||||
contractFiles.value = contractNamesArr.map((fileName: string, index: number) => ({
|
contractFiles.value = contractNamesArr.map((fileName: string, index: number) => ({
|
||||||
@@ -1012,7 +1034,9 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
|||||||
: String(res.pi_doc).split(',')
|
: String(res.pi_doc).split(',')
|
||||||
const piUrlsArr: string[] = Array.isArray(res.pi_doc_url)
|
const piUrlsArr: string[] = Array.isArray(res.pi_doc_url)
|
||||||
? (res.pi_doc_url as string[])
|
? (res.pi_doc_url as string[])
|
||||||
: (res.pi_doc_url ? String(res.pi_doc_url).split(',') : [])
|
: res.pi_doc_url
|
||||||
|
? String(res.pi_doc_url).split(',')
|
||||||
|
: []
|
||||||
baseForm.pi_doc = piNamesArr
|
baseForm.pi_doc = piNamesArr
|
||||||
baseForm.pi_doc_url = piUrlsArr
|
baseForm.pi_doc_url = piUrlsArr
|
||||||
piFiles.value = piNamesArr.map((fileName: string, index: number) => ({
|
piFiles.value = piNamesArr.map((fileName: string, index: number) => ({
|
||||||
@@ -1029,7 +1053,9 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
|||||||
: String(res.transaction_slip).split(',')
|
: String(res.transaction_slip).split(',')
|
||||||
const slipUrlsArr: string[] = Array.isArray(res.transaction_slip_url)
|
const slipUrlsArr: string[] = Array.isArray(res.transaction_slip_url)
|
||||||
? (res.transaction_slip_url as string[])
|
? (res.transaction_slip_url as string[])
|
||||||
: (res.transaction_slip_url ? String(res.transaction_slip_url).split(',') : [])
|
: res.transaction_slip_url
|
||||||
|
? String(res.transaction_slip_url).split(',')
|
||||||
|
: []
|
||||||
baseForm.transaction_slip = slipNamesArr
|
baseForm.transaction_slip = slipNamesArr
|
||||||
baseForm.transaction_slip_url = slipUrlsArr
|
baseForm.transaction_slip_url = slipUrlsArr
|
||||||
waterBillFiles.value = slipNamesArr.map((fileName: string, index: number) => ({
|
waterBillFiles.value = slipNamesArr.map((fileName: string, index: number) => ({
|
||||||
@@ -1131,7 +1157,11 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
|
|||||||
|
|
||||||
// 从提交参数中移除 settlement_currency
|
// 从提交参数中移除 settlement_currency
|
||||||
const baseFormWithoutCur = { ...(baseForm as any) }
|
const baseFormWithoutCur = { ...(baseForm as any) }
|
||||||
baseFormWithoutCur.cif_total = wrapMoney(baseFormWithoutCur.cif_total, baseFormWithoutCur.cif_total_currency, '合计')
|
baseFormWithoutCur.cif_total = wrapMoney(
|
||||||
|
baseFormWithoutCur.cif_total,
|
||||||
|
baseFormWithoutCur.cif_total_currency,
|
||||||
|
'合计'
|
||||||
|
)
|
||||||
|
|
||||||
// delete (baseFormWithoutCur as any).cif_total
|
// delete (baseFormWithoutCur as any).cif_total
|
||||||
delete (baseFormWithoutCur as any).cif_total_currency
|
delete (baseFormWithoutCur as any).cif_total_currency
|
||||||
|
|||||||
Reference in New Issue
Block a user