index.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  1. <template>
  2. <div id="">
  3. <table-list
  4. :tableSets="tableSet"
  5. :tableData="tableData"
  6. :navText="navText"
  7. :loading="loading"
  8. >
  9. <template slot="btn" slot-scope="props">
  10. <el-button type="text" @click="jumpPage(props.scope.row)"
  11. >学习记录</el-button
  12. >
  13. </template>
  14. </table-list>
  15. <pagination
  16. :total="total"
  17. :pageSize="formData.pageSize"
  18. :currentPage="formData.pageNum"
  19. @handleSizeChange="handleSizeChange"
  20. @handleCurrentChange="handleCurrentChange"
  21. />
  22. </div>
  23. </template>
  24. <script>
  25. import tableList from "@/components/tableList";
  26. import pagination from "@/components/pagination";
  27. export default {
  28. name: "",
  29. components: { tableList, pagination },
  30. data() {
  31. return {
  32. size: "small",
  33. loading: false, //当前表单加载是否加载动画
  34. navText: {
  35. title: "完成列表",
  36. index: 0,
  37. ch: "条",
  38. num: false,
  39. border: true,
  40. choice: true,
  41. addHide: true,
  42. backFatherBtn: {
  43. status: false,
  44. title: "未定义",
  45. },
  46. },
  47. formData: {
  48. profileStatus: "",
  49. periodStatus: 1,
  50. status: 1,
  51. pageSize: 10,
  52. pageNum: 1,
  53. },
  54. // 表单
  55. tableSet: [
  56. {
  57. label: "学员编码",
  58. prop: "studentCode",
  59. hidden: false,
  60. },
  61. {
  62. label: "学员姓名",
  63. prop: "realName",
  64. hidden: true,
  65. },
  66. {
  67. label: "学员身份证",
  68. prop: "idCard",
  69. hidden: true,
  70. },
  71. {
  72. label: "绑定手机号码",
  73. prop: "telPhone",
  74. hidden: false,
  75. },
  76. {
  77. label: "所购商品",
  78. prop: "goodsName",
  79. hidden: true,
  80. },
  81. {
  82. label: "所在班级",
  83. prop: "className",
  84. hidden: true,
  85. },
  86. {
  87. label: "班级有效期",
  88. prop1: "classStartTime",
  89. prop2: "classEndTime",
  90. hidden: false,
  91. scope: "TimeLists",
  92. },
  93. {
  94. label: "学时",
  95. prop: "classHours",
  96. hidden: false,
  97. },
  98. {
  99. label: "视频学习进度(节)",
  100. prop1: "stuAllNum",
  101. prop2: "secAllNum",
  102. hidden: false,
  103. scope: "computer",
  104. },
  105. {
  106. label: "做题进度(章卷)",
  107. prop1: "recordNum",
  108. prop2: "examNum",
  109. hidden: false,
  110. scope: "computer",
  111. },
  112. {
  113. label: "学习开始时间",
  114. prop: "startTime",
  115. hidden: true,
  116. scope: "aTimeList",
  117. },
  118. {
  119. label: "学习结束时间",
  120. prop: "endTime",
  121. hidden: true,
  122. scope: "aTimeList",
  123. },
  124. {
  125. label: "学习服务期",
  126. prop1: "serviceStartTime",
  127. prop2: "serviceEndTime",
  128. hidden: false,
  129. Diszing: true,
  130. scope: "TimeLists",
  131. },
  132. {
  133. label: "填写资料审核状态",
  134. prop: "profileStatus",
  135. hidden: true,
  136. scope: "isOptions",
  137. options: [
  138. {
  139. label: "审核通过",
  140. value: 1,
  141. },
  142. {
  143. label: "待审核",
  144. value: 2,
  145. },
  146. {
  147. label: "审核不通过",
  148. value: 3,
  149. },
  150. ],
  151. },
  152. {
  153. label: "学时审批状态",
  154. prop: "periodStatus",
  155. hidden: true,
  156. scope: "statusPeriod",
  157. },
  158. {
  159. label: "审核通过时间",
  160. prop: "periodTime",
  161. hidden: true,
  162. scope: "aTimeList",
  163. },
  164. {
  165. label: "待重修(视频节和题卷)",
  166. prop: "waitRebuildNum",
  167. prop1: "rebuildNum",
  168. hidden: false,
  169. scope: "againStudent",
  170. },
  171. ],
  172. tableData: [], //表单数据
  173. total: 0, //一共多少条
  174. };
  175. },
  176. mounted() {
  177. this.$api
  178. .coursebusinessqueryFullId({
  179. educationName: "继续教育",
  180. projectName: "造价师",
  181. businessName: "二级",
  182. })
  183. .then((res) => {
  184. this.formData.educationId = res.data.educationId;
  185. this.formData.projectId = res.data.projectId;
  186. this.formData.businessId = res.data.businessId;
  187. this.search();
  188. });
  189. },
  190. methods: {
  191. jumpPage(v) {
  192. this.$api
  193. .inquireGradegradelockPeriodStatus({
  194. gradeId: v.gradeId,
  195. userId: v.userId,
  196. goodsId: v.goodsId,
  197. })
  198. .then((res) => {
  199. if (res.msg) {
  200. this.$message.warning(res.msg + "正在操作");
  201. return;
  202. } else {
  203. let data = {
  204. userId: v.userId,
  205. realName: v.realName,
  206. id: v.gradeId,
  207. className: v.className,
  208. goodsId: v.goodsId,
  209. goodsName: v.goodsName,
  210. keyId: `${v.userId}-${v.goodsId}-${v.gradeId}`,
  211. };
  212. this.checkSession(data)
  213. .then(() => {
  214. //学员详情
  215. this.$router.push({
  216. name: "ClassHoursReviews",
  217. });
  218. })
  219. .catch(() => {
  220. this.$message.error("存在异常,请联系开发人员");
  221. });
  222. }
  223. });
  224. },
  225. checkSession(row) {
  226. return new Promise((resolve, reject) => {
  227. const SESSION = sessionStorage.getItem("hoursAudit");
  228. try {
  229. if (SESSION) {
  230. let parseSession = JSON.parse(SESSION);
  231. const STATUS = parseSession.options.some((item) => {
  232. return (
  233. item.userId == row.userId &&
  234. item.goodsId == row.goodsId &&
  235. item.id == row.id
  236. );
  237. });
  238. if (!STATUS) {
  239. parseSession.options.push(row);
  240. }
  241. parseSession.activeData = `${row.userId}-${row.goodsId}-${row.id}`;
  242. sessionStorage.setItem("hoursAudit", JSON.stringify(parseSession));
  243. } else {
  244. let data = {
  245. activeData: `${row.userId}-${row.goodsId}-${row.id}`,
  246. options: [row],
  247. };
  248. sessionStorage.setItem("hoursAudit", JSON.stringify(data));
  249. }
  250. resolve();
  251. } catch (error) {
  252. reject();
  253. }
  254. });
  255. },
  256. search(int) {
  257. this.loading = true;
  258. if (int === 1) {
  259. this.formData.pageNum = 1;
  260. }
  261. var data = JSON.parse(JSON.stringify(this.formData));
  262. this.$api
  263. .inquireGradegradelistUserPeriods(data)
  264. .then((res) => {
  265. this.tableData = res.rows;
  266. this.total = res.total;
  267. this.navText.index = res.total;
  268. })
  269. .finally(() => {
  270. this.loading = false;
  271. });
  272. },
  273. handleSizeChange(v) {
  274. this.formData.pageSize = v;
  275. this.formData.pageNum = 1;
  276. this.search();
  277. },
  278. handleCurrentChange(v) {
  279. this.formData.pageNum = v;
  280. this.search();
  281. },
  282. },
  283. };
  284. </script>
  285. <style lang="less" scoped>
  286. /deep/.el-button {
  287. border-radius: 8px;
  288. }
  289. /deep/.el-dialog {
  290. border-radius: 8px;
  291. .el-dialog__header {
  292. padding: 0;
  293. .hearders {
  294. height: 40px;
  295. display: flex;
  296. align-items: center;
  297. justify-content: space-between;
  298. padding: 0px 18px 0px 20px;
  299. border-bottom: 1px solid #e2e2e2;
  300. .leftTitle {
  301. font-size: 14px;
  302. font-weight: bold;
  303. color: #2f4378;
  304. }
  305. .rightBoxs {
  306. display: flex;
  307. align-items: center;
  308. img {
  309. width: 14px;
  310. height: 14px;
  311. margin-left: 13px;
  312. cursor: pointer;
  313. }
  314. }
  315. }
  316. }
  317. .el-dialog__footer {
  318. padding: 0;
  319. .dialog-footer {
  320. padding: 0px 40px;
  321. height: 70px;
  322. border-top: 1px solid #e2e2e2;
  323. display: flex;
  324. align-items: center;
  325. justify-content: flex-end;
  326. }
  327. }
  328. }
  329. .imgBox {
  330. width: 100%;
  331. // height: 210px;
  332. border: 1px solid #e2e2e2;
  333. border-radius: 8px;
  334. padding: 8px 8px 3px;
  335. display: flex;
  336. flex-direction: column;
  337. align-items: center;
  338. .imgLabel {
  339. flex: 1;
  340. width: 100%;
  341. border: 1px dotted #e2e2e2;
  342. color: #999;
  343. font-size: 14px;
  344. cursor: pointer;
  345. border-radius: 8px;
  346. .msPhoto {
  347. display: flex;
  348. justify-content: center;
  349. align-items: center;
  350. max-width: 100%;
  351. max-height: 270px;
  352. img {
  353. max-width: 100%;
  354. max-height: 270px;
  355. }
  356. }
  357. .imgbbx {
  358. display: flex;
  359. flex-direction: column;
  360. align-items: center;
  361. justify-content: center;
  362. width: 100%;
  363. height: 100%;
  364. i {
  365. font-weight: bold;
  366. margin: 14px 0;
  367. font-size: 24px;
  368. }
  369. }
  370. }
  371. p {
  372. margin: 5px 0px;
  373. }
  374. }
  375. </style>