修复商户账号添加功能
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="商户图标" name="image">
|
||||
<a-form-item label="店铺图标" name="image">
|
||||
<SelectFile
|
||||
:placeholder="`请选择图片`"
|
||||
:limit="1"
|
||||
|
||||
@@ -7,24 +7,24 @@
|
||||
</template>
|
||||
<span>添加</span>
|
||||
</a-button>
|
||||
<a-button class="ele-btn-icon" @click="openUrl(`/shop/index`)">
|
||||
<span>店铺管理</span>
|
||||
</a-button>
|
||||
<a-button class="ele-btn-icon" @click="openUrl(`/shop/index`)">
|
||||
<span>门店职员</span>
|
||||
</a-button>
|
||||
<a-button class="ele-btn-icon" @click="openUrl(`/goods/category/:id`)">
|
||||
<span>商品分类</span>
|
||||
</a-button>
|
||||
<a-button class="ele-btn-icon" @click="openUrl(`/shop/apply`)">
|
||||
<span>入驻申请</span>
|
||||
</a-button>
|
||||
<a-button class="ele-btn-icon" @click="openUrl(`/shop/desk`)">
|
||||
<span>桌号管理</span>
|
||||
</a-button>
|
||||
<a-button class="ele-btn-icon" @click="openUrl(`/shop/type`)">
|
||||
<span>店铺类型</span>
|
||||
</a-button>
|
||||
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/shop/index`)">-->
|
||||
<!-- <span>店铺管理</span>-->
|
||||
<!-- </a-button>-->
|
||||
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/shop/index`)">-->
|
||||
<!-- <span>门店职员</span>-->
|
||||
<!-- </a-button>-->
|
||||
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/goods/category/:id`)">-->
|
||||
<!-- <span>商品分类</span>-->
|
||||
<!-- </a-button>-->
|
||||
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/shop/apply`)">-->
|
||||
<!-- <span>入驻申请</span>-->
|
||||
<!-- </a-button>-->
|
||||
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/shop/desk`)">-->
|
||||
<!-- <span>桌号管理</span>-->
|
||||
<!-- </a-button>-->
|
||||
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/shop/type`)">-->
|
||||
<!-- <span>店铺类型</span>-->
|
||||
<!-- </a-button>-->
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
import { openUrl } from '@/utils/common';
|
||||
import router from '@/router';
|
||||
import { getMerchant } from '@/api/shop/merchant';
|
||||
import merchant from "@/views/shop/merchant/index.vue";
|
||||
import { getMerchantId } from "@/utils/merchant";
|
||||
import merchant from '@/views/shop/merchant/index.vue';
|
||||
import { getMerchantId } from '@/utils/merchant';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
|
||||
@@ -127,13 +127,13 @@
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '商户姓名',
|
||||
title: '姓名',
|
||||
dataIndex: 'realName',
|
||||
key: 'realName',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '商户手机号',
|
||||
title: '登录账号',
|
||||
dataIndex: 'phone',
|
||||
key: 'phone',
|
||||
align: 'center'
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
:width="600"
|
||||
:visible="visible"
|
||||
:maskClosable="false"
|
||||
:title="isUpdate ? '编辑商户职员' : '添加商户职员'"
|
||||
:title="isUpdate ? '编辑账号' : '添加账号'"
|
||||
:body-style="{ paddingBottom: '28px' }"
|
||||
@update:visible="updateVisible"
|
||||
@ok="save"
|
||||
@@ -18,30 +18,34 @@
|
||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||
"
|
||||
>
|
||||
<a-form-item label="职员名称" name="realName">
|
||||
<a-form-item label="选择商户" name="merchantId">
|
||||
<SelectMerchant
|
||||
:placeholder="`选择商户`"
|
||||
v-model:value="form.merchantName"
|
||||
@done="chooseMerchantId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="选择用户" name="userId">
|
||||
<SelectUser
|
||||
:placeholder="`选择用户`"
|
||||
v-model:value="form.phone"
|
||||
@done="chooseUserId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="选择角色" name="roleId">
|
||||
<SelectRole
|
||||
:placeholder="`选择角色`"
|
||||
v-model:value="form.roleName"
|
||||
@done="chooseRoleId"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="真实名称" name="realName">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入真实姓名"
|
||||
v-model:value="form.realName"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="登录账号" name="phone">
|
||||
<a-input
|
||||
allow-clear
|
||||
placeholder="请输入手机号码"
|
||||
:maxlength="11"
|
||||
:disabled="isUpdate && form.phone"
|
||||
v-model:value="form.phone"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="密码" name="password" v-if="!isUpdate">
|
||||
<a-input-password
|
||||
allow-clear
|
||||
placeholder="请输入登录密码"
|
||||
:disabled="isUpdate"
|
||||
v-model:value="form.password"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" name="comments">
|
||||
<a-textarea
|
||||
:rows="4"
|
||||
@@ -74,6 +78,9 @@
|
||||
getRoleIdByMerchant,
|
||||
getRoleNameByMerchant
|
||||
} from '@/utils/merchant';
|
||||
import { User } from '@/api/system/user/model';
|
||||
import { Role } from '@/api/system/role/model';
|
||||
import { Merchant } from '@/api/shop/merchant/model';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
@@ -191,6 +198,22 @@
|
||||
]
|
||||
});
|
||||
|
||||
const chooseUserId = (user: User) => {
|
||||
form.userId = user.userId;
|
||||
form.realName = user.realName;
|
||||
form.phone = user.phone;
|
||||
};
|
||||
|
||||
const chooseMerchantId = (data: Merchant) => {
|
||||
form.merchantId = data.merchantId;
|
||||
form.merchantName = data.merchantName;
|
||||
};
|
||||
|
||||
const chooseRoleId = (data: Role) => {
|
||||
form.roleId = data.roleId;
|
||||
form.roleName = data.roleName;
|
||||
};
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
@@ -203,12 +226,12 @@
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
const formData = {
|
||||
...form,
|
||||
merchantId: getMerchantId(),
|
||||
merchantName: getMerchantName(),
|
||||
merchantAvatar: getMerchantAvatar(),
|
||||
roleId: getRoleIdByMerchant(),
|
||||
roleName: getRoleNameByMerchant()
|
||||
...form
|
||||
// merchantId: getMerchantId(),
|
||||
// merchantName: getMerchantName(),
|
||||
// merchantAvatar: getMerchantAvatar(),
|
||||
// roleId: getRoleIdByMerchant(),
|
||||
// roleName: getRoleNameByMerchant()
|
||||
};
|
||||
const saveOrUpdate = isUpdate.value
|
||||
? updateMerchantAccount
|
||||
|
||||
@@ -30,10 +30,7 @@
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a-popconfirm
|
||||
title="确定要移除该门店用户吗?"
|
||||
@confirm="remove(record)"
|
||||
>
|
||||
<a-popconfirm title="确定要移除吗?" @confirm="remove(record)">
|
||||
<a class="ele-text-danger">移除</a>
|
||||
</a-popconfirm>
|
||||
</a-space>
|
||||
@@ -122,7 +119,7 @@
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '门店名称',
|
||||
title: '店铺名称',
|
||||
dataIndex: 'merchantName',
|
||||
key: 'merchantName',
|
||||
align: 'center'
|
||||
|
||||
Reference in New Issue
Block a user