| | |
| | | style="width: 100%" |
| | | v-model="form.applyTime" |
| | | type="date" format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="申请日期" |
| | | :disabled="true" |
| | | > |
| | |
| | | import OrgSelecter from "@/views/project/components/orgselect"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import { moneySum, moneyAdd, moneySub, moneyRound } from "@/utils/money"; |
| | | import { checkFileName, checkDetails } from "@/utils/fileNameCheck"; |
| | | import CustomImageViewer from "@/components/CustomImageViewer"; |
| | | |
| | | export default { |
| | |
| | | }, |
| | | /** 提交按钮 */ |
| | | submitForm: debounce(function() { |
| | | // 2026-10-15:保存前附件文件名规范校验(仅新增单据;老单据的历史附件由后端按"只校验本次变更"放行) |
| | | if (!this.checkDetailFileNames()) { |
| | | return; |
| | | } |
| | | |
| | | if (!this.randomnumber) { |
| | | this.randomnumber = this.generateRandomString(9); |
| | | this.form.randomnumber = this.randomnumber; |
| | |
| | | }, |
| | | // 接受提醒立刻保存 |
| | | Savenow() { |
| | | // 2026-10-15:保存前附件文件名规范校验(仅新增单据;老单据的历史附件由后端按"只校验本次变更"放行) |
| | | if (!this.checkDetailFileNames()) { |
| | | return; |
| | | } |
| | | |
| | | if (!this.randomnumber) { |
| | | this.randomnumber = this.generateRandomString(9); |
| | | this.form.randomnumber = this.randomnumber; |
| | |
| | | this.Networkheader = string.slice(0, index + 4); // 截取8032及其前部字符 |
| | | } |
| | | }, |
| | | /** |
| | | * 2026-10-15:上传时校验附件文件名(业务要求:不合格立即提示且不加入列表)。 |
| | | * 规则与后端 AttachmentNameValidator 同口径:必须含中文 / 去掉扩展名后主干 ≤20 字 / |
| | | * 不含空格及 / \ : * ? " < > | # % 等特殊字符。 |
| | | */ |
| | | checkUploadFileName(file) { |
| | | const raw = file && file.raw ? file.raw.name : file && file.name; |
| | | const r = checkFileName(raw); |
| | | if (!r.ok) { |
| | | this.$modal.msgError(r.msg); |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | |
| | | /** |
| | | * 2026-10-15:保存前校验整单明细附件文件名(含同一行内重名)。 |
| | | * 口径(业务确认):只校验"本次变更"的附件——老单据里已存在的不合规附件名不能把保存卡死 |
| | | * (否则老单据改一个金额都存不进去)。后端按 id 读旧记录放行历史附件;前端拿不到"哪些是历史" |
| | | * 的权威信息,因此**仅新增单据**做保存前拦截,编辑老单据时新增的不合规附件由后端二次校验拦下。 |
| | | */ |
| | | checkDetailFileNames() { |
| | | if (this.form && this.form.id) { |
| | | return true; |
| | | } |
| | | const c = checkDetails(this.rbDetails); |
| | | if (!c.ok) { |
| | | this.$modal.msgError(c.msg); |
| | | return false; |
| | | } |
| | | return true; |
| | | }, |
| | | |
| | | uploadSccess(response, file, fileList) { |
| | | if (!this.checkUploadFileName(file)) { |
| | | return; |
| | | } |
| | | this.rbDetails; |
| | | const config = { |
| | | headers: { Authorization: "Bearer " + this.ICDtoken } |