LessonTable.vue 9.9 KB

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