SacleUserList.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  1. <!--**Lxh-查询学校下测试量表下的用户-->
  2. <template>
  3. <div>
  4. <div class="headerRow">
  5. <el-date-picker
  6. v-model="beginTime"
  7. type="date"
  8. format="yyyy-MM-dd"
  9. class="mrr"
  10. style="width: 160px"
  11. value-format="yyyy-MM-dd"
  12. placeholder="选择开始日期"
  13. >
  14. </el-date-picker>
  15. <el-date-picker
  16. v-model="endTime"
  17. style="width: 160px"
  18. class="mrr"
  19. type="date"
  20. format="yyyy-MM-dd"
  21. value-format="yyyy-MM-dd"
  22. placeholder="选择结束日期"
  23. >
  24. </el-date-picker>
  25. <el-select
  26. v-model="groupValue"
  27. @change="onSubmit"
  28. placeholder="年级选择"
  29. style="width: 120px"
  30. class=""
  31. >
  32. <el-option
  33. v-for="item in groupOptions"
  34. :key="item.id"
  35. :label="item.groupName"
  36. :value="item.id"
  37. >
  38. </el-option>
  39. </el-select>
  40. &nbsp;&nbsp;
  41. <el-input
  42. placeholder="请输入名称搜索"
  43. v-model="searchKeyLin"
  44. class="input-with-select mrr"
  45. style="width: 240px"
  46. @keyup.enter.native="onSubmit"
  47. >
  48. <el-button
  49. class="button-pub-select"
  50. slot="append"
  51. icon="el-icon-search"
  52. @click="onSubmit"
  53. ></el-button>
  54. </el-input>
  55. <el-button
  56. class="ml10 button-pub"
  57. icon="el-icon-refresh"
  58. @click="reset"
  59. ></el-button>
  60. <el-button
  61. class="mrl"
  62. type="primary"
  63. :disabled="multipleSelection.length == 0"
  64. @click="listDown()"
  65. >
  66. 批量下载
  67. </el-button>
  68. <el-button class="mrl" type="primary" @click="downloadAll">
  69. 全部下载
  70. </el-button>
  71. <el-button
  72. class="mrl"
  73. type="primary"
  74. :disabled="multipleSelection.length == 0"
  75. @click="rowDataDownload(0)"
  76. >
  77. 原始数据批量下载
  78. </el-button>
  79. <el-button class="mrl" type="primary" @click="rowDataDownload(1)">
  80. 原始数据全部下载
  81. </el-button>
  82. <el-button type="primary" @click="goReturn()">返回</el-button>
  83. </div>
  84. <div class="headerRow" style="margin-top: 10px">
  85. <el-button
  86. class="mrl"
  87. type="primary"
  88. :disabled="multipleSelection.length == 0"
  89. @click="downloadPDF(0)"
  90. >
  91. PDF报告批量下载
  92. </el-button>
  93. <el-button class="mrl" type="primary" @click="downloadPDF(1)">
  94. PDF报告全部下载
  95. </el-button>
  96. </div>
  97. <!--记录展示start-->
  98. <el-table
  99. :header-cell-style="{ background: '#F6F7FB', color: '#606266' }"
  100. :data="tableData"
  101. border
  102. style="margin-top: 20px"
  103. class="table-padding"
  104. :row-key="getRowKeys"
  105. @selection-change="handleSelectionChange"
  106. >
  107. <el-table-column type="selection" :reserve-selection="true" width="55">
  108. </el-table-column>
  109. <el-table-column
  110. prop="petName"
  111. label="用户名称"
  112. width="auto"
  113. align="center"
  114. >
  115. </el-table-column>
  116. <el-table-column prop="phone" label="账号" width="auto" align="center">
  117. </el-table-column>
  118. <el-table-column
  119. prop="gender"
  120. label="性别"
  121. width="auto"
  122. align="center"
  123. :formatter="sexFormat"
  124. >
  125. </el-table-column>
  126. <el-table-column prop="gid" label="年级名称" width="auto" align="center">
  127. </el-table-column>
  128. <el-table-column
  129. prop="profession"
  130. label="职业"
  131. width="auto"
  132. align="center"
  133. >
  134. </el-table-column>
  135. <el-table-column
  136. prop="testDate"
  137. label="测试时间"
  138. width="auto"
  139. align="center"
  140. >
  141. </el-table-column>
  142. <el-table-column label="操作" width="auto" align="center">
  143. <template slot-scope="scope">
  144. <el-button type="primary" size="small" @click="detailP(scope.row.id)"
  145. >查看测试详情</el-button
  146. >
  147. </template>
  148. </el-table-column>
  149. </el-table>
  150. <!--记录展示end-->
  151. <!--分页插件start-->
  152. <el-row>
  153. <el-col :span="24" style="text-align: right">
  154. <el-pagination
  155. background
  156. @size-change="handleSizeChange"
  157. @current-change="handleCurrentChange"
  158. :current-page="currentPage"
  159. :page-sizes="[10, 20, 50, 100]"
  160. :page-size="pageSize"
  161. layout="total, sizes, prev, pager, next, jumper"
  162. :total="total"
  163. >
  164. </el-pagination>
  165. </el-col>
  166. </el-row>
  167. <div class="txt-center" style="margin-top: 20px"></div>
  168. <!--分页插件end-->
  169. </div>
  170. </template>
  171. <script>
  172. export default {
  173. name: "SacleUserList",
  174. data() {
  175. return {
  176. //年级过滤条件
  177. groupValue: "",
  178. //年级信息
  179. groupOptions: [],
  180. userBid: "", //用户唯一标识
  181. searchKeyLin: "", //查询条件
  182. searchKey: "", //查询条件
  183. currentPage: 1,
  184. total: 200, //记录总数
  185. pageSize: 10,
  186. baseUrl: baseUrl,
  187. tableData: [],
  188. userId:'',
  189. institutionNo: "",
  190. name: "", //学校名称
  191. multipleSelection: [], //批量导出选中的对象
  192. time: ["", ""],
  193. beginTime: "",
  194. endTime: "",
  195. getRowKeys(row) {
  196. return row.id;
  197. }, //获取row的key值
  198. };
  199. },
  200. /*页面初始化*/
  201. created() {
  202. this.institutionNo = sessionStorage.getItem(
  203. "f7a42fe7211f98ac7a60a285ac3a9527"
  204. );
  205. this.userId = sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f");
  206. this.name = this.$route.query.name;
  207. //this.getUserBid()
  208. this.getData();
  209. this.groupFun();
  210. },
  211. methods: {
  212. //查询年级信息
  213. groupFun() {
  214. this.$http.get(
  215. // "/group/find?institutionNo=" + this.institutionNo,
  216. `/group/find?institutionNo=${this.institutionNo}&userId=${this.userId}`,
  217. {},
  218. (response) => {
  219. this.groupOptions = response.data;
  220. // this.tableData = response.data;
  221. // console.log(response.data)
  222. }
  223. );
  224. },
  225. /*后台get请求获得数据*/
  226. goReturn() {
  227. this.$router.push({
  228. path: "/ContainerSys/SacleList",
  229. });
  230. },
  231. getData() {
  232. if (this.endTime == null) {
  233. this.endTime = "";
  234. }
  235. if (this.beginTime == null) {
  236. this.beginTime = "";
  237. }
  238. this.searchKeyLin = this.searchKey;
  239. this.$http.get(
  240. "/institution/getTestUser?institutionNo=" +
  241. this.institutionNo +
  242. "&name=" +
  243. this.name +
  244. "&pageNum=" +
  245. this.currentPage +
  246. "&pageSize=" +
  247. this.pageSize +
  248. "&searchKey=" +
  249. this.searchKey +
  250. "&beginTime=" +
  251. this.beginTime +
  252. "&endTime=" +
  253. this.endTime +
  254. "&groupId=" +
  255. this.groupValue +
  256. "&userId=" +
  257. this.userId,
  258. {},
  259. (response) => {
  260. this.total = response.data.allNum;
  261. this.tableData = response.data.institutionUserRecordingList;
  262. }
  263. );
  264. },
  265. /*getUserBid(){
  266. this.userBid = sessionStorage.getItem("f7a42fe7211f98ac7a60a285ac3a9e87");
  267. },*/
  268. /*分页start*/
  269. handleCurrentChange(val) {
  270. this.currentPage = val;
  271. this.getData();
  272. },
  273. handleSizeChange(val) {
  274. this.pageSize = val;
  275. this.getData();
  276. },
  277. reset() {
  278. console.log(this.tableData);
  279. this.searchKey = "";
  280. this.currentPage = 1;
  281. this.beginTime = "";
  282. this.endTime = "";
  283. this.groupValue = "";
  284. this.getData();
  285. },
  286. // 性别,状态设置
  287. sexFormat(row) {
  288. if (row.gender == 0) {
  289. return "男";
  290. } else {
  291. return "女";
  292. }
  293. },
  294. //查看详情
  295. detailP(id) {
  296. this.JumpJudgment(id);
  297. },
  298. // 跳转到SCl-90
  299. JumpJudgment(id) {
  300. this.$router.push({
  301. path: "/ContainerSys/SearchScaleRecordSCl",
  302. query: {
  303. id: id,
  304. come: 3,
  305. }
  306. });
  307. },
  308. onSubmit() {
  309. this.currentPage = 1;
  310. this.searchKey = this.searchKeyLin;
  311. this.getData();
  312. },
  313. //批量导出
  314. handleSelectionChange(val) {
  315. this.multipleSelection = val;
  316. },
  317. listDown() {
  318. let str = "";
  319. this.multipleSelection.forEach((item) => {
  320. str += item.id + ",";
  321. });
  322. window.location.href =
  323. this.baseUrl +
  324. `/result/download/userReds?institutionNo=${
  325. this.institutionNo
  326. }&ids=${str.substring(0, str.length - 1)}&name=${this.name}`;
  327. },
  328. // 全部下载
  329. downloadAll() {
  330. window.location.href = `${this.baseUrl}result/download/allUserReds?institutionNo=${this.institutionNo}&userId=${this.userId}&name=${this.name}&searchKey=${this.searchKey}&beginTime=${this.beginTime}&endTime=${this.endTime}&groupId=${this.groupValue}`;
  331. // this.multipleSelection = val;
  332. },
  333. rowDataDownload(i) {
  334. if (i == 0) {
  335. let str = "";
  336. this.multipleSelection.forEach((item) => {
  337. str += item.id + ",";
  338. });
  339. window.location.href =
  340. this.baseUrl +
  341. `result/download/planResultBatch?institutionNo=${
  342. this.institutionNo
  343. }&ids=${str.substring(0, str.length - 1)}&name=${this.name}`;
  344. } else {
  345. window.location.href = `${this.baseUrl}result/download/planResultAll?institutionNo=${this.institutionNo}&userId=${this.userId}&name=${this.name}&searchKey=${this.searchKey}&beginTime=${this.beginTime}&endTime=${this.endTime}&groupId=${this.groupValue}`;
  346. }
  347. },
  348. downloadPDF(i) {
  349. if (i == 0) {
  350. let str = "";
  351. this.multipleSelection.forEach((item) => {
  352. str += item.id + ",";
  353. });
  354. window.location.href =
  355. this.baseUrl +
  356. `/result/download/userPDFReds?institutionNo=${
  357. this.institutionNo
  358. }&ids=${str.substring(0, str.length - 1)}`;
  359. } else {
  360. window.location.href = `${this.baseUrl}result/download/allUserPDFReds?institutionNo=${this.institutionNo}&userId=${this.userId}&name=${this.name}&searchKey=${this.searchKey}&beginTime=${this.beginTime}&endTime=${this.endTime}`;
  361. }
  362. }
  363. },
  364. };
  365. </script>
  366. <style scoped>
  367. .button-pub-select {
  368. background: #00CDDD !important;
  369. color: #ffffff !important;
  370. border-bottom-right-radius: 4px !important;
  371. border-top-right-radius: 4px !important;
  372. border-bottom-left-radius: 0px !important;
  373. border-top-left-radius: 0px !important;
  374. }
  375. .button-pub {
  376. background: #00CDDD !important;
  377. color: #ffffff !important;
  378. border-radius: 4px !important;
  379. }
  380. ::v-deep .el-button--primary {
  381. color: #fff;
  382. background-color: #00CDDD;
  383. border-color: #00CDDD;
  384. border-radius: 4px !important;
  385. }
  386. ::v-deep .el-pager li.active {
  387. color: #ffffff;
  388. cursor: default;
  389. background-color: #00CDDD;
  390. }
  391. ::v-deep .el-pagination.is-background .el-pager li {
  392. margin: 0 5px;
  393. background-color: #ffffff;
  394. color: #606266;
  395. min-width: 30px;
  396. border-radius: 2px;
  397. border: 1px solid #dfe0e4;
  398. }
  399. </style>