|
|
@@ -9,25 +9,23 @@
|
|
|
<el-button type="primary" @click="handleViewChangeRecord"> 查看变更记录 </el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="license-container">
|
|
|
+ <div class="license-container" v-if="licenseImage">
|
|
|
<div class="license-display">
|
|
|
- <el-image
|
|
|
- v-if="licenseImage"
|
|
|
- :src="licenseImage"
|
|
|
- fit="contain"
|
|
|
- class="license-image"
|
|
|
- :preview-src-list="[licenseImage]"
|
|
|
- />
|
|
|
- <div v-else class="empty-image-box">
|
|
|
- <el-icon class="empty-icon">
|
|
|
- <Picture />
|
|
|
- </el-icon>
|
|
|
- </div>
|
|
|
+ <el-image :src="licenseImage" fit="contain" class="license-image" :preview-src-list="[licenseImage]" />
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+ <div v-else class="empty-license">
|
|
|
+ <el-empty description="暂无食品经营许可证" :image-size="100" />
|
|
|
+ </div>
|
|
|
<!-- 更换食品经营许可证弹窗 -->
|
|
|
- <el-dialog v-model="replaceDialogVisible" title="更换食品经营许可证" width="600px" :before-close="handleReplaceDialogClose">
|
|
|
+ <el-dialog
|
|
|
+ v-model="replaceDialogVisible"
|
|
|
+ title="更换食品经营许可证"
|
|
|
+ width="600px"
|
|
|
+ :before-close="handleReplaceDialogClose"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ >
|
|
|
<div class="replace-upload-area" :class="{ 'upload-full': uploadedImageCount >= 1 }">
|
|
|
<el-upload
|
|
|
v-model:file-list="fileList"
|
|
|
@@ -111,24 +109,29 @@ import { ref, computed, onMounted } from "vue";
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import { Picture, Plus } from "@element-plus/icons-vue";
|
|
|
import type { UploadProps, UploadFile } from "element-plus";
|
|
|
-import { getFoodBusinessLicense, uploadContractImage, submitFoodLicenseReview } from "@/api/modules/licenseManagement";
|
|
|
+import {
|
|
|
+ getFoodBusinessLicense,
|
|
|
+ uploadContractImage,
|
|
|
+ submitFoodLicenseReview,
|
|
|
+ getChangeRecords,
|
|
|
+ getStoreFoodLicenceStatus
|
|
|
+} from "@/api/modules/licenseManagement";
|
|
|
import { localGet } from "@/utils";
|
|
|
|
|
|
-interface ChangeRecordItem {
|
|
|
- id: string;
|
|
|
- status: "pending" | "success" | "failed";
|
|
|
- imgUrl: string; // 图片URL
|
|
|
- rejectionReason?: string;
|
|
|
-}
|
|
|
+// 状态映射对象
|
|
|
+const statusMap: Record<number, { name: string; class: string }> = {
|
|
|
+ 1: { name: "审核通过", class: "status-success" },
|
|
|
+ 2: { name: "审核中", class: "status-pending" },
|
|
|
+ 3: { name: "审核拒绝", class: "status-failed" }
|
|
|
+};
|
|
|
+
|
|
|
const id = localGet("createdId");
|
|
|
|
|
|
const licenseImage = ref<string>("");
|
|
|
const replaceDialogVisible = ref(false);
|
|
|
const changeRecordDialogVisible = ref(false);
|
|
|
const fileList = ref<UploadFile[]>([]);
|
|
|
-const currentRecordDate = ref("2025.08.01 10:29");
|
|
|
-const changeRecordList = ref<ChangeRecordItem[]>([]);
|
|
|
-const rejectionReason = ref("");
|
|
|
+const changeRecordList = ref<any>([]);
|
|
|
|
|
|
// ==================== 图片上传相关变量 ====================
|
|
|
const uploading = ref(false);
|
|
|
@@ -174,12 +177,20 @@ const initData = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-const handleReplace = () => {
|
|
|
+const handleReplace = async () => {
|
|
|
fileList.value = [];
|
|
|
imageUrlList.value = [];
|
|
|
pendingUploadFiles.value = [];
|
|
|
uploading.value = false;
|
|
|
- replaceDialogVisible.value = true;
|
|
|
+ const params = {
|
|
|
+ id: localGet("createdId")
|
|
|
+ };
|
|
|
+ const res: any = await getStoreFoodLicenceStatus(params);
|
|
|
+ if (res.data.foodLicenceStatus === 2) {
|
|
|
+ ElMessage.warning("食品经营许可证审核中,请耐心等待");
|
|
|
+ } else {
|
|
|
+ replaceDialogVisible.value = true;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const handleViewChangeRecord = async () => {
|
|
|
@@ -598,18 +609,12 @@ const getStatusText = (status: string) => {
|
|
|
border-radius: 8px;
|
|
|
box-shadow: 0 2px 12px rgb(0 0 0 / 10%);
|
|
|
}
|
|
|
-.empty-image-box {
|
|
|
+.empty-license {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- background-color: var(--el-fill-color-lighter);
|
|
|
- border-radius: 8px;
|
|
|
- .empty-icon {
|
|
|
- font-size: 64px;
|
|
|
- color: var(--el-text-color-placeholder);
|
|
|
- }
|
|
|
+ min-height: 570px;
|
|
|
+ padding: 40px 20px;
|
|
|
}
|
|
|
.replace-upload-area {
|
|
|
min-height: 300px;
|
|
|
@@ -683,75 +688,92 @@ const getStatusText = (status: string) => {
|
|
|
color: #8c939d;
|
|
|
}
|
|
|
}
|
|
|
+.change-record-scrollbar {
|
|
|
+ :deep(.el-scrollbar__wrap) {
|
|
|
+ overflow-x: hidden;
|
|
|
+ }
|
|
|
+}
|
|
|
.change-record-content {
|
|
|
- padding: 20px 0;
|
|
|
- .record-date {
|
|
|
- margin-bottom: 20px;
|
|
|
- font-size: 16px;
|
|
|
- font-weight: 500;
|
|
|
- color: var(--el-text-color-primary);
|
|
|
- }
|
|
|
- .record-items {
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- gap: 15px;
|
|
|
- margin-bottom: 20px;
|
|
|
- }
|
|
|
- .record-item {
|
|
|
- position: relative;
|
|
|
- width: 150px;
|
|
|
- height: 150px;
|
|
|
- overflow: hidden;
|
|
|
- border-radius: 8px;
|
|
|
- .record-status-badge {
|
|
|
- position: absolute;
|
|
|
- right: 0;
|
|
|
- bottom: 0;
|
|
|
- left: 0;
|
|
|
- z-index: 1;
|
|
|
- padding: 4px 8px;
|
|
|
- font-size: 12px;
|
|
|
+ .record-group {
|
|
|
+ padding: 20px;
|
|
|
+ margin-bottom: 30px;
|
|
|
+ background-color: var(--el-fill-color-lighter);
|
|
|
+ &:last-child {
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+ .record-date {
|
|
|
+ margin-bottom: 15px;
|
|
|
+ font-size: 16px;
|
|
|
font-weight: 500;
|
|
|
- text-align: center;
|
|
|
- border-radius: 0 0 8px 8px;
|
|
|
- &.status-pending {
|
|
|
- color: #e6a23c;
|
|
|
- background-color: rgb(253 246 236 / 95%);
|
|
|
- border-top: 1px solid #e6a23c;
|
|
|
- }
|
|
|
- &.status-success {
|
|
|
- color: #67c23a;
|
|
|
- background-color: rgb(240 249 255 / 95%);
|
|
|
- border-top: 1px solid #67c23a;
|
|
|
- }
|
|
|
- &.status-failed {
|
|
|
- color: #f56c6c;
|
|
|
- background-color: rgb(254 240 240 / 95%);
|
|
|
- border-top: 1px solid #f56c6c;
|
|
|
- }
|
|
|
+ color: var(--el-text-color-primary);
|
|
|
}
|
|
|
- .record-image {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- .image-slot {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
+ .record-items {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 15px;
|
|
|
+ }
|
|
|
+ .record-item {
|
|
|
+ position: relative;
|
|
|
+ width: 150px;
|
|
|
+ height: 150px;
|
|
|
+ overflow: hidden;
|
|
|
+ border-radius: 8px;
|
|
|
+ .record-status-badge {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ z-index: 1;
|
|
|
+ padding: 4px 8px;
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: 500;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 0 0 8px 8px;
|
|
|
+ &.status-pending {
|
|
|
+ color: #e6a23c;
|
|
|
+ background-color: rgb(253 246 236 / 90%);
|
|
|
+ border-top: 1px solid #e6a23c;
|
|
|
+ }
|
|
|
+ &.status-success {
|
|
|
+ color: #67c23a;
|
|
|
+ background-color: rgb(240 249 255 / 90%);
|
|
|
+ border-top: 1px solid #67c23a;
|
|
|
+ }
|
|
|
+ &.status-failed {
|
|
|
+ color: #f56c6c;
|
|
|
+ background-color: rgb(254 240 240 / 90%);
|
|
|
+ border-top: 1px solid #f56c6c;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .record-image {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
- font-size: 30px;
|
|
|
- color: var(--el-text-color-placeholder);
|
|
|
- background: var(--el-fill-color-light);
|
|
|
+ .image-slot {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ font-size: 30px;
|
|
|
+ color: var(--el-text-color-placeholder);
|
|
|
+ background: var(--el-fill-color-light);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ .rejection-reason {
|
|
|
+ margin-top: 15px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: var(--el-text-color-regular);
|
|
|
+ border-radius: 8px;
|
|
|
+ }
|
|
|
}
|
|
|
- .rejection-reason {
|
|
|
- padding: 15px;
|
|
|
- margin-top: 20px;
|
|
|
- font-size: 14px;
|
|
|
- color: var(--el-text-color-regular);
|
|
|
- background-color: var(--el-fill-color-lighter);
|
|
|
- border-radius: 8px;
|
|
|
- }
|
|
|
+}
|
|
|
+.empty-record {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ min-height: 300px;
|
|
|
+ padding: 40px 20px;
|
|
|
}
|
|
|
</style>
|