examine.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215
  1. <template>
  2. <div class="table_container">
  3. <div class="title_examine">
  4. <p style="font-size: 30px;font-weight: 400;margin-left: -91%;padding-top: 20px">账号审核</p>
  5. </div>
  6. <div class="examine">
  7. <div class="examine_title1">
  8. <a @click="showPending"
  9. :style="{ color: isPending ? 'black' : 'rgb(179, 179, 179)', fontWeight: 'bold' }">待审核({{ tableData.length
  10. }})</a>
  11. </div>
  12. <div class="examine_title2">
  13. <a @click="showApproved"
  14. :style="{ color: isApproved ? 'black' : 'rgb(179, 179, 179)', fontWeight: 'bold' }">已通过</a>
  15. </div>
  16. <div class="examine_title3">
  17. <a @click="showRefused"
  18. :style="{ color: isRefused ? 'black' : 'rgb(179, 179, 179)', fontWeight: 'bold' }">已拒绝</a>
  19. </div>
  20. <div class="examine_title4">
  21. <a @click="showAll" :style="{ color: isAll ? 'black' : 'rgb(179, 179, 179)', fontWeight: 'bold' }">全部记录</a>
  22. </div>
  23. </div>
  24. <div class="content">
  25. <div class="search-container">
  26. <div class="Search">
  27. <input type="text" placeholder="搜索记录" style="width: 120px; height: 40px; border-radius: 40px">
  28. <button class="search-button" @click="performSearch">
  29. <img src="@/assets/搜索框.png" alt="搜索" class="search-icon" />
  30. </button>
  31. </div>
  32. </div>
  33. <!-- 待审核的数据 -->
  34. <div v-if="isPending">
  35. <el-table :data="currentTableData" stripe border style="width: 100%; background-color: white;"
  36. @selection-change="handleSelectionChange">
  37. <el-table-column type="selection" width="50"></el-table-column>
  38. <el-table-column prop="company" label="组织名称" width="400">
  39. <template slot-scope="scope">{{ scope.row.company }}</template>
  40. </el-table-column>
  41. <el-table-column prop="phone" label="电话/邮箱" width="400"></el-table-column>
  42. <el-table-column prop="name" label="姓名" width="400" show-overflow-tooltip
  43. :label-class-name="'address-column'"></el-table-column>
  44. <el-table-column prop="submission_time" label="提交时间" width="400"></el-table-column>
  45. <el-table-column prop="remarks" label="备注" width="400"></el-table-column>
  46. <el-table-column label="操作" width="283">
  47. <template slot-scope="{ row }">
  48. <button @click="ajax_move_to_approved(row.userid, row.companyNumber)"
  49. style="color: #308fff; background: none; border: none; cursor: pointer; margin-left: 25px;">通过</button>
  50. <button @click="ajax_move_to_rejected(row.userid, row.companyNumber)"
  51. style="color: #308fff; background: none; border: none; cursor: pointer; margin-left: 35px;">拒绝</button>
  52. </template>
  53. </el-table-column>
  54. </el-table>
  55. </div>
  56. <!-- 分页组件 -->
  57. <el-pagination v-if="Pending_request" :current-page="currentPage" :page-size="pageSize"
  58. :page-sizes="pageSizeOptions" :total="tableData.length" @size-change="handlePageSizeChange"
  59. @current-change="handlePageChange" layout="total,sizes,prev, pager, next, jumper">
  60. </el-pagination>
  61. <!-- 已通过的数据 -->
  62. <div v-if="isApproved">
  63. <el-table :data="currentApprovedData" stripe border style="width: 100%; background-color: white;"
  64. @selection-change="handleApprovedSelectionChange">
  65. <el-table-column type="selection" width="50" />
  66. <el-table-column prop="company" label="组织名称" width="350">
  67. <template slot="default" slot-scope="scope">{{ scope.row.company }}</template>
  68. </el-table-column>
  69. <el-table-column prop="phone" label="电话/邮箱" width="350" />
  70. <el-table-column prop="name" label="姓名" width="350" show-overflow-tooltip
  71. :label-class-name="'address-column'" />
  72. <el-table-column prop="submission_time" label="提交时间" width="331" />
  73. <el-table-column prop="remarks" label="备注" width="300" />
  74. <el-table-column prop="Pending_time" label="审核时间" width="300" />
  75. <el-table-column prop="open_organization" label="开通组织" width="300">
  76. <template slot="default" slot-scope="scope">{{ scope.row.open_organization }}</template>
  77. </el-table-column>
  78. </el-table>
  79. <!-- 分页组件 -->
  80. <el-pagination :current-page="currentApprovedPage" :page-size="pageSize" :page-sizes="pageSizeOptions"
  81. :total="approvedData.length" @size-change="handlePageSizeChange" @current-change="handleApprovedPageChange"
  82. layout="total,sizes,prev, pager, next, jumper" />
  83. </div>
  84. <!-- 已拒绝的数据 -->
  85. <div v-if="isRefused">
  86. <el-table :data="currentRefusedData" stripe border style="width: 100%; background-color: white;"
  87. @selection-change="handleRefusedSelectionChange">
  88. <el-table-column type="selection" width="50" />
  89. <el-table-column prop="company" label="组织名称" width="320">
  90. <template slot="default" slot-scope="scope">{{ scope.row.company }}</template>
  91. </el-table-column>
  92. <el-table-column prop="phone" label="电话/邮箱" width="330" />
  93. <el-table-column prop="name" label="姓名" width="350" show-overflow-tooltip
  94. :label-class-name="'address-column'" />
  95. <el-table-column prop="submission_time" label="提交时间" width="300" />
  96. <el-table-column prop="remarks" label="备注" width="350" />
  97. <el-table-column prop="Pending_time" label="审核时间" width="350" />
  98. <el-table-column label="操作" width="283">
  99. <template slot-scope="{ row }">
  100. <button @click="ajax__move_to_pending_from_rejected(row.userid, row.companyNumber)"
  101. style="color: #308fff; background: none; border: none; cursor: pointer; margin-left: 25px;">移动至待审核</button>
  102. </template>
  103. </el-table-column>
  104. </el-table>
  105. <!-- 分页组件 -->
  106. <el-pagination :current-page="currentRefusedPage" :page-size="pageSize" :page-sizes="pageSizeOptions"
  107. :total="RefusedData.length" @size-change="handlePageSizeChange" @current-change="handleRefusedPageChange"
  108. layout="total,sizes,prev, pager, next, jumper" />
  109. </div>
  110. <!-- 全部记录的数据 -->
  111. <div v-if="isAll">
  112. <el-table :data="currentAllData" stripe border style="width: 100%; background-color: white;"
  113. @selection-change="handleAllSelectionChange">
  114. <el-table-column type="selection" width="50" />
  115. <el-table-column prop="company" label="组织名称" width="350">
  116. <template slot="default" slot-scope="scope">{{ scope.row.company }}</template>
  117. </el-table-column>
  118. <el-table-column prop="phone" label="电话/邮箱" width="350" />
  119. <el-table-column prop="name" label="姓名" width="350" show-overflow-tooltip
  120. :label-class-name="'address-column'" />
  121. <el-table-column prop="submission_time" label="提交时间" width="300" />
  122. <el-table-column prop="remarks" label="备注" width="350" />
  123. <el-table-column prop="Pending_time" label="审核时间" width="300" />
  124. <el-table-column label="操作" width="283" prop="status">
  125. <template slot="default" slot-scope="scope">
  126. <!-- 根据状态值显示不同颜色的按钮 -->
  127. <el-button :type="getButtonType(scope.row.status)" :disabled="false" style="border-radius: 5px; padding: 4px 12px; font-size: 14px;">
  128. {{ getStatusText(scope.row.status) }}
  129. </el-button>
  130. </template>
  131. </el-table-column>
  132. </el-table>
  133. <!-- 分页组件 -->
  134. <el-pagination :current-page="currentAllPage" :page-size="pageSize" :page-sizes="[5, 10, 25]"
  135. :total="AllData.length" @size-change="handlePageSizeChange" @current-change="handleAllPageChange"
  136. layout="total,sizes,prev, pager, next, jumper" />
  137. </div>
  138. </div>
  139. </div>
  140. </template>
  141. <script>
  142. import { reactive } from 'vue' // 添加这行导入
  143. export default {
  144. name: 'IndexTable',
  145. components: {
  146. },
  147. data() {
  148. return {
  149. checked: true,
  150. selectedOptions: [], // 用于存储选中的复选框
  151. showCompany: false, // 默认隐藏
  152. selectedOrg: "CN", // 默认选中CN组织
  153. checkboxStates: Array(10).fill(false), // 确保初始化为一个包含10个元素的数组
  154. selectedSchools: Array(16).fill(''), // 确保初始化为一个包含16个空字符串的数组
  155. showCompanyList: reactive(Array(8).fill(false)), // 确保初始化为一个包含8个元素的数组
  156. button: Array(10).fill(false), // 确保初始化为一个包含10个元素的数组
  157. currentPage: 1,
  158. currentApprovedPage: 1,
  159. currentRefusedPage: 1,
  160. currentAllPage: 1,
  161. pageSize: 5, // 每页显示的条目数
  162. pageSizeOptions: [5, 10, 25, 50], // 可选的页大小
  163. // 待审核数据
  164. tableData: [],
  165. // 已审核数据
  166. approvedData: [],
  167. RefusedData: [],
  168. AllData: [],
  169. Pending_request: true,
  170. isPending: true, // 初始状态为待审核
  171. isApproved: false,
  172. isRefused: false,
  173. isAll: false,
  174. showModal: false,// 弹窗是否显示
  175. showConfirmationModal: false, // 控制确认通知申请人的弹窗
  176. }
  177. },
  178. computed: {
  179. currentTableData() {
  180. const start = (this.currentPage - 1) * this.pageSize;
  181. const end = this.currentPage * this.pageSize;
  182. return this.tableData.slice(start, end);
  183. },
  184. currentApprovedData() {
  185. const start = (this.currentApprovedPage - 1) * this.pageSize;
  186. const end = this.currentApprovedPage * this.pageSize;
  187. return this.approvedData.slice(start, end);
  188. },
  189. currentRefusedData() {
  190. const start = (this.currentRefusedPage - 1) * this.pageSize;
  191. const end = this.currentRefusedPage * this.pageSize;
  192. return this.RefusedData.slice(start, end);
  193. },
  194. currentAllData() {
  195. const start = (this.currentAllPage - 1) * this.pageSize;
  196. const end = this.currentAllPage * this.pageSize;
  197. return this.AllData.slice(start, end);
  198. },
  199. },
  200. methods: {
  201. // 获取状态文本
  202. getStatusText(status) {
  203. const statusMap = {
  204. 0: "待审核",
  205. 1: "已通过",
  206. 2: "已拒绝"
  207. };
  208. return statusMap[status] || "未知状态";
  209. },
  210. // 获取状态对应的按钮类型
  211. getButtonType(status) {
  212. const typeMap = {
  213. 0: "primary", // 待审核 -> 蓝色
  214. 1: "success", // 已通过 -> 绿色
  215. 2: "danger", // 已拒绝 -> 红色
  216. };
  217. return typeMap[status] || "default"; // 默认为默认按钮类型
  218. },
  219. // 多选框选择事件处理
  220. handleSelectionChange(selection) {
  221. this.selectedPendingData = selection;
  222. },
  223. handleApprovedSelectionChange(selection) {
  224. this.selectedApprovedData = selection;
  225. },
  226. handleRefusedSelectionChange(selection) {
  227. this.selectedRefusedData = selection;
  228. },
  229. handleAllSelectionChange(selection) {
  230. this.selectedAllData = selection;
  231. },
  232. // 待审核的分页逻辑
  233. handlePageChange(page) {
  234. this.currentPage = page;
  235. },
  236. // 已通过的分页逻辑
  237. handleApprovedPageChange(page) {
  238. this.currentApprovedPage = page;
  239. },
  240. // 已拒绝的分页逻辑
  241. handleRefusedPageChange(page) {
  242. this.currentRefusedPage = page;
  243. },
  244. // 全部记录的分页逻辑
  245. handleAllPageChange(page) {
  246. this.currentAllPage = page;
  247. },
  248. // 显示创建账户的弹窗
  249. showModalHandler() {
  250. this.showModal = true;
  251. },
  252. performSearch() {
  253. console.log('执行搜索');
  254. },
  255. // 创建账户的逻辑
  256. handleCreateAccount() {
  257. // 在这里可以进行创建账户的逻辑
  258. console.log('账户创建完成');
  259. // 点击创建账户后弹出通知确认的灰色弹窗
  260. this.showModal = false; // 关闭创建账户弹窗
  261. this.showConfirmationModal = true; // 打开通知确认弹窗
  262. },
  263. // 通知申请人
  264. notifyApplicant() {
  265. // 在这里进行通知申请人的逻辑
  266. this.$message.success('通知申请人成功!');
  267. this.showConfirmationModal = false; // 关闭通知确认弹窗
  268. },
  269. show_company() {
  270. this.showCompany = !this.showCompany; // 切换 showCompany 的值
  271. },
  272. toggleCompany(index) {
  273. this.showCompanyList[index] = !this.showCompanyList[index];
  274. },
  275. // 待审核
  276. showPending() {
  277. this.isPending = true;
  278. this.isApproved = false;
  279. this.isRefused = false;
  280. this.isAll = false;
  281. this.Pending_request = true;
  282. },
  283. // 已通过
  284. showApproved() {
  285. this.Pending_request = false;
  286. this.isPending = false;
  287. this.isApproved = true;
  288. this.isRefused = false;
  289. this.isAll = false;
  290. },
  291. // 已拒绝
  292. showRefused() {
  293. // console.log("Clicked Refused!");
  294. this.isPending = false;
  295. this.isApproved = false;
  296. this.isRefused = true;
  297. this.isAll = false;
  298. this.Pending_request = false;
  299. },
  300. //全部记录
  301. showAll() {
  302. this.isPending = false;
  303. this.isApproved = false;
  304. this.isRefused = false;
  305. this.isAll = true;
  306. this.Pending_request = false;
  307. },
  308. // 用于切换组织
  309. selectOrg(org) {
  310. this.selectedOrg = org;
  311. },
  312. // 处理每页条目数量变化
  313. handlePageSizeChange(size) {
  314. this.pageSize = size;
  315. },
  316. // 用于显示待审核的表格数据
  317. ajaxpending() {
  318. // console.log(11111);
  319. let params = [
  320. {
  321. functionName: "select_requestuser", // 调用存储过程的名称
  322. r_type: 0,
  323. page: 1,
  324. r_num: 20,
  325. },
  326. ];
  327. this.$ajax.post("http://10.3.16.166:7003/api/pbl/localPost", params)
  328. .then((res) => {
  329. // 假设res.data是一个返回待审核数据的数组
  330. // console.log("返回结果为:", res.data); // 打印返回的查询结果
  331. this.tableData = res.data[0].map(user => ({
  332. company: user.schoolName || '未知', // 组织名称
  333. phone: user.contact_info || '未知',
  334. name: user.name || '未知', // 真实姓名对应 name
  335. submission_time: user.create_at || '未知', // 提交时间对应 数据库里的create_at
  336. remarks: user.remark || '未知', // 备注内容对应 remark
  337. userid: user.id || '未知',
  338. })); // 将数据存储到 tableData 中
  339. // 打印映射后的用户信息
  340. console.log("待审核的数据为:", res.data);
  341. })
  342. .catch((err) => {
  343. // 处理失败的响应
  344. this.$message.error("查询失败");
  345. console.error(err); // 打印错误信息
  346. });
  347. },
  348. // 用于显示已通过的表格数据
  349. ajaxapproved() {
  350. let params = [
  351. {
  352. functionName: "select_requestuser", // 调用存储过程的名称
  353. r_type: 1,
  354. page: 1,
  355. r_num: 100,
  356. },
  357. ];
  358. this.$ajax.post("http://10.3.16.166:7003/api/pbl/localPost", params)
  359. .then((res) => {
  360. // 假设res.data是一个返回已通过的数组
  361. this.approvedData = res.data[0].map(user => ({
  362. company: user.schoolName || '未知', // 组织名称对应 schoolName
  363. phone: user.contact_info || '未知',
  364. name: user.name || '未知', // 真实姓名对应 alias
  365. submission_time: user.create_at || '未知', // 提交时间对应 数据库里的create_at
  366. remarks: user.remark || '未知', // 备注内容对应 remark
  367. Pending_time: user.active_at || '未知', // 处理时间对应 update_time
  368. open_organization: user.school_name || '未知', // 所属组织对应 school_name
  369. userid: user.id || '未知',
  370. }));
  371. // 在这里进行已通过数据的获取和处理
  372. console.log("已通过的数据为:", res.data);
  373. })
  374. .catch((err) => {
  375. // 处理失败的响应
  376. this.$message.error("查询失败");
  377. console.error(err); // 打印错误信息
  378. });
  379. },
  380. // 用于显示已拒绝的表格数据
  381. ajaxrefused() {
  382. let params = [
  383. {
  384. functionName: "select_requestuser", // 调用存储过程的名称
  385. r_type: 2,
  386. page: 1,
  387. r_num: 100,
  388. },
  389. ];
  390. this.$ajax.post("http://10.3.16.166:7003/api/pbl/localPost", params)
  391. .then((res) => {
  392. this.RefusedData = res.data[0].map(user => ({
  393. company: user.schoolName || '未知', // 组织名称对应 organizeid
  394. phone: user.contact_info || '未知', // 用户名对应 username,使用数据库里的username因为有邮箱作为联系方式
  395. name: user.name || '未知', // 真实姓名对应 alias
  396. submission_time: user.create_at || '未知', // 提交时间对应 数据库里的create_at
  397. remarks: user.remark || '未知', // 备注内容对应 remark
  398. Pending_time: user.active_at || '未知', // 处理时间对应 update_time
  399. userid: user.id || '未知',
  400. }));
  401. // 在这里进行已拒绝数据的获取和处理
  402. // console.log(this.RefusedData);
  403. console.log("已拒绝的数据为:", res.data);
  404. })
  405. .catch((err) => {
  406. // 处理失败的响应
  407. this.$message.error("查询失败");
  408. console.error(err); // 打印错误信息
  409. })
  410. },
  411. // 用于显示全部记录的表格数据
  412. ajaxAll() {
  413. console.log("获取所有记录");
  414. // 假设分别调用待审核、已通过、已拒绝的请求
  415. Promise.all([
  416. this.$ajax.post("http://10.3.16.166:7003/api/pbl/localPost", [
  417. { functionName: "select_requestuser", r_type: 0, page: 1, r_num: 100, }
  418. ]),
  419. this.$ajax.post("http://10.3.16.166:7003/api/pbl/localPost", [
  420. { functionName: "select_requestuser", r_type: 1, page: 1, r_num: 100, }
  421. ]),
  422. this.$ajax.post("http://10.3.16.166:7003/api/pbl/localPost", [
  423. { functionName: "select_requestuser", r_type: 2, page: 1, r_num: 100, }
  424. ])
  425. ])
  426. .then((responses) => {
  427. // 解构响应
  428. const [pendingRes, approvedRes, refusedRes] = responses;
  429. // 合并待审核、已通过和已拒绝的数据
  430. const AllData = [
  431. ...pendingRes.data[0], // 待审核数据
  432. ...approvedRes.data[0], // 已通过数据
  433. ...refusedRes.data[0], // 已拒绝数据
  434. ];
  435. // 打印出整个 AllData 数据,查看是否有 r_type 字段
  436. console.log("AllData:", AllData);
  437. // // 确认每个 user 对象中是否有 r_type 字段
  438. // AllData.forEach(user => {
  439. // console.log('user:', user); // 打印 user 对象
  440. // console.log('r_type:', user.r_type); // 确认 r_type 的值
  441. // });
  442. this.AllData = AllData.map(user => {
  443. const status = user.type !== undefined && user.type !== null ? user.type : 0; // 使用 type 替代 r_type
  444. console.log('status:', status); // 确保 status 被正确输出
  445. // console.log('r_type:', user.r_type); // 打印 r_type 的值以调试
  446. return {
  447. company: user.schoolName || '未知',
  448. phone: user.contact_info || '未知',
  449. name: user.name || '未知',
  450. submission_time: user.create_at || '未知',
  451. remarks: user.remark || '未知',
  452. Pending_time: user.active_at || '未知',
  453. status: status, // 保持原始的数字状态值
  454. userid: user.id || '未知',
  455. };
  456. });
  457. console.log(this.AllData);
  458. })
  459. .catch((err) => {
  460. this.$message.error("查询失败");
  461. console.error(err);
  462. });
  463. },
  464. // 通过操作,将数据移到已通过
  465. ajax_move_to_approved(userid) {
  466. const successMessage = '数据已成功移动到已通过状态!';
  467. // 弹出确认框
  468. this.$confirm(`您确定将此数据移至“已通过”状态吗?`, '确认操作', {
  469. confirmButtonText: '确定',
  470. cancelButtonText: '取消',
  471. type: 'warning',
  472. }).then(() => {
  473. // 确认后发起请求
  474. let params = [
  475. {
  476. functionName: "account_approve_user", // 这里是将数据移至已通过状态的操作
  477. u_id: userid, // id
  478. },
  479. ];
  480. // 发起请求
  481. this.$ajax
  482. .post("http://10.3.16.166:7003/api/pbl/localPost", params)
  483. .then((res) => {
  484. console.log(res);
  485. this.$message({
  486. type: 'success',
  487. message: successMessage,
  488. });
  489. // 更新数据状态
  490. this.refreshTableData(); // 例如刷新表格数据
  491. console.log("此条数据处理后的id为:", userid);
  492. })
  493. .catch((err) => {
  494. this.$message.error("操作失败");
  495. console.error("请求失败,错误信息:", err);
  496. });
  497. }).catch(() => {
  498. // 取消操作后的提示
  499. this.$message({
  500. type: 'info',
  501. message: '已取消操作',
  502. });
  503. });
  504. },
  505. // 忽略操作,将数据移到已拒绝
  506. ajax_move_to_rejected(userid) {
  507. const successMessage = '数据已成功移动到已拒绝状态!';
  508. // 弹出确认框
  509. this.$confirm(`您确定将此数据移至“已拒绝”状态吗?`, '确认操作', {
  510. confirmButtonText: '确定',
  511. cancelButtonText: '取消',
  512. type: 'warning',
  513. }).then(() => {
  514. // 确认后发起请求
  515. let params = [
  516. {
  517. functionName: "account_reject_user", // 这里是将数据移至已拒绝状态的操作
  518. u_id: userid, // 公司编号
  519. },
  520. ];
  521. // 发起请求
  522. this.$ajax
  523. .post("http://10.3.16.166:7003/api/pbl/localPost", params)
  524. .then((res) => {
  525. console.log(res);
  526. this.$message({
  527. type: 'success',
  528. message: successMessage,
  529. });
  530. // 更新数据状态
  531. this.refreshTableData(); // 例如刷新表格数据
  532. console.log("此条数据处理后的id为:", userid);
  533. })
  534. .catch((err) => {
  535. this.$message.error("操作失败");
  536. console.error("请求失败,错误信息:", err);
  537. });
  538. }).catch(() => {
  539. // 取消操作后的提示
  540. this.$message({
  541. type: 'info',
  542. message: '已取消操作',
  543. });
  544. });
  545. },
  546. // 刷新数据(假设你需要刷新表格数据)
  547. refreshTableData() {
  548. // 在这里重新获取数据或者更新视图
  549. this.ajaxpending(); // 例如通过接口重新获取数据
  550. this.ajaxapproved(); // 例如通过接口重新获取数据
  551. this.ajaxrefused(); // 例如通过接口重新获取数据
  552. },
  553. // // 在待审核区域点击通过和忽略
  554. // ajax__handle_pending_action(userid, actionType) {
  555. // // 根据不同的操作,设置对应的API函数和提示消息
  556. // let params = [
  557. // {
  558. // functionName: actionType === 'approve' ? "approve_user" : "ignore_user", // 通过或忽略
  559. // u_id: userid, // 传递公司编号
  560. // },
  561. // ];
  562. // const actionMessage = actionType === 'approve' ? '通过该条数据' : '忽略该条数据';
  563. // const successMessage = actionType === 'approve' ? '通过成功!' : '忽略成功!';
  564. // const cancelMessage = actionType === 'approve' ? '已取消通过' : '已取消忽略';
  565. // // 弹窗确认
  566. // this.$confirm(`此操作将会${actionMessage}, 是否继续?`, '提示', {
  567. // confirmButtonText: '确定',
  568. // cancelButtonText: '取消',
  569. // type: 'warning'
  570. // }).then(() => {
  571. // // 确定后发起请求
  572. // this.$ajax
  573. // .post("http://10.3.16.166:7003/api/pbl/localPost", params)
  574. // .then((res) => {
  575. // console.log(res); // 打印成功响应
  576. // this.$message({
  577. // type: 'success',
  578. // message: successMessage
  579. // });
  580. // // 如果是通过操作,调用已通过处理函数
  581. // if (actionType === 'approve') {
  582. // this.ajax_move_to_approved(userid);
  583. // } else {
  584. // // 如果是忽略操作,调用已拒绝处理函数
  585. // this.ajax_move_to_rejected(userid);
  586. // }
  587. // })
  588. // .catch((err) => {
  589. // // 处理失败的响应
  590. // this.$message.error("处理失败");
  591. // console.error("请求失败,错误信息:", err);
  592. // });
  593. // }).catch(() => {
  594. // // 取消操作后的提示
  595. // this.$message({
  596. // type: 'info',
  597. // message: cancelMessage
  598. // });
  599. // });
  600. // },
  601. // 在已拒绝区域点击移动至待审核
  602. ajax__move_to_pending_from_rejected(userid) {
  603. let params = [
  604. {
  605. functionName: "account_move_to_pending", // 移动至待审核的操作
  606. u_id: userid, // id
  607. },
  608. ];
  609. const successMessage = '已移动至待审核!';
  610. // 弹窗确认
  611. this.$confirm(`此操作将会将该条数据移回待审核, 是否继续?`, '提示', {
  612. confirmButtonText: '确定',
  613. cancelButtonText: '取消',
  614. type: 'warning'
  615. }).then(() => {
  616. // 发起请求
  617. this.$ajax
  618. .post("http://10.3.16.166:7003/api/pbl/localPost", params)
  619. .then((res) => {
  620. console.log(res);
  621. this.$message({
  622. type: 'success',
  623. message: successMessage
  624. });
  625. // 调用函数更新数据
  626. // 更新数据状态
  627. this.refreshTableData(); // 例如刷新表格数据
  628. console.log("此条数据处理后的id为:", userid);
  629. this.ajaxpending(userid); // 数据移回待审核区域
  630. })
  631. .catch((err) => {
  632. this.$message.error("处理失败");
  633. console.error("请求失败,错误信息:", err);
  634. });
  635. }).catch(() => {
  636. this.$message({
  637. type: 'info',
  638. message: '已取消移动至待审核'
  639. });
  640. });
  641. }
  642. },
  643. mounted() {
  644. this.ajaxpending(); // 组件挂载后调用 ajaxpending 方法
  645. this.ajaxapproved(); // 组件挂载后调用 ajaxapproved 方法
  646. this.ajaxrefused(); // 组件挂载后调用 ajaxrefused 方法
  647. this.ajaxAll(); // 组件挂载后调用 ajaxAll 方法
  648. },
  649. }
  650. </script>
  651. <style scoped>
  652. .content {
  653. width: 100%;
  654. /* position: relative; */
  655. }
  656. /* 表格容器样式 */
  657. .table_container{
  658. width: 97%;
  659. padding: 30px;
  660. }
  661. /* 账号审核标题样式 */
  662. .title_examine {
  663. width: 100%;
  664. height: 100px;
  665. background-color: #fff;
  666. border-radius: 10px 10px 10px 10px;
  667. }
  668. /* 搜索框容器样式 */
  669. .search-container {
  670. position: absolute;
  671. /* 设置为绝对定位 */
  672. right: -420px;
  673. /* 右对齐 */
  674. top: -50px;
  675. /* 根据需要调整顶部位置 */
  676. }
  677. /* 搜索框样式 */
  678. .Search input {
  679. border: none;
  680. /* 去掉边框 */
  681. padding: 0 10px;
  682. /* 添加内边距 */
  683. padding-left: 15px;
  684. /* 增加左内边距以移动文字 */
  685. font-size: 18px;
  686. /* 增大字体大小 */
  687. outline: none;
  688. /* 去掉聚焦时的轮廓 */
  689. color: black;
  690. }
  691. /* 搜索框按钮样式 */
  692. .search-button {
  693. position: absolute;
  694. /* 设置为绝对定位 */
  695. right: 10px;
  696. /* 右对齐,距离右边10px */
  697. height: 40px;
  698. /* 设置按钮高度与输入框一致 */
  699. border: none;
  700. /* 去掉边框 */
  701. background: none;
  702. /* 去掉背景 */
  703. cursor: pointer;
  704. /* 鼠标悬停时显示手型 */
  705. padding: 0;
  706. /* 去掉内边距 */
  707. }
  708. /* 搜索框图标样式 */
  709. .search-icon {
  710. width: 40px;
  711. /* 设置图标宽度 */
  712. height: 40px;
  713. /* 设置图标高度 */
  714. opacity: 0.5;
  715. /* 设置透明度 */
  716. }
  717. .el-table {
  718. border: 1px solid #dcdfe6;
  719. /* 设置表格边框 */
  720. }
  721. .el-table th,
  722. .el-table td {
  723. border: 1px solid #dcdfe6;
  724. /* 设置单元格边框 */
  725. height: 80px;
  726. }
  727. /* 设置表头背景颜色 */
  728. .el-table th {
  729. background-color: #f5f7f9 !important;
  730. /* 设置表头背景颜色 */
  731. height: 60px;
  732. }
  733. /* 自定义斑马线的背景色 */
  734. .el-table .success-row {
  735. background-color: #f0f9eb;
  736. }
  737. .address-column {
  738. margin: 0;
  739. /* 调整边距 */
  740. padding: 5px;
  741. /* 调整填充 */
  742. }
  743. /*审核框架 */
  744. .examine {
  745. width: 55%;
  746. height: 50px;
  747. margin-top: 20px;
  748. /* border: 1px solid black; */
  749. }
  750. .examine_title1,
  751. .examine_title2,
  752. .examine_title3,
  753. .examine_title4 {
  754. width: 15%;
  755. height: 50px;
  756. float: left;
  757. }
  758. .examine_title1 p,
  759. .examine_title2 p,
  760. .examine_title3 p,
  761. .examine_title4 p {
  762. margin-top: 10px;
  763. margin-left: -20px;
  764. }
  765. /* 新增账户对话框样式 */
  766. .add-account-button {
  767. margin-top: 20px;
  768. /* 添加顶部间距 */
  769. padding: 10px 20px;
  770. /* 添加内边距 */
  771. background-color: transparent;
  772. /* 去掉按钮背景 */
  773. color: black;
  774. /* 设置字体颜色为黑色 */
  775. border-radius: 4px;
  776. /* 设置圆角 */
  777. cursor: pointer;
  778. /* 鼠标悬停时显示手型 */
  779. font-size: 18px;
  780. /* 增大字体 */
  781. display: flex;
  782. /* 使用 Flexbox 布局 */
  783. border: none;
  784. align-items: center;
  785. /* 垂直居中对齐 */
  786. }
  787. .add-icon {
  788. width: 20px;
  789. /* 设置小图片的宽度 */
  790. height: 20px;
  791. /* 设置小图片的高度 */
  792. margin-right: 8px;
  793. /* 图片与文字之间的间距 */
  794. }
  795. /* 对话框内容样式 */
  796. .modal-content {
  797. display: flex;
  798. flex-direction: column;
  799. }
  800. /* 标题样式 */
  801. .modal-header {
  802. display: flex;
  803. gap: 80px;
  804. /* 设置元素之间的固定间距 */
  805. justify-content: center;
  806. /* 居中对齐所有元素 */
  807. align-items: center;
  808. /* 垂直居中对齐 */
  809. cursor: pointer;
  810. /* 鼠标悬停时显示手型 */
  811. }
  812. /* 组织标题样式 */
  813. .org-title {
  814. display: flex;
  815. align-items: center;
  816. margin-bottom: 15px;
  817. }
  818. .org-title h3 {
  819. margin-right: 10px;
  820. font-weight: bold;
  821. }
  822. /* dialog搜索框容器 */
  823. .dialogsearch-container input {
  824. border: none;
  825. /* 去掉边框 */
  826. padding: 0 10px;
  827. /* 添加内边距 */
  828. padding-left: 15px;
  829. /* 增加左内边距以移动文字 */
  830. font-size: 18px;
  831. /* 增大字体大小 */
  832. outline: none;
  833. /* 去掉聚焦时的轮廓 */
  834. color: black;
  835. border: 1px solid black;
  836. }
  837. /* dialog搜索框按钮样式 */
  838. .dialogsearch-button {
  839. position: absolute;
  840. /* 设置为绝对定位 */
  841. right: 310px;
  842. /* 右对齐,距离右边310px */
  843. height: 40px;
  844. /* 设置按钮高度与输入框一致 */
  845. border: none;
  846. /* 去掉边框 */
  847. background: none;
  848. /* 去掉背景 */
  849. cursor: pointer;
  850. /* 鼠标悬停时显示手型 */
  851. padding: 0;
  852. /* 去掉内边距 */
  853. }
  854. /* 复选框容器样式 */
  855. .checkbox-container {
  856. display: flex;
  857. flex-direction: row;
  858. /* 水平排列 */
  859. gap: 10px;
  860. /* justify-content: space-between; 在两排之间留出空间 */
  861. margin-top: 100px;
  862. /* 添加顶部间距 */
  863. }
  864. /* 复选框组样式 */
  865. .checkbox-group {
  866. float: right;
  867. margin-left: 140px;
  868. /* border: 1px solid red; */
  869. height: 400px;
  870. width: 350px;
  871. padding-top: 20px;
  872. }
  873. /* 复选框在右侧样式 */
  874. .checkbox-left {
  875. flex-direction: row-reverse;
  876. /* 选择框在右侧 */
  877. display: flex;
  878. /* 使用 Flexbox */
  879. align-items: center;
  880. /* 垂直居中 */
  881. position: relative;
  882. /* 为下划线定位 */
  883. padding-top: 15px;
  884. /* 设置文本与下划线之间的间距 */
  885. }
  886. /*复选框文本样式 */
  887. .checkbox-left::after {
  888. content: '';
  889. display: block;
  890. width: 150%;
  891. height: 1px;
  892. background-color: black;
  893. position: absolute;
  894. bottom: 0;
  895. left: -12%;
  896. }
  897. hr {
  898. margin: 20px 0;
  899. /* 上下间距 */
  900. border: 1px solid #dcdfe6;
  901. /* 分隔线颜色 */
  902. }
  903. /* dialog学校复选框样式 */
  904. .checkbox-group span.el-checkbox__inner {
  905. position: absolute;
  906. right: -125px;
  907. width: 20px;
  908. height: 20px;
  909. }
  910. /* dialog组织下拉框复选框样式 */
  911. .checkbox-company span.el-checkbox__inner {
  912. width: 20px;
  913. height: 20px;
  914. }
  915. /* 复选框在右侧样式 */
  916. .checkbox-company {
  917. float: right;
  918. margin-left: 140px;
  919. /* border: 1px solid red; */
  920. height: 400px;
  921. width: 350px;
  922. padding-top: 20px;
  923. }
  924. .checkbox-right {
  925. align-items: center;
  926. /* 垂直居中 */
  927. position: relative;
  928. /* 为下划线定位 */
  929. padding-bottom: 5px;
  930. /* 设置文本与下划线之间的间距 */
  931. padding-top: 15px;
  932. }
  933. .checkbox-right::after {
  934. content: '';
  935. /* 创建伪元素 */
  936. display: block;
  937. /* 使其成为块级元素 */
  938. width: 80%;
  939. /* 下划线宽度,调整为所需的宽度 */
  940. height: 1px;
  941. /* 下划线高度 */
  942. background-color: black;
  943. /* 下划线颜色 */
  944. position: absolute;
  945. /* 绝对定位 */
  946. bottom: 0;
  947. /* 距离底部 */
  948. left: 8%;
  949. /* 调整下划线的水平位置,设置为10% */
  950. }
  951. /* 为 select 添加自定义下拉箭头 */
  952. .select_right {
  953. border: none;
  954. /* 去掉边框 */
  955. outline: none;
  956. /* 去掉聚焦时的轮廓线 */
  957. }
  958. /* 公司下拉菜单 */
  959. .company_checkbox {
  960. position: absolute;
  961. /* 设置为绝对定位 */
  962. width: 278px;
  963. background-color: rgb(255, 255, 255);
  964. border: 1px solid rgb(239, 239, 239);
  965. margin-left: 28px;
  966. margin-top: 6px;
  967. z-index: 200;
  968. padding: 10px 0;
  969. /* 给下拉菜单加一点内边距,避免内容太紧 */
  970. }
  971. /* 每个下拉项的容器,使用flexbox布局 */
  972. .com_check {
  973. display: flex;
  974. /* 使用flex布局 */
  975. justify-content: space-between;
  976. /* 让文本和复选框两端对齐 */
  977. align-items: center;
  978. /* 让文本和复选框垂直居中对齐 */
  979. padding: 5px 20px;
  980. /* 给复选框加点内边距,避免紧凑 */
  981. position: relative;
  982. /* 确保伪元素的定位是相对当前元素 */
  983. margin-bottom: 10px;
  984. /* 给每个复选框之间留点空隙 */
  985. }
  986. /* 复选框下的下划线 */
  987. .com_check::after {
  988. content: '';
  989. /* 创建伪元素 */
  990. display: block;
  991. /* 使其成为块级元素 */
  992. width: 100%;
  993. /* 下划线宽度与复选框相同 */
  994. height: 1px;
  995. /* 下划线高度 */
  996. background-color: rgb(214, 214, 214);
  997. /* 下划线颜色 */
  998. position: absolute;
  999. /* 绝对定位 */
  1000. bottom: 0;
  1001. /* 距离底部 */
  1002. left: 0;
  1003. /* 距离左边 */
  1004. }
  1005. /* 新增学校按钮 */
  1006. .com_but {
  1007. width: 275px;
  1008. height: 35px;
  1009. margin-top: 10px;
  1010. /* 给按钮与上面的选项留一点空隙 */
  1011. border: none;
  1012. background-color: rgb(255, 255, 255);
  1013. /* 按钮背景色 */
  1014. outline: none;
  1015. color: rgb(98, 98, 98);
  1016. text-align: left;
  1017. text-indent: 20px;
  1018. /* 左侧文字缩进 */
  1019. font-size: 15px;
  1020. padding-bottom: 5px;
  1021. /* 设置文本与下划线之间的间距 */
  1022. }
  1023. /* 给每个下拉项之间加点空隙 */
  1024. .checkbox-right {
  1025. margin-bottom: 10px;
  1026. /* 给每个项之间留点空隙 */
  1027. }
  1028. /* 弹窗部分的样式 */
  1029. .confirmation-dialog .el-dialog {
  1030. position: absolute;
  1031. top: 20%;
  1032. left: 40%;
  1033. }
  1034. /* 弹窗内容部分的样式 */
  1035. .modal-content .el-overlay .el-dialog {
  1036. text-align: center;
  1037. padding: 20px;
  1038. }
  1039. /* 弹窗标题部分的样式 */
  1040. /* 是否通知申请人弹窗标题部分的样式 */
  1041. .confirmation-modal {
  1042. position: fixed;
  1043. /* 使用固定定位 */
  1044. transform: translate(-50%, -50%);
  1045. /* 使其真正居中 */
  1046. background-color: rgba(255, 255, 255, 0.9);
  1047. /* 背景颜色 */
  1048. border: 1px solid #ccc;
  1049. /* 边框 */
  1050. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  1051. /* 阴影效果 */
  1052. padding: 20px;
  1053. /* 内边距 */
  1054. z-index: 2000;
  1055. /* 确保在其他元素之上 */
  1056. }
  1057. /* 是否通知申请人弹窗标题部分按钮的样式 */
  1058. .button-container {
  1059. display: flex;
  1060. /* 使用flex布局 */
  1061. justify-content: space-around;
  1062. /* 按钮之间的间距 */
  1063. margin-top: 120px;
  1064. /* 按钮与文本之间的间距 */
  1065. }
  1066. /* 分页功能的样式 */
  1067. .el-pagination {
  1068. margin-top: 50px;
  1069. /* 调整分页组件的顶部向上方距离50px */
  1070. }
  1071. /* 设置分页按钮的宽度 */
  1072. .el-pagination .el-pagination__prev,
  1073. .el-pagination .el-pagination__next {
  1074. width: 60px;
  1075. /* 设置上一页和下一页按钮的宽度 */
  1076. }
  1077. /* 设置页码按钮的宽度 */
  1078. .el-pagination .el-pager li {
  1079. width: 50px;
  1080. /* 设置每个页码按钮的宽度 */
  1081. }
  1082. /* 设置分页大小选择框的宽度 */
  1083. .el-pagination .el-select {
  1084. width: 80px;
  1085. /* 设置分页大小选择框的宽度 */
  1086. }
  1087. /*取消dialog学校最后一个的margin值 */
  1088. .el-checkbox {
  1089. margin-right: none !important;
  1090. }
  1091. .cell {
  1092. position: absolute;
  1093. }
  1094. .el-checkbox span {
  1095. margin-left: 3px;
  1096. }
  1097. /* 取消 ElTableColumn 默认的 inline-block 和 vertical-align 样式 */
  1098. .el-scrollbar__view {
  1099. display: block !important;
  1100. /* 或者 display: flex; 根据你的需求 */
  1101. }
  1102. /* 取消 ElTableColumn 的下方滚动条样式 */
  1103. .el-table--scrollable-x .el-table__body-wrapper{
  1104. overflow-x: hidden !important; /* 禁止水平滚动 */
  1105. overflow-y: auto; /* 保留垂直滚动(如果需要) */
  1106. }
  1107. </style>