feat: add order detail

This commit is contained in:
2025-10-10 17:00:41 +08:00
parent 3bd8d12d09
commit 7e64968e42
3 changed files with 34 additions and 24 deletions

View File

@@ -89,11 +89,8 @@ import option from '@/option/kiosk/order';
import optionSub from '@/option/kiosk/orderDetail';
import { mapGetters } from 'vuex';
import 'nprogress/nprogress.css';
import func from '@/utils/func';
import NProgress from 'nprogress';
import { exportBlob } from '@/api/common';
import { getToken } from '@/utils/auth';
import { downloadFile, downloadXls } from '@/utils/util';
import { $Export } from '@smallwei/avue';
export default {
data() {
@@ -309,22 +306,23 @@ export default {
});
},
handleDownload(row) {
const account = func.toStr(this.search.account);
const realName = func.toStr(this.search.realName);
this.$confirm('Confirm download of order detail assets?', 'Message', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning'
}).then(() => {
// NProgress.start();
// exportBlob(
// `/kiosk/orderDetail/export-assets?${
// this.website.tokenHeader
// }=${getToken()}&account=${account}&realName=${realName}`
// ).then(res => {
// downloadFile(res.data, `${row.id}-assets-${this.$dayjs().format('YYYY-MM-DD')}.zip`);
// NProgress.done();
// });
// 安全访问数组,避免 undefined.map()
const urlData = (row.photos || []).map(url => ({ url }));
const u = (row.stickers || []).map(url => ({ url }));
const t = (row.texts || []).map(t => ({
url: `[font:${t.font || 'normal'}] [size:${t.size || 12}] [content:${t.content || ''}]`
}));
const r = [
...urlData,
{ url: '======Stickers=====' },
...u,
{ url: '======Texts=======' },
...t
];
$Export.excel({
columns: [{ label: '======Photos======', prop: 'url' }],
data: r
});
},
rowSaveSub(row, loading, done) {
@@ -411,7 +409,7 @@ export default {
let values = {
...params,
orderId: this.orderId,
orderId: this.orderId
};
// const {} = this.querySub;
getListSub(page.currentPage, page.pageSize, Object.assign(values, this.querySub)).then(res => {