|
|
|
|
@ -1,8 +1,18 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="business-coop-management">
|
|
|
|
|
<!-- Search input -->
|
|
|
|
|
<div class="search-container">
|
|
|
|
|
<!-- <div class="search-container">
|
|
|
|
|
<a-input-search v-model:value="searchKeyword" placeholder="请输入关键字" style="width: 320px" @search="getTable" @change="handleChangeSearch" allowClear />
|
|
|
|
|
</div> -->
|
|
|
|
|
<div class="header-container">
|
|
|
|
|
<div class="left-container">
|
|
|
|
|
<a-input-search v-model:value="searchKeyword" placeholder="请输入关键字" style="width: 320px" @search="getTable" @change="handleChangeSearch" allowClear />
|
|
|
|
|
</div>
|
|
|
|
|
<a-radio-group v-model:value="activeTab" style="margin-left: 16px">
|
|
|
|
|
<a-radio-button value="all" style="width: 80px; text-align: center">全部</a-radio-button>
|
|
|
|
|
<a-radio-button value="pending" style="width: 80px; text-align: center">待审核</a-radio-button>
|
|
|
|
|
<a-radio-button value="approved" style="width: 80px; text-align: center">已审核</a-radio-button>
|
|
|
|
|
</a-radio-group>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Business coop table -->
|
|
|
|
|
@ -55,9 +65,13 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<!-- Operation column -->
|
|
|
|
|
<template v-if="column.dataIndex === 'operate'">
|
|
|
|
|
<!-- <template v-if="column.dataIndex === 'operate'">
|
|
|
|
|
<a href="javascript:" @click="showExamineModal(record)">审核</a>
|
|
|
|
|
</template>
|
|
|
|
|
</template> -->
|
|
|
|
|
<template v-if="column.dataIndex === 'operate'">
|
|
|
|
|
<span v-if="record.finished === 1" style="color: #999; cursor: not-allowed;">已审核</span>
|
|
|
|
|
<a v-else href="javascript:" @click="showExamineModal(record)">审核</a>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</a-table>
|
|
|
|
|
|
|
|
|
|
@ -92,9 +106,9 @@
|
|
|
|
|
<div class="display-flex">
|
|
|
|
|
<span style="max-width: 475px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">{{ formState.address }}</span>
|
|
|
|
|
|
|
|
|
|
<span class="iconfont icon-dizhi f14" style="color: #999; line-height: 32px; margin-left: 6px; cursor: pointer" v-if="!formState.address" @click="showMapModal()"></span>
|
|
|
|
|
<span class="iconfont icon-dizhi f14" style="color: #999; line-height: 32px; margin-left: 6px; cursor: pointer" v-if="!formState.address" @click="handleOpenMap('address')"></span>
|
|
|
|
|
|
|
|
|
|
<span class="iconfont icon-dizhi f14" v-if="formState.address" style="color: #1890ff; line-height: 32px; margin-left: 6px; cursor: pointer" @click="showMapModal()"></span>
|
|
|
|
|
<span class="iconfont icon-dizhi f14" v-if="formState.address" style="color: #1890ff; line-height: 32px; margin-left: 6px; cursor: pointer" @click="handleOpenMap('address')"></span>
|
|
|
|
|
</div>
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
|
@ -135,12 +149,20 @@
|
|
|
|
|
<a-modal :visible="imageModalVisible" title="查看图片" @ok="imageModalVisible = false" @cancel="imageModalVisible = false">
|
|
|
|
|
<img :src="currentImage" alt="Image" style="max-width: 100%; max-height: 80vh" />
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
|
|
|
<!-- 高德POI搜索 -->
|
|
|
|
|
<a-modal v-model:open="poiModal.isShow" title="位置" width="800px" :zIndex="1001" centered :footer="false" :destroyOnClose="true" :forceRender="true">
|
|
|
|
|
<div class style="height: calc(100vh - 200px); overflow-y: auto">
|
|
|
|
|
<mapPOIpanel :info="poiModal" @submitEvent="getPoiInfo" />
|
|
|
|
|
</div>
|
|
|
|
|
</a-modal>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
import { ref, reactive, onMounted, watch, getCurrentInstance } from "vue";
|
|
|
|
|
import { message } from "ant-design-vue";
|
|
|
|
|
import mapPOIpanel from "../components/poi.vue"; // 地图插件
|
|
|
|
|
import { getBusinessCoopList, addAgency, getTemplateList, getChannelUserList } from "@/api/bussinessCoop";
|
|
|
|
|
const commonJS = getCurrentInstance().appContext.app.config.globalProperties.G;
|
|
|
|
|
// State
|
|
|
|
|
@ -160,6 +182,7 @@ const searchForm = reactive({
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
keyword: "",
|
|
|
|
|
status: "", // 新增字段
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const coopTypesArray = [
|
|
|
|
|
@ -204,6 +227,7 @@ const formState = reactive({
|
|
|
|
|
lngLatStr: "",
|
|
|
|
|
updateContactTime: 0,
|
|
|
|
|
desp: "",
|
|
|
|
|
businessCooperationId:'',
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Form item layout
|
|
|
|
|
@ -289,17 +313,6 @@ window.addEventListener("resize", () => {
|
|
|
|
|
tableHeight.value = window.innerHeight - 381;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Methods
|
|
|
|
|
const getTable = async () => {
|
|
|
|
|
searchForm.keyword = searchKeyword.value;
|
|
|
|
|
searchForm.pageNum = 1;
|
|
|
|
|
pagination.current = 1;
|
|
|
|
|
await fetchBusinessCoopList();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleChangeSearch = () => {
|
|
|
|
|
searchForm.keyword = searchKeyword.value;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const fetchBusinessCoopList = async () => {
|
|
|
|
|
loading.value = true;
|
|
|
|
|
@ -324,6 +337,50 @@ const fetchBusinessCoopList = async () => {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Methods
|
|
|
|
|
const getTable = async () => {
|
|
|
|
|
searchForm.keyword = searchKeyword.value;
|
|
|
|
|
searchForm.pageNum = 1;
|
|
|
|
|
pagination.current = 1;
|
|
|
|
|
|
|
|
|
|
// 同步 activeTab 的值到 status
|
|
|
|
|
if (activeTab.value === "all") {
|
|
|
|
|
searchForm.status = "";
|
|
|
|
|
} else if (activeTab.value === "pending") {
|
|
|
|
|
searchForm.status = 2;
|
|
|
|
|
} else if (activeTab.value === "approved") {
|
|
|
|
|
searchForm.status = 1;
|
|
|
|
|
}
|
|
|
|
|
await fetchBusinessCoopList();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleChangeSearch = () => {
|
|
|
|
|
searchForm.keyword = searchKeyword.value;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const activeTab = ref("all");
|
|
|
|
|
|
|
|
|
|
// 根据 activeTab 设置 status 参数
|
|
|
|
|
watch(
|
|
|
|
|
() => activeTab.value,
|
|
|
|
|
(newVal) => {
|
|
|
|
|
if (newVal === "all") {
|
|
|
|
|
searchForm.status = ""; // 全部不传参
|
|
|
|
|
} else if (newVal === "pending") {
|
|
|
|
|
searchForm.status = 2;
|
|
|
|
|
} else if (newVal === "approved") {
|
|
|
|
|
searchForm.status = 1;
|
|
|
|
|
}
|
|
|
|
|
fetchBusinessCoopList(); // 切换时重新获取数据
|
|
|
|
|
},
|
|
|
|
|
{ immediate: true }
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleTableChange = (pag) => {
|
|
|
|
|
pagination.current = pag.current;
|
|
|
|
|
searchForm.pageNum = pag.current;
|
|
|
|
|
@ -337,11 +394,13 @@ const handlePageChange = (page) => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const showExamineModal = (record) => {
|
|
|
|
|
console.log(record);
|
|
|
|
|
// Pre-fill form data if needed
|
|
|
|
|
formState.agencyName = record.companyName || "";
|
|
|
|
|
formState.userName = record.userName || "";
|
|
|
|
|
formState.tel = record.tel || "";
|
|
|
|
|
formState.address = record.address || "";
|
|
|
|
|
formState.businessCooperationId = record.id || "";
|
|
|
|
|
entryShowExamine.value = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -373,9 +432,48 @@ const showImageModal = (imageUrl) => {
|
|
|
|
|
currentImage.value = imageUrl;
|
|
|
|
|
imageModalVisible.value = true;
|
|
|
|
|
};
|
|
|
|
|
/* #################### 高德POI弹窗模块 #################### */
|
|
|
|
|
const poiModal = ref({
|
|
|
|
|
isShow: false,
|
|
|
|
|
name: "",
|
|
|
|
|
address: "",
|
|
|
|
|
lat: "",
|
|
|
|
|
lng: "",
|
|
|
|
|
type: "",
|
|
|
|
|
});
|
|
|
|
|
const submitForm = ref({});
|
|
|
|
|
const handleOpenMap = ($type) => {
|
|
|
|
|
// 打开地图弹窗
|
|
|
|
|
poiModal.value = {
|
|
|
|
|
isShow: true,
|
|
|
|
|
// name: submitForm.value.aliasName,
|
|
|
|
|
address: submitForm.value.address,
|
|
|
|
|
lat: commonJS.isNotEmptyCheck(submitForm.value.lat) ? submitForm.value.lat : 0,
|
|
|
|
|
lng: commonJS.isNotEmptyCheck(submitForm.value.lng) ? submitForm.value.lng : 0,
|
|
|
|
|
type: $type,
|
|
|
|
|
};
|
|
|
|
|
console.log("poiModal.value", poiModal.value);
|
|
|
|
|
};
|
|
|
|
|
const getPoiInfo = (e) => {
|
|
|
|
|
console.log("获取地图选择信息:", e, " -- 类型:", poiModal.value.type);
|
|
|
|
|
// 关闭弹窗
|
|
|
|
|
poiModal.value.isShow = false;
|
|
|
|
|
// 赋值
|
|
|
|
|
var reg = /.+?(省|市|自治区|自治州|县|区)/g; // 省市区的正则
|
|
|
|
|
if (poiModal.value.type == "address") {
|
|
|
|
|
submitForm.value.address = e.pointInfo.address;
|
|
|
|
|
submitForm.value.district = e.initInfo.district
|
|
|
|
|
.match(reg)
|
|
|
|
|
.filter((item, index) => item)
|
|
|
|
|
.join(",");
|
|
|
|
|
submitForm.value.lat = e.initInfo.lat;
|
|
|
|
|
submitForm.value.lng = e.initInfo.lng;
|
|
|
|
|
submitForm.value.mdistrict = e.initInfo.mdistrict;
|
|
|
|
|
formState.address = e.pointInfo.address;
|
|
|
|
|
formState.lngLatStr = e.initInfo.lng+','+e.initInfo.lat;
|
|
|
|
|
|
|
|
|
|
const showMapModal = () => {
|
|
|
|
|
// Implement map modal logic here
|
|
|
|
|
}
|
|
|
|
|
console.log(submitForm.value);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const handleChange = () => {
|
|
|
|
|
@ -426,4 +524,16 @@ onMounted(async () => {
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
.header-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
/* justify-content: space-between; */
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.left-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
|