feat: add order detail
This commit is contained in:
@@ -11,6 +11,10 @@ export default {
|
||||
delBtn: false,
|
||||
editBtn: false,
|
||||
selection: true,
|
||||
gridBtn: false,
|
||||
refreshBtn: false,
|
||||
columnBtn: false,
|
||||
excelBtn: true,
|
||||
menuWidth: 300,
|
||||
column: [
|
||||
{
|
||||
@@ -98,9 +102,15 @@ export default {
|
||||
res: 'data',
|
||||
url: 'link'
|
||||
},
|
||||
overHidden: true,
|
||||
align: 'center',
|
||||
value: []
|
||||
value: [],
|
||||
overHidden: true,
|
||||
},
|
||||
{
|
||||
label: 'Texts',
|
||||
prop: 'texts',
|
||||
type: 'input',
|
||||
hide: true,
|
||||
},
|
||||
{
|
||||
label: 'Stickers',
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user