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) => { export const getList = (current, size, params) => {
return request({ return request({
url: '/kiosk/orderDetail/list', url: '/kiosk/orderDetail/page',
method: 'get', method: 'get',
params: { params: {
...params, ...params,
current, current,
size, size
} }
}) });
} };
export const getDetail = (id) => { export const getDetail = (id) => {
return request({ return request({
@@ -19,32 +19,39 @@ export const getDetail = (id) => {
params: { params: {
id id
} }
}) });
} };
export const remove = (ids) => { export const remove = (ids) => {
return request({ return request({
url: '/kiosk/orderDetail/remove', url: '/kiosk/orderDetail/remove',
method: 'post', method: 'post',
params: { params: {
ids, ids
} }
}) });
} };
export const add = (row) => { export const add = (row) => {
return request({ return request({
url: '/kiosk/orderDetail/submit', url: '/kiosk/orderDetail/submit',
method: 'post', method: 'post',
data: row data: row
}) });
} };
export const update = (row) => { export const update = (row) => {
return request({ return request({
url: '/kiosk/orderDetail/submit', url: '/kiosk/orderDetail/submit',
method: 'post', method: 'post',
data: row 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, searchMenuSpan: 6,
border: true, border: true,
index: true, index: true,
addBtn: true, addBtn: false,
delBtn: false, delBtn: false,
editBtn: false, editBtn: false,
viewBtn: false, viewBtn: false,
@@ -46,6 +46,7 @@ export default {
label: "Email", label: "Email",
prop: "userEmail", prop: "userEmail",
type: "input", type: "input",
overHidden: true,
}, },
{ {
label: "Amount", label: "Amount",
@@ -71,7 +72,7 @@ export default {
hide: true, hide: true,
}, },
{ {
label: "创建时间", label: "CreateTime",
prop: "createTime", prop: "createTime",
type: "input", type: "input",
addDisplay: false, addDisplay: false,
@@ -107,6 +108,7 @@ export default {
value: 'dictKey' value: 'dictKey'
}, },
dataType: 'number', dataType: 'number',
search: true,
}, },
{ {
label: "是否已删除", label: "是否已删除",

View File

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

View File

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