diff --git a/src/api/hard/hard-car.ts b/src/api/hard/hard-car.ts index 89f38f5..6c068e1 100644 --- a/src/api/hard/hard-car.ts +++ b/src/api/hard/hard-car.ts @@ -1,5 +1,13 @@ import request from "/@/utils/request" +export function getCarByOrderId(query?: Object) { + return request({ + url: '/hard/hard-car/order-id', + method: 'get', + params: query + }) +} + export function pageJoin(query?: Object) { return request({ url: '/hard/hard-car/page-join', diff --git a/src/views/hard/components/shop-car.vue b/src/views/hard/components/shop-car.vue new file mode 100644 index 0000000..721d614 --- /dev/null +++ b/src/views/hard/components/shop-car.vue @@ -0,0 +1,62 @@ + + + + + + + + + + + + {{ displayPrice(row.productPrice) }} + + + + + + {{ displayPrice(row.totalPrice) }} + + + + + + + 取消 + + + + + + \ No newline at end of file diff --git a/src/views/hard/hard-order/index.vue b/src/views/hard/hard-order/index.vue index e94d321..7fcd0aa 100644 --- a/src/views/hard/hard-order/index.vue +++ b/src/views/hard/hard-order/index.vue @@ -1,35 +1,118 @@ - - - - 新 增 - - - 删除 - - + + + + + + + + + {{ $t('common.queryBtn') + }} + {{ $t('common.resetBtn') }} + + + + + + + + - + - - - + + + + + + + + + + + 商户 + + {{ row.merchantName }} + + + + 设备名 + + {{ row.hardName }} + + + + 设备类型 + + {{ row.hardType }} + + + + + + + + 订单类型 + + + + + + 支付方式 + + + + + + 订单状态 + + + + + + + + + + 商品总价 + + {{ displayPrice(row.totalPrice) }} + + + + 额外支付 + + {{ displayPrice(row.extraPrice) }} + + + + 实际支付 + + {{ displayPrice(row.payPrice) }} + + + + + - - 编辑 - 删除 + + 购物车 + + 退款 + + 编辑 + 删除 @@ -38,6 +121,7 @@ + @@ -46,15 +130,21 @@ import { BasicTableProps, useTable } from "/@/hooks/table"; import * as hardOrder from "/@/api/hard/hard-order"; import * as hardCar from "/@/api/hard/hard-car"; +import { getDicts } from '/@/api/admin/dict'; import { useMessage, useMessageBox } from "/@/hooks/message"; import { useDict } from '/@/hooks/dict'; +import { displayPrice } from "/@/utils/formatMoney" // 引入组件 const FormDialog = defineAsyncComponent(() => import('./form.vue')); +const ShopCar = defineAsyncComponent(() => import('../components/shop-car.vue')); // 定义查询字典 - +const { hard_pay_type, hard_order_type, hard_order_status, hard_type } = useDict("hard_pay_type", "hard_order_type", "hard_order_status", "hard_type") // 定义变量内容 const formDialogRef = ref() +const shopCarDialogRef = ref() +const tabList = ref([{}]) +const activeName = ref(null) // 搜索变量 const queryRef = ref() const showSearch = ref(true) @@ -77,6 +167,12 @@ const { tableStyle } = useTable(state) +onMounted(async () => { + const { data } = await getDicts("hard_order_type") + data.unshift({ label: '全部', value: null }) + tabList.value = data +}) + // 清空搜索条件 const resetQuery = () => { // 清空搜索条件 @@ -86,6 +182,11 @@ const resetQuery = () => { getDataList() } +const handleClick = (e: any) => { + state.queryForm.orderType = tabList.value[e.index].value + getDataList() +} + // 导出excel const exportExcel = () => { downBlobFile('/hard/hardwareOrder/export', Object.assign(state.queryForm, { ids: selectObjs }), 'hardwareOrder.xlsx') @@ -113,4 +214,25 @@ const handleDelete = async (ids: string[]) => { useMessage().error(err.msg); } }; - \ No newline at end of file + + + \ No newline at end of file