This commit is contained in:
luojiaquan
2026-09-24 09:26:00 +08:00
8 changed files with 79 additions and 18 deletions
@@ -62,7 +62,7 @@
<el-icon class="tip-icon"><Info-Filled /></el-icon> <el-icon class="tip-icon"><Info-Filled /></el-icon>
<div class="tip-text"> <div class="tip-text">
仅允许上传 {{ accept }} 格式文件,文件大小不超过 {{ fileSizeMb }} MB。 仅允许上传 {{ accept }} 格式文件,文件大小不超过 {{ fileSizeMb }} MB。
<el-link v-if="templateUrl" type="primary" underline="never" class="template-link" @click="handleDownloadTemplate">下载模板</el-link> <el-link v-if="hasTemplate" type="primary" underline="never" class="template-link" @click="handleDownloadTemplate">下载模板</el-link>
</div> </div>
</div> </div>
</div> </div>
@@ -97,12 +97,18 @@ const props = defineProps({
type: String, type: String,
required: true required: true
}, },
// 模板下载接口地址,不传则不显示下载模板链接 // 模板下载接口地址(后端接口,走 proxy.download),不传则不显示下载模板链接
templateAction: { templateAction: {
type: String, type: String,
default: '' default: ''
}, },
// 模板文件名前缀 // 静态模板文件地址(public 目录下相对路径,如 /templates/product/xxx.xlsx),
// 与 templateAction 二选一,静态地址优先
templateUrl: {
type: String,
default: ''
},
// 模板下载文件名(不含扩展名;静态下载时为保存文件名,接口下载时为文件名前缀)
templateFileName: { templateFileName: {
type: String, type: String,
default: 'template' default: 'template'
@@ -181,7 +187,7 @@ const uploadUrl = computed(() => {
return import.meta.env.VITE_APP_BASE_API + props.action + '?' + query.toString() return import.meta.env.VITE_APP_BASE_API + props.action + '?' + query.toString()
}) })
const templateUrl = computed(() => !!props.templateAction) const hasTemplate = computed(() => !!(props.templateUrl || props.templateAction))
// 打开对话框(供父组件通过 ref 调用) // 打开对话框(供父组件通过 ref 调用)
function open() { function open() {
@@ -205,8 +211,17 @@ function handleClose() {
uploadRef.value?.clearFiles() uploadRef.value?.clearFiles()
} }
// 下载模板 // 下载模板:静态文件直接 <a download>,接口走 proxy.download
function handleDownloadTemplate() { function handleDownloadTemplate() {
if (props.templateUrl) {
const link = document.createElement('a')
link.href = props.templateUrl
link.download = props.templateFileName + '.xlsx'
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
return
}
proxy.download(props.templateAction, {}, `${props.templateFileName}_${new Date().getTime()}.xlsx`) proxy.download(props.templateAction, {}, `${props.templateFileName}_${new Date().getTime()}.xlsx`)
} }
@@ -9,7 +9,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="单号"> <el-form-item label="单号">
<div class="order-identifier-input"> <div class="order-identifier-input">
<el-input v-model="generateForm.orderOrTrackingNo" type="textarea" :rows="4" resize="vertical" placeholder="请输入订单号、运单号或转单号,每行一个,最多2000个" clearable /> <el-input v-model="generateForm.orderOrTrackingNo" type="textarea" :rows="4" resize="vertical" placeholder="请输入订单号、运单号或转单号" clearable />
<el-button v-if="generateForm.orderOrTrackingNo" class="order-identifier-clear" link type="primary" @click="clearOrderIdentifiers">清空</el-button> <el-button v-if="generateForm.orderOrTrackingNo" class="order-identifier-clear" link type="primary" @click="clearOrderIdentifiers">清空</el-button>
</div> </div>
</el-form-item> </el-form-item>
@@ -96,7 +96,7 @@
<el-dialog v-model="excludeDialogOpen" title="选择排除订单" width="1100px" append-to-body destroy-on-close @close="handleExcludeDialogClose"> <el-dialog v-model="excludeDialogOpen" title="选择排除订单" width="1100px" append-to-body destroy-on-close @close="handleExcludeDialogClose">
<div class="exclude-toolbar"> <div class="exclude-toolbar">
<div class="order-identifier-input exclude-search-input"> <div class="order-identifier-input exclude-search-input">
<el-input v-model="excludeKeyword" type="textarea" :rows="4" resize="vertical" clearable placeholder="请输入订单号、运单号或转单号,每行一个,最多2000个" /> <el-input v-model="excludeKeyword" type="textarea" :rows="4" resize="vertical" clearable placeholder="请输入订单号、运单号或转单号" />
<el-button v-if="excludeKeyword" class="order-identifier-clear" link type="primary" @click="clearExcludeIdentifiers">清空</el-button> <el-button v-if="excludeKeyword" class="order-identifier-clear" link type="primary" @click="clearExcludeIdentifiers">清空</el-button>
</div> </div>
<el-button type="primary" :loading="excludeLoading" @click="queryExcludeRows">查询</el-button> <el-button type="primary" :loading="excludeLoading" @click="queryExcludeRows">查询</el-button>
+2 -2
View File
@@ -2,10 +2,10 @@
<div class="app-container home"> <div class="app-container home">
<div class="home-hero"> <div class="home-hero">
<div class="hero-main"> <div class="hero-main">
<h2 class="hero-title">BMS 业务管理系统</h2> <h2 class="hero-title">BMS 业财一体化系统</h2>
<p class="hero-sub">跨境物流 · 询价计价 · 账单管理</p> <p class="hero-sub">跨境物流 · 询价计价 · 账单管理</p>
<p class="hero-welcome"> <p class="hero-welcome">
{{ greeting }},{{ user.nickName || user.name }},欢迎使用 BMS 业务管理系统。 {{ greeting }},{{ user.nickName || user.name }},欢迎使用 BMS 业财一体化系统。
</p> </p>
<p class="hero-date">{{ nowText }}</p> <p class="hero-date">{{ nowText }}</p>
</div> </div>
+22 -1
View File
@@ -37,6 +37,12 @@
<el-descriptions-item v-if="detail.logType === 'CREDIT'" label="金额"> <el-descriptions-item v-if="detail.logType === 'CREDIT'" label="金额">
{{ creditAmountLabel(detail) }} {{ creditAmountLabel(detail) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="detail.logType === 'ARREARS'" label="清除范围">
{{ arrearsScopeLabel(detail) }}
</el-descriptions-item>
<el-descriptions-item v-if="detail.logType === 'ARREARS'" label="清除金额">
{{ arrearsAmountLabel(detail) }}
</el-descriptions-item>
<el-descriptions-item v-if="detail.errorMessage" label="错误信息" :span="2"> <el-descriptions-item v-if="detail.errorMessage" label="错误信息" :span="2">
<span class="err-text">{{ detail.errorMessage }}</span> <span class="err-text">{{ detail.errorMessage }}</span>
</el-descriptions-item> </el-descriptions-item>
@@ -73,7 +79,8 @@ const drawerTitle = ref('ES日志详情')
const typeOptions = [ const typeOptions = [
{ label: '计费', value: 'BILL' }, { label: '计费', value: 'BILL' },
{ label: '试算', value: 'QUOTE' }, { label: '试算', value: 'QUOTE' },
{ label: '扣减额度', value: 'CREDIT' } { label: '扣减额度', value: 'CREDIT' },
{ label: '欠费清除', value: 'ARREARS' }
] ]
const statusOptions = [ const statusOptions = [
@@ -125,10 +132,24 @@ function creditAmountLabel(detail) {
return String(req.amount) + (req.currency ? (' ' + req.currency) : '') return String(req.amount) + (req.currency ? (' ' + req.currency) : '')
} }
function arrearsScopeLabel(detail) {
const req = parseReq(detail)
const map = { SUMMARY: '客户汇总', ORDER: '单订单' }
return map[req.scope] || req.scope || '-'
}
function arrearsAmountLabel(detail) {
const req = parseReq(detail)
const amount = req.scope === 'ORDER' ? req.batchAmount : req.amount
if (amount == null || amount === '') return '-'
return String(amount) + (req.currency ? (' ' + req.currency) : '')
}
function typeTag(type) { function typeTag(type) {
if (type === 'BILL') return 'success' if (type === 'BILL') return 'success'
if (type === 'QUOTE') return 'warning' if (type === 'QUOTE') return 'warning'
if (type === 'CREDIT') return 'danger' if (type === 'CREDIT') return 'danger'
if (type === 'ARREARS') return 'primary'
return 'info' return 'info'
} }
@@ -5,7 +5,7 @@
:closable="false" :closable="false"
show-icon show-icon
class="mb16" class="mb16"
title="多国家价表用「导入 Excel」。单国专线成本价用「按国家导入」:先选目的国家,目录里的产品都记到该国。相同产品代码+生效日期不覆盖主数据。" title="多国家价表用「全部导入」。单国专线成本价用「按国家导入」:先选目的国家,目录里的产品都记到该国。相同产品代码+生效日期不覆盖主数据。两种导入均可在弹窗内下载对应模板。"
/> />
<basic-table <basic-table
@@ -20,10 +20,17 @@
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['price:product:add']">新建产品</el-button> <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['price:product:add']">新建产品</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="info" plain icon="Upload" @click="handleImport" v-hasPermi="['price:product:import']">导入 Excel</el-button> <el-dropdown @command="handleImportCommand">
</el-col> <el-button type="info" plain icon="Upload" v-hasPermi="['price:product:import']">
<el-col :span="1.5"> 导入 Excel<el-icon class="el-icon--right"><arrow-down /></el-icon>
<el-button type="info" plain icon="Upload" @click="handleCountryImport" v-hasPermi="['price:product:import']">按国家导入</el-button> </el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="all">全部导入(多国家价表)</el-dropdown-item>
<el-dropdown-item command="country">按国家导入(单国专线成本价)</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</el-col> </el-col>
</template> </template>
@@ -51,6 +58,9 @@
action="/price/product/importData" action="/price/product/importData"
width="560px" width="560px"
:show-update-support="false" :show-update-support="false"
template-url="/templates/product/product-import-all-template.xlsx"
template-file-name="产品多国家价表导入模板"
:import-desc="allImportDesc"
@success="() => tableRef.refresh()" @success="() => tableRef.refresh()"
/> />
<excel-import-dialog <excel-import-dialog
@@ -62,6 +72,8 @@
:extra-query="countryImportQuery" :extra-query="countryImportQuery"
:before-submit="validateCountryImport" :before-submit="validateCountryImport"
:import-desc="countryImportDesc" :import-desc="countryImportDesc"
template-url="/templates/product/product-import-country-template.xlsx"
template-file-name="产品按国家导入模板"
@success="() => tableRef.refresh()" @success="() => tableRef.refresh()"
> >
<template #extra> <template #extra>
@@ -102,9 +114,14 @@ const countryImportRef = ref()
const importCountryCode = ref('') const importCountryCode = ref('')
const regionOptions = ref([]) const regionOptions = ref([])
const countryImportQuery = computed(() => ({ countryCode: importCountryCode.value })) const countryImportQuery = computed(() => ({ countryCode: importCountryCode.value }))
const allImportDesc = [
'适用多国家价表(B2C 小包价表等),按目录 sheet 匹配国家导入。',
'请在弹窗底部下载模板,按模板格式整理后上传。相同产品代码+生效日期不覆盖主数据。'
]
const countryImportDesc = [ const countryImportDesc = [
'选择目的国家后上传专线成本价表,目录中的产品都会记到该国家。', '选择目的国家后上传专线成本价表,目录中的产品都会记到该国家。',
'邮编、赔偿标准等 sheet 不导入。相同产品代码+生效日期不覆盖主数据,重量段按生效日写入。' '邮编、赔偿标准等 sheet 不导入。相同产品代码+生效日期不覆盖主数据,重量段按生效日写入。',
'可在弹窗底部下载模板,按模板格式整理后上传。'
] ]
const columns = [ const columns = [
@@ -152,6 +169,14 @@ function handleUpdate(row) {
formRef.value.open(row) formRef.value.open(row)
} }
function handleImportCommand(command) {
if (command === 'country') {
handleCountryImport()
return
}
handleImport()
}
function handleImport() { function handleImport() {
importRef.value.open() importRef.value.open()
} }
+2 -2
View File
@@ -67,7 +67,7 @@
<template #col-payTotal="{ row }"> <template #col-payTotal="{ row }">
<span class="payable">{{ formatMoney(row.payTotal) }}</span> <span class="payable">{{ formatMoney(row.payTotal) }}</span>
</template> </template>
<template #toolbar="{ selection, ids }"> <!-- <template #toolbar="{ selection, ids }">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
@@ -78,7 +78,7 @@
@click="handleUpdateArrears(ids, selection)" @click="handleUpdateArrears(ids, selection)"
>更新欠费状态</el-button> >更新欠费状态</el-button>
</el-col> </el-col>
</template> </template> -->
<template #col-action="{ row }"> <template #col-action="{ row }">
<el-button link type="primary" icon="View" @click="handleView(row)">查看</el-button> <el-button link type="primary" icon="View" @click="handleView(row)">查看</el-button>
</template> </template>