chore: prepare release build
This commit is contained in:
@@ -273,25 +273,58 @@ async function openDetailFromRouteQuery() {
|
||||
await loadDetail(reportId);
|
||||
}
|
||||
|
||||
async function publishReport(row: Pick<AdminReportListItem, "id" | "report_status"> | { id: number; report_status: string }) {
|
||||
type PublishReportTarget = Pick<AdminReportListItem, "id" | "report_status" | "report_type" | "material_tag_bound"> | {
|
||||
id: number;
|
||||
report_status: string;
|
||||
report_type: string;
|
||||
material_tag_bound: boolean;
|
||||
};
|
||||
|
||||
async function promptReportMaterialTagInput() {
|
||||
try {
|
||||
const result = await ElMessageBox.prompt("是否已鉴定完成并确定发布报告?", "绑定验真吊牌并发布报告", {
|
||||
type: "warning",
|
||||
inputPlaceholder: "请扫描验真吊牌二维码",
|
||||
inputPattern: /\S+/,
|
||||
inputErrorMessage: "请扫描验真吊牌二维码",
|
||||
confirmButtonText: "是的,去绑定验真吊牌",
|
||||
cancelButtonText: "取消",
|
||||
closeOnClickModal: false,
|
||||
});
|
||||
return String(result.value || "").trim();
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
async function publishReport(row: PublishReportTarget) {
|
||||
if (row.report_status !== "pending_publish") {
|
||||
ElMessage.warning("仅待发布报告可以执行发布");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await ElMessageBox.confirm("发布后用户端将可查看正式报告并进行验真,是否继续?", "发布报告", {
|
||||
type: "warning",
|
||||
confirmButtonText: "确认发布",
|
||||
cancelButtonText: "取消",
|
||||
});
|
||||
} catch {
|
||||
return;
|
||||
const needMaterialTag = row.report_type !== "inspection" && !row.material_tag_bound;
|
||||
let qrInput = "";
|
||||
if (needMaterialTag) {
|
||||
qrInput = await promptReportMaterialTagInput();
|
||||
if (!qrInput) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
await ElMessageBox.confirm("发布后用户端将可查看正式报告并进行验真,是否继续?", "发布报告", {
|
||||
type: "warning",
|
||||
confirmButtonText: "确认发布",
|
||||
cancelButtonText: "取消",
|
||||
});
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
publishingId.value = row.id;
|
||||
try {
|
||||
const response = await adminApi.publishReport(row.id);
|
||||
const response = await adminApi.publishReport(row.id, qrInput);
|
||||
if (response.code !== 0) {
|
||||
ElMessage.error(response.message || "报告发布失败");
|
||||
return;
|
||||
@@ -427,6 +460,12 @@ watch(
|
||||
<OrderStatusTag :status="row.report_status_text" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="验真吊牌" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<OrderStatusTag v-if="row.report_type !== 'inspection'" :status="row.material_tag_bound ? '已绑定' : '未绑定'" />
|
||||
<span v-else class="detail-label">不适用</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="institution_name" label="出具机构" min-width="160" />
|
||||
<el-table-column prop="publish_time" label="发布时间" min-width="170" />
|
||||
<el-table-column label="操作" fixed="right" width="220">
|
||||
@@ -464,7 +503,12 @@ watch(
|
||||
v-if="canPublishCurrentReport"
|
||||
type="primary"
|
||||
:loading="publishingId === detail.report_header.id"
|
||||
@click="publishReport({ id: detail.report_header.id, report_status: detail.report_header.report_status })"
|
||||
@click="publishReport({
|
||||
id: detail.report_header.id,
|
||||
report_status: detail.report_header.report_status,
|
||||
report_type: detail.report_header.report_type,
|
||||
material_tag_bound: Boolean(detail.material_tag),
|
||||
})"
|
||||
>
|
||||
发布报告
|
||||
</el-button>
|
||||
@@ -496,6 +540,32 @@ watch(
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-card">
|
||||
<div class="detail-card__title">验真吊牌</div>
|
||||
<template v-if="detail.report_header.report_type === 'inspection'">
|
||||
<div class="detail-card__desc">
|
||||
<div class="detail-value">补录检查单不需要绑定验真吊牌</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="detail.material_tag">
|
||||
<div class="detail-card__desc">
|
||||
<div class="detail-label">二维码链接</div>
|
||||
<div class="detail-value" style="word-break: break-all;">{{ detail.material_tag.qr_url }}</div>
|
||||
</div>
|
||||
<div class="detail-card__desc">
|
||||
<div class="detail-label">验真编码</div>
|
||||
<div class="detail-value">{{ detail.material_tag.verify_code }}</div>
|
||||
</div>
|
||||
<div class="detail-card__desc">
|
||||
<div class="detail-label">绑定时间</div>
|
||||
<div class="detail-value">{{ detail.material_tag.bound_at || "-" }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<div v-else class="detail-card__desc">
|
||||
<div class="detail-value">未绑定,发布前需要扫描验真吊牌。</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="detail-card">
|
||||
<div class="detail-card__title">商品信息</div>
|
||||
<div class="detail-card__desc">
|
||||
@@ -652,7 +722,7 @@ watch(
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="detail.report_header.service_provider !== 'zhongjian'" class="detail-card" style="grid-column: 1 / -1">
|
||||
<div class="detail-card" style="grid-column: 1 / -1">
|
||||
<div class="detail-card__title">扫码与公开链接</div>
|
||||
<div style="display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start;">
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user