feat: add report review publish flow
This commit is contained in:
@@ -41,6 +41,14 @@ const supplementForm = reactive({
|
||||
|
||||
const isZhongjian = computed(() => detail.value?.task_info.service_provider === "zhongjian");
|
||||
const isTaskReadonly = computed(() => {
|
||||
const reportStatus = detail.value?.report_summary?.report_status || "";
|
||||
if (["draft", "pending_publish", "updated", "rejected"].includes(reportStatus)) {
|
||||
return false;
|
||||
}
|
||||
if (reportStatus === "published") {
|
||||
return true;
|
||||
}
|
||||
|
||||
const status = detail.value?.task_info.status || "";
|
||||
return status === "submitted" || status === "completed";
|
||||
});
|
||||
@@ -293,7 +301,7 @@ function confirmPublishReport() {
|
||||
return new Promise<boolean>((resolve) => {
|
||||
uni.showModal({
|
||||
title: "提交确认",
|
||||
content: "是否已鉴定完成并确定发布报告?",
|
||||
content: "是否已鉴定完成并提交报告待发布?",
|
||||
cancelText: "取消",
|
||||
confirmText: "去绑定",
|
||||
success: (result) => resolve(Boolean(result.confirm)),
|
||||
@@ -558,7 +566,7 @@ async function submitResult(action: "save" | "submit") {
|
||||
}),
|
||||
);
|
||||
if (action === "submit") {
|
||||
returnToWorkOrders("验真吊牌已绑定,报告已发布");
|
||||
returnToWorkOrders("报告已提交,待管理员发布");
|
||||
return;
|
||||
}
|
||||
showInfoToast("鉴定已保存");
|
||||
@@ -659,7 +667,7 @@ async function submitZhongjianReport() {
|
||||
report_files: zhongjianFiles.value,
|
||||
qr_input: qrInput,
|
||||
});
|
||||
returnToWorkOrders("验真吊牌已绑定,报告已发布");
|
||||
returnToWorkOrders("报告已提交,待管理员发布");
|
||||
} catch (error) {
|
||||
showErrorToast(error, "中检报告录入失败");
|
||||
} finally {
|
||||
@@ -953,7 +961,7 @@ onShow(() => {
|
||||
</button>
|
||||
</view>
|
||||
<view v-if="!isTaskReadonly || detail.report_summary?.id" class="form-actions" :class="detail.report_summary?.id && !isTaskReadonly ? '' : 'form-actions--single'">
|
||||
<button v-if="!isTaskReadonly" class="form-action form-action--primary" :disabled="submitting" @click="submitZhongjianReport">提交并发布</button>
|
||||
<button v-if="!isTaskReadonly" class="form-action form-action--primary" :disabled="submitting" @click="submitZhongjianReport">提交待发布</button>
|
||||
<button v-if="detail.report_summary?.id" class="form-action form-action--secondary" @click="openReportDetail">查看报告</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user