fix: allow rejected report resubmission
This commit is contained in:
@@ -55,6 +55,7 @@ const isTaskReadonly = computed(() => {
|
||||
const internalTagNo = computed(() => detail.value?.task_info.internal_tag_no || "");
|
||||
const resultSummary = computed(() => detail.value?.result_info.result_text || "暂未填写");
|
||||
const reportSummary = computed(() => detail.value?.report_summary?.report_no || "");
|
||||
const hasBoundMaterialTag = computed(() => Boolean(detail.value?.material_tag?.id));
|
||||
type AppraisalTemplate = NonNullable<AdminAppraisalTaskDetail["appraisal_template"]>;
|
||||
|
||||
function hasConditionFields(template?: AppraisalTemplate | null) {
|
||||
@@ -297,13 +298,13 @@ function returnToWorkOrders(message: string) {
|
||||
}, 700);
|
||||
}
|
||||
|
||||
function confirmPublishReport() {
|
||||
function confirmPublishReport(requiresMaterialTag = true) {
|
||||
return new Promise<boolean>((resolve) => {
|
||||
uni.showModal({
|
||||
title: "提交确认",
|
||||
content: "是否已鉴定完成并提交报告待发布?",
|
||||
cancelText: "取消",
|
||||
confirmText: "去绑定",
|
||||
confirmText: requiresMaterialTag ? "去绑定" : "提交",
|
||||
success: (result) => resolve(Boolean(result.confirm)),
|
||||
fail: () => resolve(false),
|
||||
});
|
||||
@@ -513,9 +514,19 @@ async function submitResult(action: "save" | "submit") {
|
||||
return;
|
||||
}
|
||||
|
||||
const qrInput = action === "submit" ? await confirmAndScanMaterialTag() : "";
|
||||
if (action === "submit" && !qrInput) {
|
||||
return;
|
||||
let qrInput = "";
|
||||
if (action === "submit") {
|
||||
if (hasBoundMaterialTag.value) {
|
||||
const confirmed = await confirmPublishReport(false);
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
qrInput = await confirmAndScanMaterialTag();
|
||||
if (!qrInput) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
submitting.value = true;
|
||||
|
||||
Reference in New Issue
Block a user