|
@@ -1,86 +1,71 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="member">
|
|
|
|
|
- <el-form label-position="left" label-width="auto">
|
|
|
|
|
- <el-row :gutter="16">
|
|
|
|
|
- <el-col :span="6">
|
|
|
|
|
- <el-form-item label="成员信息">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="formAccessibility.firstName"
|
|
|
|
|
- placeholder="输入姓名,手机号,工号查询"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="6">
|
|
|
|
|
- <el-form-item label="状态">
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="value"
|
|
|
|
|
- placeholder="成员状态"
|
|
|
|
|
- style="width: 240px"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in options"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="4">
|
|
|
|
|
- <el-form-item label="">
|
|
|
|
|
- <el-button type="primary">查询</el-button>
|
|
|
|
|
- <el-button type="primary" plain @click="reset">重置</el-button>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <!-- <el-col :span="24">
|
|
|
|
|
- <el-form-item label="">
|
|
|
|
|
- <el-button type="primary" @click="add(ruleFormRef)">
|
|
|
|
|
- <el-icon><Plus /></el-icon>添加成员</el-button
|
|
|
|
|
- >
|
|
|
|
|
-
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col> -->
|
|
|
|
|
- </el-row>
|
|
|
|
|
- </el-form>
|
|
|
|
|
-
|
|
|
|
|
- <Table
|
|
|
|
|
- :tableData="tableData"
|
|
|
|
|
- :columns="columns"
|
|
|
|
|
- :showIndex="false"
|
|
|
|
|
- :showSelect="true"
|
|
|
|
|
- :pageInfo="pageInfo"
|
|
|
|
|
- @getList="getList"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <PageMain class="vh100">
|
|
|
|
|
+ <ElForm :inline="false" :model="formInline" class="demo-form-inline" label-width="100px">
|
|
|
|
|
+ <ElRow :gutter="20">
|
|
|
|
|
+ <ElCol :md="8">
|
|
|
|
|
+ <ElFormItem label="成员信息">
|
|
|
|
|
+ <el-input v-model="formInline.searchValue" placeholder="输入姓名,手机号,工号查找" clearable class="el-inputs" />
|
|
|
|
|
+ </ElFormItem>
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ <ElCol :md="8">
|
|
|
|
|
+ <ElFormItem label="状态">
|
|
|
|
|
+ <el-select v-model="formInline.isEnable" placeholder="选择状态" clearable class="el-inputs">
|
|
|
|
|
+ <el-option label="全部" value=" " />
|
|
|
|
|
+ <el-option label="启用" :value="1" />
|
|
|
|
|
+ <el-option label="禁用" :value="0" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </ElFormItem>
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ <ElCol :md="8">
|
|
|
|
|
+ <ElFormItem>
|
|
|
|
|
+ <div class="flex j-end" style="width: 100%;">
|
|
|
|
|
+ <el-button type="primary" @click="memberQuery" @keydown.enter="handleEnter">查询</el-button>
|
|
|
|
|
+ <el-button type="default" @click="resetForm">重置</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </ElFormItem>
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ </ElRow>
|
|
|
|
|
+ </ElForm>
|
|
|
|
|
+ <ElDivider border-style="dashed"></ElDivider>
|
|
|
|
|
+ <Table :tableData="tableData" :columns="columns" :showIndex="false" :columnheight="200" :showSelect="true"
|
|
|
|
|
+ :pageInfo="pageInfo" @getList="getList" @selectAllChange="handleSelectionChange" @selectChange="selectChange">
|
|
|
<template v-slot:table-title-btn>
|
|
<template v-slot:table-title-btn>
|
|
|
- <el-button type="primary" @click="add(ruleFormRef)">
|
|
|
|
|
- <el-icon><Plus /></el-icon>添加成员</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button type="primary" @click="userAdd">
|
|
|
|
|
+ 添加成员
|
|
|
|
|
+ <template #icon>
|
|
|
|
|
+ <el-icon>
|
|
|
|
|
+ <Plus />
|
|
|
|
|
+ </el-icon>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-button>
|
|
|
<el-dropdown placement="bottom-start">
|
|
<el-dropdown placement="bottom-start">
|
|
|
- <el-button> 批量操作<el-icon class="el-icon--right">
|
|
|
|
|
|
|
+ <el-button> 批量管理<el-icon>
|
|
|
<arrow-down />
|
|
<arrow-down />
|
|
|
</el-icon>
|
|
</el-icon>
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<template #dropdown>
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
<el-dropdown-menu>
|
|
|
- <el-dropdown-item>批量删除</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item>批量禁用</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item>批量启用</el-dropdown-item>
|
|
|
|
|
|
|
+ <el-dropdown-item :disabled="!sysUpAndDownList.length" @click="batchDel">批量删除</el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item :disabled="!sysUpAndDownList.length" @click="batchdisable">批量禁用</el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item :disabled="!sysUpAndDownList.length" @click="batchenable">批量启用</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-slot:operation="scope">
|
|
<template v-slot:operation="scope">
|
|
|
- <el-button type="primary" link @click="editor(scope)"> 编辑 </el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" link @click="tenantUpdate(scope.operationData.id)"> 编辑 </el-button>
|
|
|
<el-dropdown placement="bottom-start">
|
|
<el-dropdown placement="bottom-start">
|
|
|
<span class="el-dropdown-link">
|
|
<span class="el-dropdown-link">
|
|
|
更 多
|
|
更 多
|
|
|
-
|
|
|
|
|
</span>
|
|
</span>
|
|
|
<template #dropdown>
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu>
|
|
<el-dropdown-menu>
|
|
|
- <el-dropdown-item>删除</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item>禁用</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item>启用</el-dropdown-item>
|
|
|
|
|
|
|
+ <el-dropdown-item @click="del(scope.operationData.id)">删除</el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item v-if="scope.operationData.accountStatus == 1"
|
|
|
|
|
+ @click="disable(scope.operationData.id)">禁用</el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item v-if="scope.operationData.accountStatus == 0"
|
|
|
|
|
+ @click="enable(scope.operationData.id)">启用</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
@@ -89,231 +74,416 @@
|
|
|
{{ scope.slotData.label }}
|
|
{{ scope.slotData.label }}
|
|
|
</template>
|
|
</template>
|
|
|
</Table>
|
|
</Table>
|
|
|
-
|
|
|
|
|
- <el-dialog v-model="dialogVisible" title="基本信息" width="800" draggable>
|
|
|
|
|
- <el-form
|
|
|
|
|
- label-position="top"
|
|
|
|
|
- label-width="auto"
|
|
|
|
|
- :rules="rules"
|
|
|
|
|
- :model="form"
|
|
|
|
|
- ref="ruleFormRef"
|
|
|
|
|
- >
|
|
|
|
|
- <el-row :gutter="24">
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="姓名" prop="name">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model.trim="form.name"
|
|
|
|
|
- maxlength="20"
|
|
|
|
|
- placeholder="输入人员姓名"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="手机号" prop="phone">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model.number.trim="form.phone"
|
|
|
|
|
- maxlength="11"
|
|
|
|
|
- placeholder="输入人员手机号"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ </PageMain>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog v-model="UpdatedialogVisible" :title="dialogTitle" width="40%">
|
|
|
|
|
+ <ElRow :gutter="20">
|
|
|
|
|
+ <el-form :model="memberform" :inline="true" label-width="120px" :rules="memberformRules" label-position="top"
|
|
|
|
|
+ ref="memberFormRef" style="width: 100%;" :size="fromSize">
|
|
|
|
|
+ <ElCol :md="24" :lg="12">
|
|
|
|
|
+ <el-form-item label="姓名" prop="username">
|
|
|
|
|
+ <el-input v-model="memberform.username" placeholder="请输入姓名" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="登录密码" prop="password">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model.trim="form.password"
|
|
|
|
|
- maxlength="20"
|
|
|
|
|
- placeholder="输入登录密码(8-20位,包含字母和数字)"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ <ElCol :md="24" :lg="12">
|
|
|
|
|
+ <el-form-item label="手机号" prop="mobile">
|
|
|
|
|
+ <el-input v-model="memberform.mobile" placeholder="请输入手机号" show-word-limit maxlength="11" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
|
|
- <el-col :span="12">
|
|
|
|
|
- <el-form-item label="角色" prop="role">
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="form.role"
|
|
|
|
|
- placeholder="选择角色"
|
|
|
|
|
- style="width: 240px"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in options"
|
|
|
|
|
- :key="item.value"
|
|
|
|
|
- :label="item.label"
|
|
|
|
|
- :value="item.value"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ <ElCol :md="24" :lg="12">
|
|
|
|
|
+ <el-form-item label="角色" prop="roleNameList">
|
|
|
|
|
+ <el-select v-model="memberform.roleNameList" multiple placeholder="请选择角色" style="width: 100%;">
|
|
|
|
|
+ <el-option :label="item.name" :value="item.id" v-for="(item, index) in roleLists" :key="index" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
|
|
- </el-row>
|
|
|
|
|
- </el-form>
|
|
|
|
|
|
|
+ </ElCol>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </ElRow>
|
|
|
|
|
+
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
|
- <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
|
- <el-button type="primary" @click="dialogVisible = false">
|
|
|
|
|
- 保 存
|
|
|
|
|
|
|
+ <el-button @click="UpdatedialogVisible = false">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="memberAdd">
|
|
|
|
|
+ 保存
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
-<script setup lang="ts">
|
|
|
|
|
-import { ref, reactive } from "vue";
|
|
|
|
|
-import type { ComponentSize, FormInstance, FormRules } from "element-plus";
|
|
|
|
|
-import { Plus,ArrowDown } from "@element-plus/icons-vue";
|
|
|
|
|
|
|
+<script lang="ts" setup>
|
|
|
|
|
+import { ref, reactive } from 'vue'
|
|
|
|
|
+import api from '@/api';
|
|
|
|
|
+import { h } from 'vue'
|
|
|
|
|
+import { RouterLink, useRouter } from "vue-router";
|
|
|
|
|
+// import ImagePreview from '@/components/ImagePreview/index.vue';
|
|
|
|
|
+import { ElMessage, ElTag, ElMessageBox } from 'element-plus'
|
|
|
|
|
+import { FormRules, FormInstance, ComponentSize } from 'element-plus';
|
|
|
|
|
|
|
|
-// import universalTable from "../"
|
|
|
|
|
-const formAccessibility = reactive({
|
|
|
|
|
- fullName: "",
|
|
|
|
|
- firstName: "",
|
|
|
|
|
- lastName: "",
|
|
|
|
|
- phone: "",
|
|
|
|
|
-});
|
|
|
|
|
-const ruleFormRef = ref<FormInstance>();
|
|
|
|
|
-const form = reactive({
|
|
|
|
|
- name: "",
|
|
|
|
|
- role: "",
|
|
|
|
|
- password: "",
|
|
|
|
|
- phone: "",
|
|
|
|
|
-});
|
|
|
|
|
-
|
|
|
|
|
-interface RuleForm {
|
|
|
|
|
- name: string;
|
|
|
|
|
- phone: string;
|
|
|
|
|
- role: string[];
|
|
|
|
|
- password: string;
|
|
|
|
|
-}
|
|
|
|
|
interface PageInfo {
|
|
interface PageInfo {
|
|
|
pageNum: number;
|
|
pageNum: number;
|
|
|
pageSize: number;
|
|
pageSize: number;
|
|
|
sizes: number[];
|
|
sizes: number[];
|
|
|
total: number;
|
|
total: number;
|
|
|
}
|
|
}
|
|
|
-const value = ref("");
|
|
|
|
|
-const dialogVisible = ref(false);
|
|
|
|
|
-const options = [
|
|
|
|
|
- {
|
|
|
|
|
- value: "Option1",
|
|
|
|
|
- label: "Option1",
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- value: "Option2",
|
|
|
|
|
- label: "Option2",
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- value: "Option3",
|
|
|
|
|
- label: "Option3",
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- value: "Option4",
|
|
|
|
|
- label: "Option4",
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- value: "Option5",
|
|
|
|
|
- label: "Option5",
|
|
|
|
|
- },
|
|
|
|
|
-];
|
|
|
|
|
-const validatePhone = (rule: any, value: string, callback: any) => {
|
|
|
|
|
- const reg = /^1[3-9]\d{9}$/;
|
|
|
|
|
- if (!value) {
|
|
|
|
|
- return callback(new Error("手机号码不能为空"));
|
|
|
|
|
- }
|
|
|
|
|
- if (!reg.test(value)) {
|
|
|
|
|
- return callback(new Error("请输入正确的手机号码"));
|
|
|
|
|
- }
|
|
|
|
|
- return callback();
|
|
|
|
|
-};
|
|
|
|
|
-const validatePassword = (rule: any, value: string, callback: any) => {
|
|
|
|
|
- const reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{8,20}$/;
|
|
|
|
|
- if (!value) {
|
|
|
|
|
- return callback(new Error("密码不能为空"));
|
|
|
|
|
- }
|
|
|
|
|
- if (!reg.test(value)) {
|
|
|
|
|
- return callback(new Error("请输入正确的密码格式"));
|
|
|
|
|
- }
|
|
|
|
|
- return callback();
|
|
|
|
|
-};
|
|
|
|
|
-const rules = reactive<FormRules<RuleForm>>({
|
|
|
|
|
- name: [
|
|
|
|
|
- { required: true, message: "请输入成员姓名", trigger: "blur" },
|
|
|
|
|
- { min: 1, max: 20, message: "请输入成员姓名", trigger: "blur" },
|
|
|
|
|
|
|
+interface roleLists {
|
|
|
|
|
+ id: string,
|
|
|
|
|
+ name: string,
|
|
|
|
|
+ [key: string]: any
|
|
|
|
|
+}
|
|
|
|
|
+const tableData = ref([]);//列表数据
|
|
|
|
|
+const memberFormRef = ref<FormInstance>()
|
|
|
|
|
+const fromSize = ref<ComponentSize>('large')//表单大小
|
|
|
|
|
+const UpdatedialogVisible = ref(false)//弹窗
|
|
|
|
|
+const sysUpAndDownList = ref<string[]>([])//选中id
|
|
|
|
|
+const roleLists = ref<roleLists[]>([])//角色列表
|
|
|
|
|
+const dialogTitle = ref('添加成员')//弹窗title
|
|
|
|
|
+const dialogType = ref('add')//弹窗title
|
|
|
|
|
+const router = useRouter();
|
|
|
|
|
+const memberform = reactive({
|
|
|
|
|
+ username: "",//机构名称
|
|
|
|
|
+ mobile: "",//上级机构
|
|
|
|
|
+ roleNameList: [],
|
|
|
|
|
+ id: '',
|
|
|
|
|
+})
|
|
|
|
|
+const memberformRules = ref<FormRules>({
|
|
|
|
|
+ username: [
|
|
|
|
|
+ { required: true, trigger: 'blur', message: '请输入姓名' },
|
|
|
|
|
+ { min: 2, max: 20, message: '请输入2~20个字符', trigger: 'blur' },
|
|
|
|
|
+ ],
|
|
|
|
|
+ roleNameList: [
|
|
|
|
|
+ { required: true, trigger: 'change', message: '请选择角色' },
|
|
|
|
|
+ ],
|
|
|
|
|
+ mobile: [
|
|
|
|
|
+ { required: true, trigger: 'blur', message: '请输入手机号' },
|
|
|
],
|
|
],
|
|
|
- phone: [{ required: true, validator: validatePhone, trigger: "blur" }],
|
|
|
|
|
- password: [{ required: true, validator: validatePassword, trigger: "blur" }],
|
|
|
|
|
- role: [{ required: true, message: "请选择角色", trigger: "change" }],
|
|
|
|
|
-});
|
|
|
|
|
-// import Select from "@/components/select/selectMain.vue";
|
|
|
|
|
-// import TestTable from "@/components/Table/index.vue";
|
|
|
|
|
-const tableData = [
|
|
|
|
|
- {
|
|
|
|
|
- size: "2024/12/1",
|
|
|
|
|
- Name: "Dec",
|
|
|
|
|
- Phone: "13333333333",
|
|
|
|
|
- role: "公司",
|
|
|
|
|
- status: "123",
|
|
|
|
|
- },
|
|
|
|
|
-];
|
|
|
|
|
-const columns = [
|
|
|
|
|
- { prop: "Name", label: "姓名" },
|
|
|
|
|
- { prop: "Phone", label: "手机号" },
|
|
|
|
|
- { prop: "size", label: "工号" },
|
|
|
|
|
- { prop: "role", label: "角色" },
|
|
|
|
|
- { prop: "status", label: "状态" },
|
|
|
|
|
|
|
|
|
|
- // {
|
|
|
|
|
- // prop: "operation", label: "operation", width: "280",
|
|
|
|
|
- // type:'operation', btn:[{
|
|
|
|
|
- // type:"pramary",
|
|
|
|
|
- // label:"编辑"
|
|
|
|
|
- // }]
|
|
|
|
|
- // },
|
|
|
|
|
-];
|
|
|
|
|
-const pageInfo = {
|
|
|
|
|
|
|
+});
|
|
|
|
|
+//分页
|
|
|
|
|
+const pageInfo = ref({
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
|
|
|
|
+ pageSize: 20,
|
|
|
sizes: [10, 20, 30, 40, 50],
|
|
sizes: [10, 20, 30, 40, 50],
|
|
|
total: 100,
|
|
total: 100,
|
|
|
|
|
+});
|
|
|
|
|
+//检索条件
|
|
|
|
|
+const formInline = reactive({
|
|
|
|
|
+ searchValue: '',
|
|
|
|
|
+ isEnable: '',
|
|
|
|
|
+})
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ findpage();
|
|
|
|
|
+ roleListfun();
|
|
|
|
|
+ window.addEventListener('keydown', handleEnter)
|
|
|
|
|
+});
|
|
|
|
|
+onUnmounted(() => {
|
|
|
|
|
+ window.removeEventListener('keydown', handleEnter, false)
|
|
|
|
|
+})
|
|
|
|
|
+function findpage() {
|
|
|
|
|
+ api.member.userList({ page: pageInfo.value.pageNum, size: pageInfo.value.pageSize, ...formInline }).then((res: any) => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ tableData.value = res.data.records;
|
|
|
|
|
+ pageInfo.value.pageNum = res.data.current;
|
|
|
|
|
+ pageInfo.value.pageSize = res.data.size;
|
|
|
|
|
+ pageInfo.value.total = res.data.total;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+const roleListfun = () => {
|
|
|
|
|
+ api.roleApi.roleList({ name: "" }).then((res: any) => {
|
|
|
|
|
+ if (res.code == '200') {
|
|
|
|
|
+ roleLists.value = res.data;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+//添加
|
|
|
|
|
+const memberAdd = () => {
|
|
|
|
|
+ if (dialogType.value == 'add') {
|
|
|
|
|
+ api.member.userAdd(memberform).then((res: any) => {
|
|
|
|
|
+ if (res.code == '200') {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ findpage();
|
|
|
|
|
+ UpdatedialogVisible.value = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.log(memberform)
|
|
|
|
|
+ api.member.userEdit(memberform).then((res: any) => {
|
|
|
|
|
+ if (res.code == '200') {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ findpage();
|
|
|
|
|
+ UpdatedialogVisible.value = false;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+//交互事件===========================
|
|
|
|
|
+function handleEnter(e: any) {
|
|
|
|
|
+ if (e.keyCode == 13 || e.keyCode == 108) {
|
|
|
|
|
+ //登录接口逻辑
|
|
|
|
|
+ memberQuery()
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+const statusformatter = (row: any, column: any, cellValue: any) => {
|
|
|
|
|
+ let accountStatus = row.accountStatus;
|
|
|
|
|
+ if (accountStatus) {
|
|
|
|
|
+ return () => h(ElTag, { type: 'primary' }, '启用');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return () => h(ElTag, { type: 'danger' }, '禁用');
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
-const getList = (item: PageInfo) => {
|
|
|
|
|
- pageInfo.pageNum = item.pageNum;
|
|
|
|
|
- pageInfo.pageSize = item.pageSize;
|
|
|
|
|
-};
|
|
|
|
|
-const editor = (item: any) => {
|
|
|
|
|
- dialogVisible.value = true;
|
|
|
|
|
- // pageInfo.pageNum=item.pageNum
|
|
|
|
|
- // pageInfo.pageSize=item.pageSize
|
|
|
|
|
-};
|
|
|
|
|
-const add = (formEl: FormInstance | undefined) => {
|
|
|
|
|
- dialogVisible.value = true;
|
|
|
|
|
- if (!formEl) return;
|
|
|
|
|
- formEl.resetFields();
|
|
|
|
|
- // pageInfo.pageNum=item.pageNum
|
|
|
|
|
- // pageInfo.pageSize=item.pageSize
|
|
|
|
|
|
|
+const roleNameformatter = (row: any, column: any, cellValue: any) => {
|
|
|
|
|
+ let roleNameList = row.roleNameList;
|
|
|
|
|
+ let roleName = roleNameList.join(',');
|
|
|
|
|
+ return () => h('div', {}, roleName);
|
|
|
};
|
|
};
|
|
|
|
|
+const columns = [
|
|
|
|
|
+ { prop: "username", label: "姓名", width: '120', },
|
|
|
|
|
+ { prop: "mobile", label: "手机号", width: '120' },
|
|
|
|
|
+ { prop: "id", label: "工号", width: '180', },
|
|
|
|
|
+ { prop: "roleNameList", label: "角色",formatter: roleNameformatter },
|
|
|
|
|
+ { prop: "accountStatus", label: "状态", formatter: statusformatter },
|
|
|
|
|
+
|
|
|
|
|
+];
|
|
|
|
|
|
|
|
-const operationMany = (item: any) => {
|
|
|
|
|
- // pageInfo.pageNum=item.pageNum
|
|
|
|
|
- // pageInfo.pageSize=item.pageSize
|
|
|
|
|
|
|
+function getList(item: PageInfo) {
|
|
|
|
|
+ pageInfo.value.pageNum = item.pageNum;
|
|
|
|
|
+ pageInfo.value.pageSize = item.pageSize;
|
|
|
};
|
|
};
|
|
|
|
|
+function tenantUpdate(id: string) {
|
|
|
|
|
+ dialogTitle.value = '编辑成员';
|
|
|
|
|
+ dialogType.value = 'edit';
|
|
|
|
|
+ api.member.userGet({ id: id }).then((res: any) => {
|
|
|
|
|
+ if (res.code == '200') {
|
|
|
|
|
+ memberform.id = res.data.id;
|
|
|
|
|
+ memberform.username = res.data.username;
|
|
|
|
|
+ memberform.mobile = res.data.mobile;
|
|
|
|
|
+ memberform.roleNameList = res.data.roleNameList;
|
|
|
|
|
+ UpdatedialogVisible.value = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+const handleSelectionChange = (val: any) => {
|
|
|
|
|
+ sysUpAndDownList.value = val;
|
|
|
|
|
+}
|
|
|
|
|
+const selectChange = (val: any) => {
|
|
|
|
|
+ sysUpAndDownList.value = val;
|
|
|
|
|
|
|
|
|
|
+}
|
|
|
|
|
+//删除
|
|
|
|
|
+const del = (value: string) => {
|
|
|
|
|
+ ElMessageBox.confirm(
|
|
|
|
|
+ '账号删除后,该账号将无法使用访问本企业,请确定是否删除?',
|
|
|
|
|
+ '确定要删除账号吗?',
|
|
|
|
|
+ {
|
|
|
|
|
+ confirmButtonText: '确认删除',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ customClass: 'ElMessageBoxClass'
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ api.member.userDelete([value]).then((res: any) => {
|
|
|
|
|
+ if (res.code == '200') {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ findpage();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+//禁用
|
|
|
|
|
+const disable = (value: string) => {
|
|
|
|
|
+ ElMessageBox.confirm(
|
|
|
|
|
+ '确定要禁用账号吗?',
|
|
|
|
|
+ '禁用账号',
|
|
|
|
|
+ {
|
|
|
|
|
+ confirmButtonText: '确认禁用',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ customClass: 'ElMessageBoxClass'
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ sysUpAndDown(0, [value]);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+//启用
|
|
|
|
|
+const enable = (value: string) => {
|
|
|
|
|
+ sysUpAndDown(1, [value]);
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+//批量删除
|
|
|
|
|
+const batchDel = () => {
|
|
|
|
|
+ ElMessageBox.confirm(
|
|
|
|
|
+ '账号删除后,该账号将无法使用访问本企业,请确定是否删除?',
|
|
|
|
|
+ '确定要删除账号吗?',
|
|
|
|
|
+ {
|
|
|
|
|
+ confirmButtonText: '确认删除',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ customClass: 'ElMessageBoxClass'
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ api.member.userDelete(sysUpAndDownList.value).then((res: any) => {
|
|
|
|
|
+ if (res.code == '200') {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ findpage();
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+//批量禁用
|
|
|
|
|
+const batchdisable = () => {
|
|
|
|
|
+ ElMessageBox.confirm(
|
|
|
|
|
+ '确定要禁用账号吗?',
|
|
|
|
|
+ '禁用账号',
|
|
|
|
|
+ {
|
|
|
|
|
+ confirmButtonText: '确认禁用',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'error',
|
|
|
|
|
+ customClass: 'ElMessageBoxClass'
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ .then(async () => {
|
|
|
|
|
+ await sysUpAndDown(0, undefined);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
-const reset = (item: any) => {
|
|
|
|
|
- // ElMessage({})
|
|
|
|
|
-};
|
|
|
|
|
|
|
|
|
|
|
|
+}
|
|
|
|
|
+//批量启用
|
|
|
|
|
+const batchenable = async () => {
|
|
|
|
|
+ await sysUpAndDown(1, undefined);
|
|
|
|
|
+}
|
|
|
|
|
+const memberQuery = () => {
|
|
|
|
|
+ findpage();
|
|
|
|
|
+}
|
|
|
|
|
+const sysUpAndDown = async (type: number, list?: string[]) => {
|
|
|
|
|
+ await api.member.upAndDown({ ids: list ? list : sysUpAndDownList.value, opType: type }).then((res: any) => {
|
|
|
|
|
+ if (res.code == '200') {
|
|
|
|
|
+ findpage();
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: res.msg,
|
|
|
|
|
+ plain: true,
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+//添加子机构
|
|
|
|
|
+// const subOrganizationAdd = (code: string) => {
|
|
|
|
|
+// router.push({
|
|
|
|
|
+// name: 'OrganizationDeptAdd',
|
|
|
|
|
+// query: {
|
|
|
|
|
+// code: code
|
|
|
|
|
+// }
|
|
|
|
|
+// })
|
|
|
|
|
+// }
|
|
|
|
|
+const resetForm = () => {
|
|
|
|
|
+ formInline.searchValue = '';
|
|
|
|
|
+ formInline.isEnable = "";
|
|
|
|
|
+}
|
|
|
|
|
+const userAdd = () => {
|
|
|
|
|
+ dialogTitle.value = '添加成员';
|
|
|
|
|
+ dialogType.value = 'add';
|
|
|
|
|
+ memberform.id = "";
|
|
|
|
|
+ UpdatedialogVisible.value = true;
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
+
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
-.member {
|
|
|
|
|
- background: #fff;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- // height: 100%;
|
|
|
|
|
- padding: 20px;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
-}
|
|
|
|
|
:deep(.el-dropdown-link) {
|
|
:deep(.el-dropdown-link) {
|
|
|
- cursor: pointer;
|
|
|
|
|
- color: var(--el-color-primary);
|
|
|
|
|
display: flex;
|
|
display: flex;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
margin-left: 15px;
|
|
margin-left: 15px;
|
|
|
|
|
+ color: var(--el-color-primary);
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+:deep(.el-divider--horizontal) {
|
|
|
|
|
+ margin: 8px 0 24px;
|
|
|
|
|
+ color: #f2f2f2;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.el-inputs {
|
|
|
|
|
+ width: 100% !important;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|