AuditCourseOutlineDialog.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. <template>
  2. <el-dialog
  3. class="page-dialog audit-course-outline-dialog"
  4. :visible.sync="modalIsShow"
  5. :title="title"
  6. fullscreen
  7. append-to-body
  8. :close-on-click-modal="false"
  9. :close-on-press-escape="false"
  10. @open="visibleChange"
  11. @close="dialogClose"
  12. >
  13. <div class="report-page">
  14. <h1>{{ reportTitle }}</h1>
  15. <!-- 课程基本信息 -->
  16. <div v-if="courseBasicInfo" class="page-part">
  17. <h3>课程基本信息</h3>
  18. <el-form label-width="100px">
  19. <el-row>
  20. <el-col :span="12">
  21. <el-form-item prop="courseCode" label="课程编码:">
  22. <el-input
  23. v-model.trim="courseBasicInfo.courseCode"
  24. placeholder="请输入课程编码"
  25. clearable
  26. ></el-input>
  27. </el-form-item>
  28. </el-col>
  29. <el-col :span="12">
  30. <el-form-item prop="courseName" label="课程名称:">
  31. <el-input
  32. v-model.trim="courseBasicInfo.courseName"
  33. placeholder="请输入课程名称"
  34. clearable
  35. ></el-input>
  36. </el-form-item>
  37. </el-col>
  38. </el-row>
  39. <el-row>
  40. <el-col :span="12">
  41. <el-form-item prop="semester" label="授课学期:">
  42. <el-input
  43. v-model.trim="courseBasicInfo.semester"
  44. placeholder="请输入授课学期"
  45. clearable
  46. ></el-input>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :span="12">
  50. <el-form-item prop="professional" label="适用专业:">
  51. <el-input
  52. v-model.trim="courseBasicInfo.professional"
  53. placeholder="请输入适用专业"
  54. clearable
  55. ></el-input>
  56. </el-form-item>
  57. </el-col>
  58. </el-row>
  59. <el-row>
  60. <el-col :span="12">
  61. <el-form-item prop="period" label="学时:">
  62. <el-input-number
  63. v-model="courseBasicInfo.period"
  64. placeholder="请输入学时"
  65. :min="0"
  66. :max="999"
  67. :controls="false"
  68. class="width-full"
  69. ></el-input-number>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="12">
  73. <el-form-item prop="credit" label="学分:">
  74. <el-input-number
  75. v-model="courseBasicInfo.credit"
  76. placeholder="请录入学分"
  77. size="small"
  78. :min="0"
  79. :max="999"
  80. :controls="false"
  81. class="width-full"
  82. ></el-input-number>
  83. </el-form-item>
  84. </el-col>
  85. </el-row>
  86. <el-row>
  87. <el-col :span="12">
  88. <el-form-item prop="clazz" label="授课班级:">
  89. <el-input
  90. v-model.trim="courseBasicInfo.clazz"
  91. placeholder="请输入授课班级"
  92. clearable
  93. ></el-input>
  94. </el-form-item>
  95. </el-col>
  96. <el-col :span="12">
  97. <el-form-item prop="teacher" label="授课教师:">
  98. <el-input
  99. v-model.trim="courseBasicInfo.teacher"
  100. placeholder="请输入授课教师"
  101. clearable
  102. ></el-input>
  103. </el-form-item>
  104. </el-col>
  105. </el-row>
  106. </el-form>
  107. </div>
  108. <!-- 课程目标情况 -->
  109. <div
  110. v-if="courseTargetInfo && courseTargetInfo.courseEvaluateList"
  111. class="page-part"
  112. >
  113. <h3>课程目标情况</h3>
  114. <table class="table">
  115. <tr>
  116. <th rowspan="2"></th>
  117. <th colspan="3">过程性评价</th>
  118. <th colspan="3">终结性评价</th>
  119. </tr>
  120. <tr>
  121. <th>形式与内容</th>
  122. <th>观测点</th>
  123. <th>分值</th>
  124. <th>形式与内容</th>
  125. <th>观测点</th>
  126. <th>分值</th>
  127. </tr>
  128. <template
  129. v-for="(item, index) in courseTargetInfo.courseEvaluateList"
  130. >
  131. <tr
  132. v-for="(evaluate, eindex) in item.procedureEvaluateList"
  133. :key="`${index}-${eindex}`"
  134. >
  135. <td v-if="eindex === 0" :rowspan="item.colspan">
  136. {{ item.name }}
  137. </td>
  138. <td>{{ evaluate.content }}</td>
  139. <td>{{ evaluate.point }}</td>
  140. <td>{{ evaluate.score }}</td>
  141. <template v-if="eindex === 0">
  142. <td :rowspan="item.colspan">
  143. {{ item.finalityEvaluateList[0]?.content }}
  144. </td>
  145. <td :rowspan="item.colspan">
  146. {{ item.finalityEvaluateList[0]?.point }}
  147. </td>
  148. <td :rowspan="item.colspan">
  149. {{ item.finalityEvaluateList[0]?.score }}
  150. </td>
  151. </template>
  152. </tr>
  153. </template>
  154. <tr>
  155. <td>总目标分值</td>
  156. <td colspan="3">{{ courseTargetInfo.proceduralTotalScore }}</td>
  157. <td colspan="3">{{ courseTargetInfo.finalityTotalScore }}</td>
  158. </tr>
  159. <tr>
  160. <td colspan="7">
  161. <el-row>
  162. <el-col :span="12">
  163. <span class="info-label">课程负责人:</span>
  164. <el-input
  165. v-model="courseTargetInfo.courseManager"
  166. placeholder="请输入"
  167. clearable
  168. style="width: 200px"
  169. ></el-input>
  170. </el-col>
  171. <el-col :span="12">
  172. <span class="info-label">填写日期:</span>
  173. <el-date-picker
  174. v-model="courseTargetInfo.date"
  175. type="date"
  176. value-format="timestamp"
  177. style="width: 200px"
  178. >
  179. </el-date-picker>
  180. </el-col>
  181. </el-row>
  182. </td>
  183. </tr>
  184. </table>
  185. </div>
  186. <!-- 合理性评价 -->
  187. <div v-if="rationalityEvaluation" class="page-part">
  188. <h3>合理性评价 <span class="tips">(请在对应结论处打√)</span></h3>
  189. <table class="table">
  190. <tr>
  191. <th></th>
  192. <th>评价内容</th>
  193. <th>合理</th>
  194. <th>较合理</th>
  195. <th>不合理</th>
  196. </tr>
  197. <tr
  198. v-for="(
  199. item, index
  200. ) in rationalityEvaluation.rationalityEvaluationDetailList"
  201. :key="index"
  202. >
  203. <td>{{ item.index || "" }}</td>
  204. <td>{{ item.content }}</td>
  205. <td style="text-align: center">
  206. <el-checkbox
  207. v-model="item.reasonable"
  208. @change="() => evaluationChange(item, 'reasonable')"
  209. ></el-checkbox>
  210. </td>
  211. <td style="text-align: center">
  212. <el-checkbox
  213. v-model="item.middle"
  214. @change="() => evaluationChange(item, 'middle')"
  215. ></el-checkbox>
  216. </td>
  217. <td style="text-align: center">
  218. <el-checkbox
  219. v-model="item.unreasonable"
  220. @change="() => evaluationChange(item, 'unreasonable')"
  221. ></el-checkbox>
  222. </td>
  223. </tr>
  224. <tr>
  225. <td colspan="5">存在的问题及建议:</td>
  226. </tr>
  227. <tr>
  228. <td colspan="5">
  229. <el-input
  230. v-model.trim="rationalityEvaluation.questionAndAdvice"
  231. type="textarea"
  232. :autosize="{ minRows: 3, maxRows: 5 }"
  233. placeholder="请输入存在的问题及建议"
  234. maxlength="999"
  235. show-word-limit
  236. ></el-input>
  237. </td>
  238. </tr>
  239. <tr>
  240. <td colspan="5">
  241. <el-row>
  242. <el-col :span="12">
  243. <span class="info-label">专业负责人:</span>
  244. <el-input
  245. v-model="rationalityEvaluation.professionalManager"
  246. placeholder="请输入"
  247. clearable
  248. style="width: 200px"
  249. ></el-input>
  250. </el-col>
  251. <el-col :span="12">
  252. <span class="info-label">评价日期:</span>
  253. <el-date-picker
  254. v-model="rationalityEvaluation.evaluateDate"
  255. type="date"
  256. value-format="timestamp"
  257. style="width: 200px"
  258. >
  259. </el-date-picker>
  260. </el-col>
  261. </el-row>
  262. </td>
  263. </tr>
  264. <tr>
  265. <td colspan="5">
  266. <el-form label-width="100px">
  267. <el-row>
  268. <el-col :span="12">
  269. <span class="info-label">审核人:</span>
  270. <el-input
  271. v-model="rationalityEvaluation.auditor"
  272. placeholder="请输入"
  273. clearable
  274. style="width: 200px"
  275. ></el-input>
  276. </el-col>
  277. <el-col :span="12">
  278. <span class="info-label">审核日期:</span>
  279. <el-date-picker
  280. v-model="rationalityEvaluation.auditDate"
  281. type="date"
  282. value-format="timestamp"
  283. style="width: 200px"
  284. >
  285. </el-date-picker>
  286. </el-col>
  287. </el-row>
  288. </el-form>
  289. </td>
  290. </tr>
  291. </table>
  292. </div>
  293. </div>
  294. <div class="report-footer">
  295. <el-button type="primary" :loading="loading" @click="toSubmit"
  296. >提交</el-button
  297. >
  298. </div>
  299. <div slot="footer"></div>
  300. </el-dialog>
  301. </template>
  302. <script>
  303. import {
  304. courseOutlineAuditReport,
  305. courseOutlineAuditRationalityReport,
  306. courseOutlineAuditSave,
  307. } from "../../api";
  308. export default {
  309. name: "audit-course-outline-dialog",
  310. props: {
  311. rowData: {
  312. type: Object,
  313. default() {
  314. return {};
  315. },
  316. },
  317. },
  318. data() {
  319. return {
  320. modalIsShow: false,
  321. loading: false,
  322. courseBasicInfo: null,
  323. courseTargetInfo: null,
  324. rationalityEvaluation: null,
  325. evaluationKeys: ["reasonable", "middle", "unreasonable"],
  326. audit: this.checkPrivilege("link", "audit"),
  327. auditRationality: this.checkPrivilege("link", "AuditAndRationality"),
  328. };
  329. },
  330. computed: {
  331. reportTitle() {
  332. return this.auditRationality
  333. ? "课程目标达成情况评价依据合理性审核表"
  334. : "课程目标达成情况评价依据审核表";
  335. },
  336. title() {
  337. return `${this.rowData.outlineName} ${this.reportTitle}`;
  338. },
  339. },
  340. methods: {
  341. visibleChange() {
  342. this.initData();
  343. },
  344. async initData() {
  345. const func = this.auditRationality
  346. ? courseOutlineAuditRationalityReport
  347. : courseOutlineAuditReport;
  348. const res = await func(this.rowData.id);
  349. const { courseBasicInfo, courseTargetInfo, rationalityEvaluation } =
  350. res || {};
  351. if (courseBasicInfo) {
  352. courseBasicInfo.credit = courseBasicInfo.credit || undefined;
  353. courseBasicInfo.period = courseBasicInfo.period || undefined;
  354. }
  355. this.courseBasicInfo = courseBasicInfo;
  356. this.rationalityEvaluation = rationalityEvaluation;
  357. if (courseTargetInfo && courseTargetInfo.courseEvaluateList) {
  358. courseTargetInfo.courseEvaluateList =
  359. courseTargetInfo.courseEvaluateList.filter(
  360. (item) =>
  361. item.procedureEvaluateList.length ||
  362. item.finalityEvaluateList.length
  363. );
  364. courseTargetInfo.courseEvaluateList.forEach((item) => {
  365. if (item.procedureEvaluateList.length === 0) {
  366. item.procedureEvaluateList = [
  367. { content: "", point: null, score: null },
  368. ];
  369. }
  370. item.colspan = Math.max(
  371. item.procedureEvaluateList.length,
  372. item.finalityEvaluateList.length
  373. );
  374. });
  375. }
  376. // console.log(courseTargetInfo);
  377. this.courseTargetInfo = courseTargetInfo;
  378. },
  379. evaluationChange(evaluate, type) {
  380. if (!evaluate[type]) return;
  381. this.evaluationKeys
  382. .filter((k) => k !== type)
  383. .forEach((k) => {
  384. evaluate[k] = false;
  385. });
  386. },
  387. cancel() {
  388. this.modalIsShow = false;
  389. },
  390. open() {
  391. this.modalIsShow = true;
  392. },
  393. dialogClose() {
  394. this.courseBasicInfo = null;
  395. this.courseTargetInfo = null;
  396. this.rationalityEvaluation = null;
  397. },
  398. checkData() {
  399. let valid = true;
  400. if (this.courseBasicInfo) {
  401. valid = Object.keys(this.courseBasicInfo).every(
  402. (k) => this.courseBasicInfo[k]
  403. );
  404. if (!valid) {
  405. this.$message.error("请完成课程基本信息");
  406. return valid;
  407. }
  408. }
  409. if (this.courseTargetInfo) {
  410. valid =
  411. this.courseTargetInfo.courseManager && this.courseTargetInfo.date;
  412. if (!valid) {
  413. this.$message.error("课程目标情况");
  414. return valid;
  415. }
  416. }
  417. if (this.rationalityEvaluation) {
  418. valid =
  419. this.rationalityEvaluation.rationalityEvaluationDetailList.every(
  420. (item) => {
  421. return this.evaluationKeys.some((k) => item[k]);
  422. }
  423. );
  424. const keys = [
  425. "professionalManager",
  426. "evaluateDate",
  427. "auditor",
  428. "auditDate",
  429. ];
  430. valid = valid && keys.every((k) => this.rationalityEvaluation[k]);
  431. if (!valid) {
  432. this.$message.error("合理性评价");
  433. return valid;
  434. }
  435. }
  436. return valid;
  437. },
  438. async toSubmit() {
  439. if (!this.checkData()) return;
  440. if (this.loading) return;
  441. this.loading = true;
  442. const res = await courseOutlineAuditSave({
  443. courseOutlineId: this.rowData.id,
  444. courseBasicInfo: this.courseBasicInfo,
  445. courseTargetInfo: this.courseTargetInfo,
  446. rationalityEvaluation: this.rationalityEvaluation,
  447. }).catch(() => {});
  448. this.loading = false;
  449. if (!res) return;
  450. this.$message.success("提交成功!");
  451. this.cancel();
  452. },
  453. },
  454. };
  455. </script>