index.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  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: "",
  50. status: 1,
  51. pageSize: 10,
  52. pageNum: 1,
  53. },
  54. // 表单
  55. tableSet: [
  56. {
  57. label: "学员姓名",
  58. prop: "realName",
  59. hidden: true,
  60. },
  61. {
  62. label: "学员身份证",
  63. prop: "idCard",
  64. hidden: true,
  65. },
  66. {
  67. label: "一寸头像照",
  68. prop: "oneInchPhotos",
  69. hidden: true,
  70. scope: "img",
  71. width: "120px",
  72. },
  73. {
  74. label: "最近人脸照",
  75. prop: "idCardImg1",
  76. hidden: true,
  77. scope: "img",
  78. width: "120px",
  79. },
  80. {
  81. label: "商品名称",
  82. prop: "goodsName",
  83. hidden: true,
  84. },
  85. {
  86. label: "学时",
  87. prop: "classHours",
  88. hidden: true,
  89. },
  90. {
  91. label: "所在班级",
  92. prop: "className",
  93. hidden: true,
  94. },
  95. // {
  96. // label: "学习服务期",
  97. // prop1: "serviceStartTime",
  98. // prop2: "serviceEndTime",
  99. // hidden: true,
  100. // Diszing: true,
  101. // scope: "TimeLists",
  102. // },
  103. // {
  104. // label: "班级有效期",
  105. // prop1: "classStartTime",
  106. // prop2: "classEndTime",
  107. // scope: "TimeLists",
  108. // Diszing: false,
  109. // hidden: false,
  110. // },
  111. {
  112. label: "学习时间",
  113. prop1: "startTime",
  114. prop2: "endTime",
  115. scope: "TimeLists",
  116. hidden: false,
  117. },
  118. // {
  119. // label: "学习状态",
  120. // prop: "periodStatus",
  121. // hidden: true,
  122. // scope: "isOptions",
  123. // options: [
  124. // {
  125. // label: "已完成",
  126. // value: 0,
  127. // },
  128. // {
  129. // label: "已完成",
  130. // value: 1,
  131. // },
  132. // {
  133. // label: "已完成",
  134. // value: 2,
  135. // },
  136. // {
  137. // label: "未完成",
  138. // value: -1,
  139. // },
  140. // ],
  141. // },
  142. {
  143. label: "学时审核状态",
  144. prop: "periodStatus",
  145. hidden: true,
  146. scope: "isOptions",
  147. options: [
  148. {
  149. label: "不可审核",
  150. value: -1,
  151. },
  152. {
  153. label: "待审核",
  154. value: 2,
  155. },
  156. {
  157. label: "审核不通过",
  158. value: 0,
  159. },
  160. {
  161. label: "审核通过",
  162. value: 1,
  163. },
  164. {
  165. label: "审核中",
  166. value: 3,
  167. },
  168. ],
  169. },
  170. // {
  171. // label: "学时官方推送状态",
  172. // prop: "periodPlush",
  173. // hidden: true,
  174. // scope: "isOptions",
  175. // options: [
  176. // {
  177. // label: "否",
  178. // value: null,
  179. // },
  180. // {
  181. // label: "否",
  182. // value: 0,
  183. // },
  184. // {
  185. // label: "是",
  186. // value: 1,
  187. // },
  188. // ],
  189. // },
  190. ],
  191. tableData: [], //表单数据
  192. total: 0, //一共多少条
  193. };
  194. },
  195. mounted() {
  196. this.$api
  197. .coursebusinessqueryFullId({
  198. educationName: "继续教育",
  199. projectName: "造价师",
  200. businessName: "二级",
  201. })
  202. .then((res) => {
  203. this.formData.educationId = res.data.educationId;
  204. this.formData.projectId = res.data.projectId;
  205. this.formData.businessId = res.data.businessId;
  206. this.search();
  207. });
  208. },
  209. methods: {
  210. jumpPage(options) {
  211. const jump = () => {
  212. //班级详情
  213. this.$router.push({
  214. name: "HoursTimesRecord",
  215. query: {
  216. gradeId: options.gradeId,
  217. userId: options.userId,
  218. goodsId: options.goodsId,
  219. goodsName: options.goodsName,
  220. className: options.className,
  221. classHours: options.classHours,
  222. studyStartTime: options.studyStartTime,
  223. studyEndTime: options.studyEndTime,
  224. },
  225. });
  226. };
  227. const statusPage = this.$store.state.tagsView.visitedViews.some(
  228. (item) => {
  229. return item.name == "HoursTimesRecord";
  230. }
  231. );
  232. if (statusPage) {
  233. this.$store
  234. .dispatch("tagsView/delCachedView", {
  235. name: "HoursTimesRecord",
  236. })
  237. .then((res) => {
  238. jump();
  239. });
  240. } else {
  241. jump();
  242. }
  243. },
  244. checkSession(row) {
  245. return new Promise((resolve, reject) => {
  246. const SESSION = sessionStorage.getItem("hoursAudit");
  247. try {
  248. if (SESSION) {
  249. let parseSession = JSON.parse(SESSION);
  250. const STATUS = parseSession.options.some((item) => {
  251. return (
  252. item.userId == row.userId &&
  253. item.goodsId == row.goodsId &&
  254. item.id == row.id
  255. );
  256. });
  257. if (!STATUS) {
  258. parseSession.options.push(row);
  259. }
  260. parseSession.activeData = `${row.userId}-${row.goodsId}-${row.id}`;
  261. sessionStorage.setItem("hoursAudit", JSON.stringify(parseSession));
  262. } else {
  263. let data = {
  264. activeData: `${row.userId}-${row.goodsId}-${row.id}`,
  265. options: [row],
  266. };
  267. sessionStorage.setItem("hoursAudit", JSON.stringify(data));
  268. }
  269. resolve();
  270. } catch (error) {
  271. reject();
  272. }
  273. });
  274. },
  275. search(int) {
  276. this.loading = true;
  277. if (int === 1) {
  278. this.formData.pageNum = 1;
  279. }
  280. var data = JSON.parse(JSON.stringify(this.formData));
  281. this.$api
  282. .inquireGradegradelistUserPeriod(data)
  283. .then((res) => {
  284. this.tableData = res.rows;
  285. this.total = res.total;
  286. this.navText.index = res.total;
  287. })
  288. .finally(() => {
  289. this.loading = false;
  290. });
  291. },
  292. handleSizeChange(v) {
  293. this.formData.pageSize = v;
  294. this.formData.pageNum = 1;
  295. this.search();
  296. },
  297. handleCurrentChange(v) {
  298. this.formData.pageNum = v;
  299. this.search();
  300. },
  301. },
  302. };
  303. </script>
  304. <style lang="less" scoped>
  305. /deep/.el-button {
  306. border-radius: 8px;
  307. }
  308. /deep/.el-dialog {
  309. border-radius: 8px;
  310. .el-dialog__header {
  311. padding: 0;
  312. .hearders {
  313. height: 40px;
  314. display: flex;
  315. align-items: center;
  316. justify-content: space-between;
  317. padding: 0px 18px 0px 20px;
  318. border-bottom: 1px solid #e2e2e2;
  319. .leftTitle {
  320. font-size: 14px;
  321. font-weight: bold;
  322. color: #2f4378;
  323. }
  324. .rightBoxs {
  325. display: flex;
  326. align-items: center;
  327. img {
  328. width: 14px;
  329. height: 14px;
  330. margin-left: 13px;
  331. cursor: pointer;
  332. }
  333. }
  334. }
  335. }
  336. .el-dialog__footer {
  337. padding: 0;
  338. .dialog-footer {
  339. padding: 0px 40px;
  340. height: 70px;
  341. border-top: 1px solid #e2e2e2;
  342. display: flex;
  343. align-items: center;
  344. justify-content: flex-end;
  345. }
  346. }
  347. }
  348. .imgBox {
  349. width: 100%;
  350. // height: 210px;
  351. border: 1px solid #e2e2e2;
  352. border-radius: 8px;
  353. padding: 8px 8px 3px;
  354. display: flex;
  355. flex-direction: column;
  356. align-items: center;
  357. .imgLabel {
  358. flex: 1;
  359. width: 100%;
  360. border: 1px dotted #e2e2e2;
  361. color: #999;
  362. font-size: 14px;
  363. cursor: pointer;
  364. border-radius: 8px;
  365. .msPhoto {
  366. display: flex;
  367. justify-content: center;
  368. align-items: center;
  369. max-width: 100%;
  370. max-height: 270px;
  371. img {
  372. max-width: 100%;
  373. max-height: 270px;
  374. }
  375. }
  376. .imgbbx {
  377. display: flex;
  378. flex-direction: column;
  379. align-items: center;
  380. justify-content: center;
  381. width: 100%;
  382. height: 100%;
  383. i {
  384. font-weight: bold;
  385. margin: 14px 0;
  386. font-size: 24px;
  387. }
  388. }
  389. }
  390. p {
  391. margin: 5px 0px;
  392. }
  393. }
  394. </style>