index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <div id="otherPlatformsChild">
  3. <div style="margin-bottom: 20px">
  4. 筛选:
  5. <el-select
  6. v-model="formData.trainOrgId"
  7. placeholder="请选择平台"
  8. style="margin: 0px 10px"
  9. size="medium"
  10. clearable
  11. >
  12. <el-option
  13. v-for="item in orgNameList"
  14. :key="item.orgId"
  15. :label="item.orgName"
  16. :value="item.orgId"
  17. >
  18. </el-option>
  19. </el-select>
  20. <el-input
  21. clearable
  22. style="width: 230px; margin: 5px 10px"
  23. v-model.trim="formData.name"
  24. placeholder="学员姓名"
  25. ></el-input>
  26. <el-input
  27. clearable
  28. style="width: 230px; margin: 5px 10px"
  29. v-model.trim="formData.idNum"
  30. placeholder="学员身份证"
  31. ></el-input>
  32. <el-input
  33. clearable
  34. style="width: 230px; margin: 5px 10px"
  35. v-model.trim="formData.mobile"
  36. placeholder="学员手机号码"
  37. ></el-input>
  38. <el-button type="primary" @click="search(3)">搜索</el-button>
  39. <el-button @click="search(2)">重置</el-button>
  40. </div>
  41. <table-list
  42. ref="tableList"
  43. :tableSets="tableSet"
  44. :tableData="tableReplace(tableData)"
  45. :navText="navText"
  46. :studentTable="true"
  47. :loading="loading"
  48. >
  49. <template slot="customize">
  50. <el-button size="medium" @click="exportDataAll"
  51. >导出学员数据</el-button
  52. >
  53. </template>
  54. <!-- <template slot="btn" slot-scope="props">
  55. <el-button type="text" @click="exportData(props.scope.row)"
  56. >导出数据</el-button
  57. >
  58. </template> -->
  59. </table-list>
  60. <pagination
  61. :total="total"
  62. :pageSize="formData.pageSize"
  63. :currentPage="formData.pageNum"
  64. @handleSizeChange="handleSizeChange"
  65. @handleCurrentChange="handleCurrentChange"
  66. />
  67. </div>
  68. </template>
  69. <script>
  70. import tableList from "@/components/tableList";
  71. import pagination from "@/components/pagination";
  72. import * as baseUrls from "@/utils/request.js";
  73. export default {
  74. name: "OtherPlatformsChild",
  75. components: { tableList, pagination },
  76. data() {
  77. return {
  78. loading: false, //当前表单加载是否加载动画
  79. navText: {
  80. title: "班级人数:",
  81. index: 0,
  82. ch: "位",
  83. num: false,
  84. choice: false,
  85. border: true,
  86. addHide: true,
  87. rowKey: "id",
  88. gftsStatus: false,
  89. gfUserStatus: false,
  90. xssbStatus: false,
  91. tableHide:true,
  92. backFatherBtn: {
  93. status: false,
  94. title: "未定义",
  95. },
  96. },
  97. // 表单
  98. tableSet: [
  99. {
  100. label: "平台",
  101. prop: "orgName",
  102. hidden: true,
  103. },
  104. {
  105. label: "项目",
  106. prop: "platformName",
  107. hidden: true,
  108. },
  109. {
  110. label: "专业",
  111. prop: "majorName",
  112. hidden: true,
  113. },
  114. {
  115. label: "班级",
  116. prop: "categoryName",
  117. hidden: true,
  118. },
  119. {
  120. label: "学员",
  121. prop: "name",
  122. hidden: true,
  123. },
  124. {
  125. label: "学员身份证",
  126. prop: "idNum",
  127. hidden: true,
  128. },
  129. {
  130. label: "学员手机",
  131. prop: "mobile",
  132. hidden: true,
  133. },
  134. {
  135. label: "学员单位",
  136. prop: "orgName",
  137. hidden: true,
  138. },
  139. {
  140. label: "下单时间",
  141. prop: "orderTime",
  142. hidden: true,
  143. },
  144. {
  145. label: "报名时间",
  146. prop: "periodStatus",
  147. hidden: true,
  148. },
  149. {
  150. label: "上传报名时间",
  151. prop: "doTime",
  152. hidden: true,
  153. },
  154. {
  155. label: "学习开始时间",
  156. prop: "beginTime",
  157. hidden: true,
  158. },
  159. {
  160. label: "学习结束时间",
  161. prop: "applyTime",
  162. hidden: true,
  163. },
  164. {
  165. label: "是否上传中心",
  166. prop: "reportStatu",
  167. hidden: true,
  168. scope: "isOptions",
  169. options: [
  170. {
  171. label: "是",
  172. value: 1,
  173. },
  174. {
  175. label: "否",
  176. value: 0,
  177. },
  178. ],
  179. },
  180. {
  181. label: "学时是否申报中心",
  182. prop: "studyQueueStatus",
  183. hidden: true,
  184. scope: "isOptions",
  185. options: [
  186. {
  187. label: "已申报",
  188. value: 1,
  189. },
  190. {
  191. label: "未申报",
  192. value: 0,
  193. },
  194. ],
  195. },
  196. ],
  197. tableData: [], //表单数据
  198. formData: {
  199. pageSize: 10,
  200. pageNum: 1,
  201. },
  202. total: 0,
  203. orgNameList: [],
  204. };
  205. },
  206. created() {
  207. this.search();
  208. //平台列表
  209. this.$api.inquiresystemoldorglist().then((res) => {
  210. this.orgNameList = res.data;
  211. });
  212. },
  213. computed:{
  214. tableReplace:function(){
  215. return function(array){
  216. return array.slice((this.formData.pageNum - 1)* this.formData.pageSize,this.formData.pageNum * this.formData.pageSize,)
  217. }
  218. }
  219. },
  220. methods: {
  221. search(int) {
  222. this.loading = true;
  223. if (int === 2) {
  224. this.formData = {
  225. pageSize: 10,
  226. pageNum: 1,
  227. };
  228. }
  229. if (int === 3) {
  230. this.$refs.tableList.clearMoreActive();
  231. this.formData.pageSize = 10;
  232. this.formData.pageNum = 1;
  233. }
  234. this.formData.gradeId = this.$route.query.id;
  235. this.$api
  236. .inquireGradegradeotherClassuser(this.formData)
  237. .then((res) => {
  238. this.tableData = res.data;
  239. this.navText.index = res.data.length;
  240. this.total = res.data.length;
  241. })
  242. .finally(() => {
  243. this.loading = false;
  244. });
  245. },
  246. //导出
  247. exportData(item) {
  248. this.$api.inquireGradegradeotherClassuserexport(item).then((res) => {
  249. if (res.msg) {
  250. let url = baseUrls.baseURL + "common/download?fileName=" + res.msg;
  251. let link = document.createElement("a");
  252. let fileName = "班级学员数据" + ".xlsx";
  253. document.body.appendChild(link);
  254. link.href = url;
  255. link.dowmload = fileName;
  256. link.click();
  257. link.remove();
  258. this.$message.success("导出成功");
  259. } else {
  260. this.$message.error("导出失败");
  261. }
  262. });
  263. },
  264. exportDataAll(){
  265. this.$api.inquireGradegradeotherClassuserexport(this.formData).then((res) => {
  266. if (res.msg) {
  267. let url = baseUrls.baseURL + "common/download?fileName=" + res.msg;
  268. let link = document.createElement("a");
  269. let fileName = "班级学员数据" + ".xlsx";
  270. document.body.appendChild(link);
  271. link.href = url;
  272. link.dowmload = fileName;
  273. link.click();
  274. link.remove();
  275. this.$message.success("导出成功");
  276. } else {
  277. this.$message.error("导出失败");
  278. }
  279. });
  280. },
  281. handleSizeChange(v) {
  282. this.formData.pageSize = v;
  283. this.formData.pageNum = 1;
  284. // this.search();
  285. },
  286. handleCurrentChange(v) {
  287. this.formData.pageNum = v;
  288. // this.search();
  289. },
  290. },
  291. };
  292. </script>
  293. <style lang="scss" scoped>
  294. </style>