|
@@ -7,49 +7,49 @@
|
|
|
<div class="button_top">
|
|
|
<div class="examine_title">
|
|
|
<a
|
|
|
- @click="showPending"
|
|
|
+ @click="showData(0)"
|
|
|
:style="{
|
|
|
- color: isPending ? 'black' : 'rgb(179, 179, 179)',
|
|
|
+ color: type == 0 ? 'black' : 'rgb(179, 179, 179)',
|
|
|
fontWeight: 'bold',
|
|
|
}"
|
|
|
- >待审核({{ tableData.length }})</a
|
|
|
+ >待审核({{ tableData }})</a
|
|
|
>
|
|
|
</div>
|
|
|
<div class="examine_title">
|
|
|
<a
|
|
|
- @click="showApproved"
|
|
|
+ @click="showData(1)"
|
|
|
:style="{
|
|
|
- color: isApproved ? 'black' : 'rgb(179, 179, 179)',
|
|
|
+ color: type == 1 ? 'black' : 'rgb(179, 179, 179)',
|
|
|
fontWeight: 'bold',
|
|
|
}"
|
|
|
- >已通过({{ approvedData.length }})</a
|
|
|
+ >已通过({{ approvedData }})</a
|
|
|
>
|
|
|
</div>
|
|
|
<div class="examine_title">
|
|
|
<a
|
|
|
- @click="showRefused"
|
|
|
+ @click="showData(2)"
|
|
|
:style="{
|
|
|
- color: isRefused ? 'black' : 'rgb(179, 179, 179)',
|
|
|
+ color: type == 2 ? 'black' : 'rgb(179, 179, 179)',
|
|
|
fontWeight: 'bold',
|
|
|
}"
|
|
|
- >已拒绝({{ RefusedData.length }})</a
|
|
|
+ >已拒绝({{ RefusedData }})</a
|
|
|
>
|
|
|
</div>
|
|
|
<div class="examine_title">
|
|
|
<a
|
|
|
- @click="showAll"
|
|
|
+ @click="showData(3)"
|
|
|
:style="{
|
|
|
- color: isAll ? 'black' : 'rgb(179, 179, 179)',
|
|
|
+ color: type == 3 ? 'black' : 'rgb(179, 179, 179)',
|
|
|
fontWeight: 'bold',
|
|
|
}"
|
|
|
- >全部记录({{ AllData.length }})</a
|
|
|
+ >全部记录({{ AllData }})</a
|
|
|
>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="content">
|
|
|
<!-- 待审核的数据 -->
|
|
|
- <div class="tableBox" v-if="isPending">
|
|
|
+ <div class="tableBox">
|
|
|
<!-- 禁用 stripe 属性,完全自定义背景色 -->
|
|
|
<el-table
|
|
|
:data="currentTableData"
|
|
@@ -58,11 +58,19 @@
|
|
|
style="width: 100%"
|
|
|
:header-cell-style="headerCellStyle"
|
|
|
>
|
|
|
- <el-table-column prop="company" label="组织名称" min-width="45">
|
|
|
- <template slot-scope="scope">{{ scope.row.company }}</template>
|
|
|
+ <el-table-column label="组织名称" min-width="45" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">{{
|
|
|
+ scope.row.orgName ? scope.row.orgName : "-"
|
|
|
+ }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="学校名字" min-width="45" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">{{
|
|
|
+ scope.row.schoolName ? scope.row.schoolName : "-"
|
|
|
+ }}</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="phone"
|
|
|
+ show-overflow-tooltip
|
|
|
+ prop="contact_info"
|
|
|
label="电话/邮箱"
|
|
|
min-width="45"
|
|
|
></el-table-column>
|
|
@@ -74,28 +82,31 @@
|
|
|
:label-class-name="'address-column'"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="submission_time"
|
|
|
+ prop="username"
|
|
|
+ label="账号"
|
|
|
+ min-width="45"
|
|
|
+ show-overflow-tooltip
|
|
|
+ :label-class-name="'address-column'"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="time"
|
|
|
label="提交时间"
|
|
|
min-width="45"
|
|
|
></el-table-column>
|
|
|
+ <el-table-column label="状态" min-width="45">
|
|
|
+ <template slot-scope="scope">{{
|
|
|
+ getStatusText(scope.row.type)
|
|
|
+ }}</template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="remarks"
|
|
|
label="备注"
|
|
|
min-width="45"
|
|
|
></el-table-column>
|
|
|
- <el-table-column label="操作" min-width="35">
|
|
|
+ <el-table-column label="操作" width="150px" v-if="type == 0">
|
|
|
<template slot-scope="{ row }">
|
|
|
<button
|
|
|
- @click="
|
|
|
- ajax_move_to_approved(
|
|
|
- row.userid,
|
|
|
- row.companyNumber,
|
|
|
- row.orgid,
|
|
|
- row.phone,
|
|
|
- row.name,
|
|
|
- row.submission_time
|
|
|
- )
|
|
|
- "
|
|
|
+ @click="ajax_move_user(1, row)"
|
|
|
style="
|
|
|
color: #308fff;
|
|
|
background: none;
|
|
@@ -107,9 +118,9 @@
|
|
|
通过
|
|
|
</button>
|
|
|
<button
|
|
|
- @click="ajax_move_to_rejected(row.userid, row.companyNumber)"
|
|
|
+ @click="ajax_move_user(2, row)"
|
|
|
style="
|
|
|
- color: #308fff;
|
|
|
+ color: #ff2570;
|
|
|
background: none;
|
|
|
border: none;
|
|
|
cursor: pointer;
|
|
@@ -124,211 +135,23 @@
|
|
|
</div>
|
|
|
<!-- 分页组件 -->
|
|
|
<el-pagination
|
|
|
- v-if="Pending_request"
|
|
|
:current-page="currentPage"
|
|
|
:page-size="pageSize"
|
|
|
- :page-sizes="pageSizeOptions"
|
|
|
- :total="tableData.length"
|
|
|
- @size-change="handlePageSizeChange"
|
|
|
+ :total="total"
|
|
|
@current-change="handlePageChange"
|
|
|
layout="total,prev, pager, next, jumper"
|
|
|
>
|
|
|
</el-pagination>
|
|
|
-
|
|
|
- <!-- 已通过的数据 -->
|
|
|
- <div class="tableBox" v-if="isApproved">
|
|
|
- <el-table
|
|
|
- :data="currentApprovedData"
|
|
|
- stripe
|
|
|
- border
|
|
|
- style="width: 100%"
|
|
|
- :header-cell-style="headerCellStyle"
|
|
|
- >
|
|
|
- <el-table-column prop="company" label="组织名称" min-width="40">
|
|
|
- <template slot="default" slot-scope="scope">{{
|
|
|
- scope.row.company
|
|
|
- }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="phone" label="电话/邮箱" min-width="40" />
|
|
|
- <el-table-column
|
|
|
- prop="name"
|
|
|
- label="姓名"
|
|
|
- min-width="40"
|
|
|
- show-overflow-tooltip
|
|
|
- :label-class-name="'address-column'"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="submission_time"
|
|
|
- label="提交时间"
|
|
|
- min-width="35"
|
|
|
- />
|
|
|
- <el-table-column prop="remarks" label="备注" min-width="35" />
|
|
|
- <el-table-column prop="Pending_time" label="审核时间" width="300" />
|
|
|
- <el-table-column
|
|
|
- prop="open_organization"
|
|
|
- label="开通组织"
|
|
|
- width="395"
|
|
|
- >
|
|
|
- <template slot="default" slot-scope="scope">{{
|
|
|
- scope.row.open_organization
|
|
|
- }}</template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <!-- 分页组件 -->
|
|
|
- <el-pagination
|
|
|
- :current-page="currentApprovedPage"
|
|
|
- :page-size="pageSize"
|
|
|
- :page-sizes="pageSizeOptions"
|
|
|
- :total="approvedData.length"
|
|
|
- @size-change="handlePageSizeChange"
|
|
|
- @current-change="handleApprovedPageChange"
|
|
|
- layout="total,sizes,prev, pager, next, jumper"
|
|
|
- />
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 已拒绝的数据 -->
|
|
|
- <div class="tableBox" v-if="isRefused">
|
|
|
- <el-table
|
|
|
- :data="currentRefusedData"
|
|
|
- stripe
|
|
|
- border
|
|
|
- style="width: 100%"
|
|
|
- :header-cell-style="headerCellStyle"
|
|
|
- >
|
|
|
- <el-table-column prop="company" label="组织名称" min-width="40">
|
|
|
- <template slot="default" slot-scope="scope">{{
|
|
|
- scope.row.company
|
|
|
- }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="phone" label="电话/邮箱" min-width="40" />
|
|
|
- <el-table-column
|
|
|
- prop="name"
|
|
|
- label="姓名"
|
|
|
- min-width="35"
|
|
|
- show-overflow-tooltip
|
|
|
- :label-class-name="'address-column'"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="submission_time"
|
|
|
- label="提交时间"
|
|
|
- width="300"
|
|
|
- />
|
|
|
- <el-table-column prop="remarks" label="备注" min-width="40" />
|
|
|
- <el-table-column
|
|
|
- prop="Pending_time"
|
|
|
- label="审核时间"
|
|
|
- min-width="40"
|
|
|
- />
|
|
|
- <el-table-column label="操作" min-width="35">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <button
|
|
|
- @click="
|
|
|
- ajax__move_to_pending_from_rejected(
|
|
|
- row.userid,
|
|
|
- row.companyNumber
|
|
|
- )
|
|
|
- "
|
|
|
- style="
|
|
|
- color: #308fff;
|
|
|
- background: none;
|
|
|
- border: none;
|
|
|
- cursor: pointer;
|
|
|
- margin-left: 25px;
|
|
|
- "
|
|
|
- >
|
|
|
- 移动至待审核
|
|
|
- </button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <!-- 分页组件 -->
|
|
|
- <el-pagination
|
|
|
- :current-page="currentRefusedPage"
|
|
|
- :page-size="pageSize"
|
|
|
- :page-sizes="pageSizeOptions"
|
|
|
- :total="RefusedData.length"
|
|
|
- @size-change="handlePageSizeChange"
|
|
|
- @current-change="handleRefusedPageChange"
|
|
|
- layout="total,sizes,prev, pager, next, jumper"
|
|
|
- />
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 全部记录的数据 -->
|
|
|
- <div class="tableBox" v-if="isAll">
|
|
|
- <el-table
|
|
|
- :data="currentAllData"
|
|
|
- stripe
|
|
|
- border
|
|
|
- style="width: 100%"
|
|
|
- :header-cell-style="headerCellStyle"
|
|
|
- >
|
|
|
- <el-table-column prop="company" label="组织名称" min-width="40">
|
|
|
- <template slot="default" slot-scope="scope">{{
|
|
|
- scope.row.company
|
|
|
- }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="phone" label="电话/邮箱" min-width="40" />
|
|
|
- <el-table-column
|
|
|
- prop="name"
|
|
|
- label="姓名"
|
|
|
- min-width="35"
|
|
|
- show-overflow-tooltip
|
|
|
- :label-class-name="'address-column'"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="submission_time"
|
|
|
- label="提交时间"
|
|
|
- min-width="35"
|
|
|
- />
|
|
|
- <el-table-column prop="remarks" label="备注" min-width="35" />
|
|
|
- <el-table-column
|
|
|
- prop="Pending_time"
|
|
|
- label="审核时间"
|
|
|
- min-width="40"
|
|
|
- />
|
|
|
- <el-table-column label="操作" min-width="35" prop="status">
|
|
|
- <template slot="default" slot-scope="scope">
|
|
|
- <!-- 根据状态值显示不同颜色的按钮 -->
|
|
|
- <el-button
|
|
|
- :type="getButtonType(scope.row.status)"
|
|
|
- :disabled="false"
|
|
|
- style="border-radius: 5px; padding: 4px 12px; font-size: 14px"
|
|
|
- >
|
|
|
- {{ getStatusText(scope.row.status) }}
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <!-- 分页组件 -->
|
|
|
- <el-pagination
|
|
|
- :current-page="currentAllPage"
|
|
|
- :page-size="pageSize"
|
|
|
- :page-sizes="[5, 10, 25]"
|
|
|
- :total="AllData.length"
|
|
|
- @size-change="handlePageSizeChange"
|
|
|
- @current-change="handleAllPageChange"
|
|
|
- layout="total,sizes,prev, pager, next, jumper"
|
|
|
- />
|
|
|
- </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { reactive } from "vue"; // 引入 reactive
|
|
|
import { API_CONFIG } from "@/common/apiConfig";
|
|
|
-// import { ref } from 'vue';
|
|
|
-// 使用 ref() 包装数组
|
|
|
-// const myArray = ref([]);
|
|
|
-
|
|
|
-// // 更新数组时可以通过 .value 来访问
|
|
|
-// myArray.value.push(1); // 这样修改数组是响应式的
|
|
|
+import { mapGetters } from 'vuex';
|
|
|
+import { addUser } from "@/api/user.js"
|
|
|
|
|
|
-// // 使用 watch 监听
|
|
|
-// watch(() => myArray.value, (newValue) => {
|
|
|
-// console.log(newValue);
|
|
|
-// });
|
|
|
export default {
|
|
|
name: "IndexTable",
|
|
|
components: {},
|
|
@@ -340,78 +163,25 @@ export default {
|
|
|
selectedOrg: "CN", // 默认选中CN组织
|
|
|
checkboxStates: Array(10).fill(false), // 确保初始化为一个包含10个元素的数组
|
|
|
selectedSchools: Array(16).fill(""), // 确保初始化为一个包含16个空字符串的数组
|
|
|
- showCompanyList: reactive(Array(8).fill(false)), // 确保初始化为一个包含8个元素的数组
|
|
|
button: Array(10).fill(false), // 确保初始化为一个包含10个元素的数组
|
|
|
currentPage: 1,
|
|
|
currentApprovedPage: 1,
|
|
|
currentRefusedPage: 1,
|
|
|
currentAllPage: 1,
|
|
|
+ total: 0,
|
|
|
pageSize: 10, // 每页显示的条目数
|
|
|
pageSizeOptions: [10, 25, 50], // 可选的页大小
|
|
|
- // 待审核数据
|
|
|
- tableData: [
|
|
|
- {
|
|
|
- company: "北京科技有限公司",
|
|
|
- phone: "010-12345678",
|
|
|
- name: "张三",
|
|
|
- submission_time: "2024-12-20 10:00",
|
|
|
- remarks: "暂无备注",
|
|
|
- userid: 1,
|
|
|
- companyNumber: "BJKJ001",
|
|
|
- },
|
|
|
- {
|
|
|
- company: "上海创新企业",
|
|
|
- phone: "021-87654321",
|
|
|
- name: "李四",
|
|
|
- submission_time: "2024-12-21 12:00",
|
|
|
- remarks: "待审核",
|
|
|
- userid: 2,
|
|
|
- companyNumber: "SHCX002",
|
|
|
- },
|
|
|
- {
|
|
|
- company: "广州实业集团",
|
|
|
- phone: "020-23456789",
|
|
|
- name: "王五",
|
|
|
- submission_time: "2024-12-22 14:30",
|
|
|
- remarks: "需要更多资料",
|
|
|
- userid: 3,
|
|
|
- companyNumber: "GZSY003",
|
|
|
- },
|
|
|
- ],
|
|
|
- // 已审核数据
|
|
|
- approvedData: [],
|
|
|
- RefusedData: [],
|
|
|
- AllData: [],
|
|
|
+ currentTableData: [],
|
|
|
Pending_request: true,
|
|
|
- isPending: true, // 初始状态为待审核
|
|
|
- isApproved: false,
|
|
|
- isRefused: false,
|
|
|
- isAll: false,
|
|
|
- showModal: false, // 弹窗是否显示
|
|
|
- showConfirmationModal: false, // 控制确认通知申请人的弹窗
|
|
|
+ type: 0,
|
|
|
+ tableData: 0,
|
|
|
+ approvedData: 0,
|
|
|
+ RefusedData: 0,
|
|
|
+ AllData: 0,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- currentTableData() {
|
|
|
- const start = (this.currentPage - 1) * this.pageSize;
|
|
|
- const end = this.currentPage * this.pageSize;
|
|
|
- return this.tableData.slice(start, end);
|
|
|
- },
|
|
|
- currentApprovedData() {
|
|
|
- const start = (this.currentApprovedPage - 1) * this.pageSize;
|
|
|
- const end = this.currentApprovedPage * this.pageSize;
|
|
|
- return this.approvedData.slice(start, end);
|
|
|
- },
|
|
|
- currentRefusedData() {
|
|
|
- const start = (this.currentRefusedPage - 1) * this.pageSize;
|
|
|
- const end = this.currentRefusedPage * this.pageSize;
|
|
|
- return this.RefusedData.slice(start, end);
|
|
|
- },
|
|
|
- currentAllData() {
|
|
|
- const start = (this.currentAllPage - 1) * this.pageSize;
|
|
|
- const end = this.currentAllPage * this.pageSize;
|
|
|
- return this.AllData.slice(start, end);
|
|
|
- },
|
|
|
+ ...mapGetters(['userid']),
|
|
|
},
|
|
|
methods: {
|
|
|
// 获取状态文本
|
|
@@ -437,343 +207,86 @@ export default {
|
|
|
headerCellStyle() {
|
|
|
return { backgroundColor: "#f1f1f1" };
|
|
|
},
|
|
|
- // 待审核的分页逻辑
|
|
|
handlePageChange(page) {
|
|
|
- this.currentPage = page;
|
|
|
- },
|
|
|
- // 已通过的分页逻辑
|
|
|
- handleApprovedPageChange(page) {
|
|
|
- this.currentApprovedPage = page;
|
|
|
- },
|
|
|
- // 已拒绝的分页逻辑
|
|
|
- handleRefusedPageChange(page) {
|
|
|
- this.currentRefusedPage = page;
|
|
|
- },
|
|
|
- // 全部记录的分页逻辑
|
|
|
- handleAllPageChange(page) {
|
|
|
- this.currentAllPage = page;
|
|
|
- },
|
|
|
- // 显示创建账户的弹窗
|
|
|
- showModalHandler() {
|
|
|
- this.showModal = true;
|
|
|
- },
|
|
|
- performSearch() {
|
|
|
- console.log("执行搜索");
|
|
|
- },
|
|
|
-
|
|
|
- // 创建账户的逻辑
|
|
|
- handleCreateAccount() {
|
|
|
- // 在这里可以进行创建账户的逻辑
|
|
|
- console.log("账户创建完成");
|
|
|
- // 点击创建账户后弹出通知确认的灰色弹窗
|
|
|
- this.showModal = false; // 关闭创建账户弹窗
|
|
|
- this.showConfirmationModal = true; // 打开通知确认弹窗
|
|
|
- },
|
|
|
- // 通知申请人
|
|
|
- notifyApplicant() {
|
|
|
- // 在这里进行通知申请人的逻辑
|
|
|
- this.$message.success("通知申请人成功!");
|
|
|
- this.showConfirmationModal = false; // 关闭通知确认弹窗
|
|
|
- },
|
|
|
- show_company() {
|
|
|
- this.showCompany = !this.showCompany; // 切换 showCompany 的值
|
|
|
- },
|
|
|
- toggleCompany(index) {
|
|
|
- this.showCompanyList[index] = !this.showCompanyList[index];
|
|
|
- },
|
|
|
-
|
|
|
- // 待审核
|
|
|
- showPending() {
|
|
|
- this.isPending = true;
|
|
|
- this.isApproved = false;
|
|
|
- this.isRefused = false;
|
|
|
- this.isAll = false;
|
|
|
- this.Pending_request = true;
|
|
|
- },
|
|
|
- // 已通过
|
|
|
- showApproved() {
|
|
|
- this.Pending_request = false;
|
|
|
- this.isPending = false;
|
|
|
- this.isApproved = true;
|
|
|
- this.isRefused = false;
|
|
|
- this.isAll = false;
|
|
|
- },
|
|
|
- // 已拒绝
|
|
|
- showRefused() {
|
|
|
- // console.log("Clicked Refused!");
|
|
|
- this.isPending = false;
|
|
|
- this.isApproved = false;
|
|
|
- this.isRefused = true;
|
|
|
- this.isAll = false;
|
|
|
- this.Pending_request = false;
|
|
|
+ API_CONFIG.allRecords.page = page;
|
|
|
+ this.$forceUpdate();
|
|
|
+ this.ajaxAll();
|
|
|
},
|
|
|
- //全部记录
|
|
|
- showAll() {
|
|
|
- this.isPending = false;
|
|
|
- this.isApproved = false;
|
|
|
- this.isRefused = false;
|
|
|
- this.isAll = true;
|
|
|
- this.Pending_request = false;
|
|
|
+ showData(type) {
|
|
|
+ this.type = type
|
|
|
+ this.ajaxAll()
|
|
|
},
|
|
|
- // 用于切换组织
|
|
|
- selectOrg(org) {
|
|
|
- this.selectedOrg = org;
|
|
|
- },
|
|
|
- // 处理每页条目数量变化
|
|
|
- handlePageSizeChange(size) {
|
|
|
- this.pageSize = size;
|
|
|
- },
|
|
|
- // 用于显示待审核的表格数据
|
|
|
- ajaxpending() {
|
|
|
- const params = [API_CONFIG.pending]; // 使用配置中的待审核接口参数
|
|
|
-
|
|
|
- // let params = [
|
|
|
- // {
|
|
|
- // functionName: "select_requestuser", // 调用存储过程的名称
|
|
|
- // r_type: 0,
|
|
|
- // page: 1,
|
|
|
- // r_num: 100,
|
|
|
- // },
|
|
|
- // ];
|
|
|
-
|
|
|
- this.$ajax
|
|
|
- .post(API_CONFIG.baseUrl, params)
|
|
|
- .then((res) => {
|
|
|
- // 假设res.data是一个返回待审核数据的数组
|
|
|
- // console.log("返回结果为:", res.data); // 打印返回的查询结果
|
|
|
-
|
|
|
- this.tableData = res.data[0].map((user) => ({
|
|
|
- company: user.schoolName || "未知", // 组织名称
|
|
|
- phone: user.contact_info || "未知",
|
|
|
- name: user.name || "未知", // 真实姓名对应 name
|
|
|
- submission_time: user.create_at || "未知", // 提交时间对应 数据库里的create_at
|
|
|
- remarks: user.remark || "未知", // 备注内容对应 remark
|
|
|
- userid: user.id || "未知",
|
|
|
- orgid: user.org_id,
|
|
|
- })); // 将数据存储到 tableData 中
|
|
|
- // 打印映射后的用户信息
|
|
|
- console.log("待审核的数据为:", res.data);
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- // 处理失败的响应
|
|
|
- this.$message.error("查询失败");
|
|
|
- console.error(err); // 打印错误信息
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- // 用于显示已通过的表格数据
|
|
|
- ajaxapproved() {
|
|
|
- const params = [API_CONFIG.approved]; // 使用配置中的已通过接口参数
|
|
|
-
|
|
|
- // let params = [
|
|
|
- // {
|
|
|
- // functionName: "select_requestuser", // 调用存储过程的名称
|
|
|
- // r_type: 1,
|
|
|
- // page: 1,
|
|
|
- // r_num: 100,
|
|
|
- // },
|
|
|
- // ];
|
|
|
-
|
|
|
- this.$ajax
|
|
|
- .post(API_CONFIG.baseUrl, params)
|
|
|
- .then((res) => {
|
|
|
- // 假设res.data是一个返回已通过的数组
|
|
|
- this.approvedData = res.data[0].map((user) => ({
|
|
|
- company: user.schoolName || "未知", // 组织名称对应 schoolName
|
|
|
- phone: user.contact_info || "未知",
|
|
|
- name: user.name || "未知", // 真实姓名对应 alias
|
|
|
- submission_time: user.create_at || "未知", // 提交时间对应 数据库里的create_at
|
|
|
- remarks: user.remark || "未知", // 备注内容对应 remark
|
|
|
- Pending_time: user.active_at || "未知", // 处理时间对应 update_time
|
|
|
- open_organization: user.school_name || "未知", // 所属组织对应 school_name
|
|
|
- userid: user.id || "未知",
|
|
|
- }));
|
|
|
- // 在这里进行已通过数据的获取和处理
|
|
|
- console.log("已通过的数据为:", res.data);
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- // 处理失败的响应
|
|
|
- this.$message.error("查询失败");
|
|
|
- console.error(err); // 打印错误信息
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- // 用于显示已拒绝的表格数据
|
|
|
- ajaxrefused() {
|
|
|
- const params = [API_CONFIG.refused]; // 使用配置中的已拒绝接口参数
|
|
|
-
|
|
|
- // let params = [
|
|
|
- // {
|
|
|
- // functionName: "select_requestuser", // 调用存储过程的名称
|
|
|
- // r_type: 2,
|
|
|
- // page: 1,
|
|
|
- // r_num: 100,
|
|
|
- // },
|
|
|
- // ];
|
|
|
-
|
|
|
- this.$ajax
|
|
|
- .post(API_CONFIG.baseUrl, params)
|
|
|
- .then((res) => {
|
|
|
- this.RefusedData = res.data[0].map((user) => ({
|
|
|
- company: user.schoolName || "未知", // 组织名称对应 organizeid
|
|
|
- phone: user.contact_info || "未知", // 用户名对应 username,使用数据库里的username因为有邮箱作为联系方式
|
|
|
- name: user.name || "未知", // 真实姓名对应 alias
|
|
|
- submission_time: user.create_at || "未知", // 提交时间对应 数据库里的create_at
|
|
|
- remarks: user.remark || "未知", // 备注内容对应 remark
|
|
|
- Pending_time: user.active_at || "未知", // 处理时间对应 update_time
|
|
|
- userid: user.id || "未知",
|
|
|
- }));
|
|
|
- // 在这里进行已拒绝数据的获取和处理
|
|
|
- // console.log(this.RefusedData);
|
|
|
- console.log("已拒绝的数据为:", res.data);
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- // 处理失败的响应
|
|
|
- this.$message.error("查询失败");
|
|
|
- console.error(err); // 打印错误信息
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
// 用于显示全部记录的表格数据
|
|
|
ajaxAll() {
|
|
|
console.log("获取所有记录");
|
|
|
-
|
|
|
// 根据 allRecords 配置生成请求
|
|
|
- const requests = API_CONFIG.allRecords.r_types.map((r_type) => {
|
|
|
- const params = {
|
|
|
- functionName: API_CONFIG.allRecords.functionName,
|
|
|
- r_type,
|
|
|
- page: API_CONFIG.allRecords.page,
|
|
|
- r_num: API_CONFIG.allRecords.r_num,
|
|
|
- };
|
|
|
- return this.$ajax.post(API_CONFIG.baseUrl, [params]);
|
|
|
- });
|
|
|
-
|
|
|
- // 使用 Promise.all 发起多个请求
|
|
|
- Promise.all(requests)
|
|
|
- .then((responses) => {
|
|
|
- // 使用 processData 方法处理响应数据
|
|
|
- const allData = API_CONFIG.allRecords.processData(responses);
|
|
|
-
|
|
|
- // 更新组件中的数据
|
|
|
- this.AllData = allData;
|
|
|
-
|
|
|
- // 打印处理后的数据
|
|
|
- console.log(this.AllData);
|
|
|
-
|
|
|
- // 刷新表格数据
|
|
|
- this.refreshTableData(); // 例如刷新表格数据
|
|
|
+ const params = [{
|
|
|
+ functionName: API_CONFIG.allRecords.functionName,
|
|
|
+ r_type: this.type == 3 ? '' : this.type,
|
|
|
+ page: API_CONFIG.allRecords.page,
|
|
|
+ r_num: API_CONFIG.allRecords.num,
|
|
|
+ }];
|
|
|
+ this.currentTableData = []
|
|
|
+ this.$ajax
|
|
|
+ .post(API_CONFIG.baseUrl, params)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data) {
|
|
|
+ this.currentTableData = res.data[0];
|
|
|
+ this.total = res.data[0].length ? res.data[0][0].total_count : 0
|
|
|
+ this.tableData = res.data[1][0].num
|
|
|
+ this.approvedData = res.data[2][0].num
|
|
|
+ this.RefusedData = res.data[3][0].num
|
|
|
+ this.AllData = res.data[4][0].num
|
|
|
+ }
|
|
|
+ console.log("返回的结果为:", res.data);
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
- this.$message.error("查询失败");
|
|
|
- console.error(err);
|
|
|
+ console.error("请求失败,错误信息:", err);
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
- // 通过操作,将数据移到已通过
|
|
|
- // ajax_move_to_approved(userid) {
|
|
|
- // const successMessage = API_CONFIG.moveToApproved.successMessage;
|
|
|
-
|
|
|
- // // 弹出确认框
|
|
|
- // this.$confirm(`您确定将此数据移至“已通过”状态吗?`, '确认操作', {
|
|
|
- // confirmButtonText: '确定',
|
|
|
- // cancelButtonText: '取消',
|
|
|
- // type: 'warning',
|
|
|
- // }).then(() => {
|
|
|
- // // 确认后发起请求
|
|
|
- // let params = [
|
|
|
- // {
|
|
|
- // functionName: API_CONFIG.moveToApproved.functionName, // 这里是将数据移至已通过状态的操作,使用配置中的存储过程名称
|
|
|
- // u_id: userid, // id
|
|
|
- // },
|
|
|
- // ];
|
|
|
-
|
|
|
- // // 发起请求
|
|
|
- // this.$ajax
|
|
|
- // .post(API_CONFIG.moveToApproved.url, params) // 使用配置中的URL
|
|
|
- // .then((res) => {
|
|
|
- // console.log(res);
|
|
|
- // this.$message({
|
|
|
- // type: 'success',
|
|
|
- // message: successMessage,
|
|
|
- // });
|
|
|
- // // 更新数据状态
|
|
|
- // this.refreshTableData(); // 例如刷新表格数据
|
|
|
- // console.log("此条数据处理后的id为:", userid);
|
|
|
- // })
|
|
|
- // .catch((err) => {
|
|
|
- // this.$message.error("操作失败");
|
|
|
- // console.error("请求失败,错误信息:", err);
|
|
|
- // });
|
|
|
- // }).catch(() => {
|
|
|
- // // 取消操作后的提示
|
|
|
- // this.$message({
|
|
|
- // type: 'info',
|
|
|
- // message: '已取消操作',
|
|
|
- // });
|
|
|
- // });
|
|
|
- // },
|
|
|
- // 通过操作,将数据移到已通过
|
|
|
- ajax_move_to_approved(userid, orgid, phone, name, submission_time) {
|
|
|
- const successMessage = API_CONFIG.moveToApproved.successMessage;
|
|
|
-
|
|
|
- // 弹出确认框
|
|
|
- this.$confirm(`您确定将此数据移至“已通过”状态吗?`, "确认操作", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- // 确认后发起请求
|
|
|
- let params = [
|
|
|
- {
|
|
|
- functionName: "insert_request_type1", // 这里是将数据移至已通过状态的操作,使用配置中的存储过程名称
|
|
|
- p_userid: userid, // id
|
|
|
- //组织id
|
|
|
- p_schoolName: orgid,
|
|
|
- //账户
|
|
|
- p_u_couent: phone,
|
|
|
- //姓名
|
|
|
- p_u_name: name,
|
|
|
- //时间
|
|
|
- p_u_time: submission_time,
|
|
|
- },
|
|
|
- ];
|
|
|
-
|
|
|
- // 发起请求
|
|
|
- this.$ajax
|
|
|
- .post(API_CONFIG.baseUrl, params) // 使用配置中的URL
|
|
|
- .then((res) => {
|
|
|
- console.log(res);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: successMessage,
|
|
|
- });
|
|
|
- // 更新数据状态
|
|
|
- this.refreshTableData(); // 例如刷新表格数据
|
|
|
- // console.log("此条数据处理后的id为:", userid);
|
|
|
- console.log("通过的数据内容为:", res.data);
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$message.error("操作失败");
|
|
|
- console.error("请求失败,错误信息:", err);
|
|
|
+ addUser(row){
|
|
|
+ let params = {
|
|
|
+ alias: row.name,
|
|
|
+ username: row.username,
|
|
|
+ org: row.orgid,
|
|
|
+ oid: row.oid,
|
|
|
+ ph: row.phonenumber,
|
|
|
+ cid: "",
|
|
|
+ type: 1,
|
|
|
+ opid: "",
|
|
|
+ dest: "",
|
|
|
+ eduid: "",
|
|
|
+ }
|
|
|
+ addUser(params)
|
|
|
+ .then((response) => {
|
|
|
+ if(response){
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: '操作成功',
|
|
|
});
|
|
|
+ this.ajaxAll(); // 例如刷新表格数据
|
|
|
+ }
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- // 取消操作后的提示
|
|
|
- this.$message({
|
|
|
- type: "info",
|
|
|
- message: "已取消操作",
|
|
|
- });
|
|
|
+ .catch((error) => {
|
|
|
+ console.error("请求失败,错误信息:", error);
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
// 忽略操作,将数据移到已拒绝
|
|
|
- ajax_move_to_rejected(userid) {
|
|
|
- const successMessage = API_CONFIG.moveToRejected.successMessage;
|
|
|
-
|
|
|
+ ajax_move_user(type, row) {
|
|
|
+ let string = ''
|
|
|
+ if(type == 1){
|
|
|
+ string = '您确定同意此用户申请并创建吗?'
|
|
|
+ }else if(type == 2){
|
|
|
+ string = '您确定拒绝此用户申请吗?'
|
|
|
+ }
|
|
|
+ let _type = 0
|
|
|
+ if(type == 1){
|
|
|
+ _type = 1
|
|
|
+ }else if(type == 2){
|
|
|
+ _type = 2
|
|
|
+ }
|
|
|
// 弹出确认框
|
|
|
- this.$confirm(`您确定将此数据移至“已拒绝”状态吗?`, "确认操作", {
|
|
|
+ this.$confirm(string, "确认操作", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
@@ -782,8 +295,10 @@ export default {
|
|
|
// 确认后发起请求
|
|
|
let params = [
|
|
|
{
|
|
|
- functionName: API_CONFIG.moveToRejected.functionName, // 这里是将数据移至已拒绝状态的操作,使用配置中的存储过程名称
|
|
|
- u_id: userid, // 公司编号
|
|
|
+ functionName: API_CONFIG.moveUser.functionName, // 这里是将数据移至已拒绝状态的操作,使用配置中的存储过程名称
|
|
|
+ uid: row.id,
|
|
|
+ type: _type,
|
|
|
+ euid: this.userid
|
|
|
},
|
|
|
];
|
|
|
|
|
@@ -792,13 +307,18 @@ export default {
|
|
|
.post(API_CONFIG.baseUrl, params)
|
|
|
.then((res) => {
|
|
|
console.log(res);
|
|
|
+ if(type == 1){
|
|
|
+ this.addUser(row)
|
|
|
+ }else{
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
- message: successMessage,
|
|
|
+ message: '操作成功',
|
|
|
});
|
|
|
// 更新数据状态
|
|
|
- this.refreshTableData(); // 例如刷新表格数据
|
|
|
- console.log("此条数据处理后的id为:", userid);
|
|
|
+ this.ajaxAll(); // 例如刷新表格数据
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log("此条数据处理后的id为:", row.id);
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
this.$message.error("操作失败");
|
|
@@ -814,65 +334,8 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- // 刷新数据(假设你需要刷新表格数据)
|
|
|
- refreshTableData() {
|
|
|
- // 在这里重新获取数据或者更新视图
|
|
|
- this.ajaxpending(); // 例如通过接口重新获取数据
|
|
|
- this.ajaxapproved(); // 例如通过接口重新获取数据
|
|
|
- this.ajaxrefused(); // 例如通过接口重新获取数据
|
|
|
- },
|
|
|
-
|
|
|
- // 在已拒绝区域点击移动至待审核
|
|
|
- ajax__move_to_pending_from_rejected(userid) {
|
|
|
- let params = [
|
|
|
- {
|
|
|
- functionName: API_CONFIG.moveToPending.functionName, // 移动至待审核的操作
|
|
|
- u_id: userid, // id
|
|
|
- },
|
|
|
- ];
|
|
|
-
|
|
|
- const successMessage = API_CONFIG.moveToPending.successMessage;
|
|
|
- // const successMessage = '已移动至待审核!';
|
|
|
-
|
|
|
- // 弹窗确认。
|
|
|
- this.$confirm(`此操作将会将该条数据移回待审核, 是否继续?`, "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- // 发起请求
|
|
|
- this.$ajax
|
|
|
- .post(API_CONFIG.baseUrl, params)
|
|
|
- .then((res) => {
|
|
|
- console.log(res);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: successMessage,
|
|
|
- });
|
|
|
- // 调用函数更新数据
|
|
|
- // 更新数据状态
|
|
|
- this.refreshTableData(); // 例如刷新表格数据
|
|
|
- console.log("此条数据处理后的id为:", userid);
|
|
|
- this.ajaxpending(userid); // 数据移回待审核区域
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$message.error("处理失败");
|
|
|
- console.error("请求失败,错误信息:", err);
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$message({
|
|
|
- type: "info",
|
|
|
- message: "已取消移动至待审核",
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.ajaxpending(); // 组件挂载后调用 ajaxpending 方法
|
|
|
- this.ajaxapproved(); // 组件挂载后调用 ajaxapproved 方法
|
|
|
- this.ajaxrefused(); // 组件挂载后调用 ajaxrefused 方法
|
|
|
this.ajaxAll(); // 组件挂载后调用 ajaxAll 方法
|
|
|
},
|
|
|
};
|
|
@@ -1325,7 +788,7 @@ hr {
|
|
|
width: 100%;
|
|
|
}
|
|
|
|
|
|
-.table_content{
|
|
|
+.table_content {
|
|
|
width: 100%;
|
|
|
overflow: auto;
|
|
|
height: calc(100% - 75px);
|