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

@@ -18,6 +18,8 @@
<link rel='stylesheet' href='/iconfont/common/iconfont.css'> <link rel='stylesheet' href='/iconfont/common/iconfont.css'>
<link rel='stylesheet' href='/css/loading.css'> <link rel='stylesheet' href='/css/loading.css'>
<link rel='stylesheet' href='/css/saber.css'> <link rel='stylesheet' href='/css/saber.css'>
<script src="https://cdn.staticfile.net/FileSaver.js/2014-11-29/FileSaver.min.js"></script>
<script src="https://cdn.staticfile.net/xlsx/0.18.2/xlsx.full.min.js"></script>
<title>MemoryBlock Management System</title> <title>MemoryBlock Management System</title>
</head> </head>

View File

@@ -11,6 +11,10 @@ export default {
delBtn: false, delBtn: false,
editBtn: false, editBtn: false,
selection: true, selection: true,
gridBtn: false,
refreshBtn: false,
columnBtn: false,
excelBtn: true,
menuWidth: 300, menuWidth: 300,
column: [ column: [
{ {
@@ -98,9 +102,15 @@ export default {
res: 'data', res: 'data',
url: 'link' url: 'link'
}, },
overHidden: true,
align: 'center', align: 'center',
value: [] value: [],
overHidden: true,
},
{
label: 'Texts',
prop: 'texts',
type: 'input',
hide: true,
}, },
{ {
label: 'Stickers', label: 'Stickers',

View File

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