|
@@ -7,15 +7,18 @@ import type { OrdersQueryParams } from '#/api/orders';
|
|
|
import { h, onMounted, ref } from 'vue';
|
|
import { h, onMounted, ref } from 'vue';
|
|
|
|
|
|
|
|
import { Page, useVbenModal } from '@vben/common-ui';
|
|
import { Page, useVbenModal } from '@vben/common-ui';
|
|
|
-import { MdiDelete, MdiDetail } from '@vben/icons';
|
|
|
|
|
|
|
+import { MdiCheckboxMultipleMarked, MdiDetail } from '@vben/icons';
|
|
|
|
|
|
|
|
-import { ElMessage, ElMessageBox, ElTag } from 'element-plus';
|
|
|
|
|
|
|
+// import { ElMessage, ElMessageBox, ElTag } from 'element-plus';
|
|
|
|
|
+import { ElTag } from 'element-plus';
|
|
|
|
|
|
|
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
|
-import { deleteOrdersApi, getOrdersListApi } from '#/api/orders';
|
|
|
|
|
|
|
+// import { deleteOrdersApi, getOrdersListApi } from '#/api/orders';
|
|
|
|
|
+import { getOrdersListApi } from '#/api/orders';
|
|
|
import { getCustomerListApi } from '#/api/user';
|
|
import { getCustomerListApi } from '#/api/user';
|
|
|
import { $t } from '#/locales';
|
|
import { $t } from '#/locales';
|
|
|
|
|
|
|
|
|
|
+import OrdersAuditForm from './audit-form.vue';
|
|
|
import OrdersForm from './form.vue';
|
|
import OrdersForm from './form.vue';
|
|
|
|
|
|
|
|
const dealerOptions = ref<Array<{ label: string; value: string }>>([]);
|
|
const dealerOptions = ref<Array<{ label: string; value: string }>>([]);
|
|
@@ -153,6 +156,7 @@ const gridOptions: VxeGridProps<any> = {
|
|
|
0: { text: '待审核', type: 'info' },
|
|
0: { text: '待审核', type: 'info' },
|
|
|
1: { text: '已支付', type: 'success' },
|
|
1: { text: '已支付', type: 'success' },
|
|
|
2: { text: '已完成', type: 'warning' },
|
|
2: { text: '已完成', type: 'warning' },
|
|
|
|
|
+ 3: { text: '审核不通过', type: 'danger' },
|
|
|
} as const;
|
|
} as const;
|
|
|
return h(
|
|
return h(
|
|
|
ElTag,
|
|
ElTag,
|
|
@@ -162,13 +166,33 @@ const gridOptions: VxeGridProps<any> = {
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
|
|
+ // {
|
|
|
|
|
+ // title: '审核状态',
|
|
|
|
|
+ // field: 'ordsesshzt',
|
|
|
|
|
+ // sortable: true,
|
|
|
|
|
+ // slots: {
|
|
|
|
|
+ // default: ({ row }) => {
|
|
|
|
|
+ // const type = row.ordsesshzt as 0 | 1 | 2;
|
|
|
|
|
+ // const typeMap = {
|
|
|
|
|
+ // 0: { text: '待审核', type: 'info' },
|
|
|
|
|
+ // 1: { text: '审核通过', type: 'success' },
|
|
|
|
|
+ // 2: { text: '审核不通过', type: 'danger' },
|
|
|
|
|
+ // } as const;
|
|
|
|
|
+ // return h(
|
|
|
|
|
+ // ElTag,
|
|
|
|
|
+ // { type: typeMap[type]?.type },
|
|
|
|
|
+ // () => typeMap[type]?.text,
|
|
|
|
|
+ // );
|
|
|
|
|
+ // },
|
|
|
|
|
+ // },
|
|
|
|
|
+ // },
|
|
|
{ title: '下单时间', field: 'ordersorderdate', sortable: true },
|
|
{ title: '下单时间', field: 'ordersorderdate', sortable: true },
|
|
|
{
|
|
{
|
|
|
title: '操作',
|
|
title: '操作',
|
|
|
field: 'action',
|
|
field: 'action',
|
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
|
slots: { default: 'action' },
|
|
slots: { default: 'action' },
|
|
|
- width: 150,
|
|
|
|
|
|
|
+ width: 200,
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
};
|
|
};
|
|
@@ -192,6 +216,13 @@ const [Modal, modalApi] = useVbenModal({
|
|
|
connectedComponent: OrdersForm,
|
|
connectedComponent: OrdersForm,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+const [AuditModal, auditModalApi] = useVbenModal({
|
|
|
|
|
+ fullscreenButton: false,
|
|
|
|
|
+ closeOnClickModal: false,
|
|
|
|
|
+ closeOnPressEscape: false,
|
|
|
|
|
+ connectedComponent: OrdersAuditForm,
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
/* 创建 */
|
|
/* 创建 */
|
|
|
function handleCreate() {
|
|
function handleCreate() {
|
|
|
modalApi.setState({ showCancelButton: true });
|
|
modalApi.setState({ showCancelButton: true });
|
|
@@ -214,21 +245,26 @@ function handleFinish() {
|
|
|
gridApi.reload();
|
|
gridApi.reload();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-/* 删除 */
|
|
|
|
|
-async function handleDelete(row: any) {
|
|
|
|
|
- try {
|
|
|
|
|
- await ElMessageBox.confirm('确认要删除该订单吗?', '提示', {
|
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
- type: 'warning',
|
|
|
|
|
- });
|
|
|
|
|
- await deleteOrdersApi({ 'ordersid.value': row.ordersid });
|
|
|
|
|
- ElMessage.success('删除成功');
|
|
|
|
|
- gridApi.reload();
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- console.error(error);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+/* 审核 */
|
|
|
|
|
+function handleAudit(row: any) {
|
|
|
|
|
+ auditModalApi.setData({ row }).open();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+/* 删除 */
|
|
|
|
|
+// async function handleDelete(row: any) {
|
|
|
|
|
+// try {
|
|
|
|
|
+// await ElMessageBox.confirm('确认要删除该订单吗?', '提示', {
|
|
|
|
|
+// confirmButtonText: '确定',
|
|
|
|
|
+// cancelButtonText: '取消',
|
|
|
|
|
+// type: 'warning',
|
|
|
|
|
+// });
|
|
|
|
|
+// await deleteOrdersApi({ 'ordersid.value': row.ordersid });
|
|
|
|
|
+// ElMessage.success('删除成功');
|
|
|
|
|
+// gridApi.reload();
|
|
|
|
|
+// } catch (error) {
|
|
|
|
|
+// console.error(error);
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -267,6 +303,20 @@ async function handleDelete(row: any) {
|
|
|
<el-tooltip
|
|
<el-tooltip
|
|
|
class="box-item"
|
|
class="box-item"
|
|
|
effect="dark"
|
|
effect="dark"
|
|
|
|
|
+ content="审核"
|
|
|
|
|
+ placement="top"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ round
|
|
|
|
|
+ @click="() => handleAudit(row)"
|
|
|
|
|
+ :icon="MdiCheckboxMultipleMarked"
|
|
|
|
|
+ class="!p-2"
|
|
|
|
|
+ :disabled="row.ordersorderstatus !== 0"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-tooltip>
|
|
|
|
|
+ <!-- <el-tooltip
|
|
|
|
|
+ class="box-item"
|
|
|
|
|
+ effect="dark"
|
|
|
content="删除"
|
|
content="删除"
|
|
|
placement="top"
|
|
placement="top"
|
|
|
>
|
|
>
|
|
@@ -276,9 +326,10 @@ async function handleDelete(row: any) {
|
|
|
:icon="MdiDelete"
|
|
:icon="MdiDelete"
|
|
|
class="!p-2"
|
|
class="!p-2"
|
|
|
/>
|
|
/>
|
|
|
- </el-tooltip>
|
|
|
|
|
|
|
+ </el-tooltip> -->
|
|
|
</template>
|
|
</template>
|
|
|
</Grid>
|
|
</Grid>
|
|
|
<Modal @finish="handleFinish" />
|
|
<Modal @finish="handleFinish" />
|
|
|
|
|
+ <AuditModal @finish="handleFinish" />
|
|
|
</Page>
|
|
</Page>
|
|
|
</template>
|
|
</template>
|