afterSchoolList.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. <!-- -->
  2. <template>
  3. <div class="">
  4. <!-- <h2>
  5. <div class="squrt"></div>课外练习
  6. </h2> -->
  7. <div>
  8. <save-form
  9. :inline="true"
  10. @submit="search"
  11. @reset="onReSet"
  12. :saveKey="'afterSchoolList'"
  13. :model="searchForm"
  14. ref="saveForm"
  15. >
  16. <el-form-item>
  17. <el-input
  18. class="searchInput"
  19. v-model.trim="searchForm.search"
  20. clearable
  21. @keyup.enter.native="
  22. e => {
  23. e.target.blur();
  24. $refs.saveForm.save();
  25. search();
  26. }
  27. "
  28. placeholder="乐团名称/老师"
  29. ></el-input>
  30. </el-form-item>
  31. <!-- <el-form-item>
  32.  <remote-search
  33. :commit="'setTeachers'"
  34. v-model="searchForm.teacherId"
  35. :isForzenWithQueryCondition="true"
  36. />
  37. </el-form-item> -->
  38. <el-form-item prop="organIdList">
  39. <el-select
  40. class="multiple"
  41. v-model.trim="searchForm.organIdList"
  42. filterable
  43. clearable
  44. placeholder="请选择分部"
  45. >
  46. <el-option
  47. v-for="(item, index) in selects.branchs"
  48. :key="index"
  49. :label="item.name"
  50. :value="item.id"
  51. ></el-option>
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item>
  55. <el-select
  56. v-model.trim="searchForm.type"
  57. class="organSelect"
  58. filterable
  59. clearable
  60. placeholder="请选择类型"
  61. >
  62. <el-option label="课外练习" value="EXTRACURRICULAR"></el-option>
  63. <el-option label="额外练习" value="EXTRA"></el-option>
  64. </el-select>
  65. </el-form-item>
  66. <!-- <el-form-item>
  67. <el-select
  68. v-model.trim="searchForm.cloudHomeworkFlag"
  69. class="organSelect"
  70. filterable
  71. clearable
  72. placeholder="是否学练宝布置"
  73. >
  74. <el-option label="是" :value="true"></el-option>
  75. <el-option label="否" :value="false"></el-option>
  76. </el-select>
  77. </el-form-item> -->
  78. <!-- <el-form-item>
  79. <el-date-picker
  80. v-model.trim="searchForm.listTimer"
  81. style="width: 410px"
  82. type="daterange"
  83. value-format="yyyy-MM-dd"
  84. range-separator="至"
  85. start-placeholder="布置开始日期"
  86. end-placeholder="布置结束日期"
  87. :picker-options="{
  88. firstDayOfWeek: 1,
  89. }"
  90. ></el-date-picker>
  91. </el-form-item> -->
  92. <el-form-item>
  93. <el-button type="danger" native-type="submit">搜索</el-button>
  94. <el-button native-type="reset" type="primary">重置</el-button>
  95. </el-form-item>
  96. </save-form>
  97. <div class="tableWrap">
  98. <el-table
  99. style="width: 100%"
  100. :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
  101. :data="tableList"
  102. >
  103. <el-table-column align="center" prop="organName" label="分部">
  104. <template slot-scope="scope">
  105. <copy-text>
  106. {{ scope.row.organName }}
  107. </copy-text>
  108. </template>
  109. </el-table-column>
  110. <el-table-column align="center" prop="organName" label="乐团">
  111. <template slot-scope="scope">
  112. {{ scope.row.musicGroupName }}
  113. </template>
  114. </el-table-column>
  115. <!-- <el-table-column align="center" prop="createTime" label="练习班级">
  116. <template slot-scope="scope">
  117. {{ scope.row.classGroupName }}
  118. </template>
  119. </el-table-column> -->
  120. <el-table-column align="center" prop="createTime" label="布置时间">
  121. <template slot-scope="scope">
  122. {{ scope.row.createTime | dateForMinFormat }}
  123. </template>
  124. </el-table-column>
  125. <el-table-column align="center" prop="createTime" label="练习类型">
  126. <template slot-scope="scope">
  127. {{
  128. scope.row.type == "EXTRACURRICULAR" ? "课外练习" : "额外练习"
  129. }}
  130. </template>
  131. </el-table-column>
  132. <el-table-column align="center" prop="teacherName" label="布置老师">
  133. <template slot-scope="scope">
  134. <copy-text v-if="scope.row.teacher">
  135. {{ scope.row.teacher.username }}
  136. </copy-text>
  137. </template>
  138. </el-table-column>
  139. <el-table-column align="center" prop="title" label="应交人数">
  140. <template slot-scope="scope">
  141. {{ scope.row.expectNum || 0 }}人
  142. </template>
  143. </el-table-column>
  144. <el-table-column
  145. align="center"
  146. prop="actualTeacherName"
  147. label="完成人数"
  148. >
  149. <template slot-scope="scope">
  150. <div>{{ scope.row.completedNum || 0 }}人</div>
  151. </template>
  152. </el-table-column>
  153. <el-table-column align="center" prop="expireDate" label="截止时间">
  154. <template slot-scope="scope">
  155. {{ scope.row.expireDate | dateForMinFormat }}
  156. </template>
  157. </el-table-column>
  158. <el-table-column align="center" label="操作">
  159. <template slot-scope="scope">
  160. <div>
  161. <auth auths="afterSchollList/look">
  162. <el-button type="text" @click="lookDetail(scope.row)"
  163. >查看</el-button
  164. >
  165. </auth>
  166. </div>
  167. </template>
  168. </el-table-column>
  169. </el-table>
  170. <pagination
  171. sync
  172. :saveKey="'afterSchoolList'"
  173. :total.sync="rules.total"
  174. :page.sync="rules.page"
  175. :limit.sync="rules.limit"
  176. :page-sizes="rules.page_size"
  177. @pagination="getList"
  178. />
  179. </div>
  180. <el-dialog
  181. title="详情"
  182. :visible.sync="classVisible"
  183. width="1000px"
  184. v-if="classVisible"
  185. >
  186. <courseWorkeDetail
  187. :studentExerciseId="activeRow.id"
  188. :showGroup="true"
  189. />
  190. </el-dialog>
  191. </div>
  192. <!-- <el-dialog title="课外练习详情"
  193. :visible.sync="afterSchoolVisible"
  194. width="600px">
  195. <el-form :model="visibleForm">
  196. <el-form-item label="布置时间">
  197. <p class="schoolCell">{{visibleForm.createTime}}</p>
  198. </el-form-item>
  199. <el-form-item label="老师姓名">
  200. <p class="schoolCell">{{visibleForm.createTime}}</p>
  201. </el-form-item>
  202. <el-form-item label="学生姓名">
  203. <el-popover placement="top-start"
  204. width="400"
  205. trigger="hover"
  206. :content="visibleForm.createTime">
  207. <p class="schoolCell"
  208. slot="reference">{{visibleForm.createTime}}</p>
  209. </el-popover>
  210. </el-form-item>
  211. <el-form-item label="截止时间">
  212. <p class="schoolCell">{{visibleForm.createTime}}</p>
  213. </el-form-item>
  214. <el-form-item label="练习标题">
  215. <p class="schoolCell">{{visibleForm.createTime}}</p>
  216. </el-form-item>
  217. <el-form-item label="练习内容">
  218. <el-input disabled
  219. type="textarea"
  220. rows="5"
  221. v-model="visibleForm.createTime"
  222. style="width:400px"></el-input>
  223. </el-form-item>
  224. <el-form-item label="学生上传">
  225. <el-input disabled
  226. v-model="visibleForm.createTime"
  227. style="width:400px"></el-input>
  228. </el-form-item>
  229. </el-form>
  230. </el-dialog> -->
  231. </div>
  232. </template>
  233. <script>
  234. import pagination from "@/components/Pagination/index";
  235. import remoteSearch from "@/components/remote-search";
  236. import courseWorkeDetail from "@/views/afterSchoolManager/components/courseWorkeDetail.vue";
  237. import { queryPageList } from "@/api/afterSchool";
  238. export default {
  239. components: { pagination, remoteSearch, courseWorkeDetail },
  240. data() {
  241. return {
  242. searchForm: {
  243. search: null,
  244. listTimer: [],
  245. teacherId: null,
  246. organIdList: null,
  247. type: null
  248. },
  249. rules: {
  250. // 分页规则
  251. limit: 10, // 限制显示条数
  252. page: 1, // 当前页
  253. total: 0, // 总条数
  254. page_size: [10, 20, 40, 50] // 选择限制显示条数
  255. },
  256. tableList: [],
  257. visibleForm: {
  258. createTime: null
  259. },
  260. classVisible: false,
  261. activeRow: null
  262. };
  263. },
  264. //生命周期 - 创建完成(可以访问当前this实例)
  265. created() {
  266. if (this.searchForm.listTimer && this.searchForm.listTimer.length <= 0) {
  267. this.getNow();
  268. }
  269. },
  270. //生命周期 - 挂载完成(可以访问DOM元素)
  271. mounted() {
  272. this.$store.dispatch("setBranchs");
  273. // 获取分部
  274. this.init();
  275. },
  276. methods: {
  277. getNow() {
  278. // let now = new Date();
  279. // let startDate = new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate()))
  280. // .toISOString()
  281. // .slice(0, 10);
  282. // let endDate = new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate()))
  283. // .toISOString()
  284. // .slice(0, 10);
  285. // this.searchForm.listTimer = [];
  286. // this.searchForm.listTimer.push(startDate);
  287. // this.searchForm.listTimer.push(endDate);
  288. },
  289. init() {
  290. this.getList();
  291. },
  292. getList() {
  293. // assignStartTime assignEndTime page search teacherId title
  294. let obj = {};
  295. if (this.searchForm.listTimer && this.searchForm.listTimer.length > 0) {
  296. obj.assignStartTime = this.searchForm.listTimer[0];
  297. obj.assignEndTime = this.searchForm.listTimer[1];
  298. }
  299. obj.page = this.rules.page;
  300. (obj.rows = this.rules.limit),
  301. this.searchForm.teacherId
  302. ? (obj.teacherId = this.searchForm.teacherId)
  303. : null;
  304. this.searchForm.search ? (obj.search = this.searchForm.search) : null;
  305. this.searchForm.organIdList
  306. ? (obj.organIdList = this.searchForm.organIdList)
  307. : null;
  308. obj.cloudHomeworkFlag = this.searchForm.cloudHomeworkFlag;
  309. obj.studentAssignFlag = false;
  310. obj.type = this.searchForm.type ? this.searchForm.type : null;
  311. queryPageList(obj).then(res => {
  312. if (res.code == 200) {
  313. this.tableList = res.data.rows;
  314. this.rules.total = res.data.total;
  315. }
  316. });
  317. },
  318. search() {
  319. this.rules.page = 1;
  320. this.getList();
  321. },
  322. onReSet() {
  323. this.searchForm = {
  324. search: null,
  325. listTimer: [],
  326. teacherId: null,
  327. organIdList: null,
  328. type: null
  329. };
  330. this.getNow();
  331. this.search();
  332. },
  333. lookDetail(row) {
  334. this.activeRow = row;
  335. if (row.versionTag == "v1") {
  336. this.$router.push({
  337. path: "/business/afterSchoolDetailold",
  338. query: {
  339. extracurricularExercisesId: row.id,
  340. title: row.title,
  341. activeIndex: 1
  342. }
  343. });
  344. } else {
  345. this.classVisible = true;
  346. }
  347. }
  348. }
  349. };
  350. </script>
  351. <style lang="scss" scoped>
  352. .searchInput {
  353. ::v-deep .el-input__inner {
  354. width: 280px !important;
  355. }
  356. }
  357. .schoolCell {
  358. width: 400px;
  359. color: #333;
  360. background-color: #f5f7fa;
  361. border-color: #e4e7ed;
  362. height: 40px;
  363. line-height: 40px;
  364. outline: 0;
  365. padding: 0 15px;
  366. border-radius: 4px;
  367. border: 1px solid #dcdfe6;
  368. display: inline-block;
  369. box-sizing: border-box;
  370. white-space: nowrap;
  371. text-overflow: ellipsis;
  372. overflow: hidden;
  373. }
  374. ::v-deep .el-textarea.is-disabled .el-textarea__inner {
  375. color: #333;
  376. }
  377. </style>