完成商城下单功能
This commit is contained in:
@@ -18,8 +18,8 @@
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="选择场馆" name="merchantId">
|
||||
<SelectMerchant
|
||||
<a-form-item label="选择场馆" name="merchantId" v-if="!getMerchantId()">
|
||||
<SelectMerchantMultipleDown
|
||||
:placeholder="`选择场馆`"
|
||||
class="input-item"
|
||||
v-model:value="form.merchantName"
|
||||
@@ -49,7 +49,7 @@
|
||||
allow-clear
|
||||
placeholder="请输入手机号码"
|
||||
maxlength="11"
|
||||
:disabled="isUpdate"
|
||||
:disabled="isUpdate && !isSuperAdmin"
|
||||
v-model:value="form.phone"
|
||||
/>
|
||||
</a-form-item>
|
||||
@@ -73,7 +73,7 @@
|
||||
</template>
|
||||
|
||||
<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 { assignObject } from 'ele-admin-pro';
|
||||
import { addUser, updateUser } from '@/api/system/user';
|
||||
@@ -82,8 +82,12 @@
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance, RuleObject } from 'ant-design-vue/es/form';
|
||||
import { Role } from '@/api/system/role/model';
|
||||
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);
|
||||
@@ -91,6 +95,8 @@
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
const { styleResponsive } = storeToRefs(themeStore);
|
||||
// 当前用户信息
|
||||
const loginUser = computed(() => userStore.info ?? {});
|
||||
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
@@ -107,10 +113,11 @@
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
const isSuperAdmin = ref<boolean>(false);
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<User>({
|
||||
@@ -120,8 +127,8 @@
|
||||
nickname: '',
|
||||
realName: '',
|
||||
companyName: '',
|
||||
merchantId: undefined,
|
||||
merchantName: undefined,
|
||||
merchantId: getMerchantId(),
|
||||
merchantName: getMerchantName(),
|
||||
sex: undefined,
|
||||
roles: [],
|
||||
roleId: undefined,
|
||||
@@ -217,11 +224,6 @@
|
||||
form.merchantName = item.merchantName;
|
||||
};
|
||||
|
||||
const chooseRoleId = (item: Role) => {
|
||||
form.roleId = item.roleId;
|
||||
form.roleName = item.roleName;
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
@@ -236,6 +238,10 @@
|
||||
const formData = {
|
||||
...form
|
||||
};
|
||||
if (getMerchantId()) {
|
||||
form.merchantId = getMerchantId();
|
||||
form.merchantName = getMerchantName();
|
||||
}
|
||||
const saveOrUpdate = isUpdate.value ? updateUser : addUser;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
@@ -257,8 +263,6 @@
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
images.value = [];
|
||||
console.log(props.data);
|
||||
console.log(form);
|
||||
if (props.data) {
|
||||
assignObject(form, props.data);
|
||||
isUpdate.value = true;
|
||||
@@ -266,6 +270,13 @@
|
||||
resetFields();
|
||||
isUpdate.value = false;
|
||||
}
|
||||
const superAdmin = loginUser.value.roles?.filter(
|
||||
(d) => d.roleCode == 'superAdmin'
|
||||
);
|
||||
// 是否超级管理员
|
||||
if (superAdmin && superAdmin.length > 0) {
|
||||
isSuperAdmin.value = true;
|
||||
}
|
||||
} else {
|
||||
resetFields();
|
||||
}
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
<template>
|
||||
<a-space :size="10" style="flex-wrap: wrap">
|
||||
<SelectMerchantDown
|
||||
v-if="!getMerchantId()"
|
||||
:placeholder="`选择场馆`"
|
||||
class="input-item"
|
||||
v-model:value="where.merchantCode"
|
||||
v-model:value="where.merchantId"
|
||||
@change="search"
|
||||
/>
|
||||
<a-date-picker
|
||||
@@ -44,7 +45,7 @@
|
||||
import { OrderParam } from '@/api/shop/order/model';
|
||||
import { getNativeCode } from '@/api/system/payment';
|
||||
import { getNext7day, getServerTime } from '@/api/layout';
|
||||
import { getWeek } from '@/utils/common';
|
||||
import { getMerchantId } from '@/utils/common';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -76,7 +77,7 @@
|
||||
isStatus: 0,
|
||||
merchantCode: undefined,
|
||||
week: 0,
|
||||
merchantId: undefined
|
||||
merchantId: getMerchantId()
|
||||
});
|
||||
|
||||
/* 搜索 */
|
||||
@@ -114,8 +115,8 @@
|
||||
getServerTime().then((res) => {
|
||||
serverTime.value = res;
|
||||
where.dateTime = res.today;
|
||||
where.merchantId = 3032;
|
||||
where.merchantCode = '37';
|
||||
where.merchantId = getMerchantId();
|
||||
// where.merchantCode = '37';
|
||||
where.isStatus = 0;
|
||||
emit('search', where);
|
||||
});
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
import { Field } from '@/api/booking/field/model';
|
||||
import { getOrder } from '@/api/booking/order';
|
||||
import { reloadPageTab } from '@/utils/page-tab-util';
|
||||
import { getMerchantId } from '@/utils/common';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
@@ -103,6 +104,7 @@
|
||||
where.status = filters.status;
|
||||
}
|
||||
where.type = 1;
|
||||
where.merchantId = getMerchantId();
|
||||
return pageOrder({
|
||||
...where,
|
||||
...orders,
|
||||
|
||||
@@ -70,14 +70,14 @@
|
||||
/>
|
||||
<div class="ele-text-placeholder">上传视频(mp4格式),视频时长不超过60秒,视频大小不超过200M。</div>
|
||||
</a-form-item>
|
||||
<a-form-item label="商品标题" name="title">
|
||||
<a-form-item label="商品名称" name="title">
|
||||
<a-space style="margin-bottom: 20px">
|
||||
<a-input
|
||||
allow-clear
|
||||
show-count
|
||||
:maxlength="60"
|
||||
style="width: 558px"
|
||||
placeholder="请输入商品标题"
|
||||
placeholder="请输入商品名称"
|
||||
v-model:value="form.title"
|
||||
/>
|
||||
</a-space>
|
||||
@@ -472,7 +472,7 @@
|
||||
title: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择商品标题',
|
||||
message: '请选择商品名称',
|
||||
type: 'string',
|
||||
trigger: 'blur'
|
||||
}
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
/>
|
||||
</template>
|
||||
<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
|
||||
record.goodsName
|
||||
}}</a>
|
||||
</template>
|
||||
<template v-if="column.key === 'image'">
|
||||
@@ -69,7 +69,7 @@
|
||||
import GoodsEdit from './components/goodsEdit.vue';
|
||||
import { pageGoods, removeGoods, removeBatchGoods } from '@/api/shop/goods';
|
||||
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';
|
||||
const { currentRoute } = useRouter();
|
||||
|
||||
@@ -98,6 +98,7 @@
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
where.merchantId = getMerchantId();
|
||||
return pageGoods({
|
||||
...where,
|
||||
...orders,
|
||||
@@ -122,8 +123,8 @@
|
||||
},
|
||||
{
|
||||
title: '课程名称',
|
||||
dataIndex: 'title',
|
||||
key: 'title'
|
||||
dataIndex: 'goodsName',
|
||||
key: 'goodsName'
|
||||
},
|
||||
{
|
||||
title: '课程售价',
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
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 { Order } from '@/api/shop/order/model';
|
||||
import { ColumnItem } from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
@@ -158,6 +158,7 @@
|
||||
CloseOutlined,
|
||||
CoffeeOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import { pageOrderInfo } from '@/api/shop/orderInfo';
|
||||
|
||||
const useForm = Form.useForm;
|
||||
|
||||
@@ -364,8 +365,12 @@
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
if (props.data) {
|
||||
loading.value = false;
|
||||
loading.value = true;
|
||||
assignObject(form, props.data);
|
||||
pageOrderInfo({ orderId: form.orderId }).then((res) => {
|
||||
form.orderInfoList = res?.list;
|
||||
loading.value = false;
|
||||
});
|
||||
loadSteps(props.data);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -221,6 +221,7 @@
|
||||
} from '@/api/booking/order';
|
||||
import type { Order, OrderParam } from '@/api/booking/order/model';
|
||||
import { formatNumber } from 'ele-admin-pro/es';
|
||||
import { getMerchantId } from '@/utils/common';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
@@ -248,6 +249,8 @@
|
||||
where.status = filters.status;
|
||||
}
|
||||
where.type = 1;
|
||||
// where.sceneType = 'showOrderInfo';
|
||||
where.merchantId = getMerchantId();
|
||||
return pageOrder({
|
||||
...where,
|
||||
...orders,
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
<!-- 搜索表单 -->
|
||||
<template>
|
||||
<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>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
|
||||
@@ -46,7 +46,11 @@
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<WechatDepositEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
<WechatDepositEdit
|
||||
v-model:visible="showEdit"
|
||||
:data="current"
|
||||
@done="reload"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -63,8 +67,16 @@
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import WechatDepositEdit from './components/wechatDepositEdit.vue';
|
||||
import { pageWechatDeposit, removeWechatDeposit, removeBatchWechatDeposit } from '@/api/shop/wechatDeposit';
|
||||
import type { WechatDeposit, WechatDepositParam } from '@/api/shop/wechatDeposit/model';
|
||||
import {
|
||||
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);
|
||||
@@ -91,6 +103,7 @@
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
where.merchantId = getMerchantId();
|
||||
return pageWechatDeposit({
|
||||
...where,
|
||||
...orders,
|
||||
@@ -105,43 +118,43 @@
|
||||
title: '订单号',
|
||||
dataIndex: 'orderNum',
|
||||
key: 'orderNum',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '场馆名称',
|
||||
dataIndex: 'siteName',
|
||||
key: 'siteName',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '微信昵称',
|
||||
dataIndex: 'username',
|
||||
key: 'username',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '手机号码',
|
||||
dataIndex: 'phone',
|
||||
key: 'phone',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '物品名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '押金金额',
|
||||
dataIndex: 'price',
|
||||
key: 'price',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '押金状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
align: 'center',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
|
||||
Reference in New Issue
Block a user