HomeWorkRecover.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. <!-- 活动解析 -->
  2. <template>
  3. <div>
  4. <!-- table 表格 -->
  5. <el-row :gutter="20" class="main-items" >
  6. <!--数据监控-->
  7. <el-col :span="20" class="main" :offset="2">
  8. <el-table
  9. :data="list"
  10. highlight-current-row
  11. size="medium"
  12. border
  13. stripe
  14. >
  15. <el-table-column
  16. prop="school"
  17. label="上传时间"
  18. header-align="center"
  19. >
  20. </el-table-column>
  21. <el-table-column
  22. prop="subject"
  23. label="科目"
  24. header-align="center"
  25. ></el-table-column>
  26. <el-table-column
  27. prop=""
  28. label="学生"
  29. header-align="center">
  30. </el-table-column>
  31. <el-table-column
  32. prop=""
  33. label="批改状况"
  34. header-align="center"
  35. >
  36. </el-table-column>
  37. <el-table-column prop="status" label="" header-align="center" width="250">
  38. <template scope="scope">
  39. <el-button type="danger" @click="isShow(2,scope.row.teacherId,scope.row.name)">去分配</el-button>
  40. </template>
  41. </el-table-column>
  42. </el-table>
  43. <!-- 分页显示 -->
  44. <div class="page-block" v-if="parseInt(applyTeacherList.pages) > 0">
  45. <el-pagination
  46. background
  47. @size-change="handleSizeChange"
  48. @current-change="pageChange"
  49. :page-sizes="[10]"
  50. layout="total, sizes, prev, pager, next, jumper"
  51. :total= parseInt(applyTeacherList.pages)
  52. ></el-pagination>
  53. </div>
  54. </el-col>
  55. </el-row>
  56. <!--是否通过-->
  57. <div class='showModel' @click="allShowModel(1)" v-if="hiddenModel"></div>
  58. <div class='model' v-if="hiddenModel">
  59. <div class='model-text'>
  60. <div class="model-text-items">
  61. <div><img src="../../assets/img/del@2x.png" alt="" @click="allShowModel(1)" class="model-text-items-close"></div>
  62. <div>是否要通过{{userName}}老师的注册申请?</div>
  63. </div>
  64. <div class="model-btn">
  65. <div class="model-btn-items main-gay" @click="ApplyOperate()">是</div>
  66. <div class="model-btn-items model-grdeen" @click="allShowModel(1)">否</div>
  67. </div>
  68. </div>
  69. </div>
  70. <!--是否驳回-->
  71. <div class='showModel' @click="allShowModel(2)" v-if="isPigai"></div>
  72. <div class='model' v-if="isPigai">
  73. <div class='model-text'>
  74. <div class="model-text-items">
  75. <div><img src="../../assets/img/del@2x.png" alt="" @click="allShowModel(2)" class="model-text-items-close"></div>
  76. <div>是否要驳回{{userName}}老师的注册申请?</div>
  77. </div>
  78. <div class="model-btn">
  79. <div class="model-btn-items main-gay" @click="ApplyOperate()">是</div>
  80. <div class="model-btn-items model-grdeen" @click="allShowModel(2)">否</div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. import { mapGetters, mapActions } from "vuex";
  88. import { IMG_BASE_URL } from '@/ImgConfig'
  89. export default {
  90. components: { },
  91. name: "actvResolveLabel",
  92. props: {},
  93. data() {
  94. return {
  95. BASE_URL:IMG_BASE_URL,
  96. hiddenModel:false,
  97. applicantId:'',
  98. operate:'',
  99. list:[],
  100. isPigai:false,
  101. options: [
  102. {
  103. value: "0",
  104. label: "一年级"
  105. },
  106. {
  107. value: "1",
  108. label: "二年级"
  109. },
  110. {
  111. value: "2",
  112. label: "三年级"
  113. },
  114. {
  115. value: "3",
  116. label: "四年级"
  117. },
  118. {
  119. value: "4",
  120. label: "五年级"
  121. },
  122. {
  123. value: "5",
  124. label: "六年级"
  125. }
  126. ],
  127. grades: [
  128. {
  129. value: "0",
  130. label: "语文"
  131. },
  132. {
  133. value: "1",
  134. label: "数学"
  135. },
  136. {
  137. value: "2",
  138. label: "英语"
  139. }
  140. ],
  141. ItemList: [
  142. {
  143. text:'数据监控'
  144. },
  145. {
  146. text:'当天'
  147. },
  148. {
  149. text:'当月'
  150. },
  151. ],
  152. filters: {
  153. actvNm: "",
  154. actvCrtUserId: "",
  155. actvType: "",
  156. actvSmallType: "",
  157. // 排序
  158. MaxtimeValue:'',
  159. pageNo: 1,
  160. pageSize: 10,
  161. count: 0,
  162. orderField: "",
  163. orderAD: ""
  164. }
  165. };
  166. },
  167. watch: {},
  168. computed: {
  169. ...mapGetters(["getUser","applyTeacherList"])
  170. },
  171. methods: {
  172. ...mapActions(["setUser"]),
  173. isShow(str,res,ts){
  174. let _this = this;
  175. console.log(str)
  176. _this.operate = str;
  177. _this.applicantId = res;
  178. _this.userName = ts
  179. if (str == 1){
  180. _this.hiddenModel = true;
  181. _this.isPigai = false;
  182. } else if (str == 2){
  183. _this.isPigai = true;
  184. _this.hiddenModel = false;
  185. }
  186. },
  187. //关闭弹框
  188. allShowModel(str) {
  189. let _this = this;
  190. if (str == 1){
  191. _this.hiddenModel = false;
  192. } else if (str == 2){
  193. _this.isPigai = false;
  194. }
  195. },
  196. //查看申请老师列表
  197. async SuperApplyTeacherList() {
  198. this.$store.dispatch("SuperApplyTeacherList", {
  199. maxCreateTime: this.formatDate(),
  200. pageNo: this.filters.pageNo,
  201. pageSize: this.filters.pageSize
  202. });
  203. console.log(this.applyTeacherList)
  204. this.applyTeacherList.list = (res => {
  205. const d = []
  206. for (let i in res) {
  207. d.push( {
  208. gradeList: this.gradeBag(i),
  209. periodList: res[i].period.split(';'),
  210. imgUrl: res[i].imgUrl,
  211. name: res[i].name,
  212. school:res[i].school,
  213. teacherId:res[i].teacherId,
  214. subject:res[i].subject
  215. })
  216. }
  217. return d
  218. })(this.applyTeacherList.list)
  219. this.list = this.applyTeacherList.list;
  220. console.log(this.list)
  221. },
  222. //申请审批操作
  223. async ApplyOperate() {
  224. this.$store.dispatch("ApplyOperate", {
  225. applicantId: this.applicantId,
  226. operate: this.operate,
  227. });
  228. this.allShowModel(this.operate)
  229. },
  230. //时间封装
  231. formatDate: function () {
  232. let date = new Date();
  233. let y = date.getFullYear();
  234. let MM = date.getMonth() + 1;
  235. MM = MM < 10 ? ('0' + MM) : MM;
  236. let d = date.getDate();
  237. d = d < 10 ? ('0' + d) : d;
  238. let h = date.getHours();
  239. h = h < 10 ? ('0' + h) : h;
  240. let m = date.getMinutes();
  241. m = m < 10 ? ('0' + m) : m;
  242. let s = date.getSeconds();
  243. s = s < 10 ? ('0' + s) : s;
  244. return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
  245. },
  246. // 数组去重
  247. uniq(array){
  248. var temp = []; //一个新的临时数组
  249. for (var i = 0; i < array.length; i++){
  250. if (temp.indexOf(array[i]) == -1) {
  251. temp.push(array[i]);
  252. }
  253. }
  254. return temp;
  255. },
  256. //年级封装
  257. gradeBag:function (res) {
  258. var arr = [];
  259. if (this.applyTeacherList.list[res].grade) {
  260. arr = this.applyTeacherList.list[res].grade.split(',');
  261. } else {
  262. arr = []
  263. }
  264. var arrList = [];
  265. for (var i in arr) {
  266. if (arr[i] == '一年级' || arr[i] == '二年级') {
  267. arrList.push('1-2年级')
  268. } else if (arr[i] == '三年级' || arr[i] == "四年级") {
  269. arrList.push('3-4年级')
  270. } else if (arr[i] == '五年级' || arr[i] == "六年级") {
  271. arrList.push('5-6年级')
  272. }
  273. }
  274. return this.uniq(arrList);
  275. },
  276. // 分页
  277. pageChange(val) {
  278. this.filters.pageNo = val;
  279. this.SuperApplyTeacherList();
  280. },
  281. changeDateSlot(dateSlot) {
  282. if (dateSlot) {
  283. this.filters.startDate = dateSlot[0];
  284. this.filters.endDate = dateSlot[1];
  285. } else {
  286. this.filters.startDate = null;
  287. this.filters.endDate = null;
  288. }
  289. },
  290. actvTypeChange(typeList) {
  291. switch (typeList.length) {
  292. case 1:
  293. this.filters.actvType = typeList[0];
  294. this.filters.actvSmallType = null;
  295. break;
  296. case 2:
  297. this.filters.actvType = null;
  298. this.filters.actvSmallType = typeList[1];
  299. break;
  300. default:
  301. this.filters.actvType = null;
  302. this.filters.actvSmallType = null;
  303. break;
  304. }
  305. },
  306. handleSizeChange(val) {
  307. console.log(val)
  308. this.filters.pageSize = val;
  309. this.SuperApplyTeacherList();
  310. },
  311. // 排序
  312. sortChange(sort) {
  313. this.filters.orderField = sort.prop;
  314. this.filters.orderAD = sort.order != null ? sort.order : "";
  315. this.itemListReshow();
  316. },
  317. clearSearch() {
  318. this.filters.actvNm = null;
  319. this.filters.actvCrtUserId = null;
  320. this.filters.actvType = null;
  321. this.filters.actvSmallType = null;
  322. this.filtersActvType = [];
  323. this.createDateSlot = null;
  324. },
  325. },
  326. mounted() {
  327. this.SuperApplyTeacherList();
  328. console.log(this.list)
  329. }
  330. };
  331. </script>
  332. <!-- Add "scoped" attribute to limit CSS to this component only -->
  333. <style scoped>
  334. .main{
  335. background-color: #fff;
  336. margin-top: 16px;
  337. padding: 0 !important;
  338. border: 1px solid #E1E1E1;
  339. min-height: 980px;
  340. }
  341. el-table{
  342. color: #999999;
  343. font-size: 18px;
  344. }
  345. .scope-name{
  346. margin-left: 13px;
  347. }
  348. .main-items{
  349. color: #393939;
  350. text-align: center;
  351. line-height: 80px;
  352. }
  353. .input-with-select .el-input-group__prepend {
  354. background-color: #fff;
  355. }
  356. .table-img{
  357. width:36px;
  358. height:36px;
  359. border-radius:6px;
  360. }
  361. .showModel{
  362. width: 100%;
  363. height: 100%;
  364. position: fixed;
  365. top: 0;
  366. left: 0;
  367. background: #000000;
  368. opacity: 0.2;
  369. overflow: hidden;
  370. z-index: 1000;
  371. color: #fff;
  372. }
  373. .model{
  374. z-index: 1001;
  375. width:40%;
  376. height:auto;
  377. position: fixed;
  378. top: 30%;
  379. left: 30%;
  380. margin:auto;
  381. background: #fff;
  382. border-radius:10px;
  383. text-align: center;
  384. }
  385. .model-text{
  386. background:rgba(255,255,255,1);
  387. border-radius:10px;
  388. }
  389. .model-btn{
  390. display: flex;
  391. justify-content: space-around;
  392. margin-bottom: 44px;
  393. }
  394. .model-btn-items{
  395. width:154px;
  396. height:50px;
  397. line-height: 50px;
  398. text-align: center;
  399. font-size: 18px;
  400. border-radius:4px;
  401. }
  402. .main-gay{
  403. background:rgba(246,247,251,1);
  404. color: #7E7E7E;
  405. }
  406. .model-grdeen{
  407. background-color: #52CC60;
  408. color: #fff;
  409. }
  410. .model-text-items-close{
  411. position: absolute;
  412. top: 10px;
  413. right: 15px;
  414. }
  415. .el-pagination.is-background .el-pager li:not(.disabled).active {
  416. background-color:#52cc60!important;
  417. color: #fff;
  418. }
  419. .model-text-items{
  420. position: relative;
  421. color: #000000;
  422. font-size: 24px;
  423. text-align: center;
  424. padding: 40px 0 50px 0;
  425. }
  426. .page-block{
  427. text-align: center;
  428. margin-top: 15px;
  429. }
  430. .scope-list{
  431. margin-left: 18px;
  432. text-align: left;
  433. }
  434. /*.all_pagination{*/
  435. /*text-align: center !important;*/
  436. /*}*/
  437. </style>