| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542 |
- <template>
- <div class="institution">
- <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
- <el-tab-pane :label="'待审核'+'('+countObj?.noAuditCount +')'" name="hold">
- <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-select
- v-model="form.leaderId"
- placeholder="归属机构"
- clearable
- >
- <el-option
- v-for="item in memberList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </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-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-dropdown placement="bottom-start">
- <el-button>
- 批量操作<el-icon class="el-icon--right">
- <arrow-down />
- </el-icon>
- </el-button>
- <template #dropdown>
- <el-dropdown-menu>
- <el-dropdown-item>审核</el-dropdown-item>
- <!-- <el-dropdown-item v-on:click="manySetDeptUser()">设置负责人</el-dropdown-item> -->
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- </div>
- </template>
- <template v-slot:operation="scope">
- <el-button
- type="primary"
- link
- @click="toExamine(scope.operationData.row, 'success')"
- >
- 审核通过
- </el-button>
- <el-button
- type="primary"
- link
- @click="toExamine(scope.operationData.row, 'error')"
- >
- 审核不通过
- </el-button>
- <el-button
- type="primary"
- link
- @click="editor(scope.operationData.row)"
- >
- 详情
- </el-button>
- </template>
- <template v-slot:search="scope">
- {{ scope.slotData.label }}
- </template>
- </Table>
- </div>
- </el-tab-pane>
- <el-tab-pane :label="'审核不通过'+'('+countObj?.failAuditCount +')'" name="pass">
- <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-select
- v-model="form.leaderId"
- placeholder="归属机构"
- clearable
- >
- <el-option
- v-for="item in memberList"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- />
- </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-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-dropdown placement="bottom-start">
- <el-button>
- 批量操作<el-icon class="el-icon--right">
- <arrow-down />
- </el-icon>
- </el-button>
- <template #dropdown>
- <el-dropdown-menu>
- <el-dropdown-item>审核</el-dropdown-item>
- <!-- <el-dropdown-item v-on:click="manySetDeptUser()">设置负责人</el-dropdown-item> -->
- </el-dropdown-menu>
- </template>
- </el-dropdown>
- </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>
- </el-tab-pane>
- </el-tabs>
- <el-dialog v-model="dialogVisible" title="审核不通过" width="500" draggable>
- <el-input
- type="textarea"
- placeholder="请输入审核不通过原因"
- v-model="textValue"
- />
- <template #footer>
- <div class="dialog-footer">
- <el-button @click="cancel()">取 消</el-button>
- <el-button type="primary" @click="confirm()"> 保 存 </el-button>
- </div>
- </template>
- </el-dialog>
- </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 } from "@element-plus/icons-vue";
- import { useRouter } from "vue-router";
- import type Node from "element-plus/es/components/tree/src/model/node";
- // 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 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: "创建时间" },
- { prop: "createBy", 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: "1",
- deptId: "",
- status: 4,
- });
- const router = useRouter();
- //详情
- const editor = (item: any) => {
- console.log(item);
- router.push({
- path: "/representative/salesman/salesmanMessage",
- 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 countObj=ref({
- noAuditCount:'',
- failAuditCount:"",
- })
- const memberList = ref([]);
- const getAllMemberList = () => {
- api.userApi.AllMemberList({}).then((res: any) => {
- if (res.code === 200) memberList.value = res.data;
- });
- api.representativeApi.getAuditCount({
- typeAttr:'1'
- }).then((res:any)=>{
- // console.log(res)
- if(res.code===200){
- countObj.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;
- :deep(.demo-tabs) {
- width: 100%;
- padding: 20px;
- box-sizing: border-box;
- }
- // .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>
|