feat(web): 企业表单提供授权委托书模板下载

用户手上通常没有空白委托书,原先只有上传入口,等于让人无从下手。

- public/files/ 放置空白模板,由 Nuxt 静态下发(固定空白件,无租户/订单维度,
  不进后端文件服务器);H5 端同一份另存于 src/static/files/
- href 在构建期就百分号编码:文件名是中文,直接写进 href 时 download 给出的
  中文名与 URL 之间会因编码不一致而在部分浏览器失效
This commit is contained in:
2026-10-09 10:20:30 +08:00
parent 0f1a6144c0
commit 9d0599ec90
2 changed files with 29 additions and 0 deletions
+29
View File
@@ -106,6 +106,20 @@
<h3 class="border-l-4 border-blue-600 pl-2 pt-2 text-sm font-semibold text-blue-600"> <h3 class="border-l-4 border-blue-600 pl-2 pt-2 text-sm font-semibold text-blue-600">
证件上传(单张不超过 5M) 证件上传(单张不超过 5M)
</h3> </h3>
<!-- 授权委托书模板:与证件同区块展示,用户到「授权委托书」那一格前先看到下载入口 -->
<div class="flex flex-wrap items-center gap-x-2 gap-y-1 rounded-md bg-blue-50 px-3 py-2 text-xs text-gray-600">
<span>还没有授权委托书?先下载模板,填写并加盖公章后再上传:</span>
<a
:href="AUTHORIZE_TEMPLATE.url"
:download="AUTHORIZE_TEMPLATE.filename"
class="font-medium text-blue-600 hover:underline"
>
{{ AUTHORIZE_TEMPLATE.filename }}
</a>
<span class="text-gray-400">(Word 文档)</span>
</div>
<div class="flex flex-wrap gap-6"> <div class="flex flex-wrap gap-6">
<div v-for="m in materials" :key="m.materialType" class="w-40 text-center"> <div v-for="m in materials" :key="m.materialType" class="w-40 text-center">
<div class="mb-2 text-xs text-gray-600">{{ m.label }}</div> <div class="mb-2 text-xs text-gray-600">{{ m.label }}</div>
@@ -180,6 +194,21 @@ const INVOICE_TYPES = [
/** 基本户账号:与后端 validateRegister 一致,仅做长度与字符校验(纯数字 8-32 位) */ /** 基本户账号:与后端 validateRegister 一致,仅做长度与字符校验(纯数字 8-32 位) */
const BANK_ACCOUNT_NO_RE = /^[0-9]{8,32}$/ const BANK_ACCOUNT_NO_RE = /^[0-9]{8,32}$/
/**
* 授权委托书模板(供用户下载后填写盖章再上传)。
*
* 文件是**官网自身的静态资源**(`public/files/`),不走后端文件服务器:它是固定的空白模板,
* 没有按租户/按订单区分的内容,放进静态目录由 Nuxt 直接下发即可;H5 端同一份文件另存于
* `hjc-h5/public/files/`(两个前端各自独立部署,不共享 public 目录)。
*
* 路径**在构建期就百分号编码好**:文件名是中文,直接写进 `href` 虽然浏览器多能容错,
* 但 `download` 属性给出的中文文件名与 URL 之间会因编码不一致而在部分浏览器上失效。
*/
const AUTHORIZE_TEMPLATE = {
url: '/files/%E6%8E%88%E6%9D%83%E5%A7%94%E6%89%98%E4%B9%A6%E6%A8%A1%E6%9D%BF.docx',
filename: '授权委托书模板.docx'
}
async function onPick(m: any, e: Event) { async function onPick(m: any, e: Event) {
const input = e.target as HTMLInputElement const input = e.target as HTMLInputElement
const file = input.files?.[0] const file = input.files?.[0]
Binary file not shown.