index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. <template>
  2. <div id="listOfhoursToBeReviewed">
  3. <div style="margin-bottom: 10px">
  4. <span style="font-size: 15px; color: #666">审核状态:</span
  5. ><el-button
  6. :type="formData.periodStatus === 2 ? 'primary' : ''"
  7. :size="size"
  8. @click="changeBTN(2)"
  9. >初审({{ reviewListNums }})
  10. <!-- <i
  11. class="el-icon-warning-outline"
  12. :style="
  13. reviewListNums >= 200
  14. ? 'color:red;'
  15. : reviewListNums < 200 && reviewListNums >= 100
  16. ? 'color:green'
  17. : reviewListNums < 100
  18. ? 'color:block;'
  19. : ''
  20. "
  21. style="font-weight: bold"
  22. ></i> --> </el-button
  23. ><el-button
  24. :type="formData.periodStatus === 3 ? 'primary' : ''"
  25. :size="size"
  26. @click="changeBTN(3)"
  27. >复审({{ underReiviewNums }})
  28. <!-- <i
  29. class="el-icon-warning-outline"
  30. :style="
  31. underReiviewNums >= 200
  32. ? 'color:red;'
  33. : underReiviewNums < 200 && underReiviewNums >= 100
  34. ? 'color:green'
  35. : underReiviewNums < 100
  36. ? 'color:block;'
  37. : ''
  38. "
  39. style="font-weight: bold"
  40. ></i> --> </el-button
  41. ><el-button
  42. :type="formData.periodStatus === 0 ? 'primary' : ''"
  43. :size="size"
  44. @click="changeBTN(0)"
  45. >不通过({{ failNums }})</el-button
  46. ><el-button
  47. :type="formData.periodStatus === 1 ? 'primary' : ''"
  48. :size="size"
  49. @click="changeBTN(1)"
  50. >已通过</el-button
  51. ><el-button
  52. :type="formData.periodStatus === -1 ? 'primary' : ''"
  53. :size="size"
  54. @click="changeBTN(-1)"
  55. >不可审核</el-button
  56. >
  57. </div>
  58. <search-box-new
  59. ref="searchBox"
  60. :formData="formData"
  61. :formList="formList"
  62. @search="search"
  63. @init="init"
  64. />
  65. <table-list
  66. :tableSets="tableSet"
  67. :tableData="tableData"
  68. :navText="navText"
  69. :loading="loading"
  70. >
  71. <template slot="btn" slot-scope="props">
  72. <el-button type="text" @click="jumpPage(props.scope.row)"
  73. >学时审核</el-button
  74. >
  75. </template>
  76. </table-list>
  77. <pagination
  78. :total="total"
  79. :pageSize="formData.pageSize"
  80. :currentPage="formData.pageNum"
  81. @handleSizeChange="handleSizeChange"
  82. @handleCurrentChange="handleCurrentChange"
  83. />
  84. </div>
  85. </template>
  86. <script>
  87. import searchBoxNew from "@/components/searchBoxNew";
  88. import tableList from "@/components/tableList";
  89. import pagination from "@/components/pagination";
  90. export default {
  91. name: "ListOfhoursToBeReviewed",
  92. components: { searchBoxNew, tableList, pagination },
  93. data() {
  94. return {
  95. size: "small",
  96. reviewListNums: 0,
  97. underReiviewNums: 0,
  98. failNums: 0,
  99. loading: false, //当前表单加载是否加载动画
  100. navText: {
  101. title: "学时审核管理",
  102. index: 0,
  103. ch: "条",
  104. num: false,
  105. border: true,
  106. choice: true,
  107. addHide: true,
  108. backFatherBtn: {
  109. status: false,
  110. title: "未定义",
  111. },
  112. },
  113. //搜索
  114. formList: [
  115. {
  116. prop: "educationTypeId",
  117. placeholder: "教育类型",
  118. scope: "educationType",
  119. },
  120. {
  121. prop: "businessId",
  122. placeholder: "业务层次",
  123. scope: "businessLevel",
  124. edu: "educationTypeId",
  125. },
  126. {
  127. prop: "schoolId",
  128. placeholder: "院校",
  129. scope: "schoolList",
  130. edu: "educationTypeId",
  131. },
  132. {
  133. prop: "majorId",
  134. placeholder: "专业",
  135. scope: "Professional",
  136. edu: "educationTypeId",
  137. },
  138. {
  139. prop: "profileStatus",
  140. placeholder: "填写资料审核状态",
  141. scope: "select",
  142. options: [
  143. {
  144. label: "通过",
  145. value: 1,
  146. },
  147. {
  148. label: "不通过",
  149. value: 3,
  150. },
  151. {
  152. label: "待审核",
  153. value: 2,
  154. },
  155. ],
  156. },
  157. {
  158. prop1: "classStartTime",
  159. prop2: "classEndTime",
  160. placeholder1: "班级有效期开始时间",
  161. placeholder2: "班级有效期结束时间",
  162. scope: "moreDataPicker",
  163. Diszing: true,
  164. },
  165. {
  166. prop: "searchKey",
  167. placeholder: "请输入姓名/身份证",
  168. },
  169. ],
  170. formData: {
  171. profileStatus: "",
  172. periodStatus: 2,
  173. status: 1,
  174. pageSize: 10,
  175. pageNum: 1,
  176. },
  177. // 表单
  178. tableSet: [
  179. {
  180. label: "学员编码",
  181. prop: "studentCode",
  182. hidden: false,
  183. },
  184. {
  185. label: "学员姓名",
  186. prop: "realName",
  187. hidden: true,
  188. },
  189. {
  190. label: "学员身份证",
  191. prop: "idCard",
  192. hidden: true,
  193. },
  194. {
  195. label: "绑定手机号码",
  196. prop: "telPhone",
  197. hidden: false,
  198. },
  199. {
  200. label: "所购商品",
  201. prop: "goodsName",
  202. hidden: true,
  203. },
  204. {
  205. label: "所在班级",
  206. prop: "className",
  207. hidden: true,
  208. },
  209. {
  210. label: "班级有效期",
  211. prop1: "classStartTime",
  212. prop2: "classEndTime",
  213. hidden: false,
  214. scope: "TimeLists",
  215. },
  216. {
  217. label: "学时",
  218. prop: "classHours",
  219. hidden: false,
  220. },
  221. {
  222. label: "视频学习进度(节)",
  223. prop1: "stuAllNum",
  224. prop2: "secAllNum",
  225. hidden: false,
  226. scope: "computer",
  227. },
  228. {
  229. label: "做题进度(章卷)",
  230. prop1: "recordNum",
  231. prop2: "examNum",
  232. hidden: false,
  233. scope: "computer",
  234. },
  235. {
  236. label: "学习开始时间",
  237. prop: "startTime",
  238. hidden: true,
  239. scope: "aTimeList",
  240. },
  241. {
  242. label: "学习结束时间",
  243. prop: "endTime",
  244. hidden: true,
  245. scope: "aTimeList",
  246. },
  247. {
  248. label: "学习服务期",
  249. prop1: "serviceStartTime",
  250. prop2: "serviceEndTime",
  251. hidden: false,
  252. Diszing: true,
  253. scope: "TimeLists",
  254. },
  255. {
  256. label: "填写资料审核状态",
  257. prop: "profileStatus",
  258. hidden: true,
  259. scope: "isOptions",
  260. options: [
  261. {
  262. label: "审核通过",
  263. value: 1,
  264. },
  265. {
  266. label: "待审核",
  267. value: 2,
  268. },
  269. {
  270. label: "审核不通过",
  271. value: 3,
  272. },
  273. ],
  274. },
  275. {
  276. label: "学时审批状态",
  277. prop: "periodStatus",
  278. hidden: true,
  279. scope: "statusPeriod",
  280. },
  281. {
  282. label: "待重修(视频节和题卷)",
  283. prop: "waitRebuildNum",
  284. prop1: "rebuildNum",
  285. hidden: false,
  286. scope: "againStudent",
  287. },
  288. ],
  289. tableData: [], //表单数据
  290. total: 0, //一共多少条
  291. };
  292. },
  293. mounted() {
  294. if (
  295. this.$route.params.educationId &&
  296. this.$route.params.businessId &&
  297. this.$route.params.type
  298. ) {
  299. this.$set(
  300. this.formData,
  301. "educationTypeId",
  302. this.$route.params.educationId
  303. );
  304. this.$set(this.formData, "businessId", this.$route.params.businessId);
  305. this.$set(this.formData, "periodStatus", this.$route.params.type);
  306. this.$refs.searchBox.changeEducationType(
  307. this.$route.params.educationId,
  308. true
  309. );
  310. this.$refs.searchBox.changeBusinessLevel(this.$route.params.businessId);
  311. }
  312. console.log(
  313. this.$methodsTools.timestampConvert(this.$route.params.timeType)[0]
  314. );
  315. console.log(
  316. this.$methodsTools.timestampConvert(this.$route.params.timeType)[1]
  317. );
  318. if (this.$route.params.timeType >= 0) {
  319. this.$set(
  320. this.formData,
  321. "classStartTime",
  322. this.$methodsTools.timestampConvert(this.$route.params.timeType)[0]
  323. );
  324. this.$set(
  325. this.formData,
  326. "classEndTime",
  327. this.$methodsTools.timestampConvert(this.$route.params.timeType)[1]
  328. );
  329. }
  330. this.search();
  331. this.getInitList();
  332. this.getInitUnderList();
  333. this.getFailList();
  334. },
  335. activated() {
  336. this.search();
  337. this.getInitList();
  338. this.getInitUnderList();
  339. this.getFailList();
  340. },
  341. methods: {
  342. changeBTN(int) {
  343. this.formData.periodStatus = int;
  344. this.search(6);
  345. },
  346. /**
  347. * 待审核数量
  348. */
  349. getInitList() {
  350. this.$api
  351. .inquireGradegradelistUserPeriod({
  352. periodStatus: 2,
  353. status: 1,
  354. })
  355. .then((res) => {
  356. this.reviewListNums = res.rows.length;
  357. });
  358. },
  359. /**
  360. * 审核中数量
  361. */
  362. getInitUnderList() {
  363. this.$api
  364. .inquireGradegradelistUserPeriod({
  365. periodStatus: 3,
  366. status: 1,
  367. })
  368. .then((res) => {
  369. this.underReiviewNums = res.rows.length;
  370. });
  371. },
  372. /**
  373. * 不通过数量
  374. */
  375. getFailList() {
  376. this.$api
  377. .inquireGradegradelistUserPeriod({
  378. periodStatus: 0,
  379. status: 1,
  380. })
  381. .then((res) => {
  382. this.failNums = res.rows.length;
  383. });
  384. },
  385. jumpPage(v) {
  386. this.$api
  387. .inquireGradegradelockPeriodStatus({
  388. gradeId: v.gradeId,
  389. userId: v.userId,
  390. goodsId: v.goodsId,
  391. })
  392. .then((res) => {
  393. if (res.msg) {
  394. this.$message.warning(res.msg + "正在操作");
  395. return;
  396. } else {
  397. let data = {
  398. userId: v.userId,
  399. realName: v.realName,
  400. id: v.gradeId,
  401. className: v.className,
  402. goodsId: v.goodsId,
  403. goodsName: v.goodsName,
  404. keyId: `${v.userId}-${v.goodsId}-${v.gradeId}`,
  405. };
  406. this.checkSession(data)
  407. .then(() => {
  408. //学员详情
  409. this.$router.push({
  410. path: "classHoursReview",
  411. });
  412. })
  413. .catch(() => {
  414. this.$message.error("存在异常,请联系开发人员");
  415. });
  416. }
  417. });
  418. },
  419. checkSession(row) {
  420. return new Promise((resolve, reject) => {
  421. const SESSION = sessionStorage.getItem("hoursAudit");
  422. try {
  423. if (SESSION) {
  424. let parseSession = JSON.parse(SESSION);
  425. const STATUS = parseSession.options.some((item) => {
  426. return (
  427. item.userId == row.userId &&
  428. item.goodsId == row.goodsId &&
  429. item.id == row.id
  430. );
  431. });
  432. if (!STATUS) {
  433. parseSession.options.push(row);
  434. }
  435. parseSession.activeData = `${row.userId}-${row.goodsId}-${row.id}`;
  436. sessionStorage.setItem("hoursAudit", JSON.stringify(parseSession));
  437. } else {
  438. let data = {
  439. activeData: `${row.userId}-${row.goodsId}-${row.id}`,
  440. options: [row],
  441. };
  442. sessionStorage.setItem("hoursAudit", JSON.stringify(data));
  443. }
  444. resolve();
  445. } catch (error) {
  446. reject();
  447. }
  448. });
  449. },
  450. search(int) {
  451. this.loading = true;
  452. if (int === 1) {
  453. this.formData.pageNum = 1;
  454. }
  455. if (int === 2) {
  456. this.formData = {
  457. profileStatus: "",
  458. periodStatus: this.formData.periodStatus,
  459. status: 1,
  460. pageSize: 10,
  461. pageNum: 1,
  462. };
  463. }
  464. if (int === 6) {
  465. this.formData.pageSize = 10;
  466. this.formData.pageNum = 10;
  467. }
  468. var data = JSON.parse(JSON.stringify(this.formData));
  469. if (this.formData.classStartTime) {
  470. data.classStartTime = parseInt(data.classStartTime / 1000);
  471. }
  472. if (this.formData.classEndTime) {
  473. data.classEndTime = parseInt(data.classEndTime / 1000);
  474. }
  475. this.$api
  476. .inquireGradegradelistUserPeriods(data)
  477. .then((res) => {
  478. this.tableData = res.rows;
  479. this.total = res.total;
  480. this.navText.index = res.total;
  481. })
  482. .finally(() => {
  483. this.loading = false;
  484. });
  485. },
  486. init() {
  487. this.search(2);
  488. },
  489. handleSizeChange(v) {
  490. this.formData.pageSize = v;
  491. this.formData.pageNum = 1;
  492. this.search();
  493. },
  494. handleCurrentChange(v) {
  495. this.formData.pageNum = v;
  496. this.search();
  497. },
  498. },
  499. };
  500. </script>
  501. <style lang="less" scoped>
  502. /deep/.el-button {
  503. border-radius: 8px;
  504. }
  505. /deep/.el-dialog {
  506. border-radius: 8px;
  507. .el-dialog__header {
  508. padding: 0;
  509. .hearders {
  510. height: 40px;
  511. display: flex;
  512. align-items: center;
  513. justify-content: space-between;
  514. padding: 0px 18px 0px 20px;
  515. border-bottom: 1px solid #e2e2e2;
  516. .leftTitle {
  517. font-size: 14px;
  518. font-weight: bold;
  519. color: #2f4378;
  520. }
  521. .rightBoxs {
  522. display: flex;
  523. align-items: center;
  524. img {
  525. width: 14px;
  526. height: 14px;
  527. margin-left: 13px;
  528. cursor: pointer;
  529. }
  530. }
  531. }
  532. }
  533. .el-dialog__footer {
  534. padding: 0;
  535. .dialog-footer {
  536. padding: 0px 40px;
  537. height: 70px;
  538. border-top: 1px solid #e2e2e2;
  539. display: flex;
  540. align-items: center;
  541. justify-content: flex-end;
  542. }
  543. }
  544. }
  545. .imgBox {
  546. width: 100%;
  547. // height: 210px;
  548. border: 1px solid #e2e2e2;
  549. border-radius: 8px;
  550. padding: 8px 8px 3px;
  551. display: flex;
  552. flex-direction: column;
  553. align-items: center;
  554. .imgLabel {
  555. flex: 1;
  556. width: 100%;
  557. border: 1px dotted #e2e2e2;
  558. color: #999;
  559. font-size: 14px;
  560. cursor: pointer;
  561. border-radius: 8px;
  562. .msPhoto {
  563. display: flex;
  564. justify-content: center;
  565. align-items: center;
  566. max-width: 100%;
  567. max-height: 270px;
  568. img {
  569. max-width: 100%;
  570. max-height: 270px;
  571. }
  572. }
  573. .imgbbx {
  574. display: flex;
  575. flex-direction: column;
  576. align-items: center;
  577. justify-content: center;
  578. width: 100%;
  579. height: 100%;
  580. i {
  581. font-weight: bold;
  582. margin: 14px 0;
  583. font-size: 24px;
  584. }
  585. }
  586. }
  587. p {
  588. margin: 5px 0px;
  589. }
  590. }
  591. </style>