index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <!--个人黑名单-->
  2. <template>
  3. <div class="app-container myBlackListInfo">
  4. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  5. <el-form-item label="状态" prop="overStatus" label-width="50px">
  6. <el-select v-model="queryParams.overStatus" placeholder="请选择状态">
  7. <el-option
  8. v-for="dict in overStatusOptions"
  9. :key="dict.id"
  10. :label="dict.name"
  11. :value="dict.id"
  12. ></el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="学期" prop="semesterId" label-width="50px">
  16. <el-select v-model="queryParams.semesterId" placeholder="请选择学期">
  17. <el-option
  18. v-for="dict in semesterOptions"
  19. :key="dict.id"
  20. :label="dict.semesterName"
  21. :value="dict.id"
  22. ></el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item label="创建时间" prop="dateRange" style="margin-left:10px;">
  26. <el-date-picker
  27. :clearable="false"
  28. v-model="dateRange"
  29. size="small"
  30. style="width: 240px"
  31. value-format="yyyy-MM-dd"
  32. type="daterange"
  33. range-separator="-"
  34. start-placeholder="开始日期"
  35. end-placeholder="结束日期"
  36. ></el-date-picker>
  37. </el-form-item>
  38. <el-form-item>
  39. <p class="inquire-button-one" @click="handleQuery">查询</p>
  40. <p class="reset-button-one" @click="resetQuery">重置</p>
  41. </el-form-item>
  42. </el-form>
  43. <el-table v-loading="loading" border :data="recordList">
  44. <el-table-column label="原因" align="left" prop="reason" />
  45. <el-table-column label="时间" align="left" prop="createTime" />
  46. <el-table-column label="处理方式" align="left" prop="treatmentMethod" />
  47. <el-table-column label="处理状态" align="left" prop="surplusPoints">
  48. <template slot-scope="scope">
  49. <div class="scope-big-box" v-if="scope.row.learnStatus == 0 || scope.row.learnStatus == 1">
  50. <p>学习</p>
  51. <p :class="scope.row.learnStatus == 0 ?'scopeColorA':(scope.row.learnStatus == 1 ?'scopeColorB':'')">{{scope.row.learnStatus == 0 ?'未完成':(scope.row.learnStatus == 1 ?'已完成':'')}}</p>
  52. </div>
  53. <div class="scope-big-box" v-if="scope.row.testStatus == 0 || scope.row.testStatus == 1">
  54. <p>考试</p>
  55. <p :class="scope.row.testStatus == 0 ?'scopeColorA':(scope.row.testStatus == 1 ?'scopeColorB':'')">{{scope.row.testStatus == 0 ?'未完成':(scope.row.testStatus == 1 ?'已完成':'')}}</p>
  56. </div>
  57. <div class="scope-big-box" v-if="scope.row.practiceStatus == 0 || scope.row.practiceStatus == 1">
  58. <p>做题</p>
  59. <p :class="scope.row.practiceStatus == 0 ?'scopeColorA':(scope.row.practiceStatus == 1 ?'scopeColorB':'')">{{scope.row.practiceStatus == 0 ?'未完成':(scope.row.practiceStatus == 1 ?'已完成':'')}}</p>
  60. </div>
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="信用分" align="left" prop="creditScore" />
  64. </el-table>
  65. <pagination :page-sizes="[20, 30, 40, 50]"
  66. v-show="total>0"
  67. :total="total"
  68. layout="total, prev, pager, next, sizes, jumper"
  69. :page.sync="queryParams.pageNum"
  70. :limit.sync="queryParams.pageSize"
  71. @pagination="getList"
  72. />
  73. </div>
  74. </template>
  75. <script>
  76. import { myBlackDetail } from "@/api/laboratory/blacklist";
  77. import { getSemesterList } from "@/api/laboratory/semester";
  78. export default {
  79. props: {
  80. propsData:{},
  81. },
  82. name: "myBlackListInfo",
  83. data() {
  84. return {
  85. //加载状态
  86. loading:false,
  87. // 显示搜索条件
  88. showSearch: true,
  89. // 查询参数
  90. queryParams: {
  91. pageNum: 1,
  92. pageSize:20,
  93. points: null,
  94. joinUserId: null,
  95. mode: null,
  96. deptName: null,
  97. deptId: null,
  98. userId: null,
  99. semesterId: null,
  100. overStatus: null
  101. },
  102. //状态条件
  103. overStatusOptions:[
  104. {id:'',name:"全部"},
  105. {id:1,name:"已完成"},
  106. {id:0,name:"未完成"},
  107. {id:-1,name:"无"},
  108. ],
  109. //列表数据
  110. recordList:[],
  111. total:0,
  112. // 日期范围
  113. dateRange: [],
  114. //学期列表
  115. semesterOptions:[],
  116. }
  117. },
  118. created(){
  119. this.getList()
  120. },
  121. mounted(){
  122. this.getSemesterList()
  123. },
  124. methods:{
  125. //返回上级页面
  126. backPage(){
  127. this.$parent.goPage(1);
  128. },
  129. /** 查询数据 */
  130. getList() {
  131. this.loading = true;
  132. if(this.dateRange&&this.dateRange.length>0)
  133. {
  134. this.queryParams.beginTime=this.dateRange[0]
  135. this.queryParams.endTime=this.dateRange[1]
  136. }
  137. else
  138. {
  139. this.queryParams.beginTime=null;
  140. this.queryParams.endTime=null
  141. }
  142. myBlackDetail(this.queryParams).then( response => {
  143. this.recordList = response.rows;
  144. this.total = response.total;
  145. this.loading = false;
  146. });
  147. },
  148. /** 查询学期列表 */
  149. getSemesterList() {
  150. getSemesterList().then(response => {
  151. this.$set(this, 'semesterOptions', response.data)
  152. });
  153. },
  154. /** 搜索按钮操作 */
  155. handleQuery() {
  156. this.queryParams.pageNum = 1;
  157. this.getList();
  158. },
  159. /** 重置按钮操作 */
  160. resetQuery() {
  161. // this.resetForm("queryParams");
  162. this.$set(this,'queryParams',{
  163. pageNum: 1,
  164. pageSize:20,
  165. overStatus:"",
  166. semesterId: '',
  167. });
  168. this.recordList = [];
  169. this.handleQuery();
  170. },
  171. },
  172. }
  173. </script>
  174. <style scoped lang="scss">
  175. .myBlackListInfo{
  176. display: flex!important;
  177. flex-direction: column;
  178. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  179. padding:11px 20px 20px!important;
  180. overflow: hidden;
  181. .scope-big-box{
  182. display: flex;
  183. p{
  184. font-size:14px;
  185. height:20px;
  186. line-height:20px;
  187. margin:4px 0;
  188. }
  189. p:nth-child(1){
  190. margin-right:10px;
  191. }
  192. p:nth-child(2){
  193. }
  194. .scopeColorA{
  195. padding:0 4px;
  196. border-radius:4px;
  197. color:#999;
  198. background: #dedede;
  199. }
  200. .scopeColorB{
  201. padding:0 4px;
  202. border-radius:4px;
  203. color:#fff;
  204. background: #39A922;
  205. }
  206. }
  207. }
  208. </style>