|
|
@@ -2,27 +2,27 @@
|
|
|
<div class="audit">
|
|
|
<MenuPage only-key="/personal_workbench/check_task" />
|
|
|
|
|
|
- <CommonPreview :id="id" ref="preview" :project-id="project_id" :is-audit="true">
|
|
|
+ <CommonPreview :id="id" ref="preview" :project-id="project_id" :is-audit="true" type="audit">
|
|
|
<template #operator="{ courseware }">
|
|
|
<span v-if="isTrue(courseware.is_can_add_audit_remark)" class="link" @click="addRemark">添加审校批注</span>
|
|
|
<span
|
|
|
v-if="isTrue(courseware.is_can_finish_audit)"
|
|
|
class="link"
|
|
|
- @click="finishCoursewareCurFlowNodeAudit('false', 'complete')"
|
|
|
+ @click="finishCoursewareCurFlowNodeAudit('false', 'complete', courseware.cur_audit_flow_node_type)"
|
|
|
>
|
|
|
审校完成
|
|
|
</span>
|
|
|
<span
|
|
|
v-if="isTrue(courseware.is_can_audit_pass)"
|
|
|
class="link"
|
|
|
- @click="finishCoursewareCurFlowNodeAudit('true', 'pass')"
|
|
|
+ @click="finishCoursewareCurFlowNodeAudit('true', 'pass', courseware.cur_audit_flow_node_type)"
|
|
|
>
|
|
|
审核通过
|
|
|
</span>
|
|
|
<span
|
|
|
v-if="isTrue(courseware.is_can_audit_reject)"
|
|
|
class="link"
|
|
|
- @click="finishCoursewareCurFlowNodeAudit('false', 'reject')"
|
|
|
+ @click="finishCoursewareCurFlowNodeAudit('false', 'reject', courseware.cur_audit_flow_node_type)"
|
|
|
>
|
|
|
审核驳回
|
|
|
</span>
|
|
|
@@ -49,6 +49,7 @@ export default {
|
|
|
return {
|
|
|
id: this.$route.params.id || '',
|
|
|
project_id: this.$route.query.project_id || '',
|
|
|
+ isSubmitting: false,
|
|
|
actionTip: {
|
|
|
complete: '是否确认审校完成?',
|
|
|
pass: '是否确认审校通过?',
|
|
|
@@ -62,23 +63,39 @@ export default {
|
|
|
* 提交课件到审校流程
|
|
|
* @param {'true'|'false'} is_pass - 是否通过审校
|
|
|
* @param {'complete'|'pass'|'reject'} action - 操作类型
|
|
|
+ * @param {string} flow_node_type - 审核流程节点类型
|
|
|
*/
|
|
|
- finishCoursewareCurFlowNodeAudit(is_pass, action) {
|
|
|
- this.$confirm(this.actionTip[action], '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- FinishCoursewareCurFlowNodeAudit({
|
|
|
- id: this.id,
|
|
|
- is_pass,
|
|
|
- }).then(() => {
|
|
|
- this.$message.success('操作成功');
|
|
|
- this.$refs.preview.getBookCoursewareInfo(this.id);
|
|
|
+ async finishCoursewareCurFlowNodeAudit(is_pass, action, flow_node_type) {
|
|
|
+ if (this.isSubmitting) return;
|
|
|
+
|
|
|
+ try {
|
|
|
+ await this.$confirm(this.actionTip[action], '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ });
|
|
|
+
|
|
|
+ if (flow_node_type === 2) {
|
|
|
+ await this.$confirm('当前为终审环节,请确认审校通过?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
});
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
+ }
|
|
|
+
|
|
|
+ this.isSubmitting = true;
|
|
|
+ await FinishCoursewareCurFlowNodeAudit({ id: this.id, is_pass });
|
|
|
+ this.$message.success('操作成功');
|
|
|
+ this.$refs.preview.getBookCoursewareInfo(this.id);
|
|
|
+ } catch (err) {
|
|
|
+ // 忽略用户取消确认的情况
|
|
|
+ if (err === 'cancel' || err === 'close') return;
|
|
|
+ // 若为请求错误,尽量展示友好信息
|
|
|
+ const msg = (err && err.message) || (err && err.msg) || '操作失败';
|
|
|
+ this.$message.error(msg);
|
|
|
+ } finally {
|
|
|
+ this.isSubmitting = false;
|
|
|
+ }
|
|
|
},
|
|
|
goBackBookList() {
|
|
|
this.$router.push({ path: `/personal_workbench/check_task` });
|