| | |
| | | |
| | | addorupdateFund(this.form).then(response => { |
| | | if (response.code === 200) { |
| | | // 2026-11-23:后端剔除了无效(blob:/data:)附件地址时给出提示 |
| | | if (response.attachWarn) { |
| | | this.$modal.msgWarning(response.attachWarn); |
| | | } |
| | | this.$modal.msgSuccess("申请单保存成功!"); |
| | | // 非提醒状态下执行审批解决异步调用延迟问题 |
| | | if (!this.Savereminder) { |
| | |
| | | }, |
| | | |
| | | remove(file, fileList) { |
| | | const rbDetails = [...this.rbDetails]; |
| | | // 2026-11-23:不再用"预览用临时列表"(blob: URL) 整表覆盖附件字段, |
| | | // 改为按文件名精确删除,避免 blob: 地址被保存进 annexfiles / invoicefiles。 |
| | | const name = |
| | | (file && (file.name || (file.raw && file.raw.name))) || ""; |
| | | if (!this.rbDetails[this.atpresent]) { |
| | | return; |
| | | } |
| | | if (this.activeName == "common") { |
| | | this.fileListto.splice(this.fileListto.indexOf(file), 1); |
| | | rbDetails[this.atpresent].annexfilesList = this.fileListto; |
| | | this.spliceByName(this.fileListto, name); |
| | | this.spliceByName(this.rbDetails[this.atpresent].annexfilesList, name); |
| | | } else { |
| | | this.invoicefileListto.splice(this.invoicefileListto.indexOf(file), 1); |
| | | rbDetails[this.atpresent].invoicefilesList = this.invoicefileListto; |
| | | this.spliceByName(this.invoicefileListto, name); |
| | | this.spliceByName( |
| | | this.rbDetails[this.atpresent].invoicefilesList, |
| | | name |
| | | ); |
| | | } |
| | | }, |
| | | |
| | | /** 按文件名从列表中删除一项(找不到则不做任何事) */ |
| | | spliceByName(list, name) { |
| | | if (!list || !name) { |
| | | return; |
| | | } |
| | | const idx = list.findIndex(item => item && item.name === name); |
| | | if (idx > -1) { |
| | | list.splice(idx, 1); |
| | | } |
| | | }, |
| | | |
| | |
| | | * 规则与后端 AttachmentNameValidator 同口径:不强制含中文 / 去掉扩展名后主干 ≤20 字 / |
| | | * 不含空格及 / \ : * ? " < > | # % 等特殊字符。 |
| | | */ |
| | | /** |
| | | * 2026-11-17:附件名是否必须含中文 |
| | | * 专家劳务费(1)、伦理专家费(2) 不要求;医学成本(3)、办公费用(4) 等其他类型必须含中文 |
| | | * (医院报销单审批要求:附件名要反映发票主要内容) |
| | | */ |
| | | requireChineseName() { |
| | | return !(this.businessType == "1" || this.businessType == "2"); |
| | | }, |
| | | checkUploadFileName(file) { |
| | | const raw = file && file.raw ? file.raw.name : file && file.name; |
| | | const r = checkFileName(raw); |
| | | const r = checkFileName(raw, { requireChinese: this.requireChineseName() }); |
| | | if (!r.ok) { |
| | | this.$modal.msgError(r.msg); |
| | | return false; |
| | |
| | | if (this.form && this.form.id) { |
| | | return true; |
| | | } |
| | | const c = checkDetails(this.rbDetails); |
| | | const c = checkDetails(this.rbDetails, { |
| | | requireChinese: this.requireChineseName() |
| | | }); |
| | | if (!c.ok) { |
| | | this.$modal.msgError(c.msg); |
| | | return false; |
| | |
| | | type: /\.pdf$/i.test(file.name) ? "pdf" : "image" |
| | | }; |
| | | this.pdfimgsrcList.push(localUrl); |
| | | // 2026-11-23:url 存服务端路径(权威值),previewUrl 只用于本地预览 |
| | | this.fileListto.push({ |
| | | name: file.name, |
| | | url: localUrl |
| | | url: response.fileName, |
| | | previewUrl: localUrl |
| | | }); |
| | | |
| | | this.$modal.msgSuccess(response.msg); |
| | |
| | | type: /\.pdf$/i.test(file.name) ? "pdf" : "image" |
| | | }; |
| | | this.invoicepdfimgsrcList.push(localUrl); |
| | | // 2026-11-23:url 存服务端路径(权威值),previewUrl 只用于本地预览 |
| | | this.invoicefileListto.push({ |
| | | name: file.name, |
| | | url: localUrl |
| | | url: response.fileName, |
| | | previewUrl: localUrl |
| | | }); |
| | | |
| | | this.$modal.msgSuccess(response.msg); |
| | |
| | | .then(blob => { |
| | | return { |
| | | name: value.name, |
| | | url: URL.createObjectURL(blob) |
| | | // 2026-11-23:权威地址仍是服务端路径,blob 只放 previewUrl |
| | | url: value.url, |
| | | previewUrl: URL.createObjectURL(blob) |
| | | }; |
| | | }) |
| | | .catch(error => { |
| | |
| | | |
| | | Promise.all(fetchPromises).then(fileListto => { |
| | | this.fileListto = fileListto.filter(item => item !== null); |
| | | this.pdfimg = this.fileListto[0].url; |
| | | this.pdfimg = |
| | | this.fileListto.length > 0 ? this.fileListto[0].previewUrl : ""; |
| | | console.log(this.pdfimg, "pdfimg"); |
| | | this.pdfimgsrcList = this.fileListto.map(item => item.url); |
| | | this.pdfimgsrcList = this.fileListto.map(item => item.previewUrl); |
| | | }); |
| | | |
| | | this.previewpdf = true; |
| | |
| | | .then(blob => { |
| | | return { |
| | | name: value.name, |
| | | url: URL.createObjectURL(blob) |
| | | // 2026-11-23:权威地址仍是服务端路径,blob 只放 previewUrl |
| | | url: value.url, |
| | | previewUrl: URL.createObjectURL(blob) |
| | | }; |
| | | }) |
| | | .catch(error => { |
| | |
| | | this.invoicefileListto = invoicefileListto.filter( |
| | | item => item !== null |
| | | ); |
| | | this.invoicepdfimg = this.invoicefileListto[0].url; |
| | | this.invoicepdfimg = |
| | | this.invoicefileListto.length > 0 |
| | | ? this.invoicefileListto[0].previewUrl |
| | | : ""; |
| | | console.log(this.invoicepdfimg, "invoicepdfimg"); |
| | | this.invoicepdfimgsrcList = this.invoicefileListto.map( |
| | | item => item.url |
| | | item => item.previewUrl |
| | | ); |
| | | }); |
| | | |
| | |
| | | downFile(item) { |
| | | const source = |
| | | this.activeName == "common" ? this.fileListto : this.invoicefileListto; |
| | | let list = (source || []).map(f => ({ name: f.name, url: f.url })); |
| | | let index = list.findIndex(f => f.url === item.url); |
| | | if (index < 0 && item && item.url) { |
| | | list = [{ name: item.name, url: item.url }]; |
| | | // 2026-11-23:预览优先用本地 blob(previewUrl),没有则退回服务端路径 |
| | | let list = (source || []).map(f => ({ |
| | | name: f.name, |
| | | url: f.previewUrl || f.url |
| | | })); |
| | | const target = item && (item.previewUrl || item.url); |
| | | let index = list.findIndex(f => f.url === target); |
| | | if (index < 0 && target) { |
| | | list = [{ name: item.name, url: target }]; |
| | | index = 0; |
| | | } |
| | | this.$previewFile(list, index > -1 ? index : 0); |
| | |
| | | console.log(row); |
| | | let indexvalue = ""; |
| | | if (this.activeName == "common") { |
| | | const indexlist = this.getIndexInArray(this.pdfimgsrcList, row.url); |
| | | const indexlist = this.getIndexInArray( |
| | | this.pdfimgsrcList, |
| | | row.previewUrl || row.url |
| | | ); |
| | | this.pdfimgsrcList.splice(indexlist, 1); |
| | | const index = this.getIndexInArray(this.fileListto, row); |
| | | this.fileListto.splice(index, 1); |
| | |
| | | item => item.name == row.name |
| | | ); |
| | | console.log(indexvalue, "删除索引"); |
| | | this.rbDetails[this.atpresent].annexfilesList.splice(indexvalue, 1); |
| | | if (indexvalue > -1) { |
| | | this.rbDetails[this.atpresent].annexfilesList.splice(indexvalue, 1); |
| | | } |
| | | } else { |
| | | const indexlist = this.getIndexInArray( |
| | | this.invoicepdfimgsrcList, |
| | | row.url |
| | | row.previewUrl || row.url |
| | | ); |
| | | this.invoicepdfimgsrcList.splice(indexlist, 1); |
| | | const index = this.getIndexInArray(this.invoicefileListto, row); |
| | |
| | | item => item.name == row.name |
| | | ); |
| | | console.log(indexvalue, "删除索引"); |
| | | this.rbDetails[this.atpresent].invoicefilesList.splice(indexvalue, 1); |
| | | if (indexvalue > -1) { |
| | | this.rbDetails[this.atpresent].invoicefilesList.splice(indexvalue, 1); |
| | | } |
| | | } |
| | | }, |
| | | // 点击上移 |
| | |
| | | // console.log(this.rbDetails[this.atpresent].invoicefilesList,'invoicefilesList'); |
| | | }, |
| | | Downloadfile(row) { |
| | | window.location.href = row.url; |
| | | // 2026-11-23:优先用本地 blob 下载;没有则拼服务端地址 |
| | | const target = (row && (row.previewUrl || row.url)) || ""; |
| | | if (!target) { |
| | | return; |
| | | } |
| | | if (/^(blob:|data:|https?:)/i.test(target)) { |
| | | window.location.href = target; |
| | | } else { |
| | | window.location.href = |
| | | this.Networkheader + process.env.VUE_APP_BASE_API + target; |
| | | } |
| | | }, |
| | | |
| | | //专家/医疗机构/费用报销机构选择 |