LessonTable.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  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}次审核记录${indexs > 0 ? '(重修)' : ''}`"
  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. {{
  138. scope2.row["type"] == 3
  139. ? $methodsTools.secondToDate(scope2.row[item.prop], false)
  140. : "分数:" + scope2.row["performance"]
  141. }}
  142. </span>
  143. <div v-else-if="item.scope === 'aTimeSE'">
  144. <div
  145. v-if="
  146. scope2.row['type'] === 3 &&
  147. scope2.row['durationTime'] &&
  148. scope2.row['studyStartTime'] &&
  149. scope2.row['studyEndTime']
  150. "
  151. :style="comput(scope2.row)"
  152. >
  153. <div
  154. v-if="
  155. scope2.row['numIndex'] === scope2.row['numList'] &&
  156. scope2.row['numIndex'] !== 1
  157. "
  158. >
  159. <div>
  160. 上次时间:{{
  161. $methodsTools.onlyForma(scope2.row["preStartTime"]) +
  162. " - " +
  163. $methodsTools.onlyForma(scope2.row["preEndTime"])
  164. }}
  165. </div>
  166. <div>
  167. 重学时间:{{
  168. $methodsTools.onlyForma(scope2.row[item.prop1]) +
  169. " - " +
  170. $methodsTools.onlyForma(scope2.row[item.prop2])
  171. }}
  172. </div>
  173. </div>
  174. <div v-else>
  175. 学习时间:{{
  176. $methodsTools.onlyForma(scope2.row[item.prop1]) +
  177. " - " +
  178. $methodsTools.onlyForma(scope2.row[item.prop2])
  179. }}
  180. </div>
  181. <!-- {{ $methodsTools.onlyForma(scope2.row[item.prop]) }} -->
  182. </div>
  183. <div
  184. v-if="
  185. (scope2.row['type'] === 4 || scope2.row['type'] === 5) &&
  186. scope2.row['studyStartTime'] &&
  187. scope2.row['studyEndTime']
  188. "
  189. >
  190. 学习时间:{{
  191. $methodsTools.onlyForma(scope2.row[item.prop1]) +
  192. " - " +
  193. $methodsTools.onlyForma(scope2.row[item.prop2])
  194. }}
  195. </div>
  196. </div>
  197. <span v-else> {{ scope2.row[item.prop] }} </span>
  198. </template>
  199. </el-table-column>
  200. </el-table>
  201. <Cheat-dialog
  202. :vidBoxHours.sync="vidBoxHours"
  203. @submit="submit"
  204. ></Cheat-dialog>
  205. </div>
  206. </template>
  207. <script>
  208. import CheatDialog from "./CheatDialog.vue";
  209. export default {
  210. props: {
  211. setData: {
  212. type: Object,
  213. default: () => {
  214. return {};
  215. },
  216. },
  217. tabledata: {
  218. type: Array,
  219. default: () => {
  220. return [];
  221. },
  222. },
  223. },
  224. inject: ["getPeriodStatus", "getUserInfo", "getAllIds"],
  225. data() {
  226. return {
  227. tableSet: [
  228. {
  229. label: "选择",
  230. prop: "numIndex",
  231. scope: "activeNum",
  232. width: "210px",
  233. },
  234. {
  235. label: "姓名",
  236. prop: "realName",
  237. },
  238. {
  239. label: "标题",
  240. prop: "typeName",
  241. },
  242. {
  243. label: "类型",
  244. prop: "type",
  245. scope: "typeOptions",
  246. width: "90px",
  247. options: [
  248. {
  249. label: "节",
  250. value: 3,
  251. },
  252. {
  253. label: "试卷",
  254. value: 4,
  255. },
  256. {
  257. label: "模块卷",
  258. value: 5,
  259. },
  260. ],
  261. },
  262. {
  263. label: "节时长",
  264. prop: "durationTime",
  265. width: "120px",
  266. scope: "durTime",
  267. },
  268. {
  269. label: "学习时间",
  270. prop1: "studyStartTime",
  271. prop2: "studyEndTime",
  272. scope: "aTimeSE",
  273. width: "420px",
  274. },
  275. {
  276. label: "审核状态",
  277. prop: "status",
  278. scope: "select",
  279. width: "100px",
  280. options: [
  281. {
  282. label: "待审核",
  283. value: 2,
  284. },
  285. {
  286. label: "通过",
  287. value: 1,
  288. },
  289. {
  290. label: "作弊",
  291. value: 0,
  292. },
  293. {
  294. label: "待重修",
  295. value: 3,
  296. },
  297. ],
  298. },
  299. {
  300. label: "审核人",
  301. prop: "auditUserName",
  302. width: "100px",
  303. },
  304. {
  305. label: "审核时间",
  306. prop: "auditTime",
  307. scope: "aTime",
  308. },
  309. ],
  310. disabledBtn: false,
  311. vidBoxHours: false,
  312. formData: {
  313. status: "",
  314. id: "",
  315. },
  316. };
  317. },
  318. methods: {
  319. submit(text) {
  320. this.formData.auditReason = text;
  321. this.$api
  322. .editGradeUsereditPeriode(this.formData)
  323. .then((res) => {
  324. this.$message.success("修改成功");
  325. this.vidBoxHours = false;
  326. if (this.allIds.length == 1) {
  327. this.$router.push({
  328. name: "ListOfhoursToBeReviewed",
  329. });
  330. }
  331. this.getUserInfo(true);
  332. })
  333. .finally(() => {
  334. this.disabledBtn = false;
  335. });
  336. },
  337. loadingClose() {
  338. this.disabledBtn = false;
  339. },
  340. comput(item) {
  341. var ast = item.studyEndTime - item.studyStartTime;
  342. let status = item.durationTime - ast
  343. if (status > 25) {
  344. return "color:red;";
  345. } else {
  346. return "";
  347. }
  348. },
  349. getNewListchapt(index, int, item) {
  350. let { courseId, moduleId, chapterId, userId, goodsId, gradeId } = item;
  351. let data = {
  352. courseId: courseId,
  353. moduleId,
  354. chapterId,
  355. numIndex: int,
  356. userId,
  357. goodsId,
  358. gradeId,
  359. orderGoodsId: this.setData.orderGoodsId,
  360. };
  361. if (item.type === 3) {
  362. data.sectionId = item.id;
  363. }
  364. if (item.type === 4) {
  365. data.examId = item.id;
  366. }
  367. this.$api.inquireGradegradelistPeriodAuditStatus(data).then((res) => {
  368. this.$set(this.tabledata, index, res.data);
  369. });
  370. },
  371. changeStatus(id, status) {
  372. this.formData = {
  373. status,
  374. id,
  375. };
  376. if (status == 0) {
  377. this.vidBoxHours = true;
  378. } else {
  379. this.submit();
  380. }
  381. },
  382. },
  383. computed: {
  384. periodStatus() {
  385. return this.getPeriodStatus();
  386. },
  387. allIds() {
  388. return this.getAllIds();
  389. },
  390. },
  391. components: {
  392. CheatDialog,
  393. },
  394. };
  395. </script>
  396. <style lang="less" scoped>
  397. .liImgs {
  398. float: left;
  399. width: 210px;
  400. height: 280px;
  401. margin-right: 16px;
  402. margin-bottom: 16px;
  403. position: relative;
  404. border-radius: 8px;
  405. overflow: hidden;
  406. .abos {
  407. position: absolute;
  408. bottom: 0px;
  409. width: 100%;
  410. height: 32px;
  411. line-height: 32px;
  412. font-size: 14px;
  413. color: #fff;
  414. text-align: center;
  415. background-color: rgba(51, 51, 51, 0.7);
  416. }
  417. }
  418. .dis_flexs {
  419. display: flex;
  420. align-items: center;
  421. padding: 10px 18px;
  422. ul {
  423. margin-bottom: 0px;
  424. max-height: 588px;
  425. overflow: auto;
  426. }
  427. }
  428. .styFlex {
  429. width: 80px;
  430. text-align: center;
  431. }
  432. .checkboxList {
  433. margin-bottom: 6px;
  434. &/deep/.el-checkbox__label {
  435. display: none;
  436. }
  437. }
  438. .btnstyles {
  439. margin-left: 0px;
  440. margin-bottom: 10px;
  441. }
  442. </style>