|
@@ -60,6 +60,15 @@
|
|
|
>
|
|
>
|
|
|
提交审核
|
|
提交审核
|
|
|
</Button>
|
|
</Button>
|
|
|
|
|
+ <Button
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ block
|
|
|
|
|
+ :loading="rejectLoading"
|
|
|
|
|
+ :touchable="canSubmitReview"
|
|
|
|
|
+ @click="submitReject"
|
|
|
|
|
+ >
|
|
|
|
|
+ 回退
|
|
|
|
|
+ </Button>
|
|
|
</FlexCol>
|
|
</FlexCol>
|
|
|
</FlexCol>
|
|
</FlexCol>
|
|
|
</template>
|
|
</template>
|
|
@@ -109,6 +118,7 @@ const currentFormCheckItems = ref<SelfAssessmentCheckItemAnswer[]>([]);
|
|
|
const checkItemList = ref<CheckItemInfo[]>([]);
|
|
const checkItemList = ref<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);
|
|
|
|
|
|
|
@@ -254,6 +264,68 @@ watch(reviewProgress, () => {
|
|
|
applyPrefillFromDetail(f as SelfAssessmentDetail);
|
|
applyPrefillFromDetail(f as SelfAssessmentDetail);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+/** 回退后 progress:退回至上一环节 */
|
|
|
|
|
+const rejectTargetProgress = computed(() => Math.max(1, reviewProgress.value - 1));
|
|
|
|
|
+
|
|
|
|
|
+function promptRejectReason() {
|
|
|
|
|
+ return new Promise<string | null>((resolve) => {
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: '回退自查评估表',
|
|
|
|
|
+ editable: true,
|
|
|
|
|
+ placeholderText: '请输入回退原因(必填)',
|
|
|
|
|
+ content: '',
|
|
|
|
|
+ confirmText: '确认回退',
|
|
|
|
|
+ cancelText: '取消',
|
|
|
|
|
+ success: (res) => {
|
|
|
|
|
+ if (!res.confirm) {
|
|
|
|
|
+ resolve(null);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const reason = (res.content ?? '').trim();
|
|
|
|
|
+ if (!reason) {
|
|
|
|
|
+ toast('请输入回退原因');
|
|
|
|
|
+ resolve(null);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ resolve(reason);
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: () => resolve(null),
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+async function submitReject() {
|
|
|
|
|
+ const f = currentForm.value;
|
|
|
|
|
+ if (!f?.id) {
|
|
|
|
|
+ toast('缺少自查表 ID');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!canSubmitReview.value) {
|
|
|
|
|
+ toast('当前账号用户组无权回退');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const rejectReason = await promptRejectReason();
|
|
|
|
|
+ if (rejectReason === null)
|
|
|
|
|
+ return;
|
|
|
|
|
+ const t = reviewProgress.value;
|
|
|
|
|
+ rejectLoading.value = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ await AssessmentContentApi.reviewSelfAssessment({
|
|
|
|
|
+ id: f.id,
|
|
|
|
|
+ progress: rejectTargetProgress.value,
|
|
|
|
|
+ rejectType: t,
|
|
|
|
|
+ rejectReason,
|
|
|
|
|
+ });
|
|
|
|
|
+ toast('已回退');
|
|
|
|
|
+ await waitTimeOut(400);
|
|
|
|
|
+ uni.navigateBack();
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ alert({ title: '回退失败', content: formatError(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) {
|