examine.vue 37 KB

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