BusinessDataExport.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <template>
  2. <div class="business-data-export">
  3. <div class="part-box part-box-filter part-box-flex">
  4. <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
  5. <el-form-item label="印刷计划:">
  6. <print-plan-select
  7. v-model.trim="filter.printPlanId"
  8. placeholder="请选择"
  9. clearable
  10. @change="planChange"
  11. ></print-plan-select>
  12. </el-form-item>
  13. <el-form-item label="课程(代码):" label-width="110px">
  14. <course-select
  15. v-model.trim="filter.courseCode"
  16. placeholder="请选择"
  17. clearable
  18. ></course-select>
  19. </el-form-item>
  20. <el-form-item label="试卷编号:">
  21. <paper-number-select
  22. ref="PaperNumberSelect"
  23. v-model="filter.paperNumber"
  24. placeholder="请选择"
  25. clearable
  26. ></paper-number-select>
  27. </el-form-item>
  28. <el-form-item label="考点:" label-width="55px">
  29. <place-select
  30. v-model.trim="filter.examPlace"
  31. placeholder="请选择"
  32. clearable
  33. ></place-select>
  34. </el-form-item>
  35. <el-form-item label="考场:" label-width="55px">
  36. <room-select
  37. v-model.trim="filter.examRoom"
  38. placeholder="请选择"
  39. clearable
  40. ></room-select>
  41. </el-form-item>
  42. <el-form-item label="考生:" label-width="55px">
  43. <el-input
  44. v-model="filter.studentParams"
  45. placeholder="考生/学号/姓名"
  46. clearable
  47. ></el-input>
  48. </el-form-item>
  49. <el-form-item label-width="0px">
  50. <el-button type="primary" icon="icon icon-search" @click="search"
  51. >查询</el-button
  52. >
  53. </el-form-item>
  54. </el-form>
  55. <div class="part-box-action">
  56. <el-button icon="icon icon-download-act">
  57. <a :href="downloadUrl" download="考务数据模板.xlsx"
  58. >考务数据模板下载</a
  59. >
  60. </el-button>
  61. <el-button icon="icon icon-download" type="primary" @click="toExport">
  62. 导出查询结果
  63. </el-button>
  64. <upload-button
  65. btn-icon="icon icon-share"
  66. btn-type="warning"
  67. btn-content="导入"
  68. :upload-url="uploadUrl"
  69. :upload-data="uploadData"
  70. :format="['xls', 'xlsx']"
  71. @upload-error="uplaodError"
  72. @upload-success="uploadSuccess"
  73. :disabled="!canImport"
  74. >
  75. </upload-button>
  76. </div>
  77. </div>
  78. <div class="part-box">
  79. <el-table ref="TableList" :data="dataList" border stripe>
  80. <el-table-column
  81. type="index"
  82. label="序号"
  83. width="70"
  84. align="center"
  85. :index="indexMethod"
  86. ></el-table-column>
  87. <el-table-column
  88. prop="printPlanName"
  89. label="印刷计划"
  90. ></el-table-column>
  91. <el-table-column prop="examStartDate" label="考试日期">
  92. <span slot-scope="scope">{{
  93. scope.row.examStartDate | timestampFilter
  94. }}</span>
  95. </el-table-column>
  96. <el-table-column prop="examEndTime" label="考试时间">
  97. <span slot-scope="scope">{{
  98. scope.row.examEndTime | timestampFilter
  99. }}</span>
  100. </el-table-column>
  101. <el-table-column prop="courseNameCode" label="课程(代码)">
  102. </el-table-column>
  103. <el-table-column prop="paperNumber" label="试卷编码"></el-table-column>
  104. <el-table-column prop="examPlace" label="考点"> </el-table-column>
  105. <el-table-column prop="packageCount" label="卷袋数" width="80">
  106. </el-table-column>
  107. <el-table-column prop="totalSubjects" label="科次" width="80">
  108. </el-table-column>
  109. <el-table-column
  110. class-name="action-column"
  111. label="操作"
  112. align="center"
  113. width="70"
  114. >
  115. <template slot-scope="scope">
  116. <el-button
  117. class="btn-table-icon"
  118. type="text"
  119. icon="icon icon-circle-right"
  120. @click="toPreview(scope.row)"
  121. title="查看详情"
  122. ></el-button>
  123. </template>
  124. </el-table-column>
  125. </el-table>
  126. </div>
  127. <div class="part-box-flex">
  128. <div>
  129. <span class="mr-2"
  130. >科次总计:<i class="color-primary">{{ totalData.totalSubjects }}</i>
  131. 科次</span
  132. >
  133. <span
  134. >卷袋数量总计:<i class="color-primary">{{
  135. totalData.packageCount
  136. }}</i>
  137. 个</span
  138. >
  139. </div>
  140. <el-pagination
  141. background
  142. layout="total,prev, pager, next"
  143. :current-page="current"
  144. :total="total"
  145. :page-size="size"
  146. @current-change="toPage"
  147. >
  148. </el-pagination>
  149. </div>
  150. </div>
  151. </template>
  152. <script>
  153. import { businessDataListPage, businessTotalData } from "../api";
  154. import UploadButton from "@/components/UploadButton";
  155. export default {
  156. name: "business-data-export",
  157. components: { UploadButton },
  158. data() {
  159. return {
  160. filter: {
  161. printPlanId: "",
  162. courseCode: "",
  163. paperNumber: "",
  164. examPlace: "",
  165. examRoom: "",
  166. studentParams: ""
  167. },
  168. current: 1,
  169. size: this.GLOBAL.pageSize,
  170. total: 0,
  171. dataList: [],
  172. curRow: {},
  173. totalData: {},
  174. curPrintPlan: {},
  175. // import
  176. downloadUrl: "/temps/考务数据模板.xlsx",
  177. uploadUrl: "/api/admin/sys/user/import",
  178. uploadData: {
  179. type: "FILE"
  180. }
  181. };
  182. },
  183. computed: {
  184. canImport() {
  185. return (
  186. this.curPrintPlan && ["NEW", "READY"].includes(this.curPrintPlan.status)
  187. );
  188. }
  189. },
  190. created() {
  191. this.search();
  192. },
  193. methods: {
  194. async getList() {
  195. const datas = {
  196. ...this.filter,
  197. pageNumber: this.current,
  198. pageSize: this.size
  199. };
  200. const data = await businessDataListPage(datas);
  201. this.dataList = data.records;
  202. this.total = data.total;
  203. },
  204. async getTotalData() {
  205. this.totalData = await businessTotalData(this.filter);
  206. },
  207. toPage(page) {
  208. this.current = page;
  209. this.getList();
  210. },
  211. search() {
  212. this.toPage(1);
  213. this.getTotalData();
  214. },
  215. planChange(plan) {
  216. this.curPrintPlan = plan;
  217. },
  218. uplaodError(errorData) {
  219. this.$notify.error({ title: "错误提示", message: errorData.message });
  220. },
  221. uploadSuccess(res) {
  222. this.$message.success("上传成功!");
  223. this.getList();
  224. },
  225. toExport() {},
  226. toPreview(row) {
  227. this.$ls.set("curBusiness", this.$objAssign(this.filter, row));
  228. this.$router.push({ name: "BusinessDataDetail" });
  229. }
  230. }
  231. };
  232. </script>