补齐店务端改密导出员工订单

This commit is contained in:
2026-07-16 12:00:06 +08:00
parent 08d24853a6
commit a9a23bfa6d
28 changed files with 768 additions and 33 deletions
+28 -2
View File
@@ -2,6 +2,7 @@ const dateUtil = require('../../utils/date')
const planningApi = require('../../api/planning')
const customersApi = require('../../api/customers')
const employeesApi = require('../../api/employees')
const shopApi = require('../../api/shop')
const PREVIEW_SIZE = 10
@@ -40,7 +41,8 @@ Page({
previewColumns: [],
previewRows: [],
previewLoading: false,
previewError: ''
previewError: '',
exporting: false
},
onLoad() {
@@ -131,7 +133,31 @@ Page({
})
},
exportExcel() { wx.showToast({ title: '导出任务已创建', icon: 'none' }) },
async exportExcel() {
if (this.data.exporting) {
return
}
this.setData({ exporting: true })
try {
const filePath = await shopApi.downloadExport({
type: this.data.type,
startDate: this.data.startDate,
endDate: this.data.endDate
})
wx.openDocument({
filePath,
fileType: 'xlsx',
showMenu: true,
fail(error) {
wx.showToast({ title: error.errMsg || 'Excel 打开失败', icon: 'none' })
}
})
} catch (error) {
wx.showToast({ title: error.message || 'Excel 导出失败', icon: 'none' })
} finally {
this.setData({ exporting: false })
}
},
back() { wx.navigateBack() }
})