完成商城下单功能
This commit is contained in:
@@ -53,6 +53,7 @@ export interface PeriodParam extends PageParam {
|
|||||||
dateTime?: string;
|
dateTime?: string;
|
||||||
isStatus?: number;
|
isStatus?: number;
|
||||||
timePeriod?: string;
|
timePeriod?: string;
|
||||||
|
merchantId?: number;
|
||||||
week?: number;
|
week?: number;
|
||||||
startTime?: string;
|
startTime?: string;
|
||||||
half?: number;
|
half?: number;
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ export interface Goods {
|
|||||||
type?: number;
|
type?: number;
|
||||||
// 商品编码
|
// 商品编码
|
||||||
code?: string;
|
code?: string;
|
||||||
// 商品标题
|
// 商品名称
|
||||||
title?: string;
|
goodsName?: string;
|
||||||
// 商品封面图
|
// 商品封面图
|
||||||
image?: string;
|
image?: string;
|
||||||
// 商品详情
|
// 商品详情
|
||||||
|
|||||||
@@ -63,5 +63,6 @@ export interface OrderInfo {
|
|||||||
*/
|
*/
|
||||||
export interface OrderInfoParam extends PageParam {
|
export interface OrderInfoParam extends PageParam {
|
||||||
id?: number;
|
id?: number;
|
||||||
|
orderId?: number;
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
106
src/api/shop/userAddress/index.ts
Normal file
106
src/api/shop/userAddress/index.ts
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { UserAddress, UserAddressParam } from './model';
|
||||||
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询收货地址
|
||||||
|
*/
|
||||||
|
export async function pageUserAddress(params: UserAddressParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<UserAddress>>>(
|
||||||
|
MODULES_API_URL + '/shop/user-address/page',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询收货地址列表
|
||||||
|
*/
|
||||||
|
export async function listUserAddress(params?: UserAddressParam) {
|
||||||
|
const res = await request.get<ApiResult<UserAddress[]>>(
|
||||||
|
MODULES_API_URL + '/shop/user-address',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加收货地址
|
||||||
|
*/
|
||||||
|
export async function addUserAddress(data: UserAddress) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/user-address',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改收货地址
|
||||||
|
*/
|
||||||
|
export async function updateUserAddress(data: UserAddress) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/user-address',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除收货地址
|
||||||
|
*/
|
||||||
|
export async function removeUserAddress(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/user-address/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除收货地址
|
||||||
|
*/
|
||||||
|
export async function removeBatchUserAddress(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/shop/user-address/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询收货地址
|
||||||
|
*/
|
||||||
|
export async function getUserAddress(id: number) {
|
||||||
|
const res = await request.get<ApiResult<UserAddress>>(
|
||||||
|
MODULES_API_URL + '/shop/user-address/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
43
src/api/shop/userAddress/model/index.ts
Normal file
43
src/api/shop/userAddress/model/index.ts
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货地址
|
||||||
|
*/
|
||||||
|
export interface UserAddress {
|
||||||
|
// 主键ID
|
||||||
|
id?: number;
|
||||||
|
// 姓名
|
||||||
|
name?: string;
|
||||||
|
// 手机号码
|
||||||
|
phone?: string;
|
||||||
|
// 所在国家
|
||||||
|
country?: string;
|
||||||
|
// 所在省份
|
||||||
|
province?: string;
|
||||||
|
// 所在城市
|
||||||
|
city?: string;
|
||||||
|
// 所在辖区
|
||||||
|
region?: string;
|
||||||
|
// 收货地址
|
||||||
|
address?: string;
|
||||||
|
// 1先生 2女士
|
||||||
|
gender?: number;
|
||||||
|
// 家、公司、学校
|
||||||
|
type?: string;
|
||||||
|
// 默认收货地址
|
||||||
|
default?: string;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 注册时间
|
||||||
|
createTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货地址搜索条件
|
||||||
|
*/
|
||||||
|
export interface UserAddressParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
69
src/components/SelectMerchantMultipleDown/index.vue
Normal file
69
src/components/SelectMerchantMultipleDown/index.vue
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<!-- 选择下拉框 -->
|
||||||
|
<template>
|
||||||
|
<a-select
|
||||||
|
:allow-clear="true"
|
||||||
|
:show-search="true"
|
||||||
|
mode="multiple"
|
||||||
|
optionFilterProp="label"
|
||||||
|
:options="options"
|
||||||
|
:value="value"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
@update:value="updateValue"
|
||||||
|
@blur="onBlur"
|
||||||
|
@change="onChange"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { Merchant } from '@/api/shop/merchant/model';
|
||||||
|
import { listMerchant } from '@/api/shop/merchant';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'update:value', value: string, item: any): void;
|
||||||
|
(e: 'done', item: Merchant): void;
|
||||||
|
(e: 'blur'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
value?: any;
|
||||||
|
type?: any;
|
||||||
|
placeholder?: string;
|
||||||
|
dictCode?: string;
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
placeholder: '请选择场馆'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// 字典数据
|
||||||
|
const options = ref<Merchant[]>([]);
|
||||||
|
|
||||||
|
/* 更新选中数据 */
|
||||||
|
const updateValue = (value: string) => {
|
||||||
|
const item = options.value?.find((d) => d.merchantName == value);
|
||||||
|
emit('update:value', value, item);
|
||||||
|
};
|
||||||
|
/* 失去焦点 */
|
||||||
|
const onBlur = () => {
|
||||||
|
emit('blur');
|
||||||
|
};
|
||||||
|
|
||||||
|
const onChange = (item: Merchant) => {
|
||||||
|
emit('done', item);
|
||||||
|
};
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
listMerchant({}).then((list) => {
|
||||||
|
options.value = list.map((d) => {
|
||||||
|
d.label = d.merchantName;
|
||||||
|
d.value = d.merchantId;
|
||||||
|
d.key = d.merchantCode;
|
||||||
|
return d;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
reload();
|
||||||
|
</script>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
showEdit.value = true;
|
showEdit.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChange = (row) => {
|
const onChange = (row?: User) => {
|
||||||
emit('done', row);
|
emit('done', row);
|
||||||
};
|
};
|
||||||
// 查询租户列表
|
// 查询租户列表
|
||||||
|
|||||||
@@ -274,18 +274,24 @@
|
|||||||
settingVisible.value = true;
|
settingVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
listMenus({ menuType: 0, hide: 0 }).then((data) => {
|
const getMenus = () => {
|
||||||
if (data) {
|
if (!getMerchantName()) {
|
||||||
menuList.value = data;
|
listMenus({ menuType: 0, hide: 0 }).then((data) => {
|
||||||
menuTree.value = toTreeData({
|
if (data) {
|
||||||
data: data.map((d) => {
|
menuList.value = data;
|
||||||
return { ...d, key: d.menuId, value: d.menuId };
|
menuTree.value = toTreeData({
|
||||||
}),
|
data: data.map((d) => {
|
||||||
idField: 'menuId',
|
return { ...d, key: d.menuId, value: d.menuId };
|
||||||
parentIdField: 'parentId'
|
}),
|
||||||
|
idField: 'menuId',
|
||||||
|
parentIdField: 'parentId'
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
|
||||||
|
getMenus();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|||||||
@@ -326,35 +326,11 @@ export const decrypt = (encrypt) => {
|
|||||||
|
|
||||||
// 获取商户ID
|
// 获取商户ID
|
||||||
export const getMerchantId = () => {
|
export const getMerchantId = () => {
|
||||||
// 读取商户账号
|
|
||||||
const merchantId = localStorage.getItem('MerchantId');
|
const merchantId = localStorage.getItem('MerchantId');
|
||||||
const userId = localStorage.getItem('UserId');
|
|
||||||
if (Number(userId) == 3731) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
if (merchantId) {
|
if (merchantId) {
|
||||||
return Number(merchantId);
|
return Number(merchantId);
|
||||||
}
|
}
|
||||||
// const tenantStore = useTenantStore();
|
return undefined;
|
||||||
// console.log(tenantStore);
|
|
||||||
// tenantStore.setMerchant({
|
|
||||||
// merchantId: merchantAccount.merchantId,
|
|
||||||
// merchantName: merchantAccount.merchantName
|
|
||||||
// });
|
|
||||||
// const phone = String(localStorage.getItem('Phone'));
|
|
||||||
// listMerchantAccount({ phone }).then((list) => {
|
|
||||||
// if (list.length == 0) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// const merchantAccount = list[0];
|
|
||||||
// const tenantStore = useTenantStore();
|
|
||||||
// tenantStore.setMerchant({
|
|
||||||
// merchantId: merchantAccount.merchantId,
|
|
||||||
// merchantName: merchantAccount.merchantName
|
|
||||||
// });
|
|
||||||
// localStorage.setItem('MerchantId', merchantAccount.merchantId + '');
|
|
||||||
// });
|
|
||||||
// return Number(merchantId);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取当前登录用户ID
|
// 获取当前登录用户ID
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
// 获取商户ID
|
// 获取商户ID
|
||||||
export const getMerchantId = () => {
|
export const getMerchantId = () => {
|
||||||
const MerchantId = localStorage.getItem('MerchantId');
|
const merchantId = localStorage.getItem('MerchantId');
|
||||||
if (MerchantId != 'null') {
|
if (merchantId) {
|
||||||
return MerchantId;
|
return Number(merchantId);
|
||||||
}
|
}
|
||||||
return null;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取商户名称
|
// 获取商户名称
|
||||||
export const getMerchantName = () => {
|
export const getMerchantName = () => {
|
||||||
const MerchantName = localStorage.getItem('MerchantName');
|
const MerchantName = localStorage.getItem('MerchantName');
|
||||||
if (MerchantName != 'null') {
|
if (MerchantName) {
|
||||||
return MerchantName;
|
return MerchantName;
|
||||||
}
|
}
|
||||||
return null;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<a-form-item label="选择场馆" name="merchantId">
|
<a-form-item label="选择场馆" name="merchantId" v-if="!getMerchantId()">
|
||||||
<SelectMerchant
|
<SelectMerchantMultipleDown
|
||||||
:placeholder="`选择场馆`"
|
:placeholder="`选择场馆`"
|
||||||
class="input-item"
|
class="input-item"
|
||||||
v-model:value="form.merchantName"
|
v-model:value="form.merchantName"
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入手机号码"
|
placeholder="请输入手机号码"
|
||||||
maxlength="11"
|
maxlength="11"
|
||||||
:disabled="isUpdate"
|
:disabled="isUpdate && !isSuperAdmin"
|
||||||
v-model:value="form.phone"
|
v-model:value="form.phone"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch, computed } from 'vue';
|
||||||
import { Form, message } from 'ant-design-vue';
|
import { Form, message } from 'ant-design-vue';
|
||||||
import { assignObject } from 'ele-admin-pro';
|
import { assignObject } from 'ele-admin-pro';
|
||||||
import { addUser, updateUser } from '@/api/system/user';
|
import { addUser, updateUser } from '@/api/system/user';
|
||||||
@@ -82,8 +82,12 @@
|
|||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
import { FormInstance, RuleObject } from 'ant-design-vue/es/form';
|
import { FormInstance, RuleObject } from 'ant-design-vue/es/form';
|
||||||
import { Role } from '@/api/system/role/model';
|
|
||||||
import RoleSelect from './role-select.vue';
|
import RoleSelect from './role-select.vue';
|
||||||
|
import { getMerchantId } from '@/utils/common';
|
||||||
|
import { getMerchantName } from '@/utils/merchant';
|
||||||
|
import { useUserStore } from '@/store/modules/user';
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
|
||||||
// 是否是修改
|
// 是否是修改
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
@@ -91,6 +95,8 @@
|
|||||||
// 是否开启响应式布局
|
// 是否开启响应式布局
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
const { styleResponsive } = storeToRefs(themeStore);
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
// 当前用户信息
|
||||||
|
const loginUser = computed(() => userStore.info ?? {});
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
// 弹窗是否打开
|
// 弹窗是否打开
|
||||||
@@ -107,10 +113,11 @@
|
|||||||
// 提交状态
|
// 提交状态
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
// 是否显示最大化切换按钮
|
// 是否显示最大化切换按钮
|
||||||
const maxable = ref(true);
|
// const maxable = ref(true);
|
||||||
// 表格选中数据
|
// 表格选中数据
|
||||||
const formRef = ref<FormInstance | null>(null);
|
const formRef = ref<FormInstance | null>(null);
|
||||||
const images = ref<ItemType[]>([]);
|
const images = ref<ItemType[]>([]);
|
||||||
|
const isSuperAdmin = ref<boolean>(false);
|
||||||
|
|
||||||
// 用户信息
|
// 用户信息
|
||||||
const form = reactive<User>({
|
const form = reactive<User>({
|
||||||
@@ -120,8 +127,8 @@
|
|||||||
nickname: '',
|
nickname: '',
|
||||||
realName: '',
|
realName: '',
|
||||||
companyName: '',
|
companyName: '',
|
||||||
merchantId: undefined,
|
merchantId: getMerchantId(),
|
||||||
merchantName: undefined,
|
merchantName: getMerchantName(),
|
||||||
sex: undefined,
|
sex: undefined,
|
||||||
roles: [],
|
roles: [],
|
||||||
roleId: undefined,
|
roleId: undefined,
|
||||||
@@ -217,11 +224,6 @@
|
|||||||
form.merchantName = item.merchantName;
|
form.merchantName = item.merchantName;
|
||||||
};
|
};
|
||||||
|
|
||||||
const chooseRoleId = (item: Role) => {
|
|
||||||
form.roleId = item.roleId;
|
|
||||||
form.roleName = item.roleName;
|
|
||||||
};
|
|
||||||
|
|
||||||
const { resetFields } = useForm(form, rules);
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
/* 保存编辑 */
|
/* 保存编辑 */
|
||||||
@@ -236,6 +238,10 @@
|
|||||||
const formData = {
|
const formData = {
|
||||||
...form
|
...form
|
||||||
};
|
};
|
||||||
|
if (getMerchantId()) {
|
||||||
|
form.merchantId = getMerchantId();
|
||||||
|
form.merchantName = getMerchantName();
|
||||||
|
}
|
||||||
const saveOrUpdate = isUpdate.value ? updateUser : addUser;
|
const saveOrUpdate = isUpdate.value ? updateUser : addUser;
|
||||||
saveOrUpdate(formData)
|
saveOrUpdate(formData)
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
@@ -257,8 +263,6 @@
|
|||||||
(visible) => {
|
(visible) => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
images.value = [];
|
images.value = [];
|
||||||
console.log(props.data);
|
|
||||||
console.log(form);
|
|
||||||
if (props.data) {
|
if (props.data) {
|
||||||
assignObject(form, props.data);
|
assignObject(form, props.data);
|
||||||
isUpdate.value = true;
|
isUpdate.value = true;
|
||||||
@@ -266,6 +270,13 @@
|
|||||||
resetFields();
|
resetFields();
|
||||||
isUpdate.value = false;
|
isUpdate.value = false;
|
||||||
}
|
}
|
||||||
|
const superAdmin = loginUser.value.roles?.filter(
|
||||||
|
(d) => d.roleCode == 'superAdmin'
|
||||||
|
);
|
||||||
|
// 是否超级管理员
|
||||||
|
if (superAdmin && superAdmin.length > 0) {
|
||||||
|
isSuperAdmin.value = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
resetFields();
|
resetFields();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-space :size="10" style="flex-wrap: wrap">
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
<SelectMerchantDown
|
<SelectMerchantDown
|
||||||
|
v-if="!getMerchantId()"
|
||||||
:placeholder="`选择场馆`"
|
:placeholder="`选择场馆`"
|
||||||
class="input-item"
|
class="input-item"
|
||||||
v-model:value="where.merchantCode"
|
v-model:value="where.merchantId"
|
||||||
@change="search"
|
@change="search"
|
||||||
/>
|
/>
|
||||||
<a-date-picker
|
<a-date-picker
|
||||||
@@ -44,7 +45,7 @@
|
|||||||
import { OrderParam } from '@/api/shop/order/model';
|
import { OrderParam } from '@/api/shop/order/model';
|
||||||
import { getNativeCode } from '@/api/system/payment';
|
import { getNativeCode } from '@/api/system/payment';
|
||||||
import { getNext7day, getServerTime } from '@/api/layout';
|
import { getNext7day, getServerTime } from '@/api/layout';
|
||||||
import { getWeek } from '@/utils/common';
|
import { getMerchantId } from '@/utils/common';
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
@@ -76,7 +77,7 @@
|
|||||||
isStatus: 0,
|
isStatus: 0,
|
||||||
merchantCode: undefined,
|
merchantCode: undefined,
|
||||||
week: 0,
|
week: 0,
|
||||||
merchantId: undefined
|
merchantId: getMerchantId()
|
||||||
});
|
});
|
||||||
|
|
||||||
/* 搜索 */
|
/* 搜索 */
|
||||||
@@ -114,8 +115,8 @@
|
|||||||
getServerTime().then((res) => {
|
getServerTime().then((res) => {
|
||||||
serverTime.value = res;
|
serverTime.value = res;
|
||||||
where.dateTime = res.today;
|
where.dateTime = res.today;
|
||||||
where.merchantId = 3032;
|
where.merchantId = getMerchantId();
|
||||||
where.merchantCode = '37';
|
// where.merchantCode = '37';
|
||||||
where.isStatus = 0;
|
where.isStatus = 0;
|
||||||
emit('search', where);
|
emit('search', where);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -73,6 +73,7 @@
|
|||||||
import { Field } from '@/api/booking/field/model';
|
import { Field } from '@/api/booking/field/model';
|
||||||
import { getOrder } from '@/api/booking/order';
|
import { getOrder } from '@/api/booking/order';
|
||||||
import { reloadPageTab } from '@/utils/page-tab-util';
|
import { reloadPageTab } from '@/utils/page-tab-util';
|
||||||
|
import { getMerchantId } from '@/utils/common';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -103,6 +104,7 @@
|
|||||||
where.status = filters.status;
|
where.status = filters.status;
|
||||||
}
|
}
|
||||||
where.type = 1;
|
where.type = 1;
|
||||||
|
where.merchantId = getMerchantId();
|
||||||
return pageOrder({
|
return pageOrder({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
|
|||||||
@@ -70,14 +70,14 @@
|
|||||||
/>
|
/>
|
||||||
<div class="ele-text-placeholder">上传视频(mp4格式),视频时长不超过60秒,视频大小不超过200M。</div>
|
<div class="ele-text-placeholder">上传视频(mp4格式),视频时长不超过60秒,视频大小不超过200M。</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="商品标题" name="title">
|
<a-form-item label="商品名称" name="title">
|
||||||
<a-space style="margin-bottom: 20px">
|
<a-space style="margin-bottom: 20px">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
show-count
|
show-count
|
||||||
:maxlength="60"
|
:maxlength="60"
|
||||||
style="width: 558px"
|
style="width: 558px"
|
||||||
placeholder="请输入商品标题"
|
placeholder="请输入商品名称"
|
||||||
v-model:value="form.title"
|
v-model:value="form.title"
|
||||||
/>
|
/>
|
||||||
</a-space>
|
</a-space>
|
||||||
@@ -472,7 +472,7 @@
|
|||||||
title: [
|
title: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择商品标题',
|
message: '请选择商品名称',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,9 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'title'">
|
<template v-if="column.key === 'goodsName'">
|
||||||
<a @click="openPreview(`/goods/detail/${record.goodsId}`)">{{
|
<a @click="openPreview(`/goods/detail/${record.goodsId}`)">{{
|
||||||
record.title
|
record.goodsName
|
||||||
}}</a>
|
}}</a>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'image'">
|
<template v-if="column.key === 'image'">
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
import GoodsEdit from './components/goodsEdit.vue';
|
import GoodsEdit from './components/goodsEdit.vue';
|
||||||
import { pageGoods, removeGoods, removeBatchGoods } from '@/api/shop/goods';
|
import { pageGoods, removeGoods, removeBatchGoods } from '@/api/shop/goods';
|
||||||
import type { Goods, GoodsParam } from '@/api/shop/goods/model';
|
import type { Goods, GoodsParam } from '@/api/shop/goods/model';
|
||||||
import { openPreview, openUrl } from '@/utils/common';
|
import { getMerchantId, openPreview, openUrl } from "@/utils/common";
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
|
|
||||||
@@ -98,6 +98,7 @@
|
|||||||
if (filters) {
|
if (filters) {
|
||||||
where.status = filters.status;
|
where.status = filters.status;
|
||||||
}
|
}
|
||||||
|
where.merchantId = getMerchantId();
|
||||||
return pageGoods({
|
return pageGoods({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
@@ -122,8 +123,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '课程名称',
|
title: '课程名称',
|
||||||
dataIndex: 'title',
|
dataIndex: 'goodsName',
|
||||||
key: 'title'
|
key: 'goodsName'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '课程售价',
|
title: '课程售价',
|
||||||
|
|||||||
@@ -149,7 +149,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import { Form } from 'ant-design-vue';
|
import { Form, message } from "ant-design-vue";
|
||||||
import { assignObject } from 'ele-admin-pro';
|
import { assignObject } from 'ele-admin-pro';
|
||||||
import { Order } from '@/api/shop/order/model';
|
import { Order } from '@/api/shop/order/model';
|
||||||
import { ColumnItem } from 'ele-admin-pro/es/ele-pro-table/types';
|
import { ColumnItem } from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
@@ -158,6 +158,7 @@
|
|||||||
CloseOutlined,
|
CloseOutlined,
|
||||||
CoffeeOutlined
|
CoffeeOutlined
|
||||||
} from '@ant-design/icons-vue';
|
} from '@ant-design/icons-vue';
|
||||||
|
import { pageOrderInfo } from '@/api/shop/orderInfo';
|
||||||
|
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
|
|
||||||
@@ -364,8 +365,12 @@
|
|||||||
(visible) => {
|
(visible) => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
if (props.data) {
|
if (props.data) {
|
||||||
loading.value = false;
|
loading.value = true;
|
||||||
assignObject(form, props.data);
|
assignObject(form, props.data);
|
||||||
|
pageOrderInfo({ orderId: form.orderId }).then((res) => {
|
||||||
|
form.orderInfoList = res?.list;
|
||||||
|
loading.value = false;
|
||||||
|
});
|
||||||
loadSteps(props.data);
|
loadSteps(props.data);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -221,6 +221,7 @@
|
|||||||
} from '@/api/booking/order';
|
} from '@/api/booking/order';
|
||||||
import type { Order, OrderParam } from '@/api/booking/order/model';
|
import type { Order, OrderParam } from '@/api/booking/order/model';
|
||||||
import { formatNumber } from 'ele-admin-pro/es';
|
import { formatNumber } from 'ele-admin-pro/es';
|
||||||
|
import { getMerchantId } from '@/utils/common';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -248,6 +249,8 @@
|
|||||||
where.status = filters.status;
|
where.status = filters.status;
|
||||||
}
|
}
|
||||||
where.type = 1;
|
where.type = 1;
|
||||||
|
// where.sceneType = 'showOrderInfo';
|
||||||
|
where.merchantId = getMerchantId();
|
||||||
return pageOrder({
|
return pageOrder({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
<!-- 搜索表单 -->
|
<!-- 搜索表单 -->
|
||||||
<template>
|
<template>
|
||||||
<a-space :size="10" style="flex-wrap: wrap">
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
<a-button
|
||||||
|
v-role="'superAdmin'"
|
||||||
|
type="primary"
|
||||||
|
class="ele-btn-icon"
|
||||||
|
@click="add"
|
||||||
|
>
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<PlusOutlined />
|
<PlusOutlined />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -46,7 +46,11 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<WechatDepositEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
<WechatDepositEdit
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:data="current"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -63,8 +67,16 @@
|
|||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import WechatDepositEdit from './components/wechatDepositEdit.vue';
|
import WechatDepositEdit from './components/wechatDepositEdit.vue';
|
||||||
import { pageWechatDeposit, removeWechatDeposit, removeBatchWechatDeposit } from '@/api/shop/wechatDeposit';
|
import {
|
||||||
import type { WechatDeposit, WechatDepositParam } from '@/api/shop/wechatDeposit/model';
|
pageWechatDeposit,
|
||||||
|
removeWechatDeposit,
|
||||||
|
removeBatchWechatDeposit
|
||||||
|
} from '@/api/shop/wechatDeposit';
|
||||||
|
import type {
|
||||||
|
WechatDeposit,
|
||||||
|
WechatDepositParam
|
||||||
|
} from '@/api/shop/wechatDeposit/model';
|
||||||
|
import { getMerchantId } from '@/utils/common';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -91,6 +103,7 @@
|
|||||||
if (filters) {
|
if (filters) {
|
||||||
where.status = filters.status;
|
where.status = filters.status;
|
||||||
}
|
}
|
||||||
|
where.merchantId = getMerchantId();
|
||||||
return pageWechatDeposit({
|
return pageWechatDeposit({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
@@ -105,43 +118,43 @@
|
|||||||
title: '订单号',
|
title: '订单号',
|
||||||
dataIndex: 'orderNum',
|
dataIndex: 'orderNum',
|
||||||
key: 'orderNum',
|
key: 'orderNum',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '场馆名称',
|
title: '场馆名称',
|
||||||
dataIndex: 'siteName',
|
dataIndex: 'siteName',
|
||||||
key: 'siteName',
|
key: 'siteName',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '微信昵称',
|
title: '微信昵称',
|
||||||
dataIndex: 'username',
|
dataIndex: 'username',
|
||||||
key: 'username',
|
key: 'username',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '手机号码',
|
title: '手机号码',
|
||||||
dataIndex: 'phone',
|
dataIndex: 'phone',
|
||||||
key: 'phone',
|
key: 'phone',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '物品名称',
|
title: '物品名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
key: 'name',
|
key: 'name',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '押金金额',
|
title: '押金金额',
|
||||||
dataIndex: 'price',
|
dataIndex: 'price',
|
||||||
key: 'price',
|
key: 'price',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '押金状态',
|
title: '押金状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
|
|||||||
@@ -70,15 +70,15 @@
|
|||||||
/>
|
/>
|
||||||
<div class="ele-text-placeholder">上传视频(mp4格式),视频时长不超过60秒,视频大小不超过200M。</div>
|
<div class="ele-text-placeholder">上传视频(mp4格式),视频时长不超过60秒,视频大小不超过200M。</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="商品标题" name="title">
|
<a-form-item label="商品名称" name="goodsName">
|
||||||
<a-space style="margin-bottom: 20px">
|
<a-space style="margin-bottom: 20px">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
show-count
|
show-count
|
||||||
:maxlength="60"
|
:maxlength="60"
|
||||||
style="width: 558px"
|
style="width: 558px"
|
||||||
placeholder="请输入商品标题"
|
placeholder="请输入商品名称"
|
||||||
v-model:value="form.title"
|
v-model:value="form.goodsName"
|
||||||
/>
|
/>
|
||||||
</a-space>
|
</a-space>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -291,15 +291,14 @@
|
|||||||
import { FormInstance, RuleObject } from 'ant-design-vue/es/form';
|
import { FormInstance, RuleObject } from 'ant-design-vue/es/form';
|
||||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
import { Form, message } from 'ant-design-vue';
|
import { Form, message } from 'ant-design-vue';
|
||||||
import {getDictionaryOptions, openUrl} from '@/utils/common';
|
import { getDictionaryOptions, getMerchantId, openUrl } from "@/utils/common";
|
||||||
import { addGoods, updateGoods } from '@/api/shop/goods';
|
import { addGoods, updateGoods } from '@/api/shop/goods';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { BathSet, Goods } from '@/api/shop/goods/model';
|
import { BathSet, Goods } from '@/api/shop/goods/model';
|
||||||
import {PlusCircleOutlined, PlusOutlined} from '@ant-design/icons-vue';
|
import {PlusCircleOutlined} from '@ant-design/icons-vue';
|
||||||
import { getGoods } from '@/api/shop/goods';
|
import { getGoods } from '@/api/shop/goods';
|
||||||
import CategorySelect from '@/views/cms/article/components/category-select.vue';
|
|
||||||
import { listGoodsCategory } from '@/api/shop/goodsCategory';
|
import { listGoodsCategory } from '@/api/shop/goodsCategory';
|
||||||
import { FileRecord } from '@/api/system/file/model';
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
import {toTreeData, uuid} from 'ele-admin-pro';
|
import {toTreeData, uuid} from 'ele-admin-pro';
|
||||||
@@ -309,6 +308,7 @@
|
|||||||
import {ColumnItem} from "ele-admin-pro/es/ele-pro-table/types";
|
import {ColumnItem} from "ele-admin-pro/es/ele-pro-table/types";
|
||||||
import {listSpec} from '@/api/shop/spec';
|
import {listSpec} from '@/api/shop/spec';
|
||||||
import {Spec} from "@/api/shop/spec/model";
|
import {Spec} from "@/api/shop/spec/model";
|
||||||
|
import { getMerchantName } from "@/utils/merchant";
|
||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
// 是否开启响应式布局
|
// 是否开启响应式布局
|
||||||
@@ -346,7 +346,7 @@
|
|||||||
const { form, assignFields } = useFormData<Goods>({
|
const { form, assignFields } = useFormData<Goods>({
|
||||||
goodsId: undefined,
|
goodsId: undefined,
|
||||||
type: 1,
|
type: 1,
|
||||||
title: '',
|
goodsName: '',
|
||||||
image: '',
|
image: '',
|
||||||
content: '',
|
content: '',
|
||||||
code: '',
|
code: '',
|
||||||
@@ -367,7 +367,8 @@
|
|||||||
comments: '',
|
comments: '',
|
||||||
recommend: 0,
|
recommend: 0,
|
||||||
sortNumber: undefined,
|
sortNumber: undefined,
|
||||||
status: undefined
|
status: undefined,
|
||||||
|
merchantId: getMerchantId()
|
||||||
});
|
});
|
||||||
const skuColumns = ref<ColumnItem[]>([
|
const skuColumns = ref<ColumnItem[]>([
|
||||||
{
|
{
|
||||||
@@ -463,10 +464,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
title: [
|
goodsName: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请选择商品标题',
|
message: '请选择商品名称',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
@@ -681,7 +682,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const chooseGoodsCategory = (item,value) => {
|
const chooseGoodsCategory = (item,value) => {
|
||||||
console.log(value);
|
|
||||||
form.categoryId = value[1].value;
|
form.categoryId = value[1].value;
|
||||||
form.categoryParent = value[0].label;
|
form.categoryParent = value[0].label;
|
||||||
form.categoryChildren = value[1].label;
|
form.categoryChildren = value[1].label;
|
||||||
@@ -881,6 +881,8 @@
|
|||||||
const formData = {
|
const formData = {
|
||||||
...form,
|
...form,
|
||||||
content: content.value,
|
content: content.value,
|
||||||
|
merchantId: getMerchantId(),
|
||||||
|
merchantName: getMerchantName(),
|
||||||
image: JSON.stringify(imgList.value),
|
image: JSON.stringify(imgList.value),
|
||||||
files: JSON.stringify(fileList.value),
|
files: JSON.stringify(fileList.value),
|
||||||
goodsSpecs: specList.value,
|
goodsSpecs: specList.value,
|
||||||
@@ -890,6 +892,10 @@
|
|||||||
saveOrUpdate(formData)
|
saveOrUpdate(formData)
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
imgList.value = []
|
||||||
|
fileList.value = []
|
||||||
|
category.value = []
|
||||||
|
resetFields();
|
||||||
message.success(msg);
|
message.success(msg);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
@@ -911,6 +917,8 @@
|
|||||||
reload();
|
reload();
|
||||||
} else {
|
} else {
|
||||||
isUpdate.value = false;
|
isUpdate.value = false;
|
||||||
|
imgList.value = []
|
||||||
|
fileList.value = []
|
||||||
// images.value = [];
|
// images.value = [];
|
||||||
// skuList.value = [];
|
// skuList.value = [];
|
||||||
// specList.value = [];
|
// specList.value = [];
|
||||||
|
|||||||
@@ -21,8 +21,8 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'title'">
|
<template v-if="column.key === 'goodsName'">
|
||||||
<a @click="openPreview(`/goods/detail/${record.goodsId}`)">{{ record.title }}</a>
|
<span>{{ record.goodsName }}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'image'">
|
<template v-if="column.key === 'image'">
|
||||||
<template
|
<template
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
import GoodsEdit from './components/goodsEdit.vue';
|
import GoodsEdit from './components/goodsEdit.vue';
|
||||||
import { pageGoods, removeGoods, removeBatchGoods } from '@/api/shop/goods';
|
import { pageGoods, removeGoods, removeBatchGoods } from '@/api/shop/goods';
|
||||||
import type { Goods, GoodsParam } from '@/api/shop/goods/model';
|
import type { Goods, GoodsParam } from '@/api/shop/goods/model';
|
||||||
import {openPreview, openUrl} from '@/utils/common';
|
import { getMerchantId, openPreview, openUrl } from "@/utils/common";
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -98,6 +98,7 @@
|
|||||||
if (filters) {
|
if (filters) {
|
||||||
where.status = filters.status;
|
where.status = filters.status;
|
||||||
}
|
}
|
||||||
|
where.merchantId = getMerchantId();
|
||||||
return pageGoods({
|
return pageGoods({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
@@ -122,8 +123,8 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '商品名称',
|
title: '商品名称',
|
||||||
dataIndex: 'title',
|
dataIndex: 'goodsName',
|
||||||
key: 'title'
|
key: 'goodsName'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '商品售价',
|
title: '商品售价',
|
||||||
|
|||||||
@@ -327,7 +327,7 @@
|
|||||||
const form = reactive<Order>({
|
const form = reactive<Order>({
|
||||||
orderId: undefined,
|
orderId: undefined,
|
||||||
orderNo: undefined,
|
orderNo: undefined,
|
||||||
wechatOrder: undefined,
|
transactionId: undefined,
|
||||||
refundOrder: undefined,
|
refundOrder: undefined,
|
||||||
merchantId: undefined,
|
merchantId: undefined,
|
||||||
couponId: undefined,
|
couponId: undefined,
|
||||||
|
|||||||
395
src/views/shop/order/components/orderInfo.vue
Normal file
395
src/views/shop/order/components/orderInfo.vue
Normal file
@@ -0,0 +1,395 @@
|
|||||||
|
<!-- 用户编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="`80%`"
|
||||||
|
:visible="visible"
|
||||||
|
:confirm-loading="loading"
|
||||||
|
:maxable="maxAble"
|
||||||
|
:title="isUpdate ? '编辑订单' : '订单详情'"
|
||||||
|
:body-style="{ paddingBottom: '8px', background: '#f3f3f3' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:footer="null"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-card class="order-card" :bordered="false">
|
||||||
|
<a-descriptions title="基本信息" :column="3">
|
||||||
|
<a-descriptions-item
|
||||||
|
label="订单号"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
{{ form.orderId }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item
|
||||||
|
label="订单编号"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
{{ form.orderNo }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item
|
||||||
|
label="订单状态"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
<a-tag v-if="form.orderStatus == 0">未使用</a-tag>
|
||||||
|
<a-tag v-if="form.orderStatus == 1">已付款</a-tag>
|
||||||
|
<a-tag v-if="form.orderStatus == 3">已取消</a-tag>
|
||||||
|
<a-tag v-if="form.orderStatus == 4">退款申请中</a-tag>
|
||||||
|
<a-tag v-if="form.orderStatus == 5">退款被拒绝</a-tag>
|
||||||
|
<a-tag v-if="form.orderStatus == 6">退款成功</a-tag>
|
||||||
|
<a-tag v-if="form.orderStatus == 7">客户端申请退款</a-tag>
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item
|
||||||
|
label="买家信息"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
{{ form.realName }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item
|
||||||
|
label="手机号码"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
{{ form.phone }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item
|
||||||
|
label="交易流水号"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
{{ form.transactionId }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item
|
||||||
|
label="订单总金额"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
¥{{ form.totalPrice }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item
|
||||||
|
label="实付金额"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
¥{{ form.payPrice }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item
|
||||||
|
label="减少金额"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
¥{{ form.reducePrice }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item
|
||||||
|
label="支付方式"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
<template v-if="form.payStatus == 1">
|
||||||
|
<a-tag v-if="form.payType == 1">微信支付</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 2">积分</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 3">支付宝</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 4">现金</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 5">POS机</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 6">VIP月卡</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 7">formVIP年卡</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 8">formVIP次卡</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 9">formIC月卡</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 10">formIC年卡</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 11">formIC次卡</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 12">form免费</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 13">formVIP充值卡</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 14">formIC充值卡</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 15">form积分支付</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 16">formVIP季卡</a-tag>
|
||||||
|
<a-tag v-if="form.payType == 17">formIC季卡</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<span></span>
|
||||||
|
</template>
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item
|
||||||
|
label="支付状态"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
<a-tag v-if="form.payStatus == 1" color="green"
|
||||||
|
><CheckOutlined class="tag-icon" />已付款</a-tag
|
||||||
|
>
|
||||||
|
<a-tag v-if="form.payStatus == 0" color="error"
|
||||||
|
><CloseOutlined class="tag-icon" />未付款</a-tag
|
||||||
|
>
|
||||||
|
<a-tag v-if="form.payStatus == 3" color="cyan"
|
||||||
|
><CoffeeOutlined class="tag-icon" />未付款,占场中</a-tag
|
||||||
|
>
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item
|
||||||
|
label="付款时间"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
{{ form.payTime }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item
|
||||||
|
label="下单时间"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
{{ form.createTime }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item
|
||||||
|
label="信息备注"
|
||||||
|
:labelStyle="{ width: '90px', color: '#808080' }"
|
||||||
|
>
|
||||||
|
{{ form.comments }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
</a-descriptions>
|
||||||
|
</a-card>
|
||||||
|
<a-card class="order-card" :bordered="false">
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-table
|
||||||
|
:data-source="form.orderInfoList"
|
||||||
|
:columns="columns"
|
||||||
|
:pagination="false"
|
||||||
|
/>
|
||||||
|
</a-spin>
|
||||||
|
</a-card>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form } from 'ant-design-vue';
|
||||||
|
import { assignObject } from 'ele-admin-pro';
|
||||||
|
import { Order } from '@/api/shop/order/model';
|
||||||
|
import { ColumnItem } from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import {
|
||||||
|
CheckOutlined,
|
||||||
|
CloseOutlined,
|
||||||
|
CoffeeOutlined
|
||||||
|
} from '@ant-design/icons-vue';
|
||||||
|
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: Order | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
export interface step {
|
||||||
|
title?: String | undefined;
|
||||||
|
subTitle?: String | undefined;
|
||||||
|
description?: String | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxAble = ref(true);
|
||||||
|
|
||||||
|
// 步骤条
|
||||||
|
const steps = ref<step[]>([
|
||||||
|
{
|
||||||
|
title: '报餐',
|
||||||
|
description: undefined
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '付款',
|
||||||
|
description: undefined
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发餐',
|
||||||
|
description: undefined
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '取餐',
|
||||||
|
description: undefined
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '完成',
|
||||||
|
description: undefined
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
const active = ref(2);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 订单信息
|
||||||
|
const form = reactive<Order>({
|
||||||
|
orderId: undefined,
|
||||||
|
orderNo: undefined,
|
||||||
|
transactionId: undefined,
|
||||||
|
refundOrder: undefined,
|
||||||
|
merchantId: undefined,
|
||||||
|
couponId: undefined,
|
||||||
|
cardId: undefined,
|
||||||
|
adminId: undefined,
|
||||||
|
confirmId: undefined,
|
||||||
|
icCard: undefined,
|
||||||
|
realName: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
totalPrice: undefined,
|
||||||
|
reducePrice: undefined,
|
||||||
|
payPrice: undefined,
|
||||||
|
price: undefined,
|
||||||
|
money: undefined,
|
||||||
|
refundMoney: undefined,
|
||||||
|
coachPrice: undefined,
|
||||||
|
coachId: undefined,
|
||||||
|
payType: undefined,
|
||||||
|
payStatus: undefined,
|
||||||
|
orderStatus: undefined,
|
||||||
|
couponType: undefined,
|
||||||
|
couponDesc: undefined,
|
||||||
|
qrcode: undefined,
|
||||||
|
returnNum: undefined,
|
||||||
|
returnMoney: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
isInvoice: undefined,
|
||||||
|
payTime: undefined,
|
||||||
|
refundTime: undefined,
|
||||||
|
refundApplyTime: undefined,
|
||||||
|
checkBill: undefined,
|
||||||
|
isSettled: undefined,
|
||||||
|
version: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
status: 0,
|
||||||
|
comments: '',
|
||||||
|
sortNumber: 100,
|
||||||
|
orderInfoList: []
|
||||||
|
});
|
||||||
|
|
||||||
|
// 请求状态
|
||||||
|
const loading = ref(true);
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form);
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: '场馆名称',
|
||||||
|
dataIndex: 'merchantName',
|
||||||
|
key: 'merchantName'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '场地',
|
||||||
|
dataIndex: 'fieldName'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '预定信息',
|
||||||
|
dataIndex: 'comments',
|
||||||
|
key: 'comments'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '金额',
|
||||||
|
dataIndex: 'price',
|
||||||
|
customRender: ({ text }) => '¥' + text
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 制作步骤条 */
|
||||||
|
const loadSteps = (order) => {
|
||||||
|
steps.value = [];
|
||||||
|
steps.value.push({
|
||||||
|
title: '下单'
|
||||||
|
});
|
||||||
|
steps.value.push({
|
||||||
|
title: '付款'
|
||||||
|
});
|
||||||
|
steps.value.push({
|
||||||
|
title: '发货'
|
||||||
|
});
|
||||||
|
steps.value.push({
|
||||||
|
title: '收货'
|
||||||
|
});
|
||||||
|
steps.value.push({
|
||||||
|
title: '完成'
|
||||||
|
});
|
||||||
|
|
||||||
|
// 下单
|
||||||
|
if (order.payStatus == 10) {
|
||||||
|
active.value = 0;
|
||||||
|
steps.value[0].description = order.createTime;
|
||||||
|
}
|
||||||
|
// 付款
|
||||||
|
if (order.payStatus == 20) {
|
||||||
|
active.value = 1;
|
||||||
|
steps.value[0].description = order.createTime;
|
||||||
|
steps.value[1].description = order.payTime;
|
||||||
|
}
|
||||||
|
// 发货
|
||||||
|
if (order.payStatus == 20 && order.deliveryStatus == 20) {
|
||||||
|
active.value = 2;
|
||||||
|
steps.value[0].description = order.createTime;
|
||||||
|
steps.value[1].description = order.payTime;
|
||||||
|
steps.value[2].description = order.deliveryTime;
|
||||||
|
}
|
||||||
|
// 收货
|
||||||
|
if (order.payStatus == 20 && order.receiptStatus == 20) {
|
||||||
|
active.value = 3;
|
||||||
|
steps.value[0].description = order.createTime;
|
||||||
|
steps.value[1].description = order.payTime;
|
||||||
|
steps.value[2].description = order.deliveryTime;
|
||||||
|
steps.value[3].description = order.receiptTime;
|
||||||
|
}
|
||||||
|
// 完成
|
||||||
|
if (order.payStatus == 20 && order.orderStatus == 30) {
|
||||||
|
active.value = 4;
|
||||||
|
steps.value[0].description = order.createTime;
|
||||||
|
steps.value[1].description = order.payTime;
|
||||||
|
steps.value[2].description = order.deliveryTime;
|
||||||
|
steps.value[3].description = order.receiptTime;
|
||||||
|
}
|
||||||
|
// 已取消
|
||||||
|
if (order.orderStatus == 20) {
|
||||||
|
active.value = 4;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// const getOrderInfo = () => {
|
||||||
|
// const orderId = props.data?.orderId;
|
||||||
|
// listOrderInfo({ orderId }).then((data) => {
|
||||||
|
// orderInfo.value = data.filter((d) => d.totalNum > 0);
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
if (props.data) {
|
||||||
|
loading.value = false;
|
||||||
|
assignObject(form, props.data);
|
||||||
|
loadSteps(props.data);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.order-card {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.ant-form-item {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
.order-info {
|
||||||
|
display: flex;
|
||||||
|
.info {
|
||||||
|
padding-left: 5px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tag-icon {
|
||||||
|
padding-right: 6px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<SelectMerchantDown
|
<SelectMerchantDown
|
||||||
:placeholder="`选择场馆`"
|
:placeholder="`选择场馆`"
|
||||||
class="input-item"
|
class="input-item"
|
||||||
v-model:value="where.merchantId"
|
v-model:value="where.merchantCode"
|
||||||
@change="search"
|
@change="search"
|
||||||
/>
|
/>
|
||||||
<a-input-search
|
<a-input-search
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
@search="search"
|
@search="search"
|
||||||
@pressEnter="search"
|
@pressEnter="search"
|
||||||
/>
|
/>
|
||||||
<a-button @click="getCode">生成支付二维码</a-button>
|
<!-- <a-button @click="getCode">生成支付二维码</a-button>-->
|
||||||
<a-button @click="reset">重置</a-button>
|
<a-button @click="reset">重置</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
<ele-modal
|
<ele-modal
|
||||||
|
|||||||
@@ -140,20 +140,34 @@
|
|||||||
><CoffeeOutlined class="tag-icon" />未付款,占场中</a-tag
|
><CoffeeOutlined class="tag-icon" />未付款,占场中</a-tag
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-if="column.key === 'orderInfo'">
|
||||||
|
{{ record.orderInfoList }}
|
||||||
|
</template>
|
||||||
<template v-if="column.key === 'orderStatus'">
|
<template v-if="column.key === 'orderStatus'">
|
||||||
<span v-if="record.orderStatus == 0"
|
<span v-if="record.orderStatus == 0" class="ele-text-primary"
|
||||||
><ClockCircleOutlined class="tag-icon" />未使用</span
|
>未使用</span
|
||||||
>
|
>
|
||||||
<span v-if="record.orderStatus == 1"
|
<span v-if="record.orderStatus == 2" class="ele-text-placeholder"
|
||||||
><CheckOutlined class="tag-icon" />已付款</span
|
>已取消</span
|
||||||
>
|
>
|
||||||
<span v-if="record.orderStatus == 3"
|
<span v-if="record.orderStatus == 1" class="ele-text-success"
|
||||||
><CloseOutlined class="tag-icon" />已取消</span
|
>已付款</span
|
||||||
|
>
|
||||||
|
<span v-if="record.orderStatus == 3" class="ele-text-placeholder"
|
||||||
|
>已取消</span
|
||||||
|
>
|
||||||
|
<span v-if="record.orderStatus == 4" class="ele-text-warning"
|
||||||
|
>退款申请中</span
|
||||||
|
>
|
||||||
|
<span v-if="record.orderStatus == 5" class="ele-text-danger"
|
||||||
|
>退款被拒绝</span
|
||||||
|
>
|
||||||
|
<span v-if="record.orderStatus == 6" class="ele-text-heading"
|
||||||
|
>退款成功</span
|
||||||
|
>
|
||||||
|
<span v-if="record.orderStatus == 7" class="ele-text-warning"
|
||||||
|
>客户端申请退款</span
|
||||||
>
|
>
|
||||||
<span v-if="record.orderStatus == 4">退款申请中</span>
|
|
||||||
<span v-if="record.orderStatus == 5">退款被拒绝</span>
|
|
||||||
<span v-if="record.orderStatus == 6">退款成功</span>
|
|
||||||
<span v-if="record.orderStatus == 7">客户端申请退款</span>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'isInvoice'">
|
<template v-if="column.key === 'isInvoice'">
|
||||||
<a-tag v-if="record.isInvoice == 0">未开</a-tag>
|
<a-tag v-if="record.isInvoice == 0">未开</a-tag>
|
||||||
@@ -167,14 +181,15 @@
|
|||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a @click="openEdit(record)">详情</a>
|
<a @click="openEdit(record)">详情</a>
|
||||||
|
<!-- <a-divider type="vertical" />-->
|
||||||
|
<!-- <a @click="openEdit(record)">编辑</a>-->
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</ele-pro-table>
|
</ele-pro-table>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<OrderEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
<OrderInfo v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -186,7 +201,6 @@
|
|||||||
ExclamationCircleOutlined,
|
ExclamationCircleOutlined,
|
||||||
CheckOutlined,
|
CheckOutlined,
|
||||||
CloseOutlined,
|
CloseOutlined,
|
||||||
RestOutlined,
|
|
||||||
ClockCircleOutlined,
|
ClockCircleOutlined,
|
||||||
IdcardOutlined,
|
IdcardOutlined,
|
||||||
WechatOutlined,
|
WechatOutlined,
|
||||||
@@ -199,7 +213,7 @@
|
|||||||
ColumnItem
|
ColumnItem
|
||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import OrderEdit from './components/orderEdit.vue';
|
import OrderInfo from './components/orderInfo.vue';
|
||||||
import {
|
import {
|
||||||
pageOrder,
|
pageOrder,
|
||||||
removeOrder,
|
removeOrder,
|
||||||
@@ -207,6 +221,7 @@
|
|||||||
} from '@/api/booking/order';
|
} from '@/api/booking/order';
|
||||||
import type { Order, OrderParam } from '@/api/booking/order/model';
|
import type { Order, OrderParam } from '@/api/booking/order/model';
|
||||||
import { formatNumber } from 'ele-admin-pro/es';
|
import { formatNumber } from 'ele-admin-pro/es';
|
||||||
|
import { getMerchantId } from '@/utils/common';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -233,6 +248,9 @@
|
|||||||
if (filters) {
|
if (filters) {
|
||||||
where.status = filters.status;
|
where.status = filters.status;
|
||||||
}
|
}
|
||||||
|
where.type = 0;
|
||||||
|
// where.sceneType = 'showOrderGoods';
|
||||||
|
where.merchantId = getMerchantId();
|
||||||
return pageOrder({
|
return pageOrder({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
@@ -295,6 +313,13 @@
|
|||||||
key: 'payStatus',
|
key: 'payStatus',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '付款时间',
|
||||||
|
dataIndex: 'payTime',
|
||||||
|
key: 'payTime',
|
||||||
|
align: 'center',
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '订单状态',
|
title: '订单状态',
|
||||||
dataIndex: 'orderStatus',
|
dataIndex: 'orderStatus',
|
||||||
@@ -314,11 +339,12 @@
|
|||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '付款时间',
|
title: '类型',
|
||||||
dataIndex: 'payTime',
|
dataIndex: 'type',
|
||||||
key: 'payTime',
|
key: 'type',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
customRender: ({ text }) =>
|
||||||
|
['商城订单', '客户预定', '俱乐部训练场', '活动订场'][text]
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: '申请退款时间',
|
// title: '申请退款时间',
|
||||||
@@ -424,11 +450,12 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import * as MenuIcons from '@/layout/menu-icons';
|
||||||
export default {
|
export default {
|
||||||
name: 'Order'
|
name: 'Order',
|
||||||
|
components: MenuIcons
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.tag-icon {
|
.tag-icon {
|
||||||
padding-right: 6px;
|
padding-right: 6px;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<a-form-item label="接收对象" name="toUserIds" v-if="!isUpdate">
|
<a-form-item label="接收对象" name="toUserIds" v-if="!isUpdate">
|
||||||
<SelectStaff
|
<SelectUser
|
||||||
:placeholder="`选择用户`"
|
:placeholder="`选择用户`"
|
||||||
v-model:value="form.toUserName"
|
v-model:value="form.toUserName"
|
||||||
@done="onToUser"
|
@done="onToUser"
|
||||||
@@ -95,6 +95,7 @@
|
|||||||
import highlight from '@bytemd/plugin-highlight-ssr';
|
import highlight from '@bytemd/plugin-highlight-ssr';
|
||||||
import 'highlight.js/styles/default.css';
|
import 'highlight.js/styles/default.css';
|
||||||
import { MerchantAccount } from '@/api/shop/merchantAccount/model';
|
import { MerchantAccount } from '@/api/shop/merchantAccount/model';
|
||||||
|
import { User } from '@/api/system/user/model';
|
||||||
|
|
||||||
// 是否是修改
|
// 是否是修改
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
@@ -190,10 +191,9 @@
|
|||||||
highlight()
|
highlight()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const onToUser = (list: MerchantAccount[]) => {
|
const onToUser = (item: User) => {
|
||||||
merchantAccount.value = list;
|
form.toUserIds = [item.phone];
|
||||||
form.toUserIds = list.map((d) => d.phone);
|
form.toUserName = [item.phone];
|
||||||
form.toUserName = list.map((d) => d.realName);
|
|
||||||
console.log(form);
|
console.log(form);
|
||||||
// form.toUserId = item.userId;
|
// form.toUserId = item.userId;
|
||||||
// form.toUserName = item.nickname;
|
// form.toUserName = item.nickname;
|
||||||
|
|||||||
Reference in New Issue
Block a user