diff --git a/bms-front/public/templates/product/product-import-all-template.xlsx b/bms-front/public/templates/product/product-import-all-template.xlsx
new file mode 100644
index 00000000..218db698
Binary files /dev/null and b/bms-front/public/templates/product/product-import-all-template.xlsx differ
diff --git a/bms-front/public/templates/product/product-import-country-template.xlsx b/bms-front/public/templates/product/product-import-country-template.xlsx
new file mode 100644
index 00000000..92d072ad
Binary files /dev/null and b/bms-front/public/templates/product/product-import-country-template.xlsx differ
diff --git a/bms-front/src/components/ExcelImportDialog/index.vue b/bms-front/src/components/ExcelImportDialog/index.vue
index 6fd92f47..0f92c161 100644
--- a/bms-front/src/components/ExcelImportDialog/index.vue
+++ b/bms-front/src/components/ExcelImportDialog/index.vue
@@ -62,7 +62,7 @@
仅允许上传 {{ accept }} 格式文件,文件大小不超过 {{ fileSizeMb }} MB。
- 下载模板
+ 下载模板
@@ -97,12 +97,18 @@ const props = defineProps({
type: String,
required: true
},
- // 模板下载接口地址,不传则不显示下载模板链接
+ // 模板下载接口地址(后端接口,走 proxy.download),不传则不显示下载模板链接
templateAction: {
type: String,
default: ''
},
- // 模板文件名前缀
+ // 静态模板文件地址(public 目录下相对路径,如 /templates/product/xxx.xlsx),
+ // 与 templateAction 二选一,静态地址优先
+ templateUrl: {
+ type: String,
+ default: ''
+ },
+ // 模板下载文件名(不含扩展名;静态下载时为保存文件名,接口下载时为文件名前缀)
templateFileName: {
type: String,
default: 'template'
@@ -181,7 +187,7 @@ const uploadUrl = computed(() => {
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 调用)
function open() {
@@ -205,8 +211,17 @@ function handleClose() {
uploadRef.value?.clearFiles()
}
-// 下载模板
+// 下载模板:静态文件直接 ,接口走 proxy.download
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`)
}
diff --git a/bms-front/src/views/monitor/eslog/index.vue b/bms-front/src/views/monitor/eslog/index.vue
index 4540000a..c2fb303a 100644
--- a/bms-front/src/views/monitor/eslog/index.vue
+++ b/bms-front/src/views/monitor/eslog/index.vue
@@ -37,6 +37,12 @@
{{ creditAmountLabel(detail) }}
+
+ {{ arrearsScopeLabel(detail) }}
+
+
+ {{ arrearsAmountLabel(detail) }}
+
{{ detail.errorMessage }}
@@ -73,7 +79,8 @@ const drawerTitle = ref('ES日志详情')
const typeOptions = [
{ label: '计费', value: 'BILL' },
{ label: '试算', value: 'QUOTE' },
- { label: '扣减额度', value: 'CREDIT' }
+ { label: '扣减额度', value: 'CREDIT' },
+ { label: '欠费清除', value: 'ARREARS' }
]
const statusOptions = [
@@ -125,10 +132,24 @@ function creditAmountLabel(detail) {
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) {
if (type === 'BILL') return 'success'
if (type === 'QUOTE') return 'warning'
if (type === 'CREDIT') return 'danger'
+ if (type === 'ARREARS') return 'primary'
return 'info'
}
diff --git a/bms-front/src/views/price/basic/product/index.vue b/bms-front/src/views/price/basic/product/index.vue
index be6ef634..e58b9bb1 100644
--- a/bms-front/src/views/price/basic/product/index.vue
+++ b/bms-front/src/views/price/basic/product/index.vue
@@ -5,7 +5,7 @@
:closable="false"
show-icon
class="mb16"
- title="多国家价表用「导入 Excel」。单国专线成本价用「按国家导入」:先选目的国家,目录里的产品都记到该国。相同产品代码+生效日期不覆盖主数据。"
+ title="多国家价表用「全部导入」。单国专线成本价用「按国家导入」:先选目的国家,目录里的产品都记到该国。相同产品代码+生效日期不覆盖主数据。两种导入均可在弹窗内下载对应模板。"
/>
新建产品
- 导入 Excel
-
-
- 按国家导入
+
+
+ 导入 Excel
+
+
+
+ 全部导入(多国家价表)
+ 按国家导入(单国专线成本价)
+
+
+
@@ -51,6 +58,9 @@
action="/price/product/importData"
width="560px"
:show-update-support="false"
+ template-url="/templates/product/product-import-all-template.xlsx"
+ template-file-name="产品多国家价表导入模板"
+ :import-desc="allImportDesc"
@success="() => tableRef.refresh()"
/>
tableRef.refresh()"
>
@@ -102,9 +114,14 @@ const countryImportRef = ref()
const importCountryCode = ref('')
const regionOptions = ref([])
const countryImportQuery = computed(() => ({ countryCode: importCountryCode.value }))
+const allImportDesc = [
+ '适用多国家价表(B2C 小包价表等),按目录 sheet 匹配国家导入。',
+ '请在弹窗底部下载模板,按模板格式整理后上传。相同产品代码+生效日期不覆盖主数据。'
+]
const countryImportDesc = [
'选择目的国家后上传专线成本价表,目录中的产品都会记到该国家。',
- '邮编、赔偿标准等 sheet 不导入。相同产品代码+生效日期不覆盖主数据,重量段按生效日写入。'
+ '邮编、赔偿标准等 sheet 不导入。相同产品代码+生效日期不覆盖主数据,重量段按生效日写入。',
+ '可在弹窗底部下载模板,按模板格式整理后上传。'
]
const columns = [
@@ -152,6 +169,14 @@ function handleUpdate(row) {
formRef.value.open(row)
}
+function handleImportCommand(command) {
+ if (command === 'country') {
+ handleCountryImport()
+ return
+ }
+ handleImport()
+}
+
function handleImport() {
importRef.value.open()
}
diff --git a/bms-front/src/views/price/billing/bill.vue b/bms-front/src/views/price/billing/bill.vue
index bb0a280e..c1f6ac74 100644
--- a/bms-front/src/views/price/billing/bill.vue
+++ b/bms-front/src/views/price/billing/bill.vue
@@ -67,7 +67,7 @@
{{ formatMoney(row.payTotal) }}
-
+
查看