CheckTeacherAudit.vue 13 KB

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