examine.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <template>
  2. <div class="pb_content" style="
  3. overflow: auto;
  4. margin: 0px;
  5. box-sizing: border-box;
  6. width: 100%;
  7. height: 100%;
  8. ">
  9. <div>
  10. <div class="pb_content_body" style="
  11. background: #fff;
  12. padding: 0px 25px;
  13. box-sizing: border-box;
  14. margin: 10px auto 0;
  15. ">
  16. <div class="pb_head">
  17. <span>项目审核</span>
  18. <!-- <span>备注:教师可以根据课程、班级条件筛选学生并查看该学生信息</span> -->
  19. </div>
  20. <div class="student_head">
  21. <div class="student_search">
  22. <div class="searchBox">
  23. <div>项目筛选</div>
  24. <el-input v-model="cn" placeholder="筛选项目名称" @input="search"></el-input>
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="pb_content_body" style="margin: 0 auto 10px;">
  30. <div class="student_table">
  31. <el-table ref="table" :data="tableData" stripe border :header-cell-style="{
  32. background: '#f1f1f1',
  33. }" style="width: 100%" :height="tableHeight" v-loading="isLoading">
  34. <el-table-column prop="title" label="项目名称" min-width="300px" align="center">
  35. </el-table-column>
  36. <el-table-column prop="uname" label="创建人" min-width="300px" align="center">
  37. </el-table-column>
  38. <el-table-column prop="school" label="学校名称" min-width="300px" align="center">
  39. </el-table-column>
  40. <el-table-column prop="date" label="操作" width="300px" align="left">
  41. <template slot-scope="scope">
  42. <div class="pb_buttonBox">
  43. <el-button class="btnClassGM" size="mini" type="primary"
  44. @click="get(scope.row.courseId)">查看课程</el-button>
  45. <el-button class="btnClassGM" size="mini" type="primary" @click="examine(scope.row.courseId,scope.row.examine,scope.row.title)">
  46. {{scope.row.examine == '1' ? "审核" : "撤销审核"}}
  47. </el-button>
  48. </div>
  49. </template>
  50. </el-table-column>
  51. </el-table>
  52. </div>
  53. </div>
  54. <div class="student_page">
  55. <el-pagination background layout="prev, pager, next" :page-size="10" :total="total" v-if="page"
  56. @current-change="handleCurrentChange"></el-pagination>
  57. </div>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. tableHeight: "500px",
  66. isLoading: false,
  67. formLabelWidth: "100px",
  68. tableData: [],
  69. fileList: [],
  70. page: 1,
  71. total: 0,
  72. userid: this.$route.query.userid,
  73. oid: this.$route.query.oid,
  74. org: this.$route.query.org,
  75. cn: ""
  76. };
  77. },
  78. mounted() {
  79. this.$nextTick(function () {
  80. });
  81. },
  82. methods: {
  83. goTo(path) {
  84. this.$router.push(path);
  85. },
  86. get(cid) {
  87. window.parent.postMessage({ cid: cid, screenType: "3gm" }, "*");
  88. },
  89. time() {
  90. if (!this.now) {
  91. this.now = new Date().getTime();
  92. return true;
  93. } else {
  94. let time = new Date().getTime();
  95. if (time - this.now > 3000) {
  96. this.now = time;
  97. return true;
  98. } else {
  99. return false;
  100. }
  101. }
  102. },
  103. tableRowClassName({ row, rowIndex }) {
  104. if ((rowIndex + 1) % 2 === 0) {
  105. return "even_row";
  106. } else {
  107. return "";
  108. }
  109. },
  110. handleCurrentChange(val) {
  111. this.page = val;
  112. this.selectCourse();
  113. },
  114. selectCourse() {
  115. this.isLoading = true;
  116. let params = {
  117. oid: this.oid,
  118. org: this.org,
  119. cn: this.cn,
  120. page: this.page,
  121. };
  122. this.ajax
  123. .get(this.$store.state.api + "selectCourseExamine", params)
  124. .then((res) => {
  125. this.isLoading = false;
  126. this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  127. this.tableData = res.data[0];
  128. })
  129. .catch((err) => {
  130. this.isLoading = false;
  131. console.error(err);
  132. });
  133. },
  134. search() {
  135. this.page = 1;
  136. this.selectCourse();
  137. },
  138. examine(cid,examine,title){
  139. // examineCourse
  140. this.$confirm(
  141. examine=='1' ? "确认此课程通过审核吗?" : "确认撤销此课程的审核吗?",
  142. "提示",
  143. {
  144. confirmButtonText: "确定",
  145. cancelButtonText: "取消",
  146. type: "warning",
  147. }
  148. )
  149. .then(() => {
  150. // if (this.time()) {
  151. let params = [
  152. {
  153. cid:cid,
  154. exa:examine == '1' ? '2' : '1',
  155. title:'新项目:'+title,
  156. oid:this.oid,
  157. org:this.org,
  158. },
  159. ];
  160. this.ajax
  161. .post(this.$store.state.api + "examineCourse", params)
  162. .then((res) => {
  163. this.$message({
  164. message: "审核成功",
  165. type: "success",
  166. });
  167. this.selectCourse();
  168. })
  169. .catch((err) => {
  170. this.$message.error("审核失败");
  171. console.error(err);
  172. });
  173. // }
  174. })
  175. .catch(() => { });
  176. }
  177. },
  178. created() {
  179. this.page = 1;
  180. this.selectCourse();
  181. },
  182. };
  183. </script>
  184. <style scoped>
  185. .pb_head>span:nth-child(2) {
  186. font-size: 16px;
  187. margin-left: 80px;
  188. color: #ab582f;
  189. }
  190. .addBox {
  191. display: flex;
  192. align-items: center;
  193. justify-content: center;
  194. }
  195. .tian1 {
  196. /* font-size: 16px; */
  197. margin-right: 10px;
  198. }
  199. .pb_head {
  200. margin: 0 !important;
  201. width: 100% !important;
  202. }
  203. .student_page {
  204. margin: 10px 0 0 45px;
  205. }
  206. .disUoloadSty>>>.el-upload--picture-card {
  207. display: none;
  208. /* 上传按钮隐藏 */
  209. }
  210. .dialogBox {
  211. display: flex;
  212. align-items: center;
  213. justify-content: center;
  214. }
  215. .dialogBox span {
  216. margin: 0 20px;
  217. }
  218. .student_head {
  219. margin-top: 10px;
  220. padding-bottom: 15px;
  221. display: flex;
  222. justify-content: space-between;
  223. }
  224. .student_search,
  225. .student_search1 {
  226. display: flex;
  227. width: 100%;
  228. position: relative;
  229. flex-direction: row;
  230. flex-wrap: nowrap;
  231. align-items: center;
  232. justify-content: flex-start;
  233. }
  234. .student_search1 {
  235. justify-content: space-between;
  236. }
  237. .searchBox {
  238. display: flex;
  239. align-items: center;
  240. }
  241. .searchBox>div {
  242. width: auto;
  243. margin-right: 10px;
  244. }
  245. .student_table>>>.el-table--border td {
  246. border-right: 0px !important;
  247. }
  248. .student_table>>>.el-table,
  249. .student_table>>>.el-table__body-wrapper {
  250. height: auto !important;
  251. }
  252. .el-table>>>.even_row {
  253. background-color: #f1f1f1 !important;
  254. }
  255. .dialog_diy>>>.el-dialog__header {
  256. padding: 9px 20px 10px;
  257. background: #32455b !important;
  258. }
  259. .dialog_diy>>>.el-dialog__title {
  260. color: #fff;
  261. font-size: 15px;
  262. }
  263. .dialog_diy>>>.el-dialog__headerbtn {
  264. top: 14px;
  265. }
  266. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
  267. color: #fff;
  268. }
  269. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
  270. color: #fff;
  271. }
  272. .dialog_diy>>>.el-dialog__body,
  273. .dialog_diy>>>.el-dialog__footer {
  274. background: #fafafa;
  275. }
  276. .r_diy>>>.el-dialog__footer {
  277. padding: 0;
  278. }
  279. .a_addBox {
  280. height: 570px;
  281. overflow: auto;
  282. }
  283. .workdates {
  284. height: 100%;
  285. position: absolute;
  286. top: 0;
  287. background: #fff;
  288. overflow: auto;
  289. z-index: 1;
  290. width: 95%;
  291. left: 50%;
  292. transform: translateX(-50%);
  293. padding: 20px;
  294. box-sizing: border-box;
  295. }
  296. .cancelbox {
  297. position: absolute;
  298. z-index: 2;
  299. left: 50%;
  300. width: 95%;
  301. transform: translateX(-50%);
  302. display: flex;
  303. justify-content: flex-end;
  304. padding: 0 90px 0px 0px;
  305. box-sizing: border-box;
  306. }
  307. .cardList {
  308. font-size: 14px;
  309. height: 360px;
  310. overflow: auto;
  311. }
  312. .cardList div {
  313. margin-bottom: 18px;
  314. }
  315. .cardList div:last-child {
  316. margin-bottom: 0;
  317. }
  318. .cardHead {
  319. display: flex;
  320. }
  321. .student_page>>>.el-pagination.is-background .el-pager li:not(.disabled).active {
  322. background-color: #5c549f;
  323. color: #fff !important;
  324. }
  325. .student_page>>>.el-pagination.is-background .el-pager li:not(.disabled):hover {
  326. color: #5c549f;
  327. }
  328. </style>