|
|
@@ -22,7 +22,7 @@
|
|
|
<el-col :span="8">
|
|
|
<div class="form-item">
|
|
|
<span class="label">所属公司:</span>
|
|
|
- <span class="value">{{ detailData.ownedCompany || '-' }}</span>
|
|
|
+ <span class="value">{{ getCompanyName(detailData.ownedCompany) }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
@@ -48,14 +48,14 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="form-item">
|
|
|
- <span class="label">供应商类型:</span>
|
|
|
- <span class="value">{{ detailData.supplierType || '-' }}</span>
|
|
|
+ <span class="label">供应商等级:</span>
|
|
|
+ <span class="value">{{ getSupplierLevelName(detailData.cooperateLevel) }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="form-item">
|
|
|
<span class="label">企业规模:</span>
|
|
|
- <span class="value">{{ detailData.membershipSize || '-' }}</span>
|
|
|
+ <span class="value">{{ getEnterpriseScaleName(detailData.membershipSize) }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -64,13 +64,13 @@
|
|
|
<el-col :span="8">
|
|
|
<div class="form-item">
|
|
|
<span class="label">行业类型:</span>
|
|
|
- <span class="value">{{ detailData.industrCategory || '-' }}</span>
|
|
|
+ <span class="value">{{ getIndustryCategoryName(detailData.industrCategory) }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<div class="form-item">
|
|
|
<span class="label">供应商类型:</span>
|
|
|
- <span class="value">{{ detailData.cooperationType || '-' }}</span>
|
|
|
+ <span class="value">{{ getSupplierTypeName(detailData.supplierType) }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
@@ -127,7 +127,7 @@
|
|
|
<el-col :span="8">
|
|
|
<div class="form-item">
|
|
|
<span class="label">详细地址:</span>
|
|
|
- <span class="value">{{ detailData.officeProvince }} {{ detailData.officeCity }}</span>
|
|
|
+ <span class="value">{{ getAreaName(detailData.officeProvince, detailData.officeCity, detailData.officeCounty) }}</span>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="16">
|
|
|
@@ -434,13 +434,13 @@
|
|
|
<span>{{ scope.row.categorysMap?.threeLevelName || '-' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="authorizationEndTime" label="禁止时间" align="center">
|
|
|
+ <el-table-column prop="authorizationEndTime" label="截止时间" align="center">
|
|
|
<template #default="scope">
|
|
|
<span>{{ scope.row.authorizationEndTime ? formatDate(scope.row.authorizationEndTime) : '-' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="province" label="网段区域(内)" align="center" />
|
|
|
- <el-table-column prop="city" label="网段区域(外)" align="center" />
|
|
|
+ <el-table-column prop="province" label="授权区域(省)" align="center" />
|
|
|
+ <el-table-column prop="city" label="授权区域(市)" align="center" />
|
|
|
<el-table-column prop="authorizedStatus" label="状态" align="center">
|
|
|
<template #default="scope">
|
|
|
<span>{{ getAuthorizedStatusText(scope.row.authorizedStatus) }}</span>
|
|
|
@@ -469,16 +469,20 @@
|
|
|
<div class="section-title">地址信息列表</div>
|
|
|
<el-table :data="addressList" border style="width: 100%">
|
|
|
<el-table-column prop="supplierNo" label="供应商编号" align="center" />
|
|
|
- <el-table-column prop="addressId" label="地址编号" align="center" />
|
|
|
- <el-table-column prop="province" label="省份" align="center" />
|
|
|
- <el-table-column prop="city" label="市区县" align="center" />
|
|
|
+ <el-table-column prop="addressNo" label="地址编号" align="center" />
|
|
|
+ <el-table-column prop="shipperName" label="姓名" align="center" />
|
|
|
+ <el-table-column prop="shipperPhone" label="手机号码" align="center" />
|
|
|
<el-table-column label="详细地址" align="center">
|
|
|
<template #default="scope">
|
|
|
- <span>{{ scope.row.detailAddress || '-' }}</span>
|
|
|
+ <span>{{ scope.row.shippingAddress || '-' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="shippingPostCode" label="邮政编码" align="center" />
|
|
|
+ <el-table-column prop="isSelf" label="默认地址" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ scope.row.isSelf === '1' ? '是' : '否' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="contactPerson" label="联系人姓名" align="center" />
|
|
|
- <el-table-column prop="contactPhone" label="联系人电话" align="center" />
|
|
|
<el-table-column label="操作" align="center" width="120">
|
|
|
<template #default>
|
|
|
<el-button link type="primary">查看</el-button>
|
|
|
@@ -618,8 +622,9 @@
|
|
|
import { ref, onMounted } from 'vue';
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
import { ArrowLeft, Plus } from '@element-plus/icons-vue';
|
|
|
-import { getInfo, getStaffListSplice, getSupplierStaffIds, getContactListById, getProductCategoryList, getSupplierCategories, getSupplierContractsById, getBankBySupplierId, getAuthorizeDetailList } from '@/api/customer/info';
|
|
|
+import { getInfo, getStaffListSplice, getSupplierStaffIds, getContactListById, getProductCategoryList, getSupplierCategories, getSupplierContractsById, getBankBySupplierId, getAuthorizeDetailList, getCompanyList, getSupplierTypeList, getDictData, getSupplierAddressById, getSupplierLevelList, getEnterpriseScaleList, getIndustryCategoryList } from '@/api/customer/info';
|
|
|
import { InfoVO } from '@/api/customer/info/types';
|
|
|
+import { regionData, codeToText } from 'element-china-area-data';
|
|
|
|
|
|
const route = useRoute();
|
|
|
const router = useRouter();
|
|
|
@@ -641,6 +646,33 @@ const contactSearchParams = ref({
|
|
|
userName: ''
|
|
|
});
|
|
|
|
|
|
+// 公司列表数据
|
|
|
+const companyList = ref<any[]>([]);
|
|
|
+
|
|
|
+// 供应商类型列表数据
|
|
|
+const supplierTypeList = ref<any[]>([]);
|
|
|
+
|
|
|
+// 供应商等级列表数据
|
|
|
+const supplierLevelList = ref<any[]>([]);
|
|
|
+
|
|
|
+// 企业规模列表数据
|
|
|
+const enterpriseScaleList = ref<any[]>([]);
|
|
|
+
|
|
|
+// 行业类别列表数据
|
|
|
+const industryCategoryList = ref<any[]>([]);
|
|
|
+
|
|
|
+// 省市区数据
|
|
|
+const areaOptions = regionData;
|
|
|
+
|
|
|
+// 办公地址省市区选择
|
|
|
+const officeAreaCode = ref<string[]>([]);
|
|
|
+
|
|
|
+// 注册地址省市区选择
|
|
|
+const businessAreaCode = ref<string[]>([]);
|
|
|
+
|
|
|
+// 企业规模字典数据
|
|
|
+const membershipSizeDict = ref<any[]>([]);
|
|
|
+
|
|
|
// 供应信息相关数据
|
|
|
const productCategoryList = ref<any[]>([]);
|
|
|
const selectedCategories = ref<string[]>([]);
|
|
|
@@ -664,6 +696,19 @@ const getAuthorizationList = async () => {
|
|
|
// 地址管理列表(静态数据)
|
|
|
const addressList = ref<any[]>([]);
|
|
|
|
|
|
+/** 获取地址列表 */
|
|
|
+const getAddressList = async () => {
|
|
|
+ const id = route.query.id as string;
|
|
|
+ if (!id) return;
|
|
|
+
|
|
|
+ try {
|
|
|
+ const res = await getSupplierAddressById(id);
|
|
|
+ addressList.value = res.data || [];
|
|
|
+ } catch (e) {
|
|
|
+ console.error('获取地址列表失败:', e);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
// 付款信息列表(静态数据)
|
|
|
const paymentInfoList = ref<any[]>([]);
|
|
|
|
|
|
@@ -683,6 +728,147 @@ const getPaymentInfo = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+/** 获取公司列表 */
|
|
|
+const getCompanyData = async () => {
|
|
|
+ try {
|
|
|
+ const res = await getCompanyList();
|
|
|
+ console.log('公司列表原始响应:', res);
|
|
|
+ companyList.value = res.rows || res.data || [];
|
|
|
+ console.log('公司列表:', companyList.value);
|
|
|
+ } catch (e) {
|
|
|
+ console.error('获取公司列表失败:', e);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+/** 根据公司ID获取公司名称 */
|
|
|
+const getCompanyName = (companyId: string) => {
|
|
|
+ if (!companyId) return '-';
|
|
|
+ console.log('查找公司ID:', companyId, '公司列表:', companyList.value);
|
|
|
+ // 先尝试用ID匹配
|
|
|
+ let company = companyList.value.find(item => String(item.id) === String(companyId));
|
|
|
+ // 如果ID匹配不到,再尝试用companyCode匹配
|
|
|
+ if (!company) {
|
|
|
+ company = companyList.value.find(item => item.companyCode === companyId);
|
|
|
+ }
|
|
|
+ console.log('找到的公司:', company);
|
|
|
+ return company ? company.companyName : companyId;
|
|
|
+};
|
|
|
+
|
|
|
+/** 获取供应商类型列表 */
|
|
|
+const getSupplierTypeData = async () => {
|
|
|
+ try {
|
|
|
+ const res = await getSupplierTypeList();
|
|
|
+ supplierTypeList.value = res.rows || [];
|
|
|
+ console.log('供应商类型列表:', supplierTypeList.value);
|
|
|
+ } catch (e) {
|
|
|
+ console.error('获取供应商类型列表失败:', e);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+/** 根据供应商类型ID获取类型名称 */
|
|
|
+const getSupplierTypeName = (typeId: string) => {
|
|
|
+ if (!typeId) return '-';
|
|
|
+ const type = supplierTypeList.value.find(item => String(item.id) === String(typeId));
|
|
|
+ return type ? type.supplierTypeName : typeId;
|
|
|
+};
|
|
|
+
|
|
|
+/** 获取供应商等级列表 */
|
|
|
+const getSupplierLevelData = async () => {
|
|
|
+ try {
|
|
|
+ const res = await getSupplierLevelList();
|
|
|
+ console.log('供应商等级原始响应:', res);
|
|
|
+ supplierLevelList.value = res.rows || res.data || [];
|
|
|
+ console.log('供应商等级列表:', supplierLevelList.value);
|
|
|
+ } catch (e) {
|
|
|
+ console.error('获取供应商等级列表失败:', e);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+/** 根据等级ID获取等级名称 */
|
|
|
+const getSupplierLevelName = (levelId: string) => {
|
|
|
+ if (!levelId) return '-';
|
|
|
+ console.log('查找等级ID:', levelId, '等级列表:', supplierLevelList.value);
|
|
|
+ const level = supplierLevelList.value.find(item => String(item.id) === String(levelId));
|
|
|
+ console.log('找到的等级:', level);
|
|
|
+ return level ? level.supplierLevelName : levelId;
|
|
|
+};
|
|
|
+
|
|
|
+/** 获取企业规模列表 */
|
|
|
+const getEnterpriseScaleData = async () => {
|
|
|
+ try {
|
|
|
+ const res = await getEnterpriseScaleList();
|
|
|
+ enterpriseScaleList.value = res.data || [];
|
|
|
+ console.log('企业规模列表:', enterpriseScaleList.value);
|
|
|
+ } catch (e) {
|
|
|
+ console.error('获取企业规模列表失败:', e);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+/** 根据企业规模ID获取规模名称 */
|
|
|
+const getEnterpriseScaleName = (scaleId: string) => {
|
|
|
+ if (!scaleId) return '-';
|
|
|
+ const scale = enterpriseScaleList.value.find(item => String(item.id) === String(scaleId));
|
|
|
+ return scale ? scale.enterpriseScaleName : scaleId;
|
|
|
+};
|
|
|
+
|
|
|
+/** 获取行业类别列表 */
|
|
|
+const getIndustryCategoryData = async () => {
|
|
|
+ try {
|
|
|
+ const res = await getIndustryCategoryList();
|
|
|
+ industryCategoryList.value = res.data || [];
|
|
|
+ console.log('行业类别列表:', industryCategoryList.value);
|
|
|
+ } catch (e) {
|
|
|
+ console.error('获取行业类别列表失败:', e);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+/** 根据行业类别ID获取类别名称 */
|
|
|
+const getIndustryCategoryName = (categoryId: string) => {
|
|
|
+ if (!categoryId) return '-';
|
|
|
+ const category = industryCategoryList.value.find(item => String(item.id) === String(categoryId));
|
|
|
+ return category ? category.industryCategoryName : categoryId;
|
|
|
+};
|
|
|
+
|
|
|
+/** 根据省市区代码获取名称 */
|
|
|
+const getAreaName = (provinceCode: string, cityCode: string, countyCode?: string) => {
|
|
|
+ const parts: string[] = [];
|
|
|
+
|
|
|
+ if (provinceCode) {
|
|
|
+ // 将六位数代码转换为两位数代码(如 110000 -> 11)
|
|
|
+ const shortProvinceCode = provinceCode.substring(0, 2);
|
|
|
+ parts.push(codeToText[shortProvinceCode] || provinceCode);
|
|
|
+ }
|
|
|
+ if (cityCode) {
|
|
|
+ // 将六位数代码转换为四位数代码(如 110100 -> 1101)
|
|
|
+ const shortCityCode = cityCode.substring(0, 4);
|
|
|
+ parts.push(codeToText[shortCityCode] || cityCode);
|
|
|
+ }
|
|
|
+ if (countyCode) {
|
|
|
+ // 县区使用完整的六位数代码
|
|
|
+ parts.push(codeToText[countyCode] || countyCode);
|
|
|
+ }
|
|
|
+
|
|
|
+ return parts.length > 0 ? parts.join(' ') : '-';
|
|
|
+};
|
|
|
+
|
|
|
+/** 获取企业规模字典 */
|
|
|
+const getMembershipSizeDict = async () => {
|
|
|
+ try {
|
|
|
+ const res = await getDictData('membership_size');
|
|
|
+ membershipSizeDict.value = res.data || [];
|
|
|
+ console.log('企业规模字典:', membershipSizeDict.value);
|
|
|
+ } catch (e) {
|
|
|
+ console.error('获取企业规模字典失败:', e);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+/** 根据字典值获取字典标签 */
|
|
|
+const getMembershipSizeLabel = (dictValue: string) => {
|
|
|
+ if (!dictValue) return '-';
|
|
|
+ const dict = membershipSizeDict.value.find(item => item.dictValue === dictValue);
|
|
|
+ return dict ? dict.dictLabel : dictValue;
|
|
|
+};
|
|
|
+
|
|
|
// 合同管理相关数据
|
|
|
const contractList = ref<any[]>([]);
|
|
|
const contractSearchParams = ref({
|
|
|
@@ -711,6 +897,9 @@ const getDetail = async () => {
|
|
|
if (id) {
|
|
|
const res = await getInfo(id);
|
|
|
detailData.value = res.data;
|
|
|
+ console.log('供应商详情数据:', detailData.value);
|
|
|
+ console.log('cooperateLevel:', detailData.value.cooperateLevel);
|
|
|
+ console.log('ownedCompany:', detailData.value.ownedCompany);
|
|
|
|
|
|
// 解析工商信息,支持 otherCustomersMap 或 otherCustomers
|
|
|
const otherCustomersData = (detailData.value as any).otherCustomersMap || detailData.value.otherCustomers;
|
|
|
@@ -941,6 +1130,12 @@ onMounted(() => {
|
|
|
getContractList(); // 获取合同列表
|
|
|
getPaymentInfo(); // 获取付款信息
|
|
|
getAuthorizationList(); // 获取授权详情列表
|
|
|
+ getAddressList(); // 获取地址列表
|
|
|
+ getCompanyData(); // 获取公司列表
|
|
|
+ getSupplierTypeData(); // 获取供应商类型列表
|
|
|
+ getSupplierLevelData(); // 获取供应商等级列表
|
|
|
+ getEnterpriseScaleData(); // 获取企业规模列表
|
|
|
+ getIndustryCategoryData(); // 获取行业类别列表
|
|
|
});
|
|
|
</script>
|
|
|
|