|
|
@@ -0,0 +1,399 @@
|
|
|
+<template>
|
|
|
+ <div class="institution">
|
|
|
+ <div class="institution-main">
|
|
|
+ <el-form label-position="left" label-width="auto">
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="成员信息">
|
|
|
+ <el-input
|
|
|
+ v-model="formAccessibility.firstName"
|
|
|
+ placeholder="输入成员信息查找"
|
|
|
+ :prefix-icon="Search"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="归属机构">
|
|
|
+ <el-cascader
|
|
|
+ clearable
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="info.deptId"
|
|
|
+ :options="institutionList"
|
|
|
+ :props="tableProps"
|
|
|
+
|
|
|
+ />
|
|
|
+ </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-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <Table
|
|
|
+ :tableData="tableData"
|
|
|
+ :columns="columns"
|
|
|
+ :showIndex="false"
|
|
|
+ :showSelect="true"
|
|
|
+ :pageInfo="pageInfo"
|
|
|
+ @getList="getList"
|
|
|
+ :treeProps="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
+ @select-all-change="selectAllChange"
|
|
|
+ @select-change="selectChange"
|
|
|
+ >
|
|
|
+ <template v-slot:table-title-btn>
|
|
|
+ <div>
|
|
|
+ <!-- <el-button type="primary" @click="add(ruleFormRef)">
|
|
|
+ <el-icon><Plus /></el-icon>添加机构</el-button
|
|
|
+ > -->
|
|
|
+ <el-button @click="router.push({path:'/content/message/messageEdit'})"><el-icon><Position /></el-icon>发布新的通知</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:operation="scope">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ link
|
|
|
+ @click="editor(scope.operationData.row)"
|
|
|
+ >
|
|
|
+ 详情
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <template v-slot:search="scope">
|
|
|
+ {{ scope.slotData.label }}
|
|
|
+ </template>
|
|
|
+ </Table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import { ref, reactive, watch, onMounted } from "vue";
|
|
|
+import type {
|
|
|
+ ComponentSize,
|
|
|
+ FormInstance,
|
|
|
+ FormRules,
|
|
|
+ TabsPaneContext,
|
|
|
+} from "element-plus";
|
|
|
+import { Plus, Search,Position } from "@element-plus/icons-vue";
|
|
|
+import { useRouter } from "vue-router";
|
|
|
+
|
|
|
+// import universalTable from "../"
|
|
|
+import { ElMessage, ElMessageBox, ElPopconfirm, ElTree } from "element-plus";
|
|
|
+import api from "@/api";
|
|
|
+import { h } from "vue";
|
|
|
+import setDept from "@/components/DialogSetDeptLeader/index.vue";
|
|
|
+interface Tree {
|
|
|
+ [key: string]: any;
|
|
|
+}
|
|
|
+
|
|
|
+const filterText = ref("");
|
|
|
+const treeRef = ref<InstanceType<typeof ElTree>>();
|
|
|
+const activeName = ref("hold");
|
|
|
+const defaultProps = {
|
|
|
+ children: "children",
|
|
|
+ label: "label",
|
|
|
+};
|
|
|
+
|
|
|
+//批量设置负责人
|
|
|
+
|
|
|
+watch(filterText, (val) => {
|
|
|
+ treeRef.value!.filter(val);
|
|
|
+});
|
|
|
+
|
|
|
+const formAccessibility = reactive({
|
|
|
+ fullName: "",
|
|
|
+ firstName: "",
|
|
|
+ lastName: "",
|
|
|
+ phone: "",
|
|
|
+});
|
|
|
+const ruleFormRef = ref<FormInstance>();
|
|
|
+let form = reactive({
|
|
|
+ name: "", //机构名称
|
|
|
+ parentId: "", //上级机构id
|
|
|
+ comType: "", //机构类型
|
|
|
+ exhibitionScope: "", //展业范围
|
|
|
+ address: "", //地址
|
|
|
+ leaderId: "", //负责人id
|
|
|
+ area: [], //地区
|
|
|
+});
|
|
|
+
|
|
|
+interface PageInfo {
|
|
|
+ pageNum: number;
|
|
|
+ pageSize: number;
|
|
|
+ sizes: number[];
|
|
|
+ total: number;
|
|
|
+ show: boolean;
|
|
|
+}
|
|
|
+
|
|
|
+const dialogVisible = ref(false);
|
|
|
+
|
|
|
+// import Select from "@/components/select/selectMain.vue";
|
|
|
+// import TestTable from "@/components/Table/index.vue";
|
|
|
+//业务员列表
|
|
|
+type tableType = {
|
|
|
+ id: string;
|
|
|
+ name: string;
|
|
|
+};
|
|
|
+const tableData = ref<tableType[]>([]);
|
|
|
+const tableProps = ref({
|
|
|
+ value: "id",
|
|
|
+ label: "name",
|
|
|
+ children: "children",
|
|
|
+ checkStrictly: true,
|
|
|
+});
|
|
|
+const typeformatter = (row: any, column: any, cellValue: any) => {
|
|
|
+ let comType = "";
|
|
|
+ comTypeList.value.map((ele) => {
|
|
|
+ if (ele.value == row.comType) {
|
|
|
+ comType = ele.label;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return () => h("div", {}, comType);
|
|
|
+};
|
|
|
+const columns = [
|
|
|
+ { prop: "name", label: "发布消息" },
|
|
|
+ { prop: "mobile", label: "发布机构" },
|
|
|
+ // { prop: "id", label: "工号" },
|
|
|
+ { prop: "deptName", label: "下级机构是否发布" },
|
|
|
+ {
|
|
|
+ prop: "username",
|
|
|
+ label: "是否强制查看",
|
|
|
+ },
|
|
|
+ { prop: "createTime", label: "查看人数" },
|
|
|
+
|
|
|
+];
|
|
|
+
|
|
|
+const pageInfo = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ sizes: [10, 20, 30, 40, 50],
|
|
|
+ total: 0,
|
|
|
+ show: true,
|
|
|
+};
|
|
|
+//分页列表功能
|
|
|
+const getList = (item: PageInfo) => {
|
|
|
+ pageInfo.pageNum = item.pageNum;
|
|
|
+ pageInfo.pageSize = item.pageSize;
|
|
|
+ salesmanAuth();
|
|
|
+};
|
|
|
+
|
|
|
+const checkTableIdList = ref([]);
|
|
|
+//表格选择事件
|
|
|
+function selectAllChange(list: any) {
|
|
|
+ checkTableIdList.value = list;
|
|
|
+}
|
|
|
+
|
|
|
+function selectChange(list: any) {
|
|
|
+ checkTableIdList.value = list;
|
|
|
+}
|
|
|
+//审核
|
|
|
+const userInfoId = ref("");
|
|
|
+const toExamine = (item: any, type: string) => {
|
|
|
+ if (type == "success") {
|
|
|
+ ElMessageBox.confirm(`确定审核通过${item.name}账号吗?`, "审核通过", {
|
|
|
+ confirmButtonText: "确认",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ center: true,
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ api.representativeApi
|
|
|
+ .salesmanAuthSuccess({
|
|
|
+ userInfoId: item.id,
|
|
|
+ })
|
|
|
+ .then((res: any) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ ElMessage.success("操作成功");
|
|
|
+ salesmanAuth(); //业务员列表
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.msg);
|
|
|
+ // salesmanAuth(); //业务员列表
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ ElMessage.warning("用户取消操作");
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ dialogVisible.value = true;
|
|
|
+ userInfoId.value = item.id;
|
|
|
+ // ElMessageBox.confirm(`<textarea placeholder='请输入审核不通过原因' oninput='handleText()' style="width:300px"></textarea>`, "审核不通过", {
|
|
|
+ // confirmButtonText: "确认",
|
|
|
+ // cancelButtonText: "取消",
|
|
|
+ // dangerouslyUseHTMLString: true ,
|
|
|
+ // type: "warning",
|
|
|
+ // center: true,
|
|
|
+
|
|
|
+ // })
|
|
|
+ // .then(() => {
|
|
|
+ // api.representativeApi.salesmanAuthFailed({}).then((res: any) => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // ElMessage.success("操作成功");
|
|
|
+ // salesmanAuth(); //业务员列表
|
|
|
+ // } else {
|
|
|
+ // ElMessage.error(res.msg);
|
|
|
+ // // salesmanAuth(); //业务员列表
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // ElMessage.warning("用户取消操作");
|
|
|
+ // });
|
|
|
+ }
|
|
|
+};
|
|
|
+function cancel() {
|
|
|
+ ElMessage.warning("用户取消操作");
|
|
|
+ dialogVisible.value = false;
|
|
|
+}
|
|
|
+const textValue = ref("");
|
|
|
+//审核不通过
|
|
|
+function confirm() {
|
|
|
+ api.representativeApi
|
|
|
+ .salesmanAuthFailed({
|
|
|
+ userInfoId: userInfoId.value,
|
|
|
+ approvalOpinion: textValue.value,
|
|
|
+ })
|
|
|
+ .then((res: any) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ ElMessage.success("操作成功");
|
|
|
+ salesmanAuth(); //业务员列表
|
|
|
+ dialogVisible.value = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+interface institutionData {
|
|
|
+ typeAttr: string;
|
|
|
+ deptId: string;
|
|
|
+ status: number;
|
|
|
+}
|
|
|
+const info = ref<institutionData>({
|
|
|
+ typeAttr: "2",
|
|
|
+ deptId: "",
|
|
|
+ status: 4,
|
|
|
+});
|
|
|
+
|
|
|
+const router = useRouter();
|
|
|
+
|
|
|
+//详情
|
|
|
+const editor = (item: any) => {
|
|
|
+ console.log(item);
|
|
|
+ router.push({
|
|
|
+ path: "/representative/member/memberMessage",
|
|
|
+ query: {
|
|
|
+ id: item.userId,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ // pageInfo.pageNum=item.pageNum
|
|
|
+ // pageInfo.pageSize=item.pageSize
|
|
|
+};
|
|
|
+
|
|
|
+//获取机构类型字典值
|
|
|
+type comType = {
|
|
|
+ value: string;
|
|
|
+ label: string;
|
|
|
+};
|
|
|
+let comTypeList = ref<comType[]>([]);
|
|
|
+
|
|
|
+const handleClick = (tab: TabsPaneContext, event: Event) => {
|
|
|
+ // console.log(tab.props.name);
|
|
|
+ if (tab.props.name == "pass") {
|
|
|
+ info.value.status = 5;
|
|
|
+ salesmanAuth();
|
|
|
+ } else {
|
|
|
+ info.value.status = 4;
|
|
|
+ salesmanAuth();
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+//获取成员员列表
|
|
|
+const salesmanAuth = () => {
|
|
|
+ api.representativeApi
|
|
|
+ .getUserInfoList({
|
|
|
+ ...info.value,
|
|
|
+ pages: pageInfo.pageNum,
|
|
|
+ size: pageInfo.pageSize,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ tableData.value = res.data.records;
|
|
|
+ pageInfo.total = res.data.total;
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+//机构列表
|
|
|
+const institutionList = ref([]);
|
|
|
+const getAllMemberList = () => {
|
|
|
+ api.institutionApi.institutionList({}).then((res: any) => {
|
|
|
+ if (res.code === 200) institutionList.value = res.data;
|
|
|
+ });
|
|
|
+ // pageInfo.pageSize=item.pageSize
|
|
|
+};
|
|
|
+
|
|
|
+const reset = (item: any) => {
|
|
|
+ // ElMessage({})
|
|
|
+};
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ // 对 asyncRoutes 进行预处理并转换为树形结构
|
|
|
+ salesmanAuth(); //业务员列表
|
|
|
+ // getAreaList(); //省市区级联数据
|
|
|
+ // getSystemList(); //机构类型字典
|
|
|
+ // getExhibitionScopeSystemList(); //展业范围字段
|
|
|
+ getAllMemberList(); //机构列表
|
|
|
+});
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+:deep(.table-title-btn) {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ > div {
|
|
|
+ display: flex;
|
|
|
+ }
|
|
|
+}
|
|
|
+.institution {
|
|
|
+ background: #fff;
|
|
|
+ width: 100%;
|
|
|
+ // height: 100%;
|
|
|
+ // padding: 20px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .institution-main {
|
|
|
+ flex: 1;
|
|
|
+ // width: 80%;
|
|
|
+ padding: 20px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+}
|
|
|
+:deep(.el-dropdown-link) {
|
|
|
+ cursor: pointer;
|
|
|
+ color: var(--el-color-primary);
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-left: 15px;
|
|
|
+}
|
|
|
+.custom-tree-node {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-size: 14px;
|
|
|
+ padding-right: 8px;
|
|
|
+}
|
|
|
+:deep(.el-message-box__container) {
|
|
|
+ width: 100% !important;
|
|
|
+ .el-message-box__message {
|
|
|
+ width: 100% !important;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|