index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. <template>
  2. <div id="studentList">
  3. <search-box-new
  4. ref="searchBox"
  5. :formData="formData"
  6. :formList="formList"
  7. @search="search"
  8. @init="init"
  9. />
  10. <table-list
  11. :tableSets="tableSet"
  12. :tableData="tableData"
  13. :navText="navText"
  14. @addClick="addClick"
  15. :loading="loading"
  16. @editInfo="editInfo"
  17. >
  18. <template slot="btn" slot-scope="props">
  19. <el-button type="text" @click="addClick(props.scope.row, 2)"
  20. >详情</el-button
  21. >
  22. <!-- <el-button type="text" @click="addClick(props.scope.row, 3)"
  23. >选班</el-button
  24. > -->
  25. </template>
  26. </table-list>
  27. <pagination
  28. :total="total"
  29. :pageSize="formData.pageSize"
  30. :currentPage="formData.pageNum"
  31. @handleSizeChange="handleSizeChange"
  32. @handleCurrentChange="handleCurrentChange"
  33. />
  34. </div>
  35. </template>
  36. <script>
  37. import searchBoxNew from "@/components/searchBoxNew";
  38. import tableList from "@/components/tableList";
  39. import pagination from "@/components/pagination";
  40. export default {
  41. name: "StudentList",
  42. components: { searchBoxNew, tableList, pagination },
  43. data() {
  44. return {
  45. loading: false, //当前表单加载是否加载动画
  46. navText: {
  47. title: "学员管理",
  48. index: 0,
  49. ch: "条",
  50. num: false,
  51. border: true,
  52. choice: true,
  53. addHide: true,
  54. backFatherBtn: {
  55. status: false,
  56. title: "未定义",
  57. },
  58. },
  59. //搜索
  60. formList: [
  61. {
  62. prop: "educationTypeId",
  63. placeholder: "教育类型",
  64. scope: "educationType",
  65. },
  66. {
  67. prop: "businessId",
  68. placeholder: "业务层次",
  69. scope: "businessLevel",
  70. edu: "educationTypeId",
  71. },
  72. {
  73. prop: "gradePoint",
  74. placeholder: "是否分班",
  75. scope: "select",
  76. options: [
  77. {
  78. label: "已分班",
  79. value: 1,
  80. },
  81. {
  82. label: "未分班",
  83. value: 2,
  84. },
  85. ],
  86. },
  87. {
  88. prop: "hasBindWx",
  89. placeholder: "是否绑定微信",
  90. scope: "select",
  91. options: [
  92. {
  93. label: "是",
  94. value: 1,
  95. },
  96. {
  97. label: "否",
  98. value: 0,
  99. },
  100. ],
  101. },
  102. {
  103. prop: "hasFollowWx",
  104. placeholder: "是否关注公众号",
  105. scope: "select",
  106. options: [
  107. {
  108. label: "是",
  109. value: 1,
  110. },
  111. {
  112. label: "否",
  113. value: 0,
  114. },
  115. ],
  116. },
  117. {
  118. prop1: "startTime",
  119. prop2: "endTime",
  120. placeholder1: "创建开始时间",
  121. placeholder2: "创建结束时间",
  122. scope: "moreDataPicker",
  123. Diszing: true,
  124. },
  125. {
  126. prop: "goodsSearchKey",
  127. placeholder: "请输入商品编码/商品名称",
  128. },
  129. {
  130. prop: "companyName",
  131. placeholder: "请输入公司名称",
  132. },
  133. {
  134. prop: "realname",
  135. placeholder: "请输入学员名称",
  136. },
  137. ],
  138. formData: {
  139. status: "0,1",
  140. pageSize: 10,
  141. pageNum: 1,
  142. getOrderNum: 1,
  143. },
  144. // 表单
  145. tableSet: [
  146. {
  147. label: "学员编码",
  148. prop: "studentCode",
  149. hidden: true,
  150. },
  151. {
  152. label: "学员姓名",
  153. prop: "realname",
  154. hidden: true,
  155. scope: "editInfo",
  156. },
  157. {
  158. label: "一寸头像",
  159. prop: "oneInchPhotos",
  160. hidden: true,
  161. scope: "img",
  162. width: "120px",
  163. },
  164. {
  165. label: "学员身份证",
  166. prop: "idCard",
  167. hidden: true,
  168. },
  169. {
  170. label: "绑定手机号",
  171. prop: "telphone",
  172. hidden: true,
  173. },
  174. {
  175. label: "是否绑定小程序账号",
  176. prop: "userBindWx",
  177. hidden: true,
  178. scope: "isOptions",
  179. options: [
  180. {
  181. label: "是",
  182. value: 1,
  183. },
  184. {
  185. label: "否",
  186. value: 0,
  187. },
  188. ],
  189. },
  190. {
  191. label: "是否关注公众号",
  192. prop: "userFollowWx",
  193. hidden: true,
  194. scope: "isOptions",
  195. options: [
  196. {
  197. label: "是",
  198. value: 1,
  199. },
  200. {
  201. label: "否",
  202. value: 0,
  203. },
  204. ],
  205. },
  206. {
  207. label: "所在公司",
  208. prop: "companyName",
  209. hidden: true,
  210. },
  211. {
  212. label: "创建时间",
  213. prop: "createTime",
  214. hidden: true,
  215. scope: "aTimeList",
  216. },
  217. {
  218. label: "所购商品",
  219. prop1: "goodsCourseNum",
  220. prop2: "goodsBankNum",
  221. prop3: "goodsLiveNum",
  222. hidden: true,
  223. scope: "payGoodsList",
  224. },
  225. {
  226. label: "所属班级",
  227. prop: "classGradeUserGoodsVoList",
  228. hidden: true,
  229. scope: "classNums",
  230. sort: true,
  231. width: "120px",
  232. },
  233. ],
  234. tableData: [], //表单数据
  235. total: 0, //一共多少条
  236. };
  237. },
  238. mounted() {
  239. if (this.$route.params.timeType >= 0) {
  240. this.$set(
  241. this.formData,
  242. "startTime",
  243. this.$methodsTools.timestampConvert(this.$route.params.timeType)[0]
  244. );
  245. this.$set(
  246. this.formData,
  247. "endTime",
  248. this.$methodsTools.timestampConvert(this.$route.params.timeType)[1]
  249. );
  250. }
  251. if (this.$route.params.educationId) {
  252. this.$set(
  253. this.formData,
  254. "educationTypeId",
  255. this.$route.params.educationId
  256. );
  257. this.$refs.searchBox.changeEducationType(
  258. this.$route.params.educationId,
  259. true
  260. );
  261. }
  262. if (this.$route.params.businessId) {
  263. this.$set(this.formData, "businessId", this.$route.params.businessId);
  264. this.$refs.searchBox.changeBusinessLevel(this.$route.params.businessId);
  265. }
  266. this.search();
  267. },
  268. activated() {
  269. this.search();
  270. },
  271. methods: {
  272. editInfo(v) {
  273. this.addClick(v, 2);
  274. },
  275. search(int) {
  276. this.loading = true;
  277. if (int === 1) {
  278. this.formData.pageNum = 1;
  279. }
  280. if (int === 2) {
  281. this.formData = {
  282. status: "0,1",
  283. pageSize: 10,
  284. pageNum: 1,
  285. getOrderNum: 1,
  286. };
  287. }
  288. var data = JSON.parse(JSON.stringify(this.formData));
  289. if (this.formData.startTime) {
  290. data.startTime = parseInt(data.startTime / 1000);
  291. }
  292. if (this.formData.endTime) {
  293. data.endTime = parseInt(data.endTime / 1000);
  294. }
  295. this.$api
  296. .inquiregradestudentlistStudent(data)
  297. .then((res) => {
  298. this.tableData = res.rows;
  299. this.total = res.total;
  300. this.navText.index = res.total;
  301. })
  302. .finally(() => {
  303. this.loading = false;
  304. });
  305. },
  306. init() {
  307. this.search(2);
  308. },
  309. del(v) {
  310. this.$alert(
  311. "确定删除此内容?<br />内容删除后将无法恢复,请慎重考虑",
  312. "提示",
  313. {
  314. dangerouslyUseHTMLString: true,
  315. }
  316. )
  317. .then(() => {
  318. var data = {
  319. chapterExamId: v.chapterExamId,
  320. status: -1,
  321. };
  322. this.$api.editbankchapter(data).then((res) => {
  323. this.$message.success("删除成功");
  324. this.search();
  325. });
  326. })
  327. .catch(() => {
  328. this.$message({
  329. type: "info",
  330. message: "已取消删除",
  331. });
  332. });
  333. },
  334. addClick(v, int) {
  335. // int = 2详情 3选班
  336. if (v === undefined) {
  337. // 添加学员
  338. // this.$router.push({
  339. // path: "addClass",
  340. // });
  341. } else {
  342. if (int === 2) {
  343. const jump = () => {
  344. //学员详情
  345. this.$router.push({
  346. path: "studentXQ",
  347. query: {
  348. id: v.userId,
  349. },
  350. });
  351. };
  352. const statusPage = this.$store.state.tagsView.visitedViews.some(
  353. (item) => {
  354. return item.name == "StudentXQ";
  355. }
  356. );
  357. if (statusPage) {
  358. this.$store
  359. .dispatch("tagsView/delCachedView", {
  360. name: "StudentXQ",
  361. })
  362. .then((res) => {
  363. jump();
  364. });
  365. } else {
  366. jump();
  367. }
  368. }
  369. if (int === 3) {
  370. // 选班
  371. this.$router.push({
  372. path: "studentMenu",
  373. query: {
  374. id: v.userId,
  375. },
  376. });
  377. }
  378. }
  379. },
  380. handleSizeChange(v) {
  381. this.formData.pageSize = v;
  382. this.formData.pageNum = 1;
  383. this.search();
  384. },
  385. handleCurrentChange(v) {
  386. this.formData.pageNum = v;
  387. this.search();
  388. },
  389. },
  390. };
  391. </script>
  392. <style lang="less" scoped>
  393. /deep/.el-button {
  394. border-radius: 8px;
  395. }
  396. /deep/.el-dialog {
  397. border-radius: 8px;
  398. .el-dialog__header {
  399. padding: 0;
  400. .hearders {
  401. height: 40px;
  402. display: flex;
  403. align-items: center;
  404. justify-content: space-between;
  405. padding: 0px 18px 0px 20px;
  406. border-bottom: 1px solid #e2e2e2;
  407. .leftTitle {
  408. font-size: 14px;
  409. font-weight: bold;
  410. color: #2f4378;
  411. }
  412. .rightBoxs {
  413. display: flex;
  414. align-items: center;
  415. img {
  416. width: 14px;
  417. height: 14px;
  418. margin-left: 13px;
  419. cursor: pointer;
  420. }
  421. }
  422. }
  423. }
  424. .el-dialog__footer {
  425. padding: 0;
  426. .dialog-footer {
  427. padding: 0px 40px;
  428. height: 70px;
  429. border-top: 1px solid #e2e2e2;
  430. display: flex;
  431. align-items: center;
  432. justify-content: flex-end;
  433. }
  434. }
  435. }
  436. .imgBox {
  437. width: 100%;
  438. // height: 210px;
  439. border: 1px solid #e2e2e2;
  440. border-radius: 8px;
  441. padding: 8px 8px 3px;
  442. display: flex;
  443. flex-direction: column;
  444. align-items: center;
  445. .imgLabel {
  446. flex: 1;
  447. width: 100%;
  448. border: 1px dotted #e2e2e2;
  449. color: #999;
  450. font-size: 14px;
  451. cursor: pointer;
  452. border-radius: 8px;
  453. .msPhoto {
  454. display: flex;
  455. justify-content: center;
  456. align-items: center;
  457. max-width: 100%;
  458. max-height: 270px;
  459. img {
  460. max-width: 100%;
  461. max-height: 270px;
  462. }
  463. }
  464. .imgbbx {
  465. display: flex;
  466. flex-direction: column;
  467. align-items: center;
  468. justify-content: center;
  469. width: 100%;
  470. height: 100%;
  471. i {
  472. font-weight: bold;
  473. margin: 14px 0;
  474. font-size: 24px;
  475. }
  476. }
  477. }
  478. p {
  479. margin: 5px 0px;
  480. }
  481. }
  482. </style>