备货单 添加 加价 将内勤专属 移到打印查看里面

This commit is contained in:
浅念
2025-10-24 14:45:15 +08:00
parent cd1bbca4a6
commit 631ca4ec30
11 changed files with 544 additions and 129 deletions
@@ -0,0 +1,204 @@
<template>
<div style="margin-bottom: 12px; display: flex; align-items: center; gap: 12px">
<span>显示币种:</span>
<el-select v-model="selectedCurrency" placeholder="选择币种" style="width: 200px">
<el-option
v-for="opt in currencyOptions"
:key="opt.currency_code"
:label="opt.currency_name + ' (' + opt.currency_code + ')'"
:value="opt.currency_code"
/>
</el-select>
</div>
<div>
<el-table :data="displayData" style="width: 100%">
<el-table-column label="编号" width="80" align="center">
<template #default="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column prop="model" label="车型" min-width="160" />
<el-table-column prop="qty" label="数量" width="80" />
<el-table-column prop="clearance_price" label="报关价" min-width="140">
<template #default="scope">{{ scope.row.clearance_price }}</template>
</el-table-column>
<el-table-column prop="fob_transport_fee" label="FOB运费" min-width="140">
<template #default="scope">{{ scope.row.fob_transport_fee }}</template>
</el-table-column>
<el-table-column prop="car_price" label="车价" min-width="140">
<template #default="scope">{{ scope.row.car_price }}</template>
</el-table-column>
<el-table-column prop="ocean_freight" label="海运费" min-width="140">
<template #default="scope">{{ scope.row.ocean_freight }}</template>
</el-table-column>
<el-table-column prop="commission" label="佣金" min-width="140">
<template #default="scope">{{ scope.row.commission }}</template>
</el-table-column>
<el-table-column prop="retention_price" label="挂账" min-width="140">
<template #default="scope">{{ scope.row.retention_price }}</template>
</el-table-column>
<el-table-column prop="port_misc_fee" label="港杂" min-width="140">
<template #default="scope">{{ scope.row.port_misc_fee }}</template>
</el-table-column>
</el-table>
</div>
</template>
<script setup lang="ts">
import { ref, computed, watch } from 'vue'
import { commonService } from '@/api/commonApi'
defineOptions({
name: 'InternalStaffViews'
})
interface CurrencyOption {
currency_code: string
currency_name: string
rate?: number
exchange_rate?: number
}
interface VehicleData {
model_snapshot?: string
model?: string
qty?: number
clearance_price?: any
clearance_price_currency?: string
fob_transport_fee?: any
fob_fee_currency?: string
car_price?: any
car_price_currency?: string
ocean_freight?: any
ocean_freight_currency?: string
commission?: any
commission_currency?: string
retention_price?: any
retention_price_currency?: string
port_misc_fee?: any
port_fee_currency?: string
}
const props = defineProps<{
visible: boolean
vehicleData: VehicleData[]
defaultCurrency?: string
}>()
// const emit = defineEmits<{
// 'update:visible': [value: boolean]
// }>()
const selectedCurrency = ref('')
const currencyOptions = ref<CurrencyOption[]>([])
const loadCurrencyOptions = async () => {
try {
const res = await commonService.getCurrencySelect()
currencyOptions.value = res || []
} catch (e) {
console.error('获取币种失败', e)
}
}
const rateOf = (c?: string) => {
const found = (currencyOptions.value || []).find((x: any) => x.currency_code === c)
return Number(found?.rate || found?.exchange_rate || 0) || 0
}
const convert = (amount: any, fromCode?: string, toCode?: string): number => {
const val = amount === undefined || amount === null || amount === '' ? 0 : Number(amount)
if (Number.isNaN(val)) return 0
const from = fromCode || 'USD'
const to = toCode || 'USD'
if (from === to) return val
const rf = rateOf(from)
const rt = rateOf(to) || 1
if (!rf) return 0
return (val * rf) / rt
}
const fmt = (n: number, cur: string) => `${n.toFixed(2)} ${cur}`
const displayData = computed(() => {
const code = selectedCurrency.value
return (props.vehicleData || []).map((it: VehicleData) => {
return {
model: it.model_snapshot || it.model || '',
qty: it.qty || 1,
clearance_price: fmt(
convert(
it.clearance_price?.amount ?? it.clearance_price,
it.clearance_price?.currency || it.clearance_price_currency,
code
),
code
),
fob_transport_fee: fmt(
convert(
it.fob_transport_fee?.amount ?? it.fob_transport_fee,
it.fob_transport_fee?.currency || it.fob_fee_currency || it.ocean_freight_currency,
code
),
code
),
car_price: fmt(
convert(
it.car_price?.amount ?? it.car_price,
it.car_price?.currency || it.car_price_currency,
code
),
code
),
ocean_freight: fmt(
convert(
it.ocean_freight?.amount ?? it.ocean_freight,
it.ocean_freight?.currency || it.ocean_freight_currency,
code
),
code
),
commission: fmt(
convert(
it.commission?.amount ?? it.commission,
it.commission?.currency || it.commission_currency,
code
),
code
),
retention_price: fmt(
convert(
it.retention_price?.amount ?? it.retention_price,
it.retention_price?.currency || it.retention_price_currency,
code
),
code
),
port_misc_fee: fmt(
convert(
it.port_misc_fee?.amount ?? it.port_misc_fee,
it.port_misc_fee?.currency || it.port_fee_currency,
code
),
code
)
}
})
})
// 监听 visible 变化,加载币种选项
watch(
() => props.visible,
(newVisible) => {
if (newVisible) {
loadCurrencyOptions()
// 设置默认币种
if (props.defaultCurrency) {
selectedCurrency.value = props.defaultCurrency
} else {
selectedCurrency.value = 'USD'
}
}
}
)
</script>
@@ -137,6 +137,14 @@
'—'
}}</template>
</ElTableColumn>
<ElTableColumn label="加价" min-width="120" align="center">
<template #default="scope">{{
scope.row.increase_price?.currency_info ||
scope.row.increase_price?.amount ||
scope.row.discount ||
'—'
}}</template>
</ElTableColumn>
<ElTableColumn label="改装费" min-width="120" align="center">
<template #default="scope">{{
scope.row.retrofit_fee?.currency_info ||
+91 -73
View File
@@ -125,6 +125,9 @@ export interface ItemRow {
car_price: number | undefined
car_price_currency: string
car_price_currency_snapshot: string
increase_price?: number | undefined
increase_price_currency?: string
increase_price_currency_snapshot?: string
}
export interface PaymentItem {
@@ -193,10 +196,10 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
clearance_port_snapshot: '',
latest_arrival_date: '',
contract_exchange_rate: '',
settlement_currency: 'USD',
settlement_currency: 'CNY',
remark: '',
cif_total: undefined,
cif_total_currency: 'USD',
cif_total_currency: 'CNY',
cif_total_currency_snapshot: '',
is_final: isFinal ? '1' : '0',
object_id: stockingId || '0',
@@ -217,11 +220,11 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
_echo_vin: false,
mileage: 0,
listing_price: undefined,
listing_price_currency: 'USD',
listing_price_currency_snapshot: '美元',
listing_price_currency: 'CNY',
listing_price_currency_snapshot: '人民币',
reduction_price: undefined,
reduction_price_currency: 'USD',
reduction_price_currency_snapshot: '美元',
reduction_price_currency: 'CNY',
reduction_price_currency_snapshot: '人民币',
color_interior_code: '',
color_interior_snapshot: '',
color_exterior_code: '',
@@ -232,62 +235,65 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
port_misc_fee: '',
remark: '',
ocean_freight: '',
ocean_freight_currency: 'USD',
ocean_freight_currency_snapshot: '美元',
ocean_freight_currency: 'CNY',
ocean_freight_currency_snapshot: '人民币',
commission: '',
commission_currency: 'USD',
commission_currency_snapshot: '美元',
commission_currency: 'CNY',
commission_currency_snapshot: '人民币',
purchase_tax: '',
purchase_tax_currency: 'USD',
purchase_tax_currency_snapshot: '美元',
purchase_tax_currency: 'CNY',
purchase_tax_currency_snapshot: '人民币',
tax_refund: '',
tax_refund_currency: 'CNY',
tax_refund_currency_snapshot: '人民币',
clearance_price: undefined,
clearance_price_currency: 'USD',
clearance_price_currency_snapshot: '美元',
clearance_price_currency: 'CNY',
clearance_price_currency_snapshot: '人民币',
retrofit_fee: '',
total_price: undefined,
official_price: undefined,
discount_price: undefined,
fob_fee: undefined,
fob_fee_currency: 'USD',
fob_fee_currency_snapshot: '美元',
fob_fee_currency: 'CNY',
fob_fee_currency_snapshot: '人民币',
helper_fee: undefined,
helper_fee_currency: 'USD',
helper_fee_currency_snapshot: '美元',
helper_fee_currency: 'CNY',
helper_fee_currency_snapshot: '人民币',
domestic_freight: undefined,
domestic_freight_currency: 'USD',
domestic_freight_currency_snapshot: '美元',
domestic_freight_currency: 'CNY',
domestic_freight_currency_snapshot: '人民币',
port_fee: undefined,
port_fee_currency: 'USD',
port_fee_currency_snapshot: '美元',
unit_price_currency: 'USD',
unit_price_currency_snapshot: '美元',
total_price_currency: 'USD',
total_price_currency_snapshot: '美元',
guide_price_currency: 'USD',
guide_price_currency_snapshot: '美元',
port_fee_currency: 'CNY',
port_fee_currency_snapshot: '人民币',
unit_price_currency: 'CNY',
unit_price_currency_snapshot: '人民币',
total_price_currency: 'CNY',
total_price_currency_snapshot: '人民币',
guide_price_currency: 'CNY',
guide_price_currency_snapshot: '人民币',
discount: undefined,
discount_currency: 'USD',
discount_currency_snapshot: '美元',
discount_currency: 'CNY',
discount_currency_snapshot: '人民币',
contract_rate: 7.16,
profit: undefined,
profit_currency: 'CNY',
profit_currency_snapshot: '人民币',
modify_ids: [],
modify_list: [],
modify_fee_currency: 'USD',
modify_fee_currency_snapshot: '美元',
modify_fee_currency: 'CNY',
modify_fee_currency_snapshot: '人民币',
accessory_price: undefined,
accessory_price_currency: 'USD',
accessory_price_currency_snapshot: '美元',
accessory_price_currency: 'CNY',
accessory_price_currency_snapshot: '人民币',
retention_price: undefined,
retention_price_currency: 'USD',
retention_price_currency_snapshot: '美元',
retention_price_currency: 'CNY',
retention_price_currency_snapshot: '人民币',
car_price: undefined,
car_price_currency: 'USD',
car_price_currency_snapshot: '美元'
car_price_currency: 'CNY',
car_price_currency_snapshot: '人民币',
increase_price: undefined,
increase_price_currency: 'CNY',
increase_price_currency_snapshot: '人民币'
})
// 创建新的收款项
@@ -295,8 +301,8 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
remit_country_id: '',
remit_country_name_snapshot: '',
remit_date: '',
currency_code: 'USD',
currency_name_snapshot: '美元',
currency_code: 'CNY',
currency_name_snapshot: '人民币',
account_id: '',
account_name_snapshot: '',
remitter_name: '',
@@ -433,7 +439,7 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
}
const validateContractRate = () => {
const code = baseForm.settlement_currency || items.value[0]?.unit_price_currency || 'USD'
const code = baseForm.settlement_currency || items.value[0]?.unit_price_currency || 'CNY'
const { min, max } = getCurrencyBounds(code)
const val = Number(baseForm.contract_exchange_rate)
if (Number.isNaN(val)) return
@@ -463,8 +469,8 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
const convertCurrency = (amount: any, fromCode?: string, toCode?: string): number => {
const val = amount === undefined || amount === null || amount === '' ? 0 : Number(amount)
if (Number.isNaN(val)) return 0
const from = fromCode || 'USD'
const to = toCode || 'USD'
const from = fromCode || 'CNY'
const to = toCode || 'CNY'
if (from === to) return val
const rateFrom = getRateNumber(from)
const rateTo = getRateNumber(to) || 1
@@ -528,6 +534,12 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
(it as any).accessory_price_currency,
targetCurrency
)
//加价
const increase = convertCurrency(
it.increase_price ?? (it as any).increase_price,
(it as any).increase_price_currency,
targetCurrency
)
const mileageVal = Number(it.mileage ?? 0)
if (mileageVal > 0) {
// 二手车:用挂牌价与二手减价替代官方指导价与优惠
@@ -552,6 +564,7 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
commission +
purchaseTax +
retention +
increase +
accessory) +
taxRefund +
reduction
@@ -580,6 +593,7 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
commission +
purchaseTax +
retention +
increase +
accessory) +
taxRefund +
discount
@@ -588,7 +602,7 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
// 计算报关价 = 收款价 - 挂账
const calcClearanceFee = (it: any): number => {
const targetCurrency = it.clearance_price_currency || baseForm.settlement_currency || 'USD'
const targetCurrency = it.clearance_price_currency || baseForm.settlement_currency || 'CNY'
const unit = convertCurrency(it.unit_price, it.unit_price_currency, targetCurrency)
const retention = convertCurrency(
it.retention_price ?? (it as any).retention_price,
@@ -620,7 +634,7 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
// 计算车价:车价 = 报关价 - FOB运费 - 港杂费 - 海运费
const calcCarPrice = (it: any): number => {
const targetCurrency = it.car_price_currency || baseForm.settlement_currency || 'USD'
const targetCurrency = it.car_price_currency || baseForm.settlement_currency || 'CNY'
const clearance = convertCurrency(
it.clearance_price ?? (it as any).clearance_price,
(it as any).clearance_price_currency,
@@ -899,10 +913,10 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
baseForm.clearance_port_snapshot = res.clearance_port_snapshot || ''
baseForm.latest_arrival_date = res.latest_arrival_date || ''
baseForm.remark = res.remark || ''
baseForm.settlement_currency = res.settlement_currency || 'USD'
baseForm.settlement_currency = res.settlement_currency || 'CNY'
// 合计与汇率
baseForm.cif_total = res.cif_total.amount ? Number(res.cif_total.amount) : undefined
baseForm.cif_total_currency = res.cif_total.currency || 'USD'
baseForm.cif_total_currency = res.cif_total.currency || 'CNY'
baseForm.contract_exchange_rate = res.contract_exchange_rate
// 明细
const list = Array.isArray(res.veh_list) ? res.veh_list : []
@@ -913,10 +927,10 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
mileage: it.mileage ?? 0,
model_snapshot: it.model_snapshot || '',
listing_price: it.listing_price?.amount ? Number(it.listing_price.amount) : undefined,
listing_price_currency: it.listing_price?.currency || 'USD',
listing_price_currency: it.listing_price?.currency || 'CNY',
listing_price_currency_snapshot: '',
reduction_price: it.reduction_price?.amount ? Number(it.reduction_price.amount) : undefined,
reduction_price_currency: it.reduction_price?.currency || 'USD',
reduction_price_currency: it.reduction_price?.currency || 'CNY',
reduction_price_currency_snapshot: '',
color_interior_code: it.color_interior_code || '',
color_interior_snapshot: it.color_interior_snapshot || '',
@@ -930,38 +944,38 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
port_misc_fee: it.port_misc_fee?.amount ?? '',
remark: it.remark || '',
ocean_freight: it.ocean_freight?.amount ?? '',
ocean_freight_currency: it.ocean_freight?.currency || 'USD',
ocean_freight_currency: it.ocean_freight?.currency || 'CNY',
ocean_freight_currency_snapshot: '',
commission: it.commission?.amount ?? '',
commission_currency: it.commission?.currency || 'USD',
commission_currency: it.commission?.currency || 'CNY',
commission_currency_snapshot: '',
purchase_tax: it.purchase_tax?.amount ?? '',
purchase_tax_currency: it.purchase_tax?.currency || 'USD',
purchase_tax_currency: it.purchase_tax?.currency || 'CNY',
purchase_tax_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,
discount_price: it.discount_price?.amount ? Number(it.discount_price.amount) : undefined,
fob_fee: undefined,
fob_fee_currency: it.fob_transport_fee?.currency || 'USD',
fob_fee_currency: it.fob_transport_fee?.currency || 'CNY',
fob_fee_currency_snapshot: '',
helper_fee: undefined,
helper_fee_currency: it.handling_fee?.currency || 'USD',
helper_fee_currency: it.handling_fee?.currency || 'CNY',
helper_fee_currency_snapshot: '',
domestic_freight: undefined,
domestic_freight_currency: it.domestic_freight?.currency || 'USD',
domestic_freight_currency: it.domestic_freight?.currency || 'CNY',
domestic_freight_currency_snapshot: '',
port_fee: undefined,
port_fee_currency: it.port_misc_fee?.currency || 'USD',
port_fee_currency: it.port_misc_fee?.currency || 'CNY',
port_fee_currency_snapshot: '',
unit_price_currency: it.unit_price?.currency || 'USD',
unit_price_currency: it.unit_price?.currency || 'CNY',
unit_price_currency_snapshot: '',
total_price_currency: it.total_price?.currency || 'USD',
total_price_currency: it.total_price?.currency || 'CNY',
total_price_currency_snapshot: '',
guide_price_currency: it.official_price?.currency || 'USD',
guide_price_currency: it.official_price?.currency || 'CNY',
guide_price_currency_snapshot: '',
discount: undefined,
discount_currency: it.discount_price?.currency || 'USD',
discount_currency: it.discount_price?.currency || 'CNY',
discount_currency_snapshot: '',
contract_rate: baseForm.contract_exchange_rate
? Number(baseForm.contract_exchange_rate)
@@ -969,7 +983,7 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
profit: it.profit?.amount ? Number(it.profit.amount) : undefined,
profit_type_snapshot: '',
clearance_price: it.clearance_price?.amount ? Number(it.clearance_price.amount) : undefined,
clearance_price_currency: it.clearance_price?.currency || 'USD',
clearance_price_currency: it.clearance_price?.currency || 'CNY',
clearance_price_currency_snapshot: '',
modify_ids: Array.isArray(it.modify_list)
? it.modify_list.map((m: any) => Number(m.option_id))
@@ -980,20 +994,23 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
option_name_snapshot: m.option_name_snapshot
}))
: [],
modify_fee_currency: it.retrofit_fee?.currency || 'USD',
modify_fee_currency: it.retrofit_fee?.currency || 'CNY',
modify_fee_currency_snapshot: '',
tax_refund: it.tax_refund?.amount ?? '',
tax_refund_currency: it.tax_refund?.currency || 'USD',
tax_refund_currency: it.tax_refund?.currency || 'CNY',
tax_refund_currency_snapshot: '',
accessory_price: it.accessory_price?.amount ? Number(it.accessory_price.amount) : undefined,
accessory_price_currency: it.accessory_price?.currency || 'USD',
accessory_price_currency: it.accessory_price?.currency || 'CNY',
accessory_price_currency_snapshot: '',
retention_price: it.retention_price?.amount ? Number(it.retention_price.amount) : undefined,
retention_price_currency: it.retention_price?.currency || 'USD',
retention_price_currency: it.retention_price?.currency || 'CNY',
retention_price_currency_snapshot: '',
car_price: it.car_price?.amount ? Number(it.car_price.amount) : undefined,
car_price_currency: it.car_price?.currency || 'USD',
car_price_currency_snapshot: ''
car_price_currency: it.car_price?.currency || 'CNY',
car_price_currency_snapshot: '',
increase_price: it.increase_price?.amount ? Number(it.increase_price.amount) : undefined,
increase_price_currency: it.increase_price?.currency || 'CNY',
increase_price_currency_snapshot: ''
}))
// 计划收款
const pays = Array.isArray(res.account_list) ? res.account_list : []
@@ -1152,7 +1169,8 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
'配件价'
),
retention_price: wrapMoney(it.retention_price, (it as any).retention_price_currency, '挂账'),
car_price: wrapMoney(it.car_price, (it as any).car_price_currency, '车价')
car_price: wrapMoney(it.car_price, (it as any).car_price_currency, '车价'),
increase_price: wrapMoney(it.increase_price, (it as any).increase_price_currency, '加价')
}))
// 从提交参数中移除 settlement_currency
@@ -1221,13 +1239,13 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
// // 确保报关价货币单位与计算结果一致
// if (items.value[index]) {
// ;(items.value[index] as any).clearance_price_currency =
// it.clearance_price_currency || baseForm.settlement_currency || 'USD'
// it.clearance_price_currency || baseForm.settlement_currency || 'CNY'
// }
// }
// const refund = calcTaxRefund(it)
// if (items.value[index]) {
// items.value[index].tax_refund = isNaN(refund) ? 0 : (Number(refund.toFixed(2)) as any)
// ;(items.value[index] as any).tax_refund_currency = baseForm.settlement_currency || 'USD'
// ;(items.value[index] as any).tax_refund_currency = baseForm.settlement_currency || 'CNY'
// }
// })
}
@@ -1265,7 +1283,7 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
// 确保报关价货币单位与计算结果一致
if (items.value[index]) {
;(items.value[index] as any).clearance_price_currency =
it.clearance_price_currency || baseForm.settlement_currency || 'USD'
it.clearance_price_currency || baseForm.settlement_currency || 'CNY'
}
}
@@ -1281,7 +1299,7 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
if (items.value[index]) {
items.value[index].car_price = isNaN(carPrice) ? 0 : Number(carPrice.toFixed(2))
;(items.value[index] as any).car_price_currency =
it.car_price_currency || baseForm.settlement_currency || 'USD'
it.car_price_currency || baseForm.settlement_currency || 'CNY'
}
})
// 合计到岸价 = 所有报关价相加
@@ -1351,7 +1369,7 @@ export function useStockingForm(isFinal = false, stockingId?: string | number) {
])
// 设置默认汇率
baseForm.contract_exchange_rate = getCurrencyRate('USD')
baseForm.contract_exchange_rate = getCurrencyRate('CNY')
// 设置预计发送日默认为当天
const today = new Date()
+15 -2
View File
@@ -86,7 +86,12 @@
<ElForm ref="formRef" :model="poForm" :rules="poRules" label-width="120px" class="form">
<ElFormItem label="PI号" prop="pi_no">
<ElSelect v-model="poForm.pi_no" placeholder="请选择PI号" style="width: 100%">
<ElOption v-for="pi in piOptions" :key="pi.pi_no" :value="pi.pi_no" />
<ElOption
v-for="pi in piOptions"
:key="pi.pi_no"
:value="pi.pi_no"
:label="pi.pi_nosnapshot"
/>
</ElSelect>
</ElFormItem>
@@ -366,7 +371,15 @@
const loadOptions = async () => {
try {
const res = await purchaseService.purchaseorderpredata({ scene: 'pi_no' })
piOptions.value = res || []
const list = Array.isArray(res) ? res : []
if (Array.isArray(list)) {
list.forEach((item: any) => {
item.pi_nosnapshot = item.pi_no + '(' + item.salesperson_snapshot + ')'
})
piOptions.value = list
} else {
piOptions.value = res
}
} catch {
piOptions.value = []
}
+22 -7
View File
@@ -85,14 +85,14 @@
>
<i class="iconfont-sys">&#xe728;</i> 查看审批
</el-link>
<el-link
<!-- <el-link
type="primary"
underline="never"
@click="handleViewnq(scope.row)"
style="margin-right: 8px;color: #750AF8"
>
<i class="iconfont-sys">&#xe76c;</i> 内勤专用
</el-link>
</el-link> -->
</ElRow>
</template>
</ElTableColumn>
@@ -135,7 +135,7 @@
top="40px"
:close-on-click-modal="false"
>
<div style="max-height: 70vh; display: flex; flex-direction: column; gap: 12px">
<div style="max-height: 50vh; display: flex; flex-direction: column; gap: 12px">
<div style="display: flex; justify-content: flex-end; gap: 8px">
<el-button @click="download" v-if="isFinites">下载</el-button>
</div>
@@ -157,6 +157,13 @@
style="flex: 1; width: 100%; border: 1px solid #eee; border-radius: 6px;"
/>
</div>
<div class="inter-view">
<InternalStaffViews
v-model:visible="pdf.visible"
:vehicle-data="nqData"
:default-currency="nqCurrency"
/>
</div>
</el-dialog>
<el-dialog
v-model="timelineDialogVisible"
@@ -172,11 +179,11 @@
</div>
</el-dialog>
<!-- 内勤查看弹窗 -->
<InternalStaffView
<!-- <InternalStaffView
v-model:visible="nqDialogVisible"
:vehicle-data="nqData"
:default-currency="nqCurrency"
/>
/> -->
</div>
</template>
@@ -190,7 +197,8 @@
import type { OrderData } from '@/composables/useOrderDetailDialog'
import { usePdfPreview } from '@/composables/usePdfPreview'
import FilePreview from '@/components/custom/FilePreview.vue'
import InternalStaffView from '@/components/custom/InternalStaffView.vue'
// import InternalStaffView from '@/components/custom/InternalStaffView.vue'
import InternalStaffViews from '@/components/custom/InternalStaffViews.vue'
const timelineDialogVisible = ref(false)
const approvalRecords = ref<any[]>([])
const isFinites = ref(false)
@@ -274,6 +282,7 @@
} else {
isFinites.value = false
}
handleViewnq(row)
manageService
.printStock({ id: row.id })
.then((res) => {
@@ -315,7 +324,7 @@
port_fee_currency: it.port_misc_fee?.currency || it.port_fee_currency,
model: it.model_snapshot
}))
nqDialogVisible.value = true
// nqDialogVisible.value = true
}
// 文件数据
const contractFiles = ref<Array<{ name: string; url: string; file_name: string }>>([])
@@ -547,4 +556,10 @@
font-size: 48px;
color: #ddd;
}
.inter-view {
margin-top: 10px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 10px;
}
</style>
+21 -14
View File
@@ -93,14 +93,6 @@
>
<i class="iconfont-sys">&#xe728;</i> 查看审批
</el-link>
<el-link
type="primary"
underline="never"
@click="handleViewnq(scope.row)"
style="margin-right: 8px;color: #750AF8;"
>
<i class="iconfont-sys">&#xe76c;</i> 内勤专用
</el-link>
</ElRow>
</template>
</ElTableColumn>
@@ -116,7 +108,7 @@
top="40px"
:close-on-click-modal="false"
>
<div style="max-height: 70vh; display: flex; flex-direction: column; gap: 12px">
<div style="max-height: 50vh; display: flex; flex-direction: column; gap: 12px">
<div style="display: flex; justify-content: flex-end; gap: 8px;">
<el-button @click="download" v-if="isFinites">下载</el-button>
</div>
@@ -138,6 +130,13 @@
style="flex: 1; width: 100%; border: 1px solid #eee; border-radius: 6px;"
/>
</div>
<div class="inter-view">
<InternalStaffViews
v-model:visible="pdf.visible"
:vehicle-data="nqData"
:default-currency="nqCurrency"
/>
</div>
</el-dialog>
<!-- 订单详情弹窗(使用公共内容组件) -->
<el-dialog
@@ -181,11 +180,11 @@
</div>
</el-dialog>
<!-- 内勤查看弹窗 -->
<InternalStaffView
<!-- <InternalStaffView
v-model:visible="nqDialogVisible"
:vehicle-data="nqData"
:default-currency="nqCurrency"
/>
/> -->
</div>
</template>
@@ -196,10 +195,11 @@
import ApprovalTimeline from '@/components/custom/ApprovalTimeline.vue'
import type { OrderData } from '@/composables/useOrderDetailDialog'
import FilePreview from '@/components/custom/FilePreview.vue'
import InternalStaffView from '@/components/custom/InternalStaffView.vue'
// import InternalStaffView from '@/components/custom/InternalStaffView.vue'
import InternalStaffViews from '@/components/custom/InternalStaffViews.vue'
const timelineDialogVisible = ref(false)
const approvalRecords = ref<any[]>([])
const nqDialogVisible = ref(false)
// const nqDialogVisible = ref(false)
const nqCurrency = ref('')
const nqData = ref<any[]>([])
const isFinites = ref(false)
@@ -466,6 +466,7 @@
} else {
isFinites.value = false
}
handleViewnq(row)
manageService
.printStock({ id: row.id })
.then((res) => {
@@ -530,7 +531,7 @@
port_fee_currency: it.port_misc_fee?.currency || it.port_fee_currency,
model: it.model_snapshot
}))
nqDialogVisible.value = true
// nqDialogVisible.value = true
}
</script>
@@ -667,5 +668,11 @@
word-break: break-all;
max-width: 100%;
}
.inter-view {
margin-top: 10px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 10px;
}
</style>
+17
View File
@@ -264,6 +264,23 @@
<ElInput v-model="item.reduction_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="4">
<ElFormItem label="加价" label-width="85px">
<ElInput v-model="item.increase_price" placeholder="请输入加价">
<template #suffix>
<ElSelect v-model="item.increase_price_currency" style="width: 74px">
<ElOption
v-for="c in currencyOptions"
:key="c.currency_code"
:label="c.currency_name"
:value="c.currency_code"
/>
</ElSelect>
</template>
</ElInput>
<ElInput v-model="item.increase_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="4">
<ElFormItem label="收款价" label-width="85px" :prop="`items.${idx}.unit_price`" required>
<ElInput v-model="item.unit_price" placeholder="请输入收款价">
+17
View File
@@ -287,6 +287,23 @@
<ElInput v-model="item.reduction_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="4">
<ElFormItem label="加价" label-width="85px">
<ElInput v-model="item.increase_price" placeholder="请输入加价">
<template #suffix>
<ElSelect v-model="item.increase_price_currency" style="width: 74px">
<ElOption
v-for="c in currencyOptions"
:key="c.currency_code"
:label="c.currency_name"
:value="c.currency_code"
/>
</ElSelect>
</template>
</ElInput>
<ElInput v-model="item.increase_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="4">
<ElFormItem label="收款价" label-width="85px" :prop="'items.' + idx + '.unit_price'" required>
<ElInput v-model="item.unit_price" placeholder="请输入收款价">
+128 -27
View File
@@ -326,6 +326,48 @@
<ElInput v-model="item.reduction_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="4">
<ElFormItem label="加价" label-width="85px">
<ElInput v-model="item.increase_price" placeholder="请输入加价">
<template #suffix>
<ElSelect v-model="item.increase_price_currency" style="width: 74px">
<ElOption
v-for="c in currencyOptions"
:key="c.currency_code"
:label="c.currency_name"
:value="c.currency_code"
/>
</ElSelect>
</template>
</ElInput>
<ElInput v-model="item.increase_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="6">
<ElFormItem label="收款价" label-width="95px" :prop="'items.' + idx + '.unit_price'" required>
<ElInput
:disabled="item._echo_vin === true"
v-model="item.unit_price"
placeholder="请输入收款价"
>
<template #suffix>
<ElSelect
:disabled="item._echo_vin === true"
v-model="item.unit_price_currency"
style="width: 64px"
>
<ElOption
v-for="c in currencyOptions"
:key="c.currency_code"
:label="c.currency_name"
:value="c.currency_code"
/>
</ElSelect>
</template>
</ElInput>
<ElInput v-model="item.unit_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
</ElRow>
<ElRow :gutter="12" class="item-row-wrap">
<ElCol :sm="12" :md="12" :lg="6" :xl="6">
@@ -378,6 +420,31 @@
<ElInput v-model="item.modify_fee_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="4">
<ElFormItem label="配件费" label-width="85px">
<ElInput
v-model="item.accessory_price"
:disabled="item._echo_vin === true"
placeholder="请输入配件费"
>
<template #suffix>
<ElSelect
v-model="item.accessory_price_currency"
:disabled="item._echo_vin === true"
style="width: 74px"
>
<ElOption
v-for="c in currencyOptions"
:key="c.currency_code"
:label="c.currency_name"
:value="c.currency_code"
/>
</ElSelect>
</template>
</ElInput>
<ElInput v-model="item.accessory_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="6">
<ElFormItem label="FOB段运费" label-width="95px">
<ElInput
@@ -455,9 +522,17 @@
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="4">
<ElFormItem label="佣金" label-width="95px">
<ElInput :disabled="item._echo_vin === true" v-model="item.commission" placeholder="请输入佣金">
<ElInput
:disabled="item._echo_vin === true"
v-model="item.commission"
placeholder="请输入佣金"
>
<template #suffix>
<ElSelect :disabled="item._echo_vin === true" v-model="item.commission_currency" style="width: 64px">
<ElSelect
:disabled="item._echo_vin === true"
v-model="item.commission_currency"
style="width: 64px"
>
<ElOption
v-for="c in currencyOptions"
:key="c.currency_code"
@@ -470,6 +545,31 @@
<ElInput v-model="item.commission_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="4">
<ElFormItem label="挂账" label-width="85px">
<ElInput
:disabled="item._echo_vin === true"
v-model="item.retention_price"
placeholder="请输入挂账"
>
<template #suffix>
<ElSelect
:disabled="item._echo_vin === true"
v-model="item.retention_price_currency"
style="width: 74px"
>
<ElOption
v-for="c in currencyOptions"
:key="c.currency_code"
:label="c.currency_name"
:value="c.currency_code"
/>
</ElSelect>
</template>
</ElInput>
<ElInput v-model="item.retention_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="4">
<ElFormItem label="购置税" label-width="95px">
<ElInput :disabled="item._echo_vin === true" v-model="item.purchase_tax" placeholder="请输入购置税">
@@ -514,31 +614,6 @@
</ElCol>
</ElRow>
<ElRow :gutter="12" class="item-row-wrap">
<ElCol :sm="12" :md="12" :lg="6" :xl="6">
<ElFormItem label="收款价" label-width="95px" :prop="'items.' + idx + '.unit_price'" required>
<ElInput
:disabled="item._echo_vin === true"
v-model="item.unit_price"
placeholder="请输入收款价"
>
<template #suffix>
<ElSelect
:disabled="item._echo_vin === true"
v-model="item.unit_price_currency"
style="width: 64px"
>
<ElOption
v-for="c in currencyOptions"
:key="c.currency_code"
:label="c.currency_name"
:value="c.currency_code"
/>
</ElSelect>
</template>
</ElInput>
<ElInput v-model="item.unit_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<!-- <ElCol :sm="12" :md="12" :lg="6" :xl="6">
<ElFormItem label="总价" label-width="95px">
<ElInput v-model="item.total_price" placeholder="请输入总价">
@@ -556,6 +631,32 @@
<ElInput v-model="item.total_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol> -->
<ElCol :sm="12" :md="12" :lg="6" :xl="4">
<ElFormItem label="车价" label-width="85px">
<ElInput
v-model="item.car_price"
:disabled="item._echo_vin === true"
placeholder="正在计算车价"
@input="handleUserEdit(idx)"
>
<template #suffix>
<ElSelect
v-model="item.car_price_currency"
:disabled="item._echo_vin === true"
style="width: 74px"
>
<ElOption
v-for="c in currencyOptions"
:key="c.currency_code"
:label="c.currency_name"
:value="c.currency_code"
/>
</ElSelect>
</template>
</ElInput>
<ElInput v-model="item.car_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="6">
<ElFormItem label="利润" label-width="95px">
<ElInput
@@ -286,6 +286,23 @@
<ElInput v-model="item.reduction_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="4">
<ElFormItem label="加价" label-width="85px">
<ElInput v-model="item.increase_price" placeholder="请输入加价">
<template #suffix>
<ElSelect v-model="item.increase_price_currency" style="width: 74px">
<ElOption
v-for="c in currencyOptions"
:key="c.currency_code"
:label="c.currency_name"
:value="c.currency_code"
/>
</ElSelect>
</template>
</ElInput>
<ElInput v-model="item.increase_price_currency_snapshot" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :sm="12" :md="12" :lg="6" :xl="6">
<ElFormItem label="收款价" label-width="95px" :prop="'items.' + idx + '.unit_price'" required>
<ElInput v-model="item.unit_price" placeholder="请输入收款价">
+4 -6
View File
@@ -137,7 +137,7 @@
:value="item.brand_name || item.name"
/>
</ElSelect>
<!-- <ElInput v-model="formData.brand_code" placeholder="品牌编码" readonly disabled /> -->
<ElInput v-model="formData.brand_code" placeholder="品牌编码" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :span="8">
@@ -150,7 +150,7 @@
:value="s.series_name || s.name"
/>
</ElSelect>
<!-- <ElInput v-model="formData.series_code" placeholder="车系编码" readonly disabled /> -->
<ElInput v-model="formData.series_code" placeholder="车系编码" type="hidden" />
</ElFormItem>
</ElCol>
<ElCol :span="8">
@@ -1258,18 +1258,16 @@
// 设置表单数据
Object.assign(formData, row)
// 立即检查车系名称是否被清空并重新设置
setTimeout(() => {
if (!formData.series_name) {
formData.series_name = row.series_name
}
}, 1)
// 先加载品牌选项
await loadBrandOptions()
// 如果品牌已选择,加载车系选项
formData.brand_code = row.brand_code
if (row.brand_code) {
await loadSeriesOptions(row.brand_code)
} else if (row.brand_name) {
@@ -1436,7 +1434,7 @@
getList()
} catch (error) {
console.error('提交失败:', error)
ElMessage.error('提交失败')
// ElMessage.error('提交失败')
} finally {
submitLoading.value = false
}