feat: add order detail

This commit is contained in:
2025-10-10 05:49:55 +08:00
parent 67c9e0c24e
commit 3bd8d12d09
4 changed files with 185 additions and 98 deletions

View File

@@ -2,15 +2,15 @@ import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/kiosk/orderDetail/list',
url: '/kiosk/orderDetail/page',
method: 'get',
params: {
...params,
current,
size,
size
}
})
}
});
};
export const getDetail = (id) => {
return request({
@@ -19,32 +19,39 @@ export const getDetail = (id) => {
params: {
id
}
})
}
});
};
export const remove = (ids) => {
return request({
url: '/kiosk/orderDetail/remove',
method: 'post',
params: {
ids,
ids
}
})
}
});
};
export const add = (row) => {
return request({
url: '/kiosk/orderDetail/submit',
method: 'post',
data: row
})
}
});
};
export const update = (row) => {
return request({
url: '/kiosk/orderDetail/submit',
method: 'post',
data: row
})
}
});
};
export const doneDetail = (row) => {
return request({
url: '/kiosk/orderDetail/done',
method: 'post',
data: row
});
};

View File

@@ -6,7 +6,7 @@ export default {
searchMenuSpan: 6,
border: true,
index: true,
addBtn: true,
addBtn: false,
delBtn: false,
editBtn: false,
viewBtn: false,
@@ -46,6 +46,7 @@ export default {
label: "Email",
prop: "userEmail",
type: "input",
overHidden: true,
},
{
label: "Amount",
@@ -71,7 +72,7 @@ export default {
hide: true,
},
{
label: "创建时间",
label: "CreateTime",
prop: "createTime",
type: "input",
addDisplay: false,
@@ -107,6 +108,7 @@ export default {
value: 'dictKey'
},
dataType: 'number',
search: true,
},
{
label: "是否已删除",

View File

@@ -1,5 +1,5 @@
export default {
height:'auto',
height: 'auto',
calcHeight: 30,
tip: false,
searchShow: true,
@@ -14,44 +14,35 @@ export default {
menuWidth: 300,
column: [
{
label: "Id",
prop: "id",
type: "input",
label: 'Id',
prop: 'id',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
hide: true
},
{
label: "TenantId",
prop: "tenantId",
type: "input",
label: 'TenantId',
prop: 'tenantId',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
hide: true
},
{
label: "oid",
prop: "orderId",
type: "input",
label: 'oid',
prop: 'orderId',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
hide: true
},
{
label: "cid",
prop: "categoryId",
type: "input",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
{
label: "CategoryType",
prop: "categoryType",
label: 'Type',
prop: 'categoryType',
type: 'radio',
dicUrl: '/blade-system/dict-biz/dictionary?code=category_type',
props: {
@@ -59,25 +50,32 @@ export default {
value: 'dictKey'
},
dataType: 'number',
hide: true
},
{
label: "Material",
prop: "material",
type: "input",
label: 'Category',
prop: 'categoryName',
type: 'input'
},
{
label: "Size",
prop: "size",
type: "input",
label: 'Material',
prop: 'material',
type: 'input',
overHidden: true
},
{
label: "Shape",
prop: "shape",
type: "input",
label: 'Size',
prop: 'size',
type: 'input'
},
{
label: "Snapshot",
prop: "snapshotLink",
label: 'Shape',
prop: 'shape',
type: 'input'
},
{
label: 'Snapshot',
prop: 'snapshotLink',
type: 'upload',
listType: 'picture-img',
dataType: 'string',
@@ -85,77 +83,110 @@ export default {
propsHttp: {
res: 'data',
url: 'link'
}
},
align: 'center',
},
{
label: "Amount",
prop: "totalAmount",
type: "number",
label: 'Photos',
prop: 'photos',
type: 'upload',
multiple: true,
listType: 'picture-card',
dataType: 'string',
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link'
},
overHidden: true,
align: 'center',
value: []
},
{
label: "创建人",
prop: "createUser",
type: "input",
label: 'Stickers',
prop: 'stickers',
type: 'upload',
multiple: true,
listType: 'picture-card',
dataType: 'string',
action: '/blade-resource/oss/endpoint/put-file',
propsHttp: {
res: 'data',
url: 'link'
},
overHidden: true,
align: 'center',
value: []
},
{
label: 'Amount',
prop: 'totalAmount',
type: 'number'
},
{
label: '创建人',
prop: 'createUser',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
hide: true
},
{
label: "创建部门",
prop: "createDept",
type: "input",
label: '创建部门',
prop: 'createDept',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
hide: true
},
{
label: "创建时间",
prop: "createTime",
type: "input",
label: '创建时间',
prop: 'createTime',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
hide: true
},
{
label: "修改人",
prop: "updateUser",
type: "input",
label: '修改人',
prop: 'updateUser',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
hide: true
},
{
label: "修改时间",
prop: "updateTime",
type: "input",
label: '修改时间',
prop: 'updateTime',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
hide: true
},
{
label: "Status",
prop: "status",
label: 'Status',
prop: 'status',
type: 'radio',
dicUrl: '/blade-system/dict-biz/dictionary?code=production_status',
props: {
label: 'dictValue',
value: 'dictKey'
},
dataType: 'number',
dataType: 'number'
},
{
label: "是否已删除",
prop: "isDeleted",
type: "input",
label: '是否已删除',
prop: 'isDeleted',
type: 'input',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
hide: true,
},
hide: true
}
]
}
};

View File

@@ -59,6 +59,17 @@
@current-change="currentChangeSub"
@size-change="sizeChangeSub"
@on-load="onLoadSub">
<template #menu="{ row }">
<el-button type="text"
icon="el-icon-download"
@click.stop="handleDownload(row)">Download
</el-button>
<el-button type="text"
icon="el-icon-finished"
v-if="row.status === 1"
@click.stop="handleDone(row)">Done
</el-button>
</template>
</avue-crud>
</basic-container>
</el-drawer>
@@ -72,12 +83,17 @@ import {
getDetail as getDetailSub,
add as addSub,
update as updateSub,
remove as removeSub
remove as removeSub, doneDetail
} from '@/api/kiosk/orderDetail';
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';
export default {
data() {
@@ -98,7 +114,7 @@ export default {
direction: 'ttb',
orderId: 0,
serialNumber: '',
orderName: 'KioskOrder:',
orderName: 'Order',
formSub: {},
querySub: {},
loadingSub: true,
@@ -260,10 +276,10 @@ export default {
},
handleAccept(row) {
this.$confirm('Confirmation for Payment?', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning'
})
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning'
})
.then(() => {
return accept(row);
})
@@ -275,6 +291,42 @@ export default {
});
});
},
handleDone(row) {
this.$confirm('Mark as Done?', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning'
})
.then(() => {
return doneDetail(row);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: 'success',
message: 'Success!'
});
});
},
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();
// });
});
},
rowSaveSub(row, loading, done) {
row = {
...row,
@@ -358,16 +410,11 @@ export default {
this.loadingSub = true;
let values = {
orderId: this.orderId
...params,
orderId: this.orderId,
};
const {} = this.querySub;
values = {
...values
};
getListSub(page.currentPage, page.pageSize, values).then(res => {
// const {} = this.querySub;
getListSub(page.currentPage, page.pageSize, Object.assign(values, this.querySub)).then(res => {
const data = res.data.data;
this.pageSub.total = data.total;
this.dataSub = data.records;