|
|
@@ -228,18 +228,22 @@ function handleUpload(file, data, options) {
|
|
|
let queryParams = Object.entries(params).map(([key, value]) => {
|
|
|
return `${key}=${encodeURIComponent(value)}`;
|
|
|
}).join('&');
|
|
|
-
|
|
|
+
|
|
|
+ uni.showLoading({
|
|
|
+ title: '上传中...'
|
|
|
+ });
|
|
|
uni.uploadFile({
|
|
|
url: `${baseUrl}/sys/wx/userHub/print?${queryParams}`,
|
|
|
filePath: file.url,
|
|
|
name: 'file', // 这里根据后端需要的字段来定义
|
|
|
fileType: options.fileType,
|
|
|
formData, // 如果需要额外的 formData
|
|
|
- success: async (res: any) => {
|
|
|
- if (res.code === 0) {
|
|
|
+ success: (res: any) => {
|
|
|
+ if (res.statusCode === 200 && JSON.parse(res.data).code === 0) {
|
|
|
message.confirm("打印成功, 是否继续打印?").then(() => {
|
|
|
hasFile.value = false
|
|
|
fileList.value = []
|
|
|
+ printerOptions.value = []
|
|
|
formData.value = {
|
|
|
printer: ""
|
|
|
}
|
|
|
@@ -259,6 +263,9 @@ function handleUpload(file, data, options) {
|
|
|
hasFile.value = false
|
|
|
fileList.value = []
|
|
|
},
|
|
|
+ complete: () => {
|
|
|
+ uni.hideLoading()
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
|