Merge branch 'prod' of https://newgitea.sxczgkj.cn/czg_team/cashier-web into prod
This commit is contained in:
@@ -14,14 +14,22 @@ const contentConfig: IContentConfig = {
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 20, 30, 50],
|
||||
},
|
||||
indexAction: function (params) {
|
||||
async indexAction(params) {
|
||||
console.log(params);
|
||||
if (params.createAt) {
|
||||
params.startTime = params.createAt[0];
|
||||
params.endTime = params.createAt[1];
|
||||
delete params.createAt;
|
||||
}
|
||||
return OrderApi.getList(params);
|
||||
|
||||
const res = await OrderApi.getList(params)
|
||||
console.log('OrderApi.getList', res);
|
||||
|
||||
res.records.map(item => {
|
||||
item.payLoading = false
|
||||
item.printStatus = JSON.parse(item.printStatus || '[]')
|
||||
})
|
||||
return res;
|
||||
},
|
||||
indexActionData: {},
|
||||
// deleteAction: OrderApi.delete,
|
||||
@@ -93,7 +101,14 @@ const contentConfig: IContentConfig = {
|
||||
templet: "custom",
|
||||
slotName: "options",
|
||||
},
|
||||
|
||||
{
|
||||
label: "打印状态",
|
||||
align: "center",
|
||||
prop: "printStatus",
|
||||
width: 120,
|
||||
templet: "custom",
|
||||
slotName: "printStatus",
|
||||
},
|
||||
{
|
||||
label: "状态",
|
||||
align: "center",
|
||||
@@ -116,7 +131,7 @@ const contentConfig: IContentConfig = {
|
||||
label: "操作",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 150,
|
||||
width: 180,
|
||||
templet: "custom",
|
||||
slotName: "operate",
|
||||
},
|
||||
|
||||
@@ -51,6 +51,13 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 打印状态 -->
|
||||
<template #printStatus="scope">
|
||||
<span v-if="scope.row.printStatus.length > 0" style="color: var(--el-color-danger)">
|
||||
打印失败({{scope.row.printStatus.map(item => item.name).join('、')}})
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #options="scope">
|
||||
{{ returnOptionsLabel(scope.prop, scope.row[scope.prop]) }}
|
||||
</template>
|
||||
@@ -65,6 +72,7 @@
|
||||
</template>
|
||||
<template #operate="scope">
|
||||
<div>
|
||||
<el-button link @click="printOrderHandle(scope.row)">打印</el-button>
|
||||
<el-button link @click="showdetail(scope.row)">详情</el-button>
|
||||
<el-button v-if="scope.row.status == 'done'" link>开票</el-button>
|
||||
<el-button v-if="scope.row.status == 'unpaid'" type="primary" @click="toPayOrder(scope.row)">
|
||||
@@ -148,6 +156,19 @@ onMounted(() => {
|
||||
}
|
||||
});
|
||||
|
||||
// 打印订单
|
||||
async function printOrderHandle(order: getListResponse) {
|
||||
try {
|
||||
await orderApi.printOrder({
|
||||
id: order.id,
|
||||
type: 0
|
||||
});
|
||||
ElMessage.success("打印成功");
|
||||
} catch (error) {
|
||||
ElMessage.error("打印失败,请稍后重试");
|
||||
}
|
||||
}
|
||||
|
||||
// 新增
|
||||
async function handleAddClick() {
|
||||
addModalRef.value?.setModalVisible();
|
||||
|
||||
Reference in New Issue
Block a user