LessonTable.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. <template>
  2. <div>
  3. <el-table
  4. :default-expand-all="true"
  5. border
  6. :data="tabledata"
  7. style="width: 100%; border-radius: 4px; overflow: hidden"
  8. :header-cell-style="{
  9. 'background-color': '#F5F5F5',
  10. padding: '8px',
  11. color: '#666',
  12. }"
  13. >
  14. <el-table-column label="节/卷" type="expand" width="70px">
  15. <template slot-scope="scope">
  16. <div class="dis_flexs">
  17. <ul
  18. style="flex: 1"
  19. v-if="
  20. scope.row.userStudyRecordPhotoList &&
  21. scope.row.userStudyRecordPhotoList.length
  22. "
  23. >
  24. <li
  25. v-for="(its, inds) in scope.row.userStudyRecordPhotoList"
  26. :key="inds"
  27. class="liImgs"
  28. >
  29. <el-image
  30. style="width: 100%; height: 100%"
  31. :src="$methodsTools.splitImgHost(its.photo)"
  32. :preview-src-list="[$methodsTools.splitImgHost(its.photo)]"
  33. >
  34. </el-image>
  35. <div class="abos">
  36. {{ $methodsTools.onlyForma(its.createTime) }}
  37. </div>
  38. </li>
  39. <div style="clear: both"></div>
  40. </ul>
  41. <p v-else style="text-align: center; width: 100%">暂无拍照数据</p>
  42. <div
  43. class="styFlex"
  44. v-if="
  45. (periodStatus === 0 ||
  46. periodStatus === 2 ||
  47. periodStatus === 3) &&
  48. scope.row.periodStatus === 1
  49. "
  50. >
  51. <div>
  52. <el-checkbox
  53. class="checkboxList"
  54. :label="scope.row.periodStatusId"
  55. :disabled="
  56. periodStatus === 3
  57. ? false
  58. : scope.row.status !== 2
  59. ? true
  60. : false
  61. "
  62. ><br
  63. /></el-checkbox>
  64. </div>
  65. <el-button
  66. :disabled="scope.row.status !== 2"
  67. class="btnstyles"
  68. size="small"
  69. type="success"
  70. :loading="disabledBtn"
  71. @click="changeStatus(scope.row.periodStatusId, 1)"
  72. >通过</el-button
  73. >
  74. <el-button
  75. :disabled="scope.row.status !== 2"
  76. class="btnstyles"
  77. size="small"
  78. type="danger"
  79. @click="changeStatus(scope.row.periodStatusId, 0)"
  80. >作弊</el-button
  81. >
  82. </div>
  83. </div>
  84. </template>
  85. </el-table-column>
  86. <el-table-column
  87. v-for="(item, index) in tableSet"
  88. :width="item.width"
  89. :key="index"
  90. :label="item.label"
  91. align="center"
  92. >
  93. <template slot-scope="scope2">
  94. <span v-if="item.scope === 'select'">
  95. <span
  96. v-for="(k, ds) in item.options"
  97. :key="ds"
  98. :style="
  99. scope2.row[item.prop] === 0
  100. ? 'color:red;'
  101. : scope2.row[item.prop] === 2
  102. ? 'color:#0047D0;'
  103. : scope2.row[item.prop] === 1
  104. ? 'color:#67C23A;'
  105. : ''
  106. "
  107. >
  108. {{ k.value == scope2.row[item.prop] ? k.label : "" }}
  109. </span>
  110. </span>
  111. <div v-else-if="item.scope === 'activeNum'">
  112. <el-select
  113. v-model="scope2.row[item.prop]"
  114. placeholder="请选择"
  115. @change="getNewListchapt(scope2.$index, $event, scope2.row)"
  116. >
  117. <el-option
  118. v-for="(items, indexs) in scope2.row['numList']"
  119. :key="indexs"
  120. :label="'第' + items + '次审核记录'"
  121. :value="items"
  122. >
  123. </el-option>
  124. </el-select>
  125. </div>
  126. <span v-else-if="item.scope === 'typeOptions'">
  127. <span v-for="(is, ds) in item.options" :key="ds">
  128. <span v-if="is.value === scope2.row[item.prop]">{{
  129. is.label
  130. }}</span>
  131. </span>
  132. </span>
  133. <span v-else-if="item.scope === 'aTime'">
  134. {{ $methodsTools.onlyForma(scope2.row[item.prop]) }}
  135. </span>
  136. <span v-else-if="item.scope === 'durTime' && scope2.row.type !== 5">
  137. {{ $methodsTools.secondToDate(scope2.row[item.prop], false) }}
  138. </span>
  139. <div v-else-if="item.scope === 'aTimeSE'">
  140. <span
  141. v-if="
  142. scope2.row['type'] === 3 &&
  143. scope2.row['durationTime'] &&
  144. scope2.row['studyStartTime'] &&
  145. scope2.row['studyEndTime']
  146. "
  147. :style="comput(scope2.row)"
  148. >
  149. {{ $methodsTools.onlyForma(scope2.row[item.prop]) }}
  150. </span>
  151. <span v-else>
  152. {{ $methodsTools.onlyForma(scope2.row[item.prop]) }}
  153. </span>
  154. </div>
  155. <span v-else> {{ scope2.row[item.prop] }} </span>
  156. </template>
  157. </el-table-column>
  158. </el-table>
  159. <Cheat-dialog
  160. :vidBoxHours.sync="vidBoxHours"
  161. @submit="submit"
  162. ></Cheat-dialog>
  163. </div>
  164. </template>
  165. <script>
  166. import CheatDialog from "./CheatDialog.vue";
  167. export default {
  168. props: {
  169. tabledata: {
  170. type: Array,
  171. default: () => {
  172. return [];
  173. },
  174. },
  175. },
  176. inject: ["getPeriodStatus", "getUserInfo", "getAllIds"],
  177. data() {
  178. return {
  179. tableSet: [
  180. {
  181. label: "选择",
  182. prop: "numIndex",
  183. scope: "activeNum",
  184. width: "180px",
  185. },
  186. {
  187. label: "姓名",
  188. prop: "realName",
  189. },
  190. {
  191. label: "标题",
  192. prop: "typeName",
  193. },
  194. {
  195. label: "类型",
  196. prop: "type",
  197. scope: "typeOptions",
  198. width: "90px",
  199. options: [
  200. {
  201. label: "节",
  202. value: 3,
  203. },
  204. {
  205. label: "试卷",
  206. value: 4,
  207. },
  208. {
  209. label: "模块卷",
  210. value: 5,
  211. },
  212. ],
  213. },
  214. {
  215. label: "节时长",
  216. prop: "durationTime",
  217. width: "120px",
  218. scope: "durTime",
  219. },
  220. {
  221. label: "开始时间",
  222. prop: "studyStartTime",
  223. scope: "aTimeSE",
  224. },
  225. {
  226. label: "结束时间",
  227. prop: "studyEndTime",
  228. scope: "aTimeSE",
  229. },
  230. {
  231. label: "审核状态",
  232. prop: "status",
  233. scope: "select",
  234. width: "100px",
  235. options: [
  236. {
  237. label: "待审核",
  238. value: 2,
  239. },
  240. {
  241. label: "通过",
  242. value: 1,
  243. },
  244. {
  245. label: "作弊",
  246. value: 0,
  247. },
  248. {
  249. label: "待重修",
  250. value: 3,
  251. },
  252. ],
  253. },
  254. {
  255. label: "审核人",
  256. prop: "auditUserName",
  257. width: "100px",
  258. },
  259. {
  260. label: "审核时间",
  261. prop: "auditTime",
  262. scope: "aTime",
  263. },
  264. ],
  265. disabledBtn: false,
  266. vidBoxHours: false,
  267. formData: {
  268. status: "",
  269. id: "",
  270. },
  271. };
  272. },
  273. methods: {
  274. submit(text) {
  275. this.formData.auditReason = text;
  276. this.$api
  277. .editGradeUsereditPeriode(this.formData)
  278. .then((res) => {
  279. this.$message.success("修改成功");
  280. this.vidBoxHours = false;
  281. if (this.allIds.length == 1) {
  282. this.$router.push({
  283. name: "ListOfhoursToBeReviewed",
  284. });
  285. }
  286. this.getUserInfo(true);
  287. })
  288. .finally(() => {
  289. this.disabledBtn = false;
  290. });
  291. },
  292. loadingClose() {
  293. this.disabledBtn = false;
  294. },
  295. comput(item) {
  296. var ast = item.studyEndTime - item.studyStartTime;
  297. if (ast < item.durationTime) {
  298. return "color:red;";
  299. } else {
  300. return "";
  301. }
  302. },
  303. getNewListchapt(index, int, item) {
  304. let { courseId, moduleId, chapterId, userId, goodsId, gradeId } = item;
  305. let data = {
  306. courseId: courseId,
  307. moduleId,
  308. chapterId,
  309. numIndex: int,
  310. userId,
  311. goodsId,
  312. gradeId,
  313. };
  314. if (item.type === 3) {
  315. data.sectionId = item.id;
  316. }
  317. if (item.type === 4) {
  318. data.examId = item.id;
  319. }
  320. this.$api.inquireGradegradelistPeriodAuditStatus(data).then((res) => {
  321. this.$set(this.tabledata, index, res.data);
  322. });
  323. },
  324. changeStatus(id, status) {
  325. this.formData = {
  326. status,
  327. id,
  328. };
  329. if (status == 0) {
  330. this.vidBoxHours = true;
  331. } else {
  332. this.submit();
  333. }
  334. },
  335. },
  336. computed: {
  337. periodStatus() {
  338. return this.getPeriodStatus();
  339. },
  340. allIds() {
  341. return this.getAllIds();
  342. },
  343. },
  344. components: {
  345. CheatDialog,
  346. },
  347. };
  348. </script>
  349. <style lang="less" scoped>
  350. .liImgs {
  351. float: left;
  352. width: 210px;
  353. height: 280px;
  354. margin-right: 16px;
  355. margin-bottom: 16px;
  356. position: relative;
  357. border-radius: 8px;
  358. overflow: hidden;
  359. .abos {
  360. position: absolute;
  361. bottom: 0px;
  362. width: 100%;
  363. height: 32px;
  364. line-height: 32px;
  365. font-size: 14px;
  366. color: #fff;
  367. text-align: center;
  368. background-color: rgba(51, 51, 51, 0.7);
  369. }
  370. }
  371. .dis_flexs {
  372. display: flex;
  373. align-items: center;
  374. padding: 10px 18px;
  375. ul {
  376. margin-bottom: 0px;
  377. }
  378. }
  379. .styFlex {
  380. width: 80px;
  381. text-align: center;
  382. }
  383. .checkboxList {
  384. margin-bottom: 6px;
  385. &/deep/.el-checkbox__label {
  386. display: none;
  387. }
  388. }
  389. .btnstyles {
  390. margin-left: 0px;
  391. margin-bottom: 10px;
  392. }
  393. </style>