Quellcode durchsuchen

Merge branch 'master' of http://8.152.4.3:3000/yp_web/yoe-scm-web

hurx vor 2 Wochen
Ursprung
Commit
54183298a9

+ 3 - 0
src/views/customer/info/detail.vue

@@ -1114,6 +1114,7 @@ const handleSave = async () => {
     // 准备提交数据,包含工商信息
     const submitData: any = {
       ...detailData.value,
+      id: route.query.id as string || '',
       supplierType: String(detailData.value.supplierType), // 确保是字符串类型
       cooperateLevel: String(detailData.value.cooperateLevel), // 确保是字符串类型
       // 将工商信息对象转换为 JSON 字符串存储到 otherCustomers 字段
@@ -1123,6 +1124,8 @@ const handleSave = async () => {
 
     // 根据模式调用新增或更新接口
     let res;
+    console.log('isAddMode:', isAddMode.value, 'isBasicInfoSaved:', isBasicInfoSaved.value);
+    console.log('submitData:', submitData);
     if (isAddMode.value && !isBasicInfoSaved.value) {
       // 新增模式,调用新增接口
       submitData.supplyStatus = 0; 

+ 65 - 4
src/views/customer/info/index.vue

@@ -67,10 +67,22 @@
       <el-table v-loading="loading" border :data="infoList" class="no-resize-table" @selection-change="handleSelectionChange">
         <el-table-column label="编号" align="center" prop="supplierNo" width="150" fixed="left" />
         <el-table-column label="名称" align="left" prop="enterpriseName" fixed="left" />
-        <el-table-column label="类型" align="center" />
-        <el-table-column label="等级" align="left" prop="enterpriseScaleName" fixed="left" />
-        <el-table-column label="企业规模" align="left" prop="enterpriseScaleName" fixed="left" />
-        <el-table-column label="评价" align="left" prop="" fixed="left" />
+        <el-table-column label="类型" align="center" prop="supplierType">
+          <template #default="scope">
+            <span>{{ getSupplierTypeName(scope.row.supplierType) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="等级" align="left" prop="cooperateLevel" fixed="left">
+          <template #default="scope">
+            <span>{{ getSupplierLevelName(scope.row.cooperateLevel) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="企业规模" align="left" prop="membershipSize" fixed="left">
+          <template #default="scope">
+            <span>{{ getEnterpriseScaleName(scope.row.membershipSize) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="评价" align="left" prop="supplyScore" fixed="left" />
         <el-table-column label="采销经理" align="center" prop="productManager" />
         <el-table-column label="产品专员" align="center" prop="buyer" />
         <!-- <el-table-column label="供应品牌" align="center" prop="brandName" width="200" />
@@ -342,6 +354,10 @@ import { getInfoList, getInfo, delInfo, addInfo, updateInfo, getProductCategoryL
 import { InfoVO, InfoQuery, InfoForm } from '@/api/customer/info/types';
 import { listType } from '@/api/system/type';
 import { TypeVO } from '@/api/system/type/types';
+import { listLevel } from '@/api/system/level';
+import { LevelVO } from '@/api/system/level/types';
+import { listEnterpriseScale } from '@/api/customer/customerCategory/enterpriseScale';
+import { EnterpriseScaleVO } from '@/api/customer/customerCategory/enterpriseScale/types';
 import { getSupplierStatusOptions, getSupplierStatusDisplayName } from '@/enums/supplierStatus';
 import { getSupplierCooperationStatusDisplayName } from '@/enums/supplierCooperationStatus';
 
@@ -360,6 +376,8 @@ const single = ref(true);
 const multiple = ref(true);
 const total = ref(0);
 const supplierTypeList = ref<TypeVO[]>([]);
+const supplierLevelList = ref<LevelVO[]>([]);
+const enterpriseScaleList = ref<EnterpriseScaleVO[]>([]);
 const productCategoryList = ref<{ categoryNo: string; categoryName: string; id?: number }[]>([]);
 const comStaffList = ref<{ staffId: string; staffName: string }[]>([]);
 // 使用枚举获取供应商状态选项,搜索框显示原始名称
@@ -743,6 +761,33 @@ const getSupplierTypeList = async () => {
   }
 };
 
+/** 获取供应商等级列表 */
+const getSupplierLevelList = async () => {
+  try {
+    const res = await listLevel({
+      pageNum: 1,
+      pageSize: 1000
+    } as any);
+    supplierLevelList.value = (res as any).data || res.rows || [];
+  } catch (e) {
+    console.error('获取供应商等级失败', e);
+  }
+};
+
+/** 获取企业规模列表 */
+const getEnterpriseScaleList = async () => {
+  try {
+    const res = await listEnterpriseScale({
+      pageNum: 1,
+      pageSize: 1000,
+      status: '0'
+    });
+    enterpriseScaleList.value = (res as any).data || res.rows || [];
+  } catch (e) {
+    console.error('获取企业规模失败', e);
+  }
+};
+
 /** 获取产品分类列表 */
 const getProductCategoryData = async () => {
   try {
@@ -783,6 +828,20 @@ const getSupplierTypeName = (typeValue: string | number) => {
   return item ? item.supplierTypeName : String(typeValue);
 };
 
+/** 根据供应商等级ID获取显示名称 */
+const getSupplierLevelName = (levelValue: string | number) => {
+  if (levelValue === undefined || levelValue === null || levelValue === '') return '';
+  const item = supplierLevelList.value.find((t) => String(t.id) === String(levelValue));
+  return item ? item.supplierLevelName : String(levelValue);
+};
+
+/** 根据企业规模ID获取显示名称 */
+const getEnterpriseScaleName = (scaleValue: string | number) => {
+  if (scaleValue === undefined || scaleValue === null || scaleValue === '') return '';
+  const item = enterpriseScaleList.value.find((t) => String(t.id) === String(scaleValue));
+  return item ? item.enterpriseScaleName : String(scaleValue);
+};
+
 /** 根据categoryNo获取categoryName */
 const getCategoryName = (categoryNo: string) => {
   const item = productCategoryList.value.find((c) => c.categoryNo === categoryNo);
@@ -825,6 +884,8 @@ const formatCityDisplay = (city: string) => {
 
 onMounted(async () => {
   getSupplierTypeList();
+  getSupplierLevelList();
+  getEnterpriseScaleList();
   getProductCategoryData();
 
   // 直接调用人员接口测试

+ 1 - 0
src/views/supplier/approve/index.vue

@@ -122,6 +122,7 @@
               "
             >
               <el-button link type="primary" @click="handleView(scope.row)" v-hasPermi="['customer:info:query']">查看</el-button>
+              <el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['customer:info:edit']">编辑</el-button>
               <el-button link type="primary" @click="handleApprove(scope.row)" v-hasPermi="['customer:info:edit']">审核通过</el-button>
               <el-button link type="danger" @click="handleReject(scope.row)" v-hasPermi="['customer:info:edit']">驳回</el-button>
             </template>