| | |
| | | } |
| | | }); |
| | | that.tableData = tableData; |
| | | |
| | | that.GetImageFileByGid(); |
| | | //if (that.tableData.length === 0) { |
| | | // that.isShowTable = true; |
| | | //} |
| | |
| | | |
| | | async afterRead(file) { |
| | | try { |
| | | //alert(APIURL_IMAGE); |
| | | // 1. 显示上传中状态 |
| | | file.status = 'uploading'; |
| | | file.message = '上传中...'; |
| | |
| | | // 8. 强制更新视图(Vant 3+ 可能需要) |
| | | this.$nextTick(); |
| | | } |
| | | } |
| | | }, |
| | | //获取图片信息 |
| | | GetImageFileByGid() { |
| | | const that = this; |
| | | that.AxiosHttp("post", 'Llj/getImage', { |
| | | gid: that.formData.guid, |
| | | Remarks: that.remarks |
| | | }, true, 0).then(res1 => { |
| | | if (res1.status === 0) { |
| | | // 关键转换:将后端数据转换为 van-uploader 需要的格式 |
| | | that.fileList = res1.data.tbBillList.map(item => ({ |
| | | url: `${APIURL_IMAGE}/${item.urlPath}`, // 拼接完整访问路径 |
| | | status: 'done', // 标记为已上传成功 |
| | | name: item.fileTitle, // 可选显示文件名 |
| | | message: '已上传', // 可选状态文字 |
| | | // 保留原始数据(按需) |
| | | id: item.guid |
| | | })); |
| | | } else { |
| | | that.$toast.fail(res1.rtnMsg); |
| | | } |
| | | }).catch(error => { |
| | | that.$toast.fail("网络错误,请重试!"); |
| | | }); |
| | | }, |
| | | } |
| | | }) |