StudyTables.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. <template>
  2. <div class="studyRecordTable">
  3. <div class="studyStyle">
  4. <div class="a_style">
  5. <i></i>
  6. <span>视频审核进度</span>
  7. <div class="flex_style_study">
  8. <div class="num_style" style="color: #0047d0">
  9. 待审:{{ userData.pending }}节
  10. </div>
  11. <div class="num_style" style="color: #e53935">
  12. 作弊:{{ userData.cheat }}节
  13. </div>
  14. <div class="num_style" style="color: #43a047">
  15. 通过:{{ userData.pass }}节
  16. </div>
  17. <div style="clear: both"></div>
  18. </div>
  19. </div>
  20. <div class="a_style">
  21. <i></i>
  22. <span>做题审核进度</span>
  23. <div class="flex_style_study">
  24. <div class="num_style" style="color: #0047d0">
  25. 待审:{{ userData.examPending }}节
  26. </div>
  27. <div class="num_style" style="color: #e53935">
  28. 作弊:{{ userData.examCheat }}节
  29. </div>
  30. <div class="num_style" style="color: #43a047">
  31. 通过:{{ userData.examPass }}节
  32. </div>
  33. <div style="clear: both"></div>
  34. </div>
  35. </div>
  36. <div class="a_style" style="width: 280px">
  37. <i></i>
  38. <span>学时审批状态</span>
  39. <div class="flex_style_study">
  40. <div class="num_style" style="color: #0047d0">
  41. {{
  42. ["不可审核", "未通过", "通过审核", "待审核", "审核中"][
  43. userData.periodStatus + 1
  44. ]
  45. }}
  46. </div>
  47. <div style="clear: both"></div>
  48. </div>
  49. </div>
  50. <div class="s_sd">
  51. <span v-if="userData.periodStatus !== 3">
  52. <el-checkbox
  53. v-if="userData.periodStatus === 2"
  54. :disabled="!allIds.length"
  55. :indeterminate="isIndeterminate"
  56. v-model="checkAll"
  57. @change="handleCheckAllChange"
  58. >待审全选</el-checkbox
  59. >
  60. <el-button
  61. style="margin-left: 10px"
  62. size="mini"
  63. type="success"
  64. v-if="userData.periodStatus === 2"
  65. @click="getChangeStatus(1)"
  66. >勾选通过</el-button
  67. >
  68. <el-button
  69. size="mini"
  70. type="danger"
  71. v-if="userData.periodStatus === 2"
  72. @click="getChangeStatus(2)"
  73. >勾选作弊</el-button
  74. >
  75. </span>
  76. <span v-else>
  77. <el-button style="margin-left: 10px" size="mini" @click="checkBack"
  78. >勾选数据,打回待审核状态</el-button
  79. >
  80. <el-button size="mini" type="warning" @click="approvedOK = true"
  81. >确认审核通过结果</el-button
  82. >
  83. </span>
  84. </div>
  85. </div>
  86. <div class="tablesBoxs">
  87. <el-checkbox-group
  88. v-model="checkList"
  89. @change="handleCheckedCitiesChange"
  90. >
  91. <component
  92. :is="keys[key]"
  93. v-for="key in Object.keys(tablesData)"
  94. :key="key"
  95. :tabledata="tablesData[key]"
  96. :lable="key == 5 ? '卷' : '章'"
  97. ></component>
  98. </el-checkbox-group>
  99. </div>
  100. <Cheat-dialog
  101. :disabledBtn="disabledBtn"
  102. :vidBoxHours.sync="vidBoxHours"
  103. @close="loadingClose"
  104. @submit="
  105. (reason) => {
  106. submitOK(2, reason);
  107. }
  108. "
  109. ></Cheat-dialog>
  110. <Base-dialog
  111. title="操作提示:"
  112. :disabledBtn="disabledBtn"
  113. :isShow.sync="through"
  114. @close="loadingClose"
  115. @submit="
  116. () => {
  117. submitOK(1);
  118. }
  119. "
  120. >
  121. <div>
  122. 确定所勾选的内容,审核结果为【通过】?<br />
  123. 确认后,初审不可再修改,请检查清楚再操作!
  124. </div>
  125. </Base-dialog>
  126. <Base-dialog
  127. title="操作提示:"
  128. :disabledBtn="disabledBtn"
  129. :isShow.sync="popback"
  130. @close="loadingClose"
  131. @submit="uploadForm"
  132. >
  133. <div>
  134. <div style="color: red">
  135. <h4 style="margin: 0px">当前勾选了{{ checkList.length }}条数据:</h4>
  136. <ul style="margin: 0px 0px 6px; max-height: 500px; overflow: auto">
  137. <li v-for="(item, index) in checkList" :key="index">
  138. {{ index + 1 }}.{{ getSecName(item) }}
  139. </li>
  140. </ul>
  141. </div>
  142. <div style="text-align: center; font-weight: bold">
  143. 所选数据,确定要打回待审核状态吗?<br />
  144. 打回后,重新走审核流程,请慎重操作。
  145. </div>
  146. </div>
  147. </Base-dialog>
  148. <Base-dialog
  149. title="操作提示:"
  150. :disabledBtn="disabledBtn"
  151. :isShow.sync="approvedOK"
  152. @close="loadingClose"
  153. @submit="approvedOKFunc"
  154. >
  155. <div>
  156. <div style="color: red">
  157. <h4 style="margin: 0px">确认审核通过结果后:</h4>
  158. <ul style="margin: 0px 0px 6px">
  159. <li>
  160. (1)有做官方接口的,自动触发【学时官方推送】<br />
  161. (2)公开【学习学时记录-学时记录】按钮,权限人可查看【审核结果】<br />
  162. (3)有匹配的预约考试,可走预约流程
  163. </li>
  164. </ul>
  165. </div>
  166. <div style="font-weight: bold; margin-top: 20px">
  167. 确认提交审核通过结果?<br />
  168. 确认后,不能再修改,请慎重操作。
  169. </div>
  170. </div>
  171. </Base-dialog>
  172. </div>
  173. </template>
  174. <script>
  175. import ModulTable from "./ModulTable.vue";
  176. import ChapterTable from "./ChapterTable.vue";
  177. import LessonTable from "./LessonTable.vue";
  178. import CheatDialog from "./CheatDialog.vue";
  179. export default {
  180. props: {
  181. tablesData: {
  182. type: Object,
  183. default: () => {
  184. return {};
  185. },
  186. },
  187. userData: {
  188. type: Object,
  189. default: () => {
  190. return {};
  191. },
  192. },
  193. setData: {
  194. type: Object,
  195. default: () => {
  196. return {};
  197. },
  198. },
  199. getUserInfo: {
  200. type: Function,
  201. default: () => {},
  202. },
  203. },
  204. provide() {
  205. return {
  206. userData: this.userData,
  207. getUserInfo: this.getUserInfo,
  208. };
  209. },
  210. data() {
  211. return {
  212. checkList: [],
  213. allIds: [],
  214. checkAll: false,
  215. isIndeterminate: false,
  216. vidBoxHours: false,
  217. through: false,
  218. popback: false,
  219. approvedOK: false,
  220. disabledBtn: false,
  221. formData: {
  222. cheating_reason: "",
  223. },
  224. statusPop: "", //1单个2批量
  225. rules: {
  226. cheating_reason: [
  227. {
  228. required: true,
  229. message: "请填写作弊原因",
  230. trigger: ["blur", "change"],
  231. },
  232. ],
  233. },
  234. msgTitle: [
  235. { label: "学习拍照异常", value: 1 },
  236. {
  237. label: "学习拍照太黑无法识别人像,请确保拍照光线充足并拍到全脸",
  238. value: 2,
  239. },
  240. {
  241. label: "学习拍照太模糊无法识别人像,请确保拍照光线充足并拍到全脸",
  242. value: 3,
  243. },
  244. {
  245. label: "学习拍照人像不全无法识别,请确保拍照光线充足并拍到全脸",
  246. value: 4,
  247. },
  248. ],
  249. allType3List: [],
  250. };
  251. },
  252. methods: {
  253. submitAllSlect(reason) {
  254. this.submitOK(2, reason);
  255. },
  256. handleCheckedCitiesChange(value) {
  257. let checkedCount = value.length;
  258. if (checkedCount) {
  259. this.checkAll = checkedCount === this.allIds.length;
  260. } else {
  261. this.checkAll = false;
  262. }
  263. this.isIndeterminate =
  264. checkedCount > 0 && checkedCount < this.allIds.length;
  265. },
  266. handleCheckAllChange(val) {
  267. this.checkList = val ? this.allIds : [];
  268. this.isIndeterminate = false;
  269. },
  270. getAllId(data) {
  271. if (!data || !data.length) {
  272. return;
  273. }
  274. data.forEach((ele) => {
  275. if (ele.type == 3 || ele.type == 4) {
  276. this.allType3List.push(ele);
  277. ele.status === 2 && this.allIds.push(ele.periodStatusId);
  278. } else {
  279. this.getAllId(
  280. ele.type == 1 ? ele.classPeriods : ele.classPeriodSectionList
  281. );
  282. }
  283. });
  284. },
  285. getChangeStatus(int) {
  286. if (!this.checkList.length) {
  287. this.$message.warning("请勾选需要操作的待审核数据");
  288. return;
  289. }
  290. var data = {
  291. gradeId: Number(this.setData.id),
  292. userId: Number(this.setData.userId),
  293. goodsId: Number(this.setData.goodsId),
  294. };
  295. if (int === 1) {
  296. data.status = 1;
  297. this.through = true;
  298. }
  299. if (int === 2) {
  300. data.status = 0;
  301. this.statusPop = 2;
  302. this.formData.cheating_reason = "";
  303. this.vidBoxHours = true;
  304. }
  305. },
  306. loadingClose() {
  307. this.disabledBtn = false;
  308. },
  309. submitOK(int, msg) {
  310. this.disabledBtn = true;
  311. var data = {
  312. gradeId: Number(this.setData.id),
  313. userId: Number(this.setData.userId),
  314. goodsId: Number(this.setData.goodsId),
  315. ids: this.checkList,
  316. };
  317. if (int === 1) {
  318. data.status = 1;
  319. }
  320. if (int === 2) {
  321. data.auditReason = msg;
  322. data.status = 0;
  323. }
  324. this.$api
  325. .editGradeUsereditPeriodeAll(data)
  326. .then((res) => {
  327. if (int === 1) {
  328. this.$message.success("状态全部通过修改成功");
  329. this.through = false;
  330. }
  331. if (int === 2) {
  332. this.$message.success("状态全部作弊修改成功");
  333. this.vidBoxHours = false;
  334. }
  335. this.checkList = [];
  336. this.isIndeterminate = false;
  337. this.checkAll = false;
  338. this.getUserInfo(true);
  339. })
  340. .catch(() => {
  341. this.disabledBtn = false;
  342. });
  343. },
  344. getSecName(id) {
  345. try {
  346. return this.allType3List.find((e) => e.periodStatusId == id).typeName;
  347. } catch (error) {
  348. return "";
  349. }
  350. },
  351. uploadText(msg) {
  352. this.formData.cheating_reason = msg;
  353. },
  354. checkBack() {
  355. if (!this.checkList.length) {
  356. this.$message.warning("请勾选数据");
  357. return;
  358. }
  359. this.popback = true;
  360. },
  361. // 打回审核状态
  362. uploadForm() {
  363. this.disabledBtn = true;
  364. let data = {
  365. gradeId: Number(this.setData.id),
  366. userId: Number(this.setData.userId),
  367. goodsId: Number(this.setData.goodsId),
  368. ids: this.checkList,
  369. };
  370. this.$api
  371. .editGradeUsereditrollbackPeriod(data)
  372. .then((res) => {
  373. this.checkList = []; //勾选列表
  374. this.isIndeterminate = false; //待审半选
  375. this.checkAll = false; //全选状态
  376. this.getUserInfo(true);
  377. this.$message.success("已打回待审核状态");
  378. this.popback = false;
  379. })
  380. .catch(() => {
  381. this.disabledBtn = false;
  382. });
  383. },
  384. // 确认审核结果
  385. approvedOKFunc() {
  386. this.disabledBtn = true;
  387. let data = {
  388. gradeId: Number(this.setData.id),
  389. userId: Number(this.setData.userId),
  390. goodsId: Number(this.setData.goodsId),
  391. };
  392. this.$api
  393. .editGradeUsereditrollconfirmPeriod(data)
  394. .then((res) => {
  395. this.getUserInfo(true);
  396. this.$message.success("审核通过");
  397. this.approvedOK = false;
  398. })
  399. .catch(() => {
  400. this.disabledBtn = false;
  401. });
  402. },
  403. setBomHeight() {
  404. let box = document.querySelector(".tablesBoxs");
  405. box.style.height = window.innerHeight - box.offsetTop - 190 + "px";
  406. },
  407. },
  408. mounted() {
  409. window.onresize = function () {
  410. this.setBomHeight();
  411. };
  412. },
  413. created() {
  414. this.keys = {
  415. 1: "ModulTable",
  416. 2: "ChapterTable",
  417. 3: "LessonTable",
  418. 5: "ChapterTable",
  419. };
  420. this.$nextTick(() => {
  421. this.setBomHeight();
  422. });
  423. },
  424. components: { ModulTable, LessonTable, ChapterTable, CheatDialog },
  425. watch: {
  426. tablesData: {
  427. handler() {
  428. for (const key in this.tablesData) {
  429. this.getAllId(this.tablesData[key]);
  430. }
  431. },
  432. immediate: true,
  433. deep: true,
  434. },
  435. },
  436. };
  437. </script>
  438. <style lang="scss" scoped>
  439. .studyRecordTable {
  440. .studyStyle {
  441. top: 100px;
  442. margin: 16px 0px 0px;
  443. display: flex;
  444. align-items: center;
  445. & > .a_style {
  446. display: flex;
  447. align-items: center;
  448. margin: 0px 16px 16px 0px;
  449. padding: 11px 16px;
  450. box-shadow: 0px 0px 8px 0px rgba(217, 217, 217, 0.8);
  451. border-radius: 4px;
  452. height: 40px;
  453. width: 440px;
  454. user-select: none;
  455. i {
  456. width: 2px;
  457. height: 18px;
  458. display: inline-block;
  459. background-color: #0047d0;
  460. margin-right: 8px;
  461. }
  462. span {
  463. color: #666;
  464. font-weight: bold;
  465. }
  466. .flex_style_study {
  467. flex: 1;
  468. }
  469. .num_style {
  470. float: right;
  471. font-size: 14px;
  472. margin-left: 14px;
  473. }
  474. }
  475. .s_sd {
  476. flex: 1;
  477. justify-content: flex-end;
  478. display: flex;
  479. align-items: center;
  480. flex-shrink: 0;
  481. margin: 0px 16px 16px 0px;
  482. .dis_colu {
  483. height: 55px;
  484. margin-right: 14px;
  485. display: flex;
  486. flex-direction: column;
  487. justify-content: space-around;
  488. font-size: 14px;
  489. }
  490. }
  491. }
  492. .tablesBoxs {
  493. overflow-x: auto;
  494. }
  495. }
  496. </style>