|
|
@@ -31,7 +31,7 @@
|
|
|
list-type="picture-card"
|
|
|
:limit="1"
|
|
|
:on-exceed="handleExceed"
|
|
|
- :on-success="(response, file) => handleUploadSuccess(response, file, 'ID_CARD')"
|
|
|
+ :on-success="(response, file) => handleUploadSuccess(response, file, 'ID_CARD', '身份证')"
|
|
|
:on-preview="handlePictureCardPreview"
|
|
|
:on-remove="handleRemove"
|
|
|
accept="image/*"
|
|
|
@@ -55,7 +55,7 @@
|
|
|
list-type="picture-card"
|
|
|
:limit="1"
|
|
|
:on-exceed="handleExceed"
|
|
|
- :on-success="(response, file) => handleUploadSuccess(response, file, 'ID_CARD')"
|
|
|
+ :on-success="(response, file) => handleUploadSuccess(response, file, 'ID_CARD', '身份证')"
|
|
|
:on-preview="handlePictureCardPreview"
|
|
|
:on-remove="handleRemove"
|
|
|
accept="image/*"
|
|
|
@@ -136,7 +136,7 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="经营板块" prop="businessSection">
|
|
|
- <el-radio-group v-model="step2Form.businessSection" @change="changeBusinessSector">
|
|
|
+ <el-radio-group v-model="step2Form.businessSection" @change="changeBusinessSection">
|
|
|
<el-radio
|
|
|
v-for="businessSection in businessSectionList"
|
|
|
:value="businessSection.dictId"
|
|
|
@@ -147,39 +147,32 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <!-- 如果有二级分类数据,显示经营种类 -->
|
|
|
- <el-form-item label="经营种类" prop="businessTypes" v-if="secondLevelList.length > 0">
|
|
|
- <el-radio-group v-model="step2Form.businessTypes" @change="changeBusinessSecondLevel">
|
|
|
- <el-radio v-for="item in secondLevelList" :value="item.dictId" :key="item.dictId">
|
|
|
- {{ item.dictDetail }}
|
|
|
+ <el-form-item label="标签" prop="storeTickets" v-if="showDisportLicence">
|
|
|
+ <el-radio-group v-model="step2Form.storeTickets">
|
|
|
+ <el-radio
|
|
|
+ v-for="businessSection in businessLabelList"
|
|
|
+ :value="businessSection.dictId"
|
|
|
+ :key="businessSection.dictId"
|
|
|
+ >
|
|
|
+ {{ businessSection.dictDetail }}
|
|
|
</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <!-- 只有当有三级分类数据且已选中经营种类时,才显示分类(三级分类多选) -->
|
|
|
- <el-form-item
|
|
|
- label="分类"
|
|
|
- prop="businessSecondLevel"
|
|
|
- v-if="thirdLevelList && thirdLevelList.length > 0 && step2Form.businessTypes"
|
|
|
- >
|
|
|
- <el-checkbox-group v-model="step2Form.businessSecondLevel">
|
|
|
- <el-checkbox v-for="item in thirdLevelList" :key="item.dictId" :label="item.dictDetail" :value="item.dictId" />
|
|
|
- </el-checkbox-group>
|
|
|
+ <!-- 经营种类 -->
|
|
|
+ <el-form-item label="经营种类" prop="businessTypeName">
|
|
|
+ <el-input v-model="step2Form.businessTypeName" type="textarea" :rows="3" placeholder="请输入" maxlength="255" />
|
|
|
</el-form-item>
|
|
|
|
|
|
- <!-- <el-form-item label="分类" prop="businessSecondLevel">
|
|
|
- <el-radio-group v-model="step2Form.businessSecondLevel" @change="changeBusinessSecondLevel">
|
|
|
- <el-radio v-for="item in secondLevelList" :value="item.dictId" :key="item.dictId">
|
|
|
- {{ item.dictDetail }}
|
|
|
- </el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item> -->
|
|
|
- <el-form-item label="是否提供餐食" prop="businessSecondMeal" v-if="showMealOption">
|
|
|
- <el-radio-group v-model="step2Form.businessSecondMeal" @change="changeBusinessSecondMeal">
|
|
|
- <el-radio v-for="item in secondMealList" :value="item.value" :key="item.key">
|
|
|
- {{ item.dictDetail }}
|
|
|
- </el-radio>
|
|
|
- </el-radio-group>
|
|
|
+ <!-- 经营类目 -->
|
|
|
+ <el-form-item label="经营类目" prop="businessCategoryName">
|
|
|
+ <el-input
|
|
|
+ v-model="step2Form.businessCategoryName"
|
|
|
+ type="textarea"
|
|
|
+ :rows="3"
|
|
|
+ placeholder="请输入"
|
|
|
+ maxlength="255"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
|
|
|
@@ -215,6 +208,15 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
+ <!-- 店铺评价(三项绑定 storePj 数组,校验才能通过) -->
|
|
|
+ <el-form-item label="店铺评价" prop="storePj" required>
|
|
|
+ <div class="store-pj-inputs">
|
|
|
+ <el-input v-model="step2Form.storePj[0]" placeholder="请输入" maxlength="2" clearable class="store-pj-input" />
|
|
|
+ <el-input v-model="step2Form.storePj[1]" maxlength="2" placeholder="请输入" clearable class="store-pj-input" />
|
|
|
+ <el-input v-model="step2Form.storePj[2]" placeholder="请输入" maxlength="2" clearable class="store-pj-input" />
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="营业执照" prop="businessLicenseAddress">
|
|
|
<el-upload
|
|
|
v-model:file-list="step2Form.businessLicenseAddress"
|
|
|
@@ -232,55 +234,19 @@
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <!-- 合同图片上传表单项 - 已隐藏 (2026-01-17) -->
|
|
|
- <!-- <el-form-item label="合同图片" prop="contractImageList">
|
|
|
- <el-upload
|
|
|
- v-model:file-list="step2Form.contractImageList"
|
|
|
- :http-request="handleHttpUpload"
|
|
|
- list-type="picture-card"
|
|
|
- :limit="20"
|
|
|
- :on-exceed="handleExceed"
|
|
|
- :on-success="(response, file) => handleUploadSuccess(response, file, '', '合同图片')"
|
|
|
- :on-preview="handlePictureCardPreview"
|
|
|
- >
|
|
|
- <el-icon><Plus /></el-icon>
|
|
|
- <template #tip>
|
|
|
- <div class="el-upload__tip">({{ step2Form.contractImageList.length }}/20)</div>
|
|
|
- </template>
|
|
|
- </el-upload>
|
|
|
- </el-form-item> -->
|
|
|
-
|
|
|
- <!-- 食品经营许可证上传表单项 - 已隐藏 (2026-01-17) -->
|
|
|
- <!-- <el-form-item label="食品经营许可证" prop="foodLicenceImgList" v-if="showFoodLicence">
|
|
|
- <el-upload
|
|
|
- v-model:file-list="step2Form.foodLicenceImgList"
|
|
|
- :http-request="handleHttpUpload"
|
|
|
- list-type="picture-card"
|
|
|
- :limit="1"
|
|
|
- :on-exceed="handleExceed"
|
|
|
- :on-success="(response, file) => handleUploadSuccess(response, file, 'FOOD_MANAGE_LICENSE', '食品经营许可证')"
|
|
|
- :on-preview="handlePictureCardPreview"
|
|
|
- >
|
|
|
- <el-icon><Plus /></el-icon>
|
|
|
- <template #tip>
|
|
|
- <div class="el-upload__tip">({{ step2Form.foodLicenceImgList.length }}/1)</div>
|
|
|
- </template>
|
|
|
- </el-upload>
|
|
|
- </el-form-item> -->
|
|
|
-
|
|
|
- <el-form-item label="其他资质证明" prop="disportLicenceImgList" v-if="showDisportLicence">
|
|
|
+ <el-form-item label="其他资质证明" prop="disportLicenceImgList">
|
|
|
<el-upload
|
|
|
v-model:file-list="step2Form.disportLicenceImgList"
|
|
|
:http-request="handleHttpUpload"
|
|
|
+ :limit="20"
|
|
|
list-type="picture-card"
|
|
|
- :limit="1"
|
|
|
:on-exceed="handleExceed"
|
|
|
:on-success="(response, file) => handleUploadSuccess(response, file, 'BUSINESS_LICENSE', '其他资质证明')"
|
|
|
:on-preview="handlePictureCardPreview"
|
|
|
>
|
|
|
<el-icon><Plus /></el-icon>
|
|
|
<template #tip>
|
|
|
- <div class="el-upload__tip">({{ step2Form.disportLicenceImgList.length }}/1)</div>
|
|
|
+ <div class="el-upload__tip">已上传 {{ step2Form.disportLicenceImgList.length }} 张(最多20张)</div>
|
|
|
</template>
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
@@ -307,15 +273,7 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { ref, reactive, watch, onMounted, computed } from "vue";
|
|
|
-import {
|
|
|
- ElMessage,
|
|
|
- ElMessageBox,
|
|
|
- type FormInstance,
|
|
|
- type FormRules,
|
|
|
- UploadProps,
|
|
|
- UploadUserFile,
|
|
|
- UploadRequestOptions
|
|
|
-} from "element-plus";
|
|
|
+import { ElMessage, ElMessageBox, type FormInstance, type FormRules, UploadUserFile, UploadRequestOptions } from "element-plus";
|
|
|
import { Plus } from "@element-plus/icons-vue";
|
|
|
|
|
|
import {
|
|
|
@@ -333,7 +291,7 @@ import { useAuthStore } from "@/stores/modules/auth";
|
|
|
const authStore = useAuthStore();
|
|
|
const userInfo = localGet("geeker-user")?.userInfo || {};
|
|
|
const latShow = ref(false);
|
|
|
-
|
|
|
+const showDisportLicence = ref(false);
|
|
|
// 图片预览相关
|
|
|
const imageViewerVisible = ref(false);
|
|
|
const imageViewerUrlList = ref<string[]>([]);
|
|
|
@@ -353,19 +311,35 @@ const entryList = ref([
|
|
|
title: "入驻成功"
|
|
|
}
|
|
|
]);
|
|
|
+const businessLabelList = ref<any[]>([
|
|
|
+ {
|
|
|
+ dictId: 1,
|
|
|
+ dictDetail: "装修公司"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictId: 2,
|
|
|
+ dictDetail: "其他类型"
|
|
|
+ }
|
|
|
+]);
|
|
|
|
|
|
+const businessSectionList = ref<any[]>([
|
|
|
+ {
|
|
|
+ dictId: 1,
|
|
|
+ dictDetail: "特色美食"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictId: 2,
|
|
|
+ dictDetail: "休闲娱乐"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dictId: 3,
|
|
|
+ dictDetail: "生活服务"
|
|
|
+ }
|
|
|
+]);
|
|
|
// 身份证正反面上传列表
|
|
|
const idCardFrontList = ref<UploadUserFile[]>([]);
|
|
|
const idCardBackList = ref<UploadUserFile[]>([]);
|
|
|
-//
|
|
|
-const showFoodLicence = ref(true);
|
|
|
-const changeBusinessSecondMeal = (value: any) => {
|
|
|
- if (value == 0) {
|
|
|
- showFoodLicence.value = false;
|
|
|
- } else {
|
|
|
- showFoodLicence.value = true;
|
|
|
- }
|
|
|
-};
|
|
|
+
|
|
|
// OCR 识别结果
|
|
|
const ocrResult = ref<{
|
|
|
name?: string;
|
|
|
@@ -420,135 +394,50 @@ const isIdCardUploadComplete = computed(() => {
|
|
|
return idCardFrontList.value.length > 0 && idCardBackList.value.length > 0;
|
|
|
});
|
|
|
|
|
|
-// 计算是否需要显示其他资质证明(酒吧或KTV时显示)
|
|
|
-const showDisportLicence = computed(() => {
|
|
|
- const sectionName = step2Form.businessSectionName;
|
|
|
- const sectionId = step2Form.businessSection;
|
|
|
-
|
|
|
- // 通过名称判断(最直接的方式)
|
|
|
- if (sectionName === "酒吧" || sectionName === "KTV" || sectionName === "ktv") {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- // 通过查找 businessSectionList 来判断(兼容 id 和 dictId)
|
|
|
- if (businessSectionList.value.length > 0 && sectionId) {
|
|
|
- const selectedSection = businessSectionList.value.find((item: any) => {
|
|
|
- // 匹配 id 或 dictId
|
|
|
- const isMatchId =
|
|
|
- item.id === sectionId ||
|
|
|
- item.dictId === sectionId ||
|
|
|
- String(item.id) === String(sectionId) ||
|
|
|
- String(item.dictId) === String(sectionId);
|
|
|
- // 匹配名称
|
|
|
- const isMatchName = item.dictDetail === "酒吧" || item.dictDetail === "KTV" || item.dictDetail === "ktv";
|
|
|
- return isMatchId && isMatchName;
|
|
|
- });
|
|
|
-
|
|
|
- if (selectedSection) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 通过 dictId 判断(KTV 的 dictId 通常是 "3")
|
|
|
- if (String(sectionId) === "3") {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
-});
|
|
|
-
|
|
|
-// 计算是否需要显示"是否提供餐食"(KTV、按摩足疗、丽人美发、运动健身、洗浴汗蒸时显示)
|
|
|
-const showMealOption = computed(() => {
|
|
|
- const sectionName = step2Form.businessSectionName;
|
|
|
- const sectionId = step2Form.businessSection;
|
|
|
-
|
|
|
- // 需要显示的经营板块名称列表
|
|
|
- const mealSectionNames = ["KTV", "ktv", "按摩足疗", "丽人美发", "运动健身", "洗浴汗蒸"];
|
|
|
-
|
|
|
- // 通过名称判断(最直接的方式)
|
|
|
- if (mealSectionNames.includes(sectionName)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- // 通过查找 businessSectionList 来判断(兼容 id 和 dictId)
|
|
|
- if (businessSectionList.value.length > 0 && sectionId) {
|
|
|
- const selectedSection = businessSectionList.value.find((item: any) => {
|
|
|
- // 匹配 id 或 dictId
|
|
|
- const isMatchId =
|
|
|
- item.dictId === sectionId ||
|
|
|
- item.dictId === sectionId ||
|
|
|
- String(item.dictId) === String(sectionId) ||
|
|
|
- String(item.dictId) === String(sectionId);
|
|
|
- // 匹配名称
|
|
|
- const isMatchName = mealSectionNames.includes(item.dictDetail);
|
|
|
- return isMatchId && isMatchName;
|
|
|
- });
|
|
|
-
|
|
|
- if (selectedSection) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 通过 dictId 判断(KTV=3, 按摩足疗=5, 丽人美发=6, 运动健身=7, 洗浴汗蒸=4)
|
|
|
- const mealSectionIds = ["3", "4", "5", "6", "7"];
|
|
|
- if (mealSectionIds.includes(String(sectionId))) {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
-});
|
|
|
-
|
|
|
// 下一步 - 验证身份证正反面是否已上传
|
|
|
const handleNextStep = async () => {
|
|
|
// 识别成功,进入下一步
|
|
|
- try {
|
|
|
- const res: any = await verifyIdInfo({
|
|
|
- idCard: ocrResult.value.idCard,
|
|
|
- name: ocrResult.value.name,
|
|
|
- appType: 1
|
|
|
- });
|
|
|
- if (res.code === 200) {
|
|
|
- ElMessage.success("身份证识别成功");
|
|
|
- setStep(2);
|
|
|
- } else {
|
|
|
- ElMessage.error(res?.msg || "身份证识别失败");
|
|
|
- }
|
|
|
- } catch (error: any) {
|
|
|
- console.log(error);
|
|
|
- }
|
|
|
+ // try {
|
|
|
+ // const res: any = await verifyIdInfo({
|
|
|
+ // idCard: ocrResult.value.idCard,
|
|
|
+ // name: ocrResult.value.name,
|
|
|
+ // appType: 1
|
|
|
+ // });
|
|
|
+ // if (res.code === 200) {
|
|
|
+ // ElMessage.success("身份证识别成功");
|
|
|
+ // setStep(2);
|
|
|
+ // } else {
|
|
|
+ // ElMessage.error(res?.msg || "身份证识别失败");
|
|
|
+ // }
|
|
|
+ // } catch (error: any) {
|
|
|
+ // console.log(error);
|
|
|
+ // }
|
|
|
+ setStep(2);
|
|
|
};
|
|
|
-
|
|
|
-const secondMealList = ref([
|
|
|
- { key: 1, value: 1, dictDetail: "提供" },
|
|
|
- { key: 0, value: 0, dictDetail: "不提供" }
|
|
|
-]);
|
|
|
const step2Rules: FormRules = {
|
|
|
storeName: [{ required: true, message: "请输入店铺名称", trigger: "blur" }],
|
|
|
storeCapacity: [{ required: true, message: "请输入容纳人数", trigger: "blur" }],
|
|
|
storeArea: [{ required: true, message: "请选择门店面积", trigger: "change" }],
|
|
|
storeBlurb: [{ required: true, message: "请输入门店简介", trigger: "change" }],
|
|
|
- storeIntro: [{ required: true, message: "请输入门店简介", trigger: "blur" }],
|
|
|
businessSection: [{ required: true, message: "请选择经营板块", trigger: "change" }],
|
|
|
- businessSecondLevel: [{ required: true, message: "请选择分类", trigger: "change" }],
|
|
|
- businessSecondMeal: [{ required: true, message: "请选择是否提供餐食", trigger: "change" }],
|
|
|
- businessTypes: [
|
|
|
+ storeTickets: [{ required: true, message: "请选择标签", trigger: "change" }],
|
|
|
+ businessTypeName: [{ required: true, message: "请输入经营种类", trigger: "change" }],
|
|
|
+ businessCategoryName: [{ required: true, message: "请选择经营类目", trigger: "change" }],
|
|
|
+ address: [{ required: true, message: "请输入经纬度", trigger: "blur" }],
|
|
|
+ businessLicenseAddress: [{ required: true, message: "请上传营业执照", trigger: "change" }],
|
|
|
+ storePj: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: "请选择经营种类",
|
|
|
- trigger: "change",
|
|
|
- validator: (rule: any, value: any, callback: any) => {
|
|
|
- if (!value || value.length === 0) {
|
|
|
- callback(new Error("请选择经营种类"));
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
+ message: "请完整填写三项店铺评价",
|
|
|
+ trigger: "blur",
|
|
|
+ validator: (_rule: any, value: any, callback: (err?: Error) => void) => {
|
|
|
+ const list = Array.isArray(value) ? value : [];
|
|
|
+ const filled = list.length >= 3 && list.every(v => v != null && String(v).trim() !== "");
|
|
|
+ if (filled) callback();
|
|
|
+ else callback(new Error("请完整填写三项店铺评价"));
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
- address: [{ required: true, message: "请输入经纬度", trigger: "blur" }],
|
|
|
- businessLicenseAddress: [{ required: true, message: "请上传营业执照", trigger: "change" }],
|
|
|
- // contractImageList: [{ required: true, message: "请上传合同图片", trigger: "change" }], // 已隐藏 (2026-01-17)
|
|
|
- // foodLicenceImgList: [{ required: true, message: "请上传食品经营许可证", trigger: "change" }], // 已隐藏 (2026-01-17)
|
|
|
disportLicenceImgList: [{ required: true, message: "请上传其他资质证明", trigger: "change" }]
|
|
|
};
|
|
|
|
|
|
@@ -591,6 +480,14 @@ watch(
|
|
|
}
|
|
|
);
|
|
|
|
|
|
+const changeBusinessSection = () => {
|
|
|
+ if (step2Form.businessSection == 3) {
|
|
|
+ showDisportLicence.value = true;
|
|
|
+ } else {
|
|
|
+ showDisportLicence.value = false;
|
|
|
+ step2Form.storeTickets = "";
|
|
|
+ }
|
|
|
+};
|
|
|
// 隐藏财务管理菜单的函数
|
|
|
const hideFinancialManagementMenu = () => {
|
|
|
const hideMenus = (menuList: any[]) => {
|
|
|
@@ -676,7 +573,6 @@ watch(
|
|
|
);
|
|
|
|
|
|
onMounted(() => {
|
|
|
- getBusinessSectionList();
|
|
|
callGetUserInfo();
|
|
|
if (currentStep.value === 3 && (storeApplicationStatus.value === 0 || storeApplicationStatus.value === 2)) {
|
|
|
updateStoreIdInCache();
|
|
|
@@ -708,8 +604,8 @@ const step2Form = reactive({
|
|
|
administrativeRegionDistrictAdcode: "",
|
|
|
storeAddress: "",
|
|
|
storeBlurb: "",
|
|
|
- businessSection: "1",
|
|
|
- businessSectionName: "",
|
|
|
+ businessSection: 1,
|
|
|
+ storeTickets: "" as string,
|
|
|
businessSecondLevel: [] as string[],
|
|
|
businessTypes: "" as string,
|
|
|
businessTypesList: [] as string[],
|
|
|
@@ -722,7 +618,13 @@ const step2Form = reactive({
|
|
|
contractImageList: [] as UploadUserFile[],
|
|
|
foodLicenceImgList: [] as UploadUserFile[],
|
|
|
disportLicenceImgList: [] as UploadUserFile[],
|
|
|
- address: ""
|
|
|
+ address: "",
|
|
|
+ // 经营种类
|
|
|
+ businessTypeName: "",
|
|
|
+ // 经营类目
|
|
|
+ businessCategoryName: "",
|
|
|
+ // 店铺评价(三项,与 prop="storePj" 对应,校验规则会检查此数组)
|
|
|
+ storePj: ["", "", ""] as string[]
|
|
|
});
|
|
|
|
|
|
// 返回按钮
|
|
|
@@ -768,89 +670,11 @@ watch(
|
|
|
}
|
|
|
);
|
|
|
|
|
|
-//经营板块 - 一级分类
|
|
|
-const businessSectionList = ref<any[]>([]);
|
|
|
-const getBusinessSectionList = async () => {
|
|
|
- try {
|
|
|
- const res: any = await getFirstLevelList({});
|
|
|
- if (res && res.code === 200 && res.data) {
|
|
|
- businessSectionList.value = res.data;
|
|
|
- // 如果有数据,自动加载第一个经营板块的二级分类(经营种类)
|
|
|
- if (res.data && res.data.length > 0) {
|
|
|
- const firstSection = res.data[0];
|
|
|
- const firstDictId = firstSection.dictId || firstSection.id;
|
|
|
- if (firstDictId) {
|
|
|
- try {
|
|
|
- const secondRes: any = await getSecondLevelList({ parentDictId: String(firstDictId) });
|
|
|
- if (secondRes && (secondRes.code === 200 || secondRes.code === "200") && secondRes.data) {
|
|
|
- secondLevelList.value = secondRes.data;
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error("获取二级分类失败:", error);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error("获取一级分类失败:", error);
|
|
|
- ElMessage.error("获取经营板块失败");
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
// 二级分类列表
|
|
|
const secondLevelList = ref<any[]>([]);
|
|
|
// 三级分类列表
|
|
|
const thirdLevelList = ref<any[]>([]);
|
|
|
|
|
|
-// 一级分类变化时,加载二级分类
|
|
|
-const changeBusinessSector = async (dictId: string | number | boolean | undefined) => {
|
|
|
- const dictIdStr = String(dictId || "");
|
|
|
- if (!dictIdStr) {
|
|
|
- secondLevelList.value = [];
|
|
|
- thirdLevelList.value = [];
|
|
|
- step2Form.businessSecondLevel = [];
|
|
|
- step2Form.businessTypes = "";
|
|
|
- step2Form.businessTypesList = [];
|
|
|
- step2Form.businessSection = "";
|
|
|
- step2Form.businessSectionName = "";
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- // 更新一级分类信息(模板中 :value 绑定的是 dictId,所以这里查找时优先使用 dictId)
|
|
|
- const selectedSection = businessSectionList.value.find(
|
|
|
- (item: any) => String(item.dictId) === dictIdStr || String(item.id) === dictIdStr
|
|
|
- );
|
|
|
-
|
|
|
- if (selectedSection) {
|
|
|
- // 保持与模板中 :value="businessSection.dictId" 绑定一致,使用 dictId
|
|
|
- step2Form.businessSection = String(selectedSection.dictId || selectedSection.id);
|
|
|
- step2Form.businessSectionName = selectedSection.dictDetail;
|
|
|
- } else {
|
|
|
- // 如果没找到,直接使用传入的值
|
|
|
- step2Form.businessSection = dictIdStr;
|
|
|
- step2Form.businessSectionName = "";
|
|
|
- }
|
|
|
-
|
|
|
- // 清空二级和三级分类
|
|
|
- secondLevelList.value = [];
|
|
|
- thirdLevelList.value = [];
|
|
|
- step2Form.businessSecondLevel = [];
|
|
|
- step2Form.businessTypes = "";
|
|
|
- step2Form.businessTypesList = [];
|
|
|
-
|
|
|
- // 加载二级分类(使用 dictId 作为 parentDictId)
|
|
|
- const parentDictId = selectedSection?.dictId || dictIdStr;
|
|
|
- try {
|
|
|
- const res: any = await getSecondLevelList({ parentDictId });
|
|
|
- if (res && (res.code === 200 || res.code === "200") && res.data) {
|
|
|
- secondLevelList.value = res.data;
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error("获取二级分类失败:", error);
|
|
|
- ElMessage.error("获取经营种类失败");
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
// 二级分类变化时,加载三级分类
|
|
|
const changeBusinessSecondLevel = async (dictId: string | number | boolean | undefined) => {
|
|
|
const dictIdStr = String(dictId || "");
|
|
|
@@ -899,7 +723,7 @@ const getLonAndLat = async (keyword: string) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-const selectAddress = async (param: any) => {
|
|
|
+const selectAddress = async () => {
|
|
|
if (!step2Form.address || typeof step2Form.address !== "string") {
|
|
|
ElMessage.warning("地址格式不正确,请重新选择");
|
|
|
return;
|
|
|
@@ -1104,7 +928,6 @@ const autoOcrRecognition = async (ocrType: string, name: string) => {
|
|
|
const validToDate = res.data[0]?.validToDate || "";
|
|
|
if (validToDate) {
|
|
|
entertainmentLicenceExpirationTime.value = formatDate(validToDate);
|
|
|
- console.log(entertainmentLicenceExpirationTime.value);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1120,9 +943,7 @@ const autoOcrRecognition = async (ocrType: string, name: string) => {
|
|
|
if (res.data && Array.isArray(res.data) && res.data.length > 0) {
|
|
|
const validToDate = res.data[0]?.validToDate || "";
|
|
|
if (validToDate) {
|
|
|
- console.log(formatDate(validToDate));
|
|
|
foodLicenceExpirationTime.value = formatDate(validToDate);
|
|
|
- console.log(foodLicenceExpirationTime.value);
|
|
|
}
|
|
|
}
|
|
|
foodLicenseOcrStatus.value = "success";
|
|
|
@@ -1132,22 +953,28 @@ const autoOcrRecognition = async (ocrType: string, name: string) => {
|
|
|
console.warn("OCR 识别失败:", res?.msg);
|
|
|
if (name === "营业执照") {
|
|
|
businessLicenseOcrStatus.value = "failed";
|
|
|
+ step2Form.businessLicenseAddress = [];
|
|
|
} else if (name === "其他资质证明") {
|
|
|
entertainmentLicenseOcrStatus.value = "failed";
|
|
|
+ step2Form.disportLicenceImgList = [];
|
|
|
} else if (ocrType === "FOOD_MANAGE_LICENSE") {
|
|
|
foodLicenseOcrStatus.value = "failed";
|
|
|
+ step2Form.foodLicenceImgList = [];
|
|
|
}
|
|
|
- ElMessage.error(res?.msg || "识别失败,请重试");
|
|
|
+ ElMessage.error(res?.msg || "识别失败,已清除该图片,请重新上传");
|
|
|
}
|
|
|
} catch (error) {
|
|
|
if (name === "营业执照") {
|
|
|
businessLicenseOcrStatus.value = "failed";
|
|
|
+ step2Form.businessLicenseAddress = [];
|
|
|
} else if (name === "其他资质证明") {
|
|
|
entertainmentLicenseOcrStatus.value = "failed";
|
|
|
+ step2Form.disportLicenceImgList = [];
|
|
|
} else if (ocrType === "FOOD_MANAGE_LICENSE") {
|
|
|
foodLicenseOcrStatus.value = "failed";
|
|
|
+ step2Form.foodLicenceImgList = [];
|
|
|
}
|
|
|
- ElMessage.error("识别失败,请重试");
|
|
|
+ ElMessage.error("识别失败,已清除该图片,请重新上传");
|
|
|
} finally {
|
|
|
isOcrProcessing.value = false;
|
|
|
}
|
|
|
@@ -1158,12 +985,16 @@ const handleUploadSuccess = (response: any, uploadFile: UploadUserFile, ocrType:
|
|
|
if (response?.fileUrl) {
|
|
|
uploadFile.url = response.fileUrl;
|
|
|
}
|
|
|
- // 只有指定的类型才进行 OCR 识别
|
|
|
+
|
|
|
+ // 其他资质证明不做 OCR,直接返回
|
|
|
+ if (name === "其他资质证明") {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 仅对身份证、营业执照、食品许可证做 OCR
|
|
|
if (ocrType && (ocrType === "ID_CARD" || ocrType === "BUSINESS_LICENSE" || ocrType === "FOOD_MANAGE_LICENSE")) {
|
|
|
if (name === "营业执照") {
|
|
|
businessLicenseOcrStatus.value = "none";
|
|
|
- } else if (name === "其他资质证明") {
|
|
|
- entertainmentLicenseOcrStatus.value = "none";
|
|
|
} else if (ocrType === "FOOD_MANAGE_LICENSE") {
|
|
|
foodLicenseOcrStatus.value = "none";
|
|
|
}
|
|
|
@@ -1282,7 +1113,8 @@ const buildWhereAddress = async (regionCodes: string[]) => {
|
|
|
}
|
|
|
return whereAddress;
|
|
|
};
|
|
|
-const handleAi = async () => {
|
|
|
+// 店铺入驻成功后调用 AI 审核接口(参考商家端:后台调用,不阻塞、不向用户展示结果)
|
|
|
+const handleAi = () => {
|
|
|
const businessLicenseUrls = getFileUrls(step2Form.businessLicenseAddress);
|
|
|
const contractImageUrls = getFileUrls(step2Form.contractImageList);
|
|
|
const foodLicenceUrls = getFileUrls(step2Form.foodLicenceImgList);
|
|
|
@@ -1291,20 +1123,17 @@ const handleAi = async () => {
|
|
|
const licenseImages = [...businessLicenseUrls, ...contractImageUrls, ...foodLicenceUrls, ...disportLicenceUrls].filter(Boolean);
|
|
|
|
|
|
const params: any = {
|
|
|
- business_scope: step2Form.storeBlurb,
|
|
|
+ business_scope: step2Form.storeBlurb || "",
|
|
|
contact_email: "",
|
|
|
- contact_name: userInfo.name,
|
|
|
- contact_phone: userInfo.phone,
|
|
|
+ contact_name: userInfo.name || "",
|
|
|
+ contact_phone: userInfo.phone || "",
|
|
|
license_images: licenseImages,
|
|
|
- merchant_name: step2Form.storeName,
|
|
|
- userId: userInfo.id
|
|
|
+ merchant_name: step2Form.storeName || "",
|
|
|
+ userId: userInfo.id || ""
|
|
|
};
|
|
|
- const res: any = await getAiapprovestoreInfo(params);
|
|
|
- if (res.code == 200) {
|
|
|
- ElMessage.success(res.msg || "AI智能审核成功");
|
|
|
- } else {
|
|
|
- ElMessage.error(res?.msg || "AI智能审核失败");
|
|
|
- }
|
|
|
+ getAiapprovestoreInfo(params).catch(aiError => {
|
|
|
+ console.error("AI店铺审核接口调用失败:", aiError);
|
|
|
+ });
|
|
|
};
|
|
|
// 提交
|
|
|
const handleSubmit = async () => {
|
|
|
@@ -1312,139 +1141,100 @@ const handleSubmit = async () => {
|
|
|
|
|
|
await step2FormRef.value.validate(async valid => {
|
|
|
if (valid) {
|
|
|
- // 检查OCR识别状态,如果有识别失败的证照,提示用户重新上传
|
|
|
- const failedLicenses: string[] = [];
|
|
|
- if (step2Form.businessLicenseAddress.length > 0 && businessLicenseOcrStatus.value === "failed") {
|
|
|
- failedLicenses.push("营业执照");
|
|
|
- }
|
|
|
- if (step2Form.foodLicenceImgList.length > 0 && foodLicenseOcrStatus.value === "failed") {
|
|
|
- failedLicenses.push("食品经营许可证");
|
|
|
- }
|
|
|
- if (step2Form.disportLicenceImgList.length > 0 && entertainmentLicenseOcrStatus.value === "failed") {
|
|
|
- failedLicenses.push("其他资质证明");
|
|
|
- }
|
|
|
-
|
|
|
- if (failedLicenses.length > 0) {
|
|
|
- ElMessage.warning("请重新上传证照");
|
|
|
- return;
|
|
|
- }
|
|
|
const businessLicenseUrls = getFileUrls(step2Form.businessLicenseAddress);
|
|
|
- // const contractImageUrls = getFileUrls(step2Form.contractImageList); // 已隐藏 (2026-01-17)
|
|
|
- // const foodLicenceUrls = getFileUrls(step2Form.foodLicenceImgList); // 已隐藏 (2026-01-17)
|
|
|
- const contractImageUrls: string[] = []; // 空数组替代 (2026-01-17)
|
|
|
- const foodLicenceUrls: string[] = []; // 空数组替代 (2026-01-17)
|
|
|
+ const contractImageUrls = getFileUrls(step2Form.contractImageList);
|
|
|
+ const foodLicenceUrls = getFileUrls(step2Form.foodLicenceImgList);
|
|
|
const disportLicenceUrls = getFileUrls(step2Form.disportLicenceImgList);
|
|
|
|
|
|
const whereAddress = await buildWhereAddress(step2Form.region);
|
|
|
|
|
|
- let storeStatus = 1;
|
|
|
- if (step2Form.businessType === "正常营业") {
|
|
|
- storeStatus = 1;
|
|
|
- } else if (step2Form.businessType === "暂停营业") {
|
|
|
- storeStatus = 0;
|
|
|
- } else if (step2Form.businessType === "筹建中") {
|
|
|
- storeStatus = 2;
|
|
|
- }
|
|
|
-
|
|
|
- const storeAreaNum = typeof step2Form.storeArea === "string" ? parseInt(step2Form.storeArea) : step2Form.storeArea;
|
|
|
-
|
|
|
- const addressObj = {
|
|
|
- address: queryAddress.value || "",
|
|
|
- longitude: parseFloat(step2Form.storePositionLongitude) || 0,
|
|
|
- latitude: parseFloat(step2Form.storePositionLatitude) || 0
|
|
|
- };
|
|
|
-
|
|
|
const storePosition =
|
|
|
step2Form.storePositionLongitude && step2Form.storePositionLatitude
|
|
|
? `${step2Form.storePositionLongitude},${step2Form.storePositionLatitude}`
|
|
|
: "";
|
|
|
+ const storePositionLatitude = parseFloat(step2Form.storePositionLatitude) || 0;
|
|
|
+ const storePositionLongitude = parseFloat(step2Form.storePositionLongitude) || 0;
|
|
|
|
|
|
- let fullStoreAddress = "";
|
|
|
- if (whereAddress.length > 0) {
|
|
|
- const provinceName = whereAddress[0]?.name || "";
|
|
|
- const cityName = whereAddress[1]?.name || "";
|
|
|
- const districtName = whereAddress[2]?.name || "";
|
|
|
- fullStoreAddress = `${provinceName}${cityName}${districtName}`;
|
|
|
- }
|
|
|
-
|
|
|
- // 获取身份证正反面URL
|
|
|
- const idCardFrontUrl = getFileUrls(idCardFrontList.value)[0] || "";
|
|
|
- const idCardBackUrl = getFileUrls(idCardBackList.value)[0] || "";
|
|
|
-
|
|
|
- // 处理经营种类和三级分类
|
|
|
- // 根据用户需求:如果有三级分类,传经营板块、经营种类(二级分类)、三级分类
|
|
|
- // 如果没有三级分类,传经营板块、经营种类(二级分类)
|
|
|
let finalBusinessTypes: string[] = [];
|
|
|
- let businessClassifyList: string[] = [];
|
|
|
-
|
|
|
if (thirdLevelList.value.length > 0) {
|
|
|
- // 有三级分类
|
|
|
- // businessTypes 存储三级分类的 dictId(字符串)
|
|
|
if (step2Form.businessTypes) {
|
|
|
finalBusinessTypes = [step2Form.businessTypes];
|
|
|
- businessClassifyList = [step2Form.businessTypes];
|
|
|
}
|
|
|
- // 如果有三级分类,还需要传递二级分类(经营种类)
|
|
|
- if (Array.isArray(step2Form.businessSecondLevel) && step2Form.businessSecondLevel.length > 0) {
|
|
|
- // 如果 finalBusinessTypes 为空,使用二级分类
|
|
|
- if (finalBusinessTypes.length === 0) {
|
|
|
- finalBusinessTypes = step2Form.businessSecondLevel;
|
|
|
- }
|
|
|
+ if (
|
|
|
+ Array.isArray(step2Form.businessSecondLevel) &&
|
|
|
+ step2Form.businessSecondLevel.length > 0 &&
|
|
|
+ finalBusinessTypes.length === 0
|
|
|
+ ) {
|
|
|
+ finalBusinessTypes = step2Form.businessSecondLevel;
|
|
|
}
|
|
|
} else {
|
|
|
- // 没有三级分类,使用二级分类(经营种类)
|
|
|
if (Array.isArray(step2Form.businessSecondLevel) && step2Form.businessSecondLevel.length > 0) {
|
|
|
finalBusinessTypes = step2Form.businessSecondLevel;
|
|
|
} else if (step2Form.businessTypes) {
|
|
|
- // 如果没有选择二级分类,使用 businessTypes(可能是二级分类的 dictId)
|
|
|
finalBusinessTypes = [step2Form.businessTypes];
|
|
|
} else if (step2Form.businessTypesList.length > 0) {
|
|
|
- // 使用旧的逻辑
|
|
|
finalBusinessTypes = step2Form.businessTypesList;
|
|
|
}
|
|
|
- // 没有三级分类时,businessClassifyList 保持为空数组
|
|
|
}
|
|
|
|
|
|
- const params = {
|
|
|
- foodLicenceExpirationTime: foodLicenceExpirationTime.value, //食品经营许可证到期时间
|
|
|
- entertainmentLicenceExpirationTime: entertainmentLicenceExpirationTime.value, //其他资质证明到期时间
|
|
|
- businessClassifyList: step2Form.businessSecondLevel, //三级分类
|
|
|
- mealProvided: step2Form.businessSecondMeal, //是否提供餐食
|
|
|
- entertainmentLicenseAddress: disportLicenceUrls, //其他资质证明
|
|
|
+ const businessTypesListVal = finalBusinessTypes.length > 0 ? finalBusinessTypes[0] : "";
|
|
|
+ // const categoryListVal = step2Form.businessCategoryName ? [step2Form.businessCategoryName] : [];
|
|
|
+
|
|
|
+ // 与商家端 storeInfo saveStoreInfo 入参保持一致(storeInfoDto + 提交覆盖项)
|
|
|
+ const storeInfoDto: any = {
|
|
|
+ updatedTime: null,
|
|
|
storeTel: userInfo.phone,
|
|
|
storeName: step2Form.storeName,
|
|
|
storeCapacity: step2Form.storeCapacity,
|
|
|
- storeArea: storeAreaNum,
|
|
|
+ storeArea: typeof step2Form.storeArea === "string" ? parseInt(step2Form.storeArea) : step2Form.storeArea,
|
|
|
isChain: step2Form.isChain,
|
|
|
- // storeDetailAddress: step2Form.storeDetailAddress,
|
|
|
storeAddress: step2Form.storeDetailAddress,
|
|
|
storeBlurb: step2Form.storeBlurb,
|
|
|
- businessSection: step2Form.businessSection,
|
|
|
- businessTypesList: finalBusinessTypes,
|
|
|
- storeStatus: storeStatus,
|
|
|
- businessStatus: step2Form.businessStatus,
|
|
|
- address: addressObj,
|
|
|
+ businessSection: String(step2Form.businessSection),
|
|
|
+ businessSectionName:
|
|
|
+ step2Form.businessSection == 1 ? "特色美食" : step2Form.businessSection == 2 ? "休闲娱乐" : "生活服务",
|
|
|
+ businessTypeName: step2Form.businessTypeName,
|
|
|
+ storeStatus: step2Form.businessType === "暂停营业" ? 0 : step2Form.businessType === "筹建中" ? 2 : 1,
|
|
|
+ queryAddress: queryAddress.value || "",
|
|
|
+ storePosition,
|
|
|
+ storePositionLatitude,
|
|
|
+ storePositionLongitude,
|
|
|
+ // businessTypesList: [businessTypesListVal],
|
|
|
+ // businessTypes: businessTypesListVal,
|
|
|
+ businessClassify: step2Form.businessCategoryName,
|
|
|
businessLicenseAddress: businessLicenseUrls,
|
|
|
+ businessLicenseUrl: businessLicenseUrls.join(","),
|
|
|
contractImageList: contractImageUrls,
|
|
|
- foodLicenceImgList: foodLicenceUrls,
|
|
|
- disportLicenceUrls: disportLicenceUrls,
|
|
|
- // storeAddress: fullStoreAddress,
|
|
|
- whereAddress: whereAddress,
|
|
|
- updatedTime: null,
|
|
|
- queryAddress: queryAddress.value,
|
|
|
- storePosition: storePosition,
|
|
|
- storePositionLatitude: parseFloat(step2Form.storePositionLatitude) || 0,
|
|
|
- storePositionLongitude: parseFloat(step2Form.storePositionLongitude) || 0,
|
|
|
- businessSectionName: step2Form.businessSectionName,
|
|
|
- businessTypes: finalBusinessTypes,
|
|
|
- foodLicenceUrl: foodLicenceUrls.length > 0 ? foodLicenceUrls[0] : "",
|
|
|
+ foodLicenceUrl: foodLicenceUrls,
|
|
|
+ otherQualificationImages: disportLicenceUrls,
|
|
|
+ otherLicenses: disportLicenceUrls.join(","),
|
|
|
+ storeEvaluate: (step2Form.storePj || []).join(","),
|
|
|
+ evaluation1: step2Form.storePj[0],
|
|
|
+ evaluation2: step2Form.storePj[1],
|
|
|
+ evaluation3: step2Form.storePj[2],
|
|
|
userAccount: userInfo.id,
|
|
|
- administrativeRegionProvinceAdcode: step2Form.administrativeRegionProvinceAdcode,
|
|
|
- administrativeRegionCityAdcode: step2Form.administrativeRegionCityAdcode,
|
|
|
- administrativeRegionDistrictAdcode: step2Form.administrativeRegionDistrictAdcode,
|
|
|
- idCardFrontUrl: idCardFrontUrl,
|
|
|
- idCardBackUrl: idCardBackUrl
|
|
|
+ administrativeRegionProvinceAdcode: step2Form.administrativeRegionProvinceAdcode || whereAddress[0]?.adcode || "",
|
|
|
+ administrativeRegionProvinceName: whereAddress[0]?.name || "",
|
|
|
+ administrativeRegionCityAdcode: step2Form.administrativeRegionCityAdcode || whereAddress[1]?.adcode || "",
|
|
|
+ administrativeRegionCityName: whereAddress[1]?.name || "",
|
|
|
+ administrativeRegionDistrictAdcode: step2Form.administrativeRegionDistrictAdcode || whereAddress[2]?.adcode || "",
|
|
|
+ administrativeRegionDistrictName: whereAddress[2]?.name || "",
|
|
|
+ businessStatus: step2Form.businessStatus,
|
|
|
+ storeContact: userInfo.name || (localGet("smName") as string) || "",
|
|
|
+ idCard: localGet("idCard") || ""
|
|
|
+ };
|
|
|
+
|
|
|
+ if (String(step2Form.businessSection) === "3") {
|
|
|
+ storeInfoDto.storeTickets = step2Form.storeTickets;
|
|
|
+ }
|
|
|
+
|
|
|
+ const saveStoreInfoParams = {
|
|
|
+ ...storeInfoDto,
|
|
|
+ foodLicenceUrl: foodLicenceUrls.join(","),
|
|
|
+ mealsFlag: step2Form.businessSecondMeal === 1 ? 1 : 0,
|
|
|
+ createdUserId: userInfo.id || ""
|
|
|
};
|
|
|
+
|
|
|
ElMessageBox.confirm("确认提交入驻申请吗?", "提示", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
@@ -1452,23 +1242,24 @@ const handleSubmit = async () => {
|
|
|
})
|
|
|
.then(async () => {
|
|
|
try {
|
|
|
- const res: any = await applyStore(params);
|
|
|
+ const res: any = await applyStore(saveStoreInfoParams);
|
|
|
if (res && res.code == 200) {
|
|
|
storeApplicationStatus.value = 0;
|
|
|
- ElMessage.success(res.msg);
|
|
|
+ ElMessage.success(res.msg || "提交成功");
|
|
|
+ if (res.data?.id) {
|
|
|
+ localSet("createdId", res.data.id);
|
|
|
+ }
|
|
|
callGetUserInfo();
|
|
|
setStep(0);
|
|
|
handleAi();
|
|
|
} else {
|
|
|
- ElMessage.error(res.msg || "提交失败");
|
|
|
+ ElMessage.error(res?.msg || "提交失败");
|
|
|
}
|
|
|
} catch (error) {
|
|
|
ElMessage.error("提交失败,请重试");
|
|
|
}
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- // 取消提交
|
|
|
- });
|
|
|
+ .catch(() => {});
|
|
|
} else {
|
|
|
ElMessage.error("请完善表单信息");
|
|
|
}
|
|
|
@@ -1482,6 +1273,17 @@ const handleExceed = () => {
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
+// 店铺评价三个输入框纵向排列
|
|
|
+.store-pj-inputs {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 12px;
|
|
|
+ width: 100%;
|
|
|
+ .store-pj-input {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// 表单页面样式
|
|
|
.form-container {
|
|
|
min-height: calc(100vh - 100px);
|