|
@@ -6,9 +6,31 @@
|
|
:model="queryParams"
|
|
:model="queryParams"
|
|
ref="queryFormRef"
|
|
ref="queryFormRef"
|
|
:inline="true"
|
|
:inline="true"
|
|
- label-width="68px"
|
|
|
|
|
|
+ label-width="90px"
|
|
>
|
|
>
|
|
- <el-form-item label="帐号状态" prop="status" v-hasPermi="['menduner:system:enterprise-user-bind:query']">
|
|
|
|
|
|
+ <el-form-item label="企业名称" prop="enterpriseId" v-hasPermi="['menduner:system:enterprise-user-bind:query']">
|
|
|
|
+ <el-select v-model="queryParams.enterpriseId" filterable clearable placeholder="请输入企业名称进行查找" class="!w-240px">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in enterpriseList"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="姓名" prop="name" v-hasPermi="['menduner:system:enterprise-user-bind:query']">
|
|
|
|
+ <el-input v-model="queryParams.name" clearable placeholder="请输入姓名" class="!w-240px" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="联系电话" prop="phone" v-hasPermi="['menduner:system:enterprise-user-bind:query']">
|
|
|
|
+ <el-input v-model="queryParams.phone" clearable class="!w-240px" placeholder="请输入联系电话" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="邮箱" prop="email" v-hasPermi="['menduner:system:enterprise-user-bind:query']">
|
|
|
|
+ <el-input v-model="queryParams.email" clearable class="!w-240px" placeholder="请输入邮箱" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="最后登录IP" prop="loginIp" v-hasPermi="['menduner:system:enterprise-user-bind:query']">
|
|
|
|
+ <el-input v-model="queryParams.loginIp" clearable class="!w-240px" placeholder="请输入最后登录IP" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="帐号状态" prop="status" clearable v-hasPermi="['menduner:system:enterprise-user-bind:query']">
|
|
<el-select
|
|
<el-select
|
|
v-model="queryParams.status"
|
|
v-model="queryParams.status"
|
|
placeholder="请选择帐号状态"
|
|
placeholder="请选择帐号状态"
|
|
@@ -37,14 +59,6 @@
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button v-hasPermi="['menduner:system:enterprise-user-bind:query']" @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
|
<el-button v-hasPermi="['menduner:system:enterprise-user-bind:query']" @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
|
<el-button v-hasPermi="['menduner:system:enterprise-user-bind:query']" @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
|
<el-button v-hasPermi="['menduner:system:enterprise-user-bind:query']" @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- plain
|
|
|
|
- @click="openForm('create')"
|
|
|
|
- v-hasPermi="['menduner:system:enterprise-user-bind:create']"
|
|
|
|
- >
|
|
|
|
- <Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
|
|
- </el-button>
|
|
|
|
<el-button
|
|
<el-button
|
|
type="success"
|
|
type="success"
|
|
plain
|
|
plain
|
|
@@ -68,12 +82,6 @@
|
|
<el-image v-if="scope.row.avatar" style="width: 60px; height: 60px" :src="scope.row.avatar" fit="contain" />
|
|
<el-image v-if="scope.row.avatar" style="width: 60px; height: 60px" :src="scope.row.avatar" fit="contain" />
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="性别" align="center" prop="sex">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <dict-tag v-if="scope.row.sex !== '0'" :type="DICT_TYPE.MENDUNER_SEX" :value="scope.row.sex" />
|
|
|
|
- <span v-else></span>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
<el-table-column label="联系电话" align="center" prop="phone" />
|
|
<el-table-column label="联系电话" align="center" prop="phone" />
|
|
<el-table-column label="邮箱" align="center" prop="email" />
|
|
<el-table-column label="邮箱" align="center" prop="email" />
|
|
<el-table-column label="帐号状态" align="center" prop="status">
|
|
<el-table-column label="帐号状态" align="center" prop="status">
|
|
@@ -96,29 +104,43 @@
|
|
/>
|
|
/>
|
|
<el-table-column label="操作" align="center">
|
|
<el-table-column label="操作" align="center">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
- <!-- <el-button
|
|
|
|
|
|
+ <el-button
|
|
link
|
|
link
|
|
type="primary"
|
|
type="primary"
|
|
- @click="openForm('update', scope.row.id)"
|
|
|
|
- v-hasPermi="['menduner:system:enterprise-user-bind:update']"
|
|
|
|
|
|
+ @click="openDetail(scope.row.id, scope.row.enterpriseId, scope.row.userId)"
|
|
>
|
|
>
|
|
- 编辑
|
|
|
|
|
|
+ 详情
|
|
</el-button>
|
|
</el-button>
|
|
<el-button
|
|
<el-button
|
|
link
|
|
link
|
|
- type="danger"
|
|
|
|
- @click="handleDelete(scope.row.id)"
|
|
|
|
- v-hasPermi="['menduner:system:enterprise-user-bind:delete']"
|
|
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="openEditEmail(scope.row.id)"
|
|
>
|
|
>
|
|
- 删除
|
|
|
|
- </el-button> -->
|
|
|
|
|
|
+ 修改登录邮箱
|
|
|
|
+ </el-button>
|
|
<el-button
|
|
<el-button
|
|
link
|
|
link
|
|
type="primary"
|
|
type="primary"
|
|
- @click="openDetail(scope.row.id, scope.row.enterpriseId, scope.row.userId)"
|
|
|
|
|
|
+ @click="openEditPassword(scope.row.id)"
|
|
>
|
|
>
|
|
- 详情
|
|
|
|
|
|
+ 修改登录密码
|
|
|
|
+ </el-button>
|
|
|
|
+ <!-- <el-button
|
|
|
|
+ v-if="scope.row.status === '0'"
|
|
|
|
+ link
|
|
|
|
+ type="danger"
|
|
|
|
+ @click="handleActions(scope.row.id, 'disabled')"
|
|
|
|
+ >
|
|
|
|
+ 禁用
|
|
</el-button>
|
|
</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="scope.row.status === '1'"
|
|
|
|
+ link
|
|
|
|
+ type="success"
|
|
|
|
+ @click="handleActions(scope.row.id, 'enable')"
|
|
|
|
+ >
|
|
|
|
+ 启用
|
|
|
|
+ </el-button> -->
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -131,8 +153,11 @@
|
|
/>
|
|
/>
|
|
</ContentWrap>
|
|
</ContentWrap>
|
|
|
|
|
|
- <!-- 表单弹窗:添加/修改 -->
|
|
|
|
- <EnterpriseUserBindForm ref="formRef" @success="getList" />
|
|
|
|
|
|
+ <!-- 修改用户登录邮箱 -->
|
|
|
|
+ <EditEmail ref="editEmailRef" @success="getList" />
|
|
|
|
+
|
|
|
|
+ <!-- 修改用户登录密码 -->
|
|
|
|
+ <EditPassword ref="editPasswordRef" @success="getList" />
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
@@ -140,13 +165,15 @@ import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
import download from '@/utils/download'
|
|
import download from '@/utils/download'
|
|
import { EnterpriseUserBindApi, EnterpriseUserBindVO } from '@/api/menduner/system/enterprise/userBind'
|
|
import { EnterpriseUserBindApi, EnterpriseUserBindVO } from '@/api/menduner/system/enterprise/userBind'
|
|
-import EnterpriseUserBindForm from './EnterpriseUserBindForm.vue'
|
|
|
|
|
|
+import EditEmail from './EditEmail.vue'
|
|
|
|
+import EditPassword from './EditPassword.vue'
|
|
|
|
|
|
/** 门墩儿-企业登录用户 列表 */
|
|
/** 门墩儿-企业登录用户 列表 */
|
|
defineOptions({ name: 'EnterpriseUserBind' })
|
|
defineOptions({ name: 'EnterpriseUserBind' })
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
const message = useMessage() // 消息弹窗
|
|
const { t } = useI18n() // 国际化
|
|
const { t } = useI18n() // 国际化
|
|
|
|
+const enterpriseList = ref([])
|
|
|
|
|
|
const loading = ref(true) // 列表的加载中
|
|
const loading = ref(true) // 列表的加载中
|
|
const list = ref<EnterpriseUserBindVO[]>([]) // 列表的数据
|
|
const list = ref<EnterpriseUserBindVO[]>([]) // 列表的数据
|
|
@@ -155,6 +182,11 @@ const queryParams = reactive({
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
status: undefined,
|
|
status: undefined,
|
|
|
|
+ loginIp: undefined,
|
|
|
|
+ name: undefined,
|
|
|
|
+ phone: undefined,
|
|
|
|
+ email: undefined,
|
|
|
|
+ enterpriseId: undefined,
|
|
createTime: ''
|
|
createTime: ''
|
|
})
|
|
})
|
|
const queryFormRef = ref() // 搜索的表单
|
|
const queryFormRef = ref() // 搜索的表单
|
|
@@ -172,6 +204,15 @@ const getList = async () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 企业列表
|
|
|
|
+const getEnterpriseListData = async () => {
|
|
|
|
+ try {
|
|
|
|
+ const data = await EnterpriseUserBindApi.getEnterpriseList()
|
|
|
|
+ enterpriseList.value = data
|
|
|
|
+ } catch (err) {}
|
|
|
|
+}
|
|
|
|
+getEnterpriseListData()
|
|
|
|
+
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
const handleQuery = () => {
|
|
const handleQuery = () => {
|
|
queryParams.pageNo = 1
|
|
queryParams.pageNo = 1
|
|
@@ -190,23 +231,16 @@ const resetQuery = () => {
|
|
handleQuery()
|
|
handleQuery()
|
|
}
|
|
}
|
|
|
|
|
|
-/** 添加/修改操作 */
|
|
|
|
-const formRef = ref()
|
|
|
|
-const openForm = (type: string, id?: number) => {
|
|
|
|
- formRef.value.open(type, id)
|
|
|
|
|
|
+/* 修改用户邮箱 */
|
|
|
|
+const editEmailRef = ref()
|
|
|
|
+const openEditEmail = (id: number) => {
|
|
|
|
+ editEmailRef.value.open(id)
|
|
}
|
|
}
|
|
|
|
|
|
-/** 删除按钮操作 */
|
|
|
|
-const handleDelete = async (id: number) => {
|
|
|
|
- try {
|
|
|
|
- // 删除的二次确认
|
|
|
|
- await message.delConfirm()
|
|
|
|
- // 发起删除
|
|
|
|
- await EnterpriseUserBindApi.deleteEnterpriseUserBind(id)
|
|
|
|
- message.success(t('common.delSuccess'))
|
|
|
|
- // 刷新列表
|
|
|
|
- await getList()
|
|
|
|
- } catch {}
|
|
|
|
|
|
+/* 修改用户登录密码 */
|
|
|
|
+const editPasswordRef = ref()
|
|
|
|
+const openEditPassword = (id: number) => {
|
|
|
|
+ editPasswordRef.value.open(id)
|
|
}
|
|
}
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
@@ -224,6 +258,16 @@ const handleExport = async () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 禁用、启用账户
|
|
|
|
+// const handleActions = async (id: number, type: string) => {
|
|
|
|
+// try {
|
|
|
|
+// type === 'disabled' ? await EnterpriseUserBindApi.disabledEnterpriseAccount([id]) : await EnterpriseUserBindApi.enableEnterpriseAccount([id])
|
|
|
|
+// message.success('操作成功')
|
|
|
|
+// // 刷新列表
|
|
|
|
+// await getList()
|
|
|
|
+// } catch {}
|
|
|
|
+// }
|
|
|
|
+
|
|
/** 初始化 **/
|
|
/** 初始化 **/
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
getList()
|
|
getList()
|