|
@@ -60,14 +60,24 @@
|
|
|
<a-input :value="progressSubmitLabel" readonly />
|
|
<a-input :value="progressSubmitLabel" readonly />
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
<a-form-item>
|
|
<a-form-item>
|
|
|
- <a-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- :loading="submitLoading"
|
|
|
|
|
- :disabled="!canSubmitReview"
|
|
|
|
|
- @click="submitReview"
|
|
|
|
|
- >
|
|
|
|
|
- 提交审核
|
|
|
|
|
- </a-button>
|
|
|
|
|
|
|
+ <a-space>
|
|
|
|
|
+ <a-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ :loading="submitLoading"
|
|
|
|
|
+ :disabled="!canSubmitReview"
|
|
|
|
|
+ @click="submitReview"
|
|
|
|
|
+ >
|
|
|
|
|
+ 提交审核
|
|
|
|
|
+ </a-button>
|
|
|
|
|
+ <a-button
|
|
|
|
|
+ danger
|
|
|
|
|
+ :loading="rejectLoading"
|
|
|
|
|
+ :disabled="!canSubmitReview"
|
|
|
|
|
+ @click="submitReject"
|
|
|
|
|
+ >
|
|
|
|
|
+ 回退
|
|
|
|
|
+ </a-button>
|
|
|
|
|
+ </a-space>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-form>
|
|
</a-form>
|
|
|
</a-card>
|
|
</a-card>
|
|
@@ -81,7 +91,7 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { computed, h, onMounted, ref, watch } from 'vue';
|
|
import { computed, h, onMounted, ref, watch } from 'vue';
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
-import { message, Modal } from 'ant-design-vue';
|
|
|
|
|
|
|
+import { Input, message, Modal } from 'ant-design-vue';
|
|
|
import { RequestApiError } from '@imengyu/imengyu-utils';
|
|
import { RequestApiError } from '@imengyu/imengyu-utils';
|
|
|
import { ArrowLeftOutlined } from '@ant-design/icons-vue';
|
|
import { ArrowLeftOutlined } from '@ant-design/icons-vue';
|
|
|
import AssessmentContentApi, {
|
|
import AssessmentContentApi, {
|
|
@@ -120,6 +130,7 @@ const currentFormCheckItems = ref([] as SelfAssessmentCheckItemAnswer[]);
|
|
|
const checkItemList = ref([] as CheckItemInfo[]);
|
|
const checkItemList = ref([] as CheckItemInfo[]);
|
|
|
|
|
|
|
|
const submitLoading = ref(false);
|
|
const submitLoading = ref(false);
|
|
|
|
|
+const rejectLoading = ref(false);
|
|
|
const reviewOpinion = ref<number | null>(null);
|
|
const reviewOpinion = ref<number | null>(null);
|
|
|
const reviewPoints = ref<number | null>(null);
|
|
const reviewPoints = ref<number | null>(null);
|
|
|
|
|
|
|
@@ -261,6 +272,74 @@ onMounted(() => {
|
|
|
loader.load();
|
|
loader.load();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+/** 回退后 progress:退回至上一环节 */
|
|
|
|
|
+const rejectTargetProgress = computed(() => Math.max(1, reviewProgress.value - 1));
|
|
|
|
|
+
|
|
|
|
|
+function promptRejectReason() {
|
|
|
|
|
+ const draft = ref('');
|
|
|
|
|
+ return new Promise<string | null>((resolve) => {
|
|
|
|
|
+ Modal.confirm({
|
|
|
|
|
+ title: '回退自查评估表',
|
|
|
|
|
+ okText: '确认回退',
|
|
|
|
|
+ cancelText: '取消',
|
|
|
|
|
+ okType: 'danger',
|
|
|
|
|
+ width: 800,
|
|
|
|
|
+ content: () => h(Input.TextArea, {
|
|
|
|
|
+ value: draft.value,
|
|
|
|
|
+ rows: 4,
|
|
|
|
|
+ maxlength: 500,
|
|
|
|
|
+ showCount: true,
|
|
|
|
|
+ placeholder: '请输入回退原因(必填)',
|
|
|
|
|
+ 'onUpdate:value': (v: string) => {
|
|
|
|
|
+ draft.value = v ?? '';
|
|
|
|
|
+ },
|
|
|
|
|
+ }),
|
|
|
|
|
+ onOk: () => {
|
|
|
|
|
+ const reason = draft.value.trim();
|
|
|
|
|
+ if (!reason) {
|
|
|
|
|
+ message.warning('请输入回退原因');
|
|
|
|
|
+ return Promise.reject();
|
|
|
|
|
+ }
|
|
|
|
|
+ resolve(reason);
|
|
|
|
|
+ },
|
|
|
|
|
+ onCancel: () => {
|
|
|
|
|
+ resolve(null);
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+async function submitReject() {
|
|
|
|
|
+ const f = currentForm.value;
|
|
|
|
|
+ if (!f?.id) {
|
|
|
|
|
+ message.warning('缺少自查表 ID');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!canSubmitReview.value) {
|
|
|
|
|
+ message.warning('当前账号用户组无权回退');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const rejectReason = await promptRejectReason();
|
|
|
|
|
+ if (rejectReason === null)
|
|
|
|
|
+ return;
|
|
|
|
|
+ const t = reviewProgress.value;
|
|
|
|
|
+ try {
|
|
|
|
|
+ rejectLoading.value = true;
|
|
|
|
|
+ await AssessmentContentApi.reviewSelfAssessment({
|
|
|
|
|
+ id: f.id,
|
|
|
|
|
+ progress: rejectTargetProgress.value,
|
|
|
|
|
+ rejectType: t,
|
|
|
|
|
+ rejectReason,
|
|
|
|
|
+ });
|
|
|
|
|
+ message.success('已回退');
|
|
|
|
|
+ router.back();
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ Modal.error({ title: '回退失败', content: formatErr(e) });
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ rejectLoading.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
async function submitReview() {
|
|
async function submitReview() {
|
|
|
const f = currentForm.value;
|
|
const f = currentForm.value;
|
|
|
if (!f?.id) {
|
|
if (!f?.id) {
|