浏览代码

feat(supplier): 重构合约供货管理功能

- 将合约供货编辑页面重构为商品报价管理页面
- 添加商品导入导出功能和模板下载
- 实现分页查询合同产品列表
- 集成Excel文件导入商品数据功能
- 优化商品删除和添加流程
- 更新API接口适配新的业务逻辑
- 调整供应商审核页面路由参数传递
- 移除合约供货首页统计卡片优化界面布局
- 统一平台价显示为官网价的标签命名
肖路 3 周之前
父节点
当前提交
10f1ef626a

+ 5 - 5
src/api/order/orderProduct/types.ts

@@ -57,7 +57,7 @@ export interface OrderProductVO {
    */
   productImageUrl: string;
   /**
-   * 平台价格(元)
+   * 官网价格(元)
    */
   platformPrice: number;
 
@@ -67,7 +67,7 @@ export interface OrderProductVO {
   taxRate: number;
 
   /**
-   * 平台价格价
+   * 官网价格价
    */
   marketPrice: number;
 
@@ -214,7 +214,7 @@ export interface OrderProductForm extends BaseEntity {
   productImage?: string;
 
   /**
-   * 平台价格(元)
+   * 官网价格(元)
    */
   platformPrice?: number;
 
@@ -224,7 +224,7 @@ export interface OrderProductForm extends BaseEntity {
   taxRate?: number;
 
   /**
-   * 平台价格价
+   * 官网价格价
    */
   marketPrice?: number;
 
@@ -360,7 +360,7 @@ export interface OrderProductQuery extends PageQuery {
   productImage?: string;
 
   /**
-   * 平台价格(元)
+   * 官网价格(元)
    */
   platformPrice?: number;
 

+ 54 - 0
src/api/product/contracproduct/index.ts

@@ -1,5 +1,6 @@
 import request from '@/utils/request';
 import { AxiosPromise } from 'axios';
+import { BaseVO, BaseForm, BaseQuery, StatusCountVo } from '@/api/product/base/types';
 import { ContracproductVO, ContracproductForm, ContracproductQuery } from '@/api/product/contracproduct/types';
 
 /**
@@ -69,3 +70,56 @@ export const delContracproduct = (id: string | number | Array<string | number>)
     method: 'delete'
   });
 };
+/**
+ * 查询产品基础信息列表
+ * @param query
+ * @returns {*}
+ */
+
+export const getContractProductList = (query?: BaseQuery): AxiosPromise<BaseVO[]> => {
+  return request({
+    url: '/product/contracproduct/getContractProductList',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 删除合同产品关联
+ * @param id
+ */
+export const delContracproductBySupplier = (productId: string | number, supplierId: string | number) => {
+  return request({
+    url: '/product/contracproduct/delContracproductBySupplier',
+    params: { productId: productId, supplierId: supplierId },
+    method: 'delete'
+  });
+};
+
+/**
+ * 下载导入模板
+ */
+export const importTemplate = () => {
+  return request({
+    url: '/product/contracproduct/importTemplate',
+    method: 'post',
+    responseType: 'blob'
+  });
+};
+
+/**
+ * 导入合同产品数据
+ * @param file 导入文件
+ */
+export const importData = (file: File) => {
+  const formData = new FormData();
+  formData.append('file', file);
+  return request({
+    url: '/product/contracproduct/importData',
+    method: 'post',
+    data: formData,
+    headers: {
+      'Content-Type': 'multipart/form-data'
+    }
+  });
+};

+ 28 - 0
src/views/customer/info/components/QualificationTab.vue

@@ -36,6 +36,14 @@
           </template>
         </el-table-column>
 
+        <el-table-column label="状态" align="center" width="100">
+          <template #default="scope">
+            <el-tag :type="getQualificationStatusTagType(scope.row.qualificationStatus)">
+              {{ getQualificationStatusText(scope.row.qualificationStatus) }}
+            </el-tag>
+          </template>
+        </el-table-column>
+
         <!-- <el-table-column label="操作" align="center" width="200" fixed="right">
           <template #default="scope">
             <el-button link type="primary" @click="emit('viewQualification', scope.row)">查看</el-button>
@@ -66,6 +74,26 @@ const formatDate = (dateStr: string) => {
   return dateStr.split(' ')[0];
 };
 
+/** 资质状态文本 */
+const getQualificationStatusText = (status: number | string) => {
+  const statusMap: Record<string, string> = {
+    '0': '待提交',
+    '1': '生效',
+    '2': '作废'
+  };
+  return statusMap[String(status)] || '-';
+};
+
+/** 资质状态标签类型 */
+const getQualificationStatusTagType = (status: number | string) => {
+  const typeMap: Record<string, 'info' | 'success' | 'danger'> = {
+    '0': 'info',
+    '1': 'success',
+    '2': 'danger'
+  };
+  return typeMap[String(status)] || 'info';
+};
+
 const emit = defineEmits<{
   (e: 'downloadQualification', row: any): void;
   // (e: 'viewQualification', row: any): void;

+ 29 - 36
src/views/index.vue

@@ -15,18 +15,10 @@
             <div class="kpi-title">待审核供应商</div>
             <div class="kpi-value">{{ stats.pendingSuppliers }}</div>
           </div>
-          <div class="kpi-card kpi-purple">
-            <div class="kpi-title">协议供货单数</div>
-            <div class="kpi-value">{{ stats.contractSupplies }}</div>
-          </div>
-          <div class="kpi-card kpi-teal">
-            <div class="kpi-title">协议供货商品数</div>
-            <div class="kpi-value">{{ stats.contractSupplyProducts }}</div>
-          </div>
-          <div class="kpi-card kpi-green">
+          <!-- <div class="kpi-card kpi-green">
             <div class="kpi-title">合同总数</div>
             <div class="kpi-value">{{ stats.contractTotal }}</div>
-          </div>
+          </div> -->
           <div class="kpi-card kpi-indigo">
             <div class="kpi-title">商品总数</div>
             <div class="kpi-value">{{ stats.productTotal }}</div>
@@ -136,14 +128,14 @@ const fetchTrend = async () => {
   });
 
   const contractReqs = days.map((day) => {
-    return listContract({
-      pageNum: 1,
-      pageSize: 1,
-      params: {
-        beginTime: `${day} 00:00:00`,
-        endTime: `${day} 23:59:59`
-      }
-    } as any);
+    // return listContract({
+    //   pageNum: 1,
+    //   pageSize: 1,
+    //   params: {
+    //     beginTime: `${day} 00:00:00`,
+    //     endTime: `${day} 23:59:59`
+    //   }
+    // } as any);
   });
 
   const [contactRes, contractRes] = await Promise.all([
@@ -156,12 +148,12 @@ const fetchTrend = async () => {
 };
 
 const fetchStats = async () => {
-  const [supplierRes, nonCoopRes, pendingRes, contractRes, productRes, contractTotalRes, productTotalRes, brandTotalRes] = await Promise.all([
-    getInfoList({ pageNum: 1, pageSize: 1 } as any),
-    getInfoList({ pageNum: 1, pageSize: 1, cooperative: 0 } as any),
-    getApproveList({ pageNum: 1, pageSize: 1 } as any),
+  const [supplierRes, nonCoopRes, pendingRes, contractRes, contractTotalRes, productTotalRes, brandTotalRes] = await Promise.all([
+    getInfoList({ pageNum: 1, pageSize: 1,supplyStatus: 1 } as any),
+    getInfoList({ pageNum: 1, pageSize: 1, supplyStatus: 2 } as any),
+    getApproveList({ pageNum: 1, pageSize: 1, supplyStatus: 0 } as any),
     listContractsupply({ pageNum: 1, pageSize: 1 } as any),
-    scmListContracproduct({ pageNum: 1, pageSize: 1 } as any),
+    // scmListContracproduct({ pageNum: 1, pageSize: 1 } as any),
     listContract({ pageNum: 1, pageSize: 1 } as any),
     listBase({ pageNum: 1, pageSize: 1 } as any),
     listBrand({ pageNum: 1, pageSize: 1 } as any)
@@ -171,7 +163,7 @@ const fetchStats = async () => {
   stats.nonCooperativeSuppliers = nonCoopRes?.total ?? 0;
   stats.pendingSuppliers = pendingRes?.total ?? 0;
   stats.contractSupplies = contractRes?.total ?? 0;
-  stats.contractSupplyProducts = productRes?.total ?? 0;
+  // stats.contractSupplyProducts = productRes?.total ?? 0;
   stats.contractTotal = contractTotalRes?.total ?? 0;
   stats.productTotal = productTotalRes?.total ?? 0;
   stats.brandTotal = brandTotalRes?.total ?? 0;
@@ -213,7 +205,8 @@ const renderCharts = () => {
       grid: { left: 40, right: 20, top: 20, bottom: 30 },
       xAxis: {
         type: 'category',
-        data: ['供应商', '不合作', '待审核', '供货单', '供货商品', '合同', '商品', '品牌'],
+        // data: ['供应商', '不合作', '待审核', '供货单', '供货商品', '合同', '商品', '品牌'],
+        data: ['供应商', '不合作', '待审核', '商品', '品牌'],
         axisTick: { show: false }
       },
       yAxis: { type: 'value', splitLine: { lineStyle: { type: 'dashed' } } },
@@ -224,9 +217,9 @@ const renderCharts = () => {
             stats.totalSuppliers,
             stats.nonCooperativeSuppliers,
             stats.pendingSuppliers,
-            stats.contractSupplies,
-            stats.contractSupplyProducts,
-            stats.contractTotal,
+            // stats.contractSupplies,
+            // stats.contractSupplyProducts,
+            // stats.contractTotal,
             stats.productTotal,
             stats.brandTotal
           ],
@@ -261,14 +254,14 @@ const renderCharts = () => {
           symbol: 'circle',
           symbolSize: 6
         },
-        {
-          name: '合同新增',
-          type: 'line',
-          data: trend.contractAdds,
-          smooth: true,
-          symbol: 'circle',
-          symbolSize: 6
-        }
+        // {
+        //   name: '合同新增',
+        //   type: 'line',
+        //   data: trend.contractAdds,
+        //   smooth: true,
+        //   symbol: 'circle',
+        //   symbolSize: 6
+        // }
       ]
     });
   }

+ 1 - 1
src/views/order/orderMain/index.vue

@@ -658,7 +658,7 @@ const submitForm = () => {
           productUnitId: product.productUnitId,
           productUnit: product.unitName, // 产品单位
           productImage: product.productImage, // 产品图片
-          platformPrice: product.price, // 平台价格(单价)
+          platformPrice: product.price, // 官网价格(单价)
           marketPrice: product.marketPrice,
           minOrderQuantity: product.minOrderQuantity, // 最小起订量
           orderPrice: product.unitPrice, // 订单单价(含税单价)

+ 2 - 2
src/views/product/pool/review1.vue

@@ -61,7 +61,7 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="项目/平台价" align="center" prop="productPrice" width="120">
+            <el-table-column label="项目/官网价" align="center" prop="productPrice" width="120">
               <template #default="scope">
                 ¥{{ scope.row.productPrice || '0.00' }}
               </template>
@@ -135,7 +135,7 @@
                 </div>
               </template>
             </el-table-column>
-            <el-table-column label="项目/平台价" align="center" prop="productPrice" width="120">
+            <el-table-column label="项目/官网价" align="center" prop="productPrice" width="120">
               <template #default="scope">
                 ¥{{ scope.row.productPrice || '0.00' }}
               </template>

+ 4 - 4
src/views/product/pool/reviewDetail.vue

@@ -154,7 +154,7 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column label="项目平台价" align="center" prop="platformPrice" width="100" />
+        <el-table-column label="项目官网价" align="center" prop="platformPrice" width="100" />
         <el-table-column label="商品状态" align="center" width="80">
           <template #default="scope">
             <el-tag v-if="scope.row.productStatus === '1'" type="success">已上架</el-tag>
@@ -316,7 +316,7 @@
                   <span>¥{{ scope.row.midRangePrice || '0.00' }}</span>
                 </div>
                 <div>
-                  <span class="text-gray-500">平台价:</span>
+                  <span class="text-gray-500">官网价:</span>
                   <span class="text-red-500">¥{{ scope.row.standardPrice || '0.00' }}</span>
                 </div>
                 <div>
@@ -624,7 +624,7 @@ const handleBatchAdd = async () => {
       poolId: queryParams.value.poolId ,
       products: selectedProducts.value.map(product => ({
         productId: product.id ,
-        agreementPrice: product.standardPrice || product.midRangePrice // 使用平台价或市场价作为协议价
+        agreementPrice: product.standardPrice || product.midRangePrice // 使用官网价或市场价作为协议价
       }))
     };
 
@@ -650,7 +650,7 @@ const handleAddSingleProduct = async (row: BaseVO) => {
       poolId: queryParams.value.poolId ,
       products: [{
         productId: row.id ,
-        agreementPrice: row.standardPrice || row.midRangePrice // 使用平台价或市场价作为协议价
+        agreementPrice: row.standardPrice || row.midRangePrice // 使用官网价或市场价作为协议价
       }]
     };
 

+ 4 - 4
src/views/product/poolLink/index.vue

@@ -148,7 +148,7 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column label="项目平台价" align="center" prop="platformPrice" width="100" />
+        <el-table-column label="项目官网价" align="center" prop="platformPrice" width="100" />
         <el-table-column label="商品状态" align="center" width="80">
           <template #default="scope">
             <el-tag v-if="scope.row.productStatus === '1'" type="success">上架</el-tag>
@@ -281,7 +281,7 @@
                   <span>¥{{ scope.row.midRangePrice || '0.00' }}</span>
                 </div>
                 <div>
-                  <span class="text-gray-500">平台价:</span>
+                  <span class="text-gray-500">官网价:</span>
                   <span class="text-red-500">¥{{ scope.row.standardPrice || '0.00' }}</span>
                 </div>
                 <div>
@@ -595,7 +595,7 @@ const handleBatchAdd = async () => {
       poolId: queryParams.value.poolId,
       products: selectedProducts.value.map(product => ({
         productId: product.id,
-        agreementPrice: product.standardPrice || product.midRangePrice // 使用平台价或市场价作为协议价
+        agreementPrice: product.standardPrice || product.midRangePrice // 使用官网价或市场价作为协议价
       }))
     };
 
@@ -621,7 +621,7 @@ const handleAddSingleProduct = async (row: BaseVO) => {
       poolId: queryParams.value.poolId,
       products: [{
         productId: row.id,
-        agreementPrice: row.standardPrice || row.midRangePrice // 使用平台价或市场价作为协议价
+        agreementPrice: row.standardPrice || row.midRangePrice // 使用官网价或市场价作为协议价
       }]
     };
 

+ 4 - 4
src/views/product/poolLink/index1.vue

@@ -154,7 +154,7 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column label="项目平台价" align="center" prop="platformPrice" width="100" />
+        <el-table-column label="项目官网价" align="center" prop="platformPrice" width="100" />
         <el-table-column label="商品状态" align="center" width="80">
           <template #default="scope">
             <el-tag v-if="scope.row.productStatus === '1'" type="success">已上架</el-tag>
@@ -316,7 +316,7 @@
                   <span>¥{{ scope.row.midRangePrice || '0.00' }}</span>
                 </div>
                 <div>
-                  <span class="text-gray-500">平台价:</span>
+                  <span class="text-gray-500">官网价:</span>
                   <span class="text-red-500">¥{{ scope.row.standardPrice || '0.00' }}</span>
                 </div>
                 <div>
@@ -624,7 +624,7 @@ const handleBatchAdd = async () => {
       poolId: queryParams.value.poolId ,
       products: selectedProducts.value.map(product => ({
         productId: product.id ,
-        agreementPrice: product.standardPrice || product.midRangePrice // 使用平台价或市场价作为协议价
+        agreementPrice: product.standardPrice || product.midRangePrice // 使用官网价或市场价作为协议价
       }))
     };
 
@@ -650,7 +650,7 @@ const handleAddSingleProduct = async (row: BaseVO) => {
       poolId: queryParams.value.poolId ,
       products: [{
         productId: row.id ,
-        agreementPrice: row.standardPrice || row.midRangePrice // 使用平台价或市场价作为协议价
+        agreementPrice: row.standardPrice || row.midRangePrice // 使用官网价或市场价作为协议价
       }]
     };
 

+ 2 - 2
src/views/product/protocolInfo/productManage.vue

@@ -79,7 +79,7 @@
           <template #default="scope">
             <div class="text-left">
               <div>市场价: ¥{{ scope.row.marketPrice || 0 }}</div>
-              <div class="text-red-500">平台价: ¥{{ scope.row.memberPrice || 0 }}</div>
+              <div class="text-red-500">官网价: ¥{{ scope.row.memberPrice || 0 }}</div>
               <div>标准成本: ¥{{ scope.row.purchasingPrice || 0 }}</div>
               <div>最低售价: ¥{{ scope.row.minSellingPrice || 0 }}</div>
             </div>
@@ -192,7 +192,7 @@
                   <span>¥{{ scope.row.midRangePrice || scope.row.marketPrice || '0.00' }}</span>
                 </div>
                 <div>
-                  <span class="text-gray-500">平台价:</span>
+                  <span class="text-gray-500">官网价:</span>
                   <span class="text-red-500">¥{{ scope.row.standardPrice || scope.row.memberPrice || '0.00' }}</span>
                 </div>
                 <div>

+ 6 - 5
src/views/supplier/approve/index.vue

@@ -39,11 +39,6 @@
                 <el-option v-for="item in comStaffList" :key="item.staffId" :label="item.staffName" :value="item.staffId" />
               </el-select>
             </el-form-item>
-            <el-form-item label="状态" prop="supplyStatus">
-              <el-select v-model="queryParams.supplyStatus" placeholder="请选择供应商状态" clearable>
-                <el-option v-for="option in supplierStatusOptions" :key="option.value" :label="option.label" :value="option.value" />
-              </el-select>
-            </el-form-item>
             <el-form-item>
               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
               <el-button icon="Refresh" @click="resetQuery">重置</el-button>
@@ -344,6 +339,7 @@
 </template>
 
 <script setup name="Info" lang="ts">
+import { useRoute } from 'vue-router';
 import {
   getApproveList,
   getInfo,
@@ -366,6 +362,7 @@ console.log('测试枚举 - 使用原始名称:', getSupplierStatusOptions(true)
 console.log('测试枚举 - 使用展示名称:', getSupplierStatusOptions(false));
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const route = useRoute();
 
 const infoList = ref<InfoVO[]>([]);
 const buttonLoading = ref(false);
@@ -874,6 +871,10 @@ onMounted(async () => {
     console.error('人员接口调用失败:', e);
   }
 
+  // 从路由query中获取supplyStatus并传给后端
+  if (route.query.supplyStatus) {
+    queryParams.value.supplyStatus = route.query.supplyStatus as string;
+  }
   getList();
 
   // 禁用表格列宽调整

+ 19 - 19
src/views/supplier/contractsupply/add.vue

@@ -64,8 +64,8 @@
         <el-row :gutter="20">
           <el-col :span="24">
             <el-form-item label="附件" prop="attachment">
-              <FileUpload 
-                v-model="form.proFile" 
+              <FileUpload
+                v-model="form.proFile"
                 :limit="10"
                 :file-size="50"
                 :file-type="['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf']"
@@ -77,9 +77,9 @@
         <el-row :gutter="20">
           <el-col :span="24">
             <el-form-item label="备注" prop="remark">
-              <el-input 
-                v-model="form.remark" 
-                type="textarea" 
+              <el-input
+                v-model="form.remark"
+                type="textarea"
                 :rows="4"
                 placeholder="请输入内容"
               />
@@ -96,9 +96,9 @@
           <el-table-column prop="productCode" label="产品编号" align="center" width="120" />
           <el-table-column label="产品图片" align="center" width="100">
             <template #default="scope">
-              <el-image 
-                v-if="scope.row.productImage" 
-                :src="scope.row.productImage" 
+              <el-image
+                v-if="scope.row.productImage"
+                :src="scope.row.productImage"
                 style="width: 60px; height: 60px;"
                 fit="cover"
               />
@@ -113,23 +113,23 @@
               <span>¥{{ scope.row.marketPrice || '0.00' }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="平台价" align="center" width="100">
+          <el-table-column label="官网价" align="center" width="100">
             <template #default="scope">
               <span>¥{{ scope.row.platformPrice || '0.00' }}</span>
             </template>
           </el-table-column>
           <el-table-column label="供应价" align="center" width="120">
             <template #default="scope">
-              <el-input 
-                v-model="scope.row.offerPrice" 
+              <el-input
+                v-model="scope.row.offerPrice"
                 placeholder="请输入"
               />
             </template>
           </el-table-column>
           <el-table-column label="供应时效(天)" align="center" width="120">
             <template #default="scope">
-              <el-input 
-                v-model="scope.row.supplyCycle" 
+              <el-input
+                v-model="scope.row.supplyCycle"
                 placeholder="请输入"
               />
             </template>
@@ -156,7 +156,7 @@
     </el-card>
 
     <!-- 添加商品对话框 -->
-    <Product 
+    <Product
       v-model:visible="productDialog.visible"
       v-model:modelValue="productList"
       @confirm="handleProductConfirm"
@@ -249,7 +249,7 @@ const handleProductConfirm = (selectedProducts: BaseVO[]) => {
     ElMessage.warning('请选择要添加的商品');
     return;
   }
-  
+
   productList.value = selectedProducts;
   ElMessage.success(`成功添加${selectedProducts.length}个商品`);
 };
@@ -267,7 +267,7 @@ const handleSubmit = async () => {
         // 从表格中收集最新的数据
         const tableInputs = document.querySelectorAll('.el-table input');
         let inputIndex = 0;
-        
+
         productList.value.forEach((item, index) => {
           // 每行有两个输入框:供应价和供应时效
           if (tableInputs[inputIndex]) {
@@ -279,7 +279,7 @@ const handleSubmit = async () => {
             inputIndex++;
           }
         });
-        
+
         // 组装提交数据,包含表单数据和商品列表
         const submitData = {
           ...form.value,
@@ -290,10 +290,10 @@ const handleSubmit = async () => {
             supplyCycle: item.supplyCycle || ''
           }))
         };
-        
+
         console.log('提交的数据:', submitData);
         console.log('商品列表:', productList.value);
-        
+
         await addContractsupply(submitData);
         ElMessage.success('新增成功');
         router.back();

+ 102 - 48
src/views/supplier/contractsupply/components/Product.vue

@@ -34,7 +34,6 @@
                 <el-select v-model="queryParams.productStatus" placeholder="请选择" clearable style="width: 100%">
                   <el-option label="已上架" :value="1" />
                   <el-option label="下架" :value="0" />
-                  <el-option label="上架中" :value="2" />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -51,11 +50,11 @@
 
       <!-- 表格区域 - 可滚动 -->
       <div class="table-wrapper">
-        <el-table 
-          v-loading="loading" 
-          border 
+        <el-table
+          v-loading="loading"
+          border
           :fit="true"
-          :data="baseList" 
+          :data="baseList"
           @selection-change="handleSelectionChange"
           max-height="calc(70vh - 200px)"
           style="width: 100%"
@@ -68,7 +67,11 @@
             </template>
           </el-table-column>
           <el-table-column label="产品名称" align="center" prop="itemName" min-width="180" show-overflow-tooltip />
-          <el-table-column label="产品类型" align="center" prop="categoryName" width="110" />
+          <el-table-column label="产品分类" align="center" width="180" show-overflow-tooltip>
+            <template #default="scope">
+              <span>{{ scope.row.topCategoryName }}-{{ scope.row.mediumCategoryName }}-{{ scope.row.bottomCategoryName }}</span>
+            </template>
+          </el-table-column>
           <el-table-column label="品牌" align="center" prop="brandName" width="100" />
           <el-table-column label="单位" align="center" prop="unitName" width="70" />
           <el-table-column label="市场价" align="center" width="90">
@@ -76,7 +79,7 @@
               <span>¥{{ scope.row.marketPrice || '0.00' }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="平台售价" align="center" width="90">
+          <el-table-column label="官网价" align="center" width="90">
             <template #default="scope">
               <span>¥{{ scope.row.memberPrice || '0.00' }}</span>
             </template>
@@ -86,14 +89,17 @@
             <template #default="scope">
               <el-tag v-if="scope.row.productStatus === 1" type="success">已上架</el-tag>
               <el-tag v-else-if="scope.row.productStatus === 0" type="warning">下架</el-tag>
-              <el-tag v-else-if="scope.row.productStatus === 2" type="info">上架中</el-tag>
               <el-tag v-else type="info">未知</el-tag>
             </template>
           </el-table-column>
+          <el-table-column label="供应价(元)" align="center" width="130">
+            <template #default="scope">
+              <el-input v-model="scope.row._offerPrice" placeholder="请输入供应价" size="small" @blur="validateSupplyPrice(scope.row)" />
+            </template>
+          </el-table-column>
           <el-table-column label="操作" align="center" width="100" fixed="right"> <!-- 固定右侧,避免空白 -->
             <template #default="scope">
-              <el-button v-if="isProductSelected(scope.row.id)" link type="success" disabled>已选</el-button>
-              <el-button v-else link type="primary" @click="handleAddToList(scope.row)">加入清单</el-button>
+              <el-button link type="primary" @click="handleAddToList(scope.row)">加入清单</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -118,6 +124,7 @@
 <script setup name="Base" lang="ts">
 // 补充必要的导入
 import { getCurrentInstance, ComponentInternalInstance, computed, ref, reactive, onMounted, toRefs } from 'vue';
+import { useRoute } from 'vue-router';
 import type { FormInstance } from 'element-plus';
 
 // Props 定义
@@ -151,10 +158,14 @@ const handleClose = () => {
 
 // 模拟接口(如果实际项目有,可替换)
 import { listBase, categoryTree } from '@/api/product/base';
+import { addContracproduct } from '@/api/product/contracproduct';
 import { BaseVO, BaseQuery, BaseForm } from '@/api/product/base/types';
 import { categoryTreeVO } from '@/api/product/category/types';
 import Pagination from '@/components/Pagination/index.vue';
 
+const route = useRoute();
+const supplierId = computed(() => route.params.id as string | number);
+
 // 类型补充
 interface PageData<F, Q> {
   form: F;
@@ -326,54 +337,94 @@ const handleSelectionChange = (selection: BaseVO[]) => {
   multiple.value = !selection.length;
 };
 
-/** 判断商品是否已加入清单 */
-const isProductSelected = (productId: string | number) => {
-  return props.modelValue.some(item => item.productId === productId);
+/** 校验供应价 ≤ 官网价(平台售价) */
+const validateSupplyPrice = (row: any) => {
+  const supplyPrice = parseFloat(row._offerPrice);
+  const platformPrice = parseFloat(row.memberPrice);
+  if (!isNaN(supplyPrice) && !isNaN(platformPrice) && supplyPrice > platformPrice) {
+    proxy?.$modal.msgWarning('供应价不能大于官网价');
+    row._offerPrice = '';
+  }
 };
 
 /** 加入清单 */
-const handleAddToList = (row: BaseVO) => {
+const handleAddToList = async (row: BaseVO) => {
   const existsInModelValue = props.modelValue.some(item => item.productId === row.id);
   if (existsInModelValue) {
     proxy?.$modal.msgWarning('该商品已在清单中');
     return;
   }
-  
-  const newProduct = {
-    productId: row.id,
-    productCode: row.productNo,
-    productImage: row.productImage,
-    productName: row.itemName,
-    productType: row.categoryName,
-    brand: row.brandName,
-    unit: row.unitName,
-    basePrice: row.purchasingPrice || 0,
-    marketPrice: row.marketPrice || 0,
-    platformPrice: row.memberPrice || 0,
-    offerPrice: '',
-    supplyCycle: '',
-    upPrice: Number(row.productStatus) === 1 ? '上架' : '下架'
-  };
-  
-  emit('update:modelValue', [...props.modelValue, newProduct]);
-  proxy?.$modal.msgSuccess('添加成功');
-  emit('update:visible', false);
+
+  const offerPrice = (row as any)._offerPrice || '';
+  if (!offerPrice) {
+    proxy?.$modal.msgWarning('请输入供应价');
+    return;
+  }
+
+  try {
+    await addContracproduct({
+      productId: row.id,
+      productNo: row.productNo,
+      offerPrice: offerPrice,
+      supplierId: supplierId.value
+    } as any);
+
+    const newProduct = {
+      productId: row.id,
+      productCode: row.productNo,
+      productImage: row.productImage,
+      productName: row.itemName,
+      productType: row.categoryName,
+      brand: row.brandName,
+      unit: row.unitName,
+      basePrice: row.purchasingPrice || 0,
+      marketPrice: row.marketPrice || 0,
+      platformPrice: row.memberPrice || 0,
+      supplyPrice: offerPrice,
+      supplyCycle: '',
+      upPrice: Number(row.productStatus) === 1 ? '上架' : '下架'
+    };
+
+    emit('update:modelValue', [...props.modelValue, newProduct]);
+    emit('confirm', [newProduct]);
+    proxy?.$modal.msgSuccess('添加成功');
+  } catch (e) {
+    console.error('添加商品报价失败:', e);
+    proxy?.$modal.msgError('添加失败');
+  }
 };
 
 /** 批量加入清单 */
-const handleBatchAddToList = () => {
+const handleBatchAddToList = async () => {
   const selectedProducts = baseList.value.filter(item => ids.value.includes(item.id));
-  
+
   if (selectedProducts.length === 0) {
     proxy?.$modal.msgWarning('请选择要添加的商品');
     return;
   }
-  
+
+  // 检查所有选中商品是否都填了供应价
+  const noPrice = selectedProducts.find(row => !(row as any)._offerPrice);
+  if (noPrice) {
+    proxy?.$modal.msgWarning('请为所有选中商品填写供应价');
+    return;
+  }
+
   const newProducts: any[] = [];
-  
-  selectedProducts.forEach(row => {
+  let successCount = 0;
+
+  for (const row of selectedProducts) {
     const exists = props.modelValue.some(item => item.productId === row.id);
-    if (!exists) {
+    if (exists) continue;
+
+    try {
+      await addContracproduct({
+        productId: row.id,
+        productNo: row.productNo,
+        offerPrice: (row as any)._offerPrice,
+        supplierId: supplierId.value
+      } as any);
+
       newProducts.push({
         productId: row.id,
         productCode: row.productNo,
@@ -385,21 +436,24 @@ const handleBatchAddToList = () => {
         basePrice: row.purchasingPrice || 0,
         marketPrice: row.marketPrice || 0,
         platformPrice: row.memberPrice || 0,
-        offerPrice: '',
+        supplyPrice: (row as any)._offerPrice,
         supplyCycle: '',
         upPrice: Number(row.productStatus) === 1 ? '上架' : '下架'
       });
+      successCount++;
+    } catch (e) {
+      console.error('添加商品报价失败:', e);
     }
-  });
-  
+  }
+
   if (newProducts.length === 0) {
-    proxy?.$modal.msgWarning('所选商品已在清单中');
+    proxy?.$modal.msgWarning('所选商品已在清单中或添加失败');
     return;
   }
-  
+
   emit('update:modelValue', [...props.modelValue, ...newProducts]);
-  proxy?.$modal.msgSuccess(`成功添加${newProducts.length}个商品`);
-  emit('update:visible', false);
+  emit('confirm', newProducts);
+  proxy?.$modal.msgSuccess(`成功添加${successCount}个商品`);
 };
 
 /** 查询分类树 */
@@ -495,4 +549,4 @@ onMounted(() => {
 .product-dialog :deep(.el-table__fixed-right) {
   height: calc(100% - 17px) !important; /* 匹配表格高度 */
 }
-</style>
+</style>

+ 143 - 281
src/views/supplier/contractsupply/edit.vue

@@ -1,327 +1,197 @@
 <template>
   <div class="app-container">
-    <!-- 页面头部 -->
-    <div class="detail-header">
-      <el-icon class="back-icon" @click="goBack"><ArrowLeft /></el-icon>
-      <span class="header-title">编辑合约供货</span>
-    </div>
 
-    <!-- 表单卡片 -->
-    <el-card shadow="never" class="form-card">
-      <el-form ref="formRef" :model="form" :rules="rules" label-width="100px" class="large-form">
-        <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="协议编号" prop="contractSupplyNo">
-              <span class="form-text">{{ form.contractSupplyNo }}</span>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="所属公司" prop="companyId">
-              <el-select v-model="form.companyId" placeholder="请选择" style="width: 100%;" size="large">
-                <el-option
-                  v-for="item in companyList"
-                  :key="item.id"
-                  :label="item.companyName"
-                  :value="item.id"
-                />
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="供应商" prop="supplierId">
-              <el-select v-model="form.supplierId" placeholder="请选择" style="width: 100%;" size="large">
-                <el-option
-                  v-for="item in supplierList"
-                  :key="item.id"
-                  :label="item.enterpriseName"
-                  :value="item.id"
-                />
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20">
-          <el-col :span="8">
-            <el-form-item label="开始时间" prop="startTime">
-              <el-date-picker
-                v-model="form.startTime"
-                type="date"
-                placeholder="请选择"
-                value-format="YYYY-MM-DD"
-                style="width: 100%;"
-                size="large"
-              />
-            </el-form-item>
-          </el-col>
-          <el-col :span="8">
-            <el-form-item label="结束时间" prop="endTime">
-              <el-date-picker
-                v-model="form.endTime"
-                type="date"
-                placeholder="请选择"
-                value-format="YYYY-MM-DD"
-                style="width: 100%;"
-                size="large"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20">
-          <el-col :span="24">
-            <el-form-item label="附件" prop="attachment">
-              <FileUpload 
-                v-model="form.attachment" 
-                :limit="10"
-                :file-size="50"
-                :file-type="['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf']"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20">
-          <el-col :span="24">
-            <el-form-item label="备注" prop="remark">
-              <el-input 
-                v-model="form.remark" 
-                type="textarea" 
-                :rows="4"
-                placeholder="请输入内容"
-                size="large"
-              />
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <!-- 商品列表 -->
-        <div class="section-title">
-          <el-button type="primary" @click="handleAddProduct">添加商品报价</el-button>
-        </div>
 
-        <el-table :data="productList" border style="width: 100%; margin-top: 20px;">
-          <el-table-column prop="productCode" label="产品编号" align="center" width="120" />
-          <el-table-column label="产品图片" align="center" width="100">
-            <template #default="scope">
-              <el-image 
-                v-if="scope.row.productImage" 
-                :src="scope.row.productImage" 
-                style="width: 60px; height: 60px;"
-                fit="cover"
-              />
-            </template>
-          </el-table-column>
-          <el-table-column prop="productName" label="产品名称" align="center" show-overflow-tooltip />
-          <el-table-column prop="productType" label="产品类型" align="center" width="120" />
-          <el-table-column prop="brand" label="品牌" align="center" width="100" />
-          <el-table-column prop="unit" label="单位" align="center" width="80" />
-          <el-table-column label="市场价" align="center" width="100">
-            <template #default="scope">
-              <span>¥{{ scope.row.marketPrice || '0.00' }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="平台价" align="center" width="100">
-            <template #default="scope">
-              <span>¥{{ scope.row.platformPrice || '0.00' }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="供应价(元)" align="center" width="120">
-            <template #default="scope">
-              <el-input v-model="scope.row.supplyPrice" placeholder="请输入" />
-            </template>
-          </el-table-column>
-          <el-table-column label="供应时效" align="center" width="120">
-            <template #default="scope">
-              <el-input v-model="scope.row.supplyCycle" placeholder="请输入" />
-            </template>
-          </el-table-column>
-          <el-table-column label="上架状态" align="center" width="100">
-            <template #default="scope">
-              <span>{{ scope.row.upPrice }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column label="操作" align="center" width="100" fixed="right">
-            <template #default="scope">
-              <el-button link type="primary" @click="handleDeleteProduct(scope.$index)">删除</el-button>
-            </template>
-          </el-table-column>
-        </el-table>
-
-      
-
-        <el-row style="margin-top: 20px;">
-          <el-col :span="24" style="text-align: center;">
-            <el-button type="primary" @click="handleSubmit">提交</el-button>
-          </el-col>
-        </el-row>
-      </el-form>
+    <!-- 商品报价信息 -->
+    <el-card shadow="never" class="form-card">
+      <div class="section-title">
+        <el-button type="primary" @click="handleAddProduct">添加商品报价</el-button>
+        <el-button plain @click="handleDownloadTemplate">下载模板</el-button>
+        <el-button plain @click="handleImportClick">导入</el-button>
+        <input
+          ref="fileInputRef"
+          type="file"
+          accept=".xlsx,.xls"
+          style="display: none"
+          @change="handleFileChange"
+        />
+      </div>
+
+      <el-table :data="productList" border style="width: 100%; margin-top: 20px;">
+        <el-table-column prop="productNo" label="产品编号" align="center" width="120" />
+        <el-table-column label="产品图片" align="center" width="100">
+          <template #default="scope">
+            <el-image
+              v-if="scope.row.productImage"
+              :src="scope.row.productImage"
+              style="width: 60px; height: 60px;"
+              fit="cover"
+            />
+          </template>
+        </el-table-column>
+        <el-table-column prop="itemName" label="产品名称" align="center" show-overflow-tooltip />
+        <el-table-column label="产品分类" align="center" width="180" show-overflow-tooltip>
+          <template #default="scope"> 
+            <span>{{ scope.row.topCategoryName }}-{{ scope.row.mediumCategoryName }}-{{ scope.row.bottomCategoryName }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="brandName" label="品牌" align="center" width="100" />
+        <el-table-column prop="unitName" label="单位" align="center" width="80" />
+        <el-table-column label="市场价" align="center" width="100">
+          <template #default="scope">
+            <span>¥{{ scope.row.marketPrice || '0.00' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="官网价" align="center" width="100">
+          <template #default="scope">
+            <span>¥{{ scope.row.memberPrice || '0.00' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="供应价(元)" align="center" width="120">
+          <template #default="scope">
+            <span>¥{{ scope.row.supplyPrice || '0.00' }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" align="center" width="100" fixed="right">
+          <template #default="scope">
+            <el-button link type="primary" @click="handleDeleteProduct(scope.row, scope.$index)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        v-model:page="queryParams.pageNum"
+        v-model:limit="queryParams.pageSize"
+        @pagination="getProductData"
+      />
     </el-card>
 
     <!-- 添加商品对话框 -->
-    <Product 
+    <Product
       v-model:visible="productDialog.visible"
       v-model:modelValue="productList"
+      @confirm="handleProductConfirm"
     />
   </div>
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted, reactive } from 'vue';
-import { useRoute, useRouter } from 'vue-router';
-import { ArrowLeft } from '@element-plus/icons-vue';
-import { getContractsupply, updateContractsupply } from '@/api/supplier/contractsupply';
-import { getCompanyList, listInfo } from '@/api/customer/info';
+import { ref, onMounted, reactive, getCurrentInstance } from 'vue';
+import { useRouter, useRoute } from 'vue-router';
+import { getContractProductList, delContracproductBySupplier, importTemplate, importData } from '@/api/product/contracproduct';
 import { ElMessage } from 'element-plus';
-import FileUpload from '@/components/FileUpload/index.vue';
 import Product from './components/Product.vue';
 
-const route = useRoute();
+const { proxy } = getCurrentInstance() as any;
 const router = useRouter();
+const route = useRoute();
 
-const formRef = ref();
 const productList = ref<any[]>([]);
-const companyList = ref<any[]>([]);
-const supplierList = ref<any[]>([]);
+const total = ref(0);
+const fileInputRef = ref<HTMLInputElement>();
+const queryParams = reactive({
+  pageNum: 1,
+  pageSize: 10
+});
 
 // 商品对话框相关
 const productDialog = reactive({
   visible: false
 });
 
-const form = ref({
-  id: '',
-  contractSupplyNo: '',
-  companyId: '',
-  supplierId: '',
-  supplyNo: '',
-  supplierName: '',
-  startTime: '',
-  endTime: '',
-  attachment: '',
-  remark: '',
-  isSubmit: false
-});
-
-const rules = {
-  // 编辑页面所有字段都不是必填
-};
-
 /** 返回上一页 */
 const goBack = () => {
   router.back();
 };
 
-/** 获取公司列表 */
-const getCompanyData = async () => {
+/** 获取商品列表 */
+const getProductData = async () => {
   try {
-    const res = await getCompanyList({ pageNum: 1, pageSize: 1000 });
-    companyList.value = res.rows || res.data || [];
+    const res = await getContractProductList({
+      supplierId: route.params.id,
+      pageNum: queryParams.pageNum,
+      pageSize: queryParams.pageSize
+    } as any);
+    productList.value = res.rows || []
+    total.value = (res as any).total || 0;
   } catch (e) {
-    console.error('获取公司列表失败:', e);
+    console.error('获取商品列表失败:', e);
+    ElMessage.error('获取商品列表失败');
   }
 };
 
-/** 获取供应商列表 */
-const getSupplierData = async () => {
+/** 添加商品 */
+const handleAddProduct = () => {
+  productDialog.visible = true;
+};
+
+/** 删除商品 */
+const handleDeleteProduct = async (row: any, index: number) => {
+  console.log('handleDeleteProduct', row, index);
   try {
-    const res = await listInfo();
-    supplierList.value = res.rows || [];
+    await proxy?.$modal.confirm('是否确认删除该商品报价数据项?');
+    await delContracproductBySupplier(row.id, route.params.id as string);
+    proxy?.$modal.msgSuccess('删除成功');
+    await getProductData();
   } catch (e) {
-    console.error('获取供应商列表失败:', e);
+    // 用户取消或请求失败时不提示
   }
 };
 
-/** 获取详情数据 */
-const getDetail = async () => {
-  const id = route.params.id as string;
-  if (id) {
-    try {
-      const res = await getContractsupply(id);
-      const data: any = res.data;
-      
-      // 回显基本信息
-      form.value = {
-        id: String(data.id ?? ''),
-        contractSupplyNo: String(data.contractSupplyNo ?? ''),
-        companyId: data.companyId ?? '',
-        supplierId: data.supplierId ?? '',
-        supplyNo: data.supplyNo || '',
-        supplierName: data.supplierName,
-        startTime: data.startTime,
-        endTime: data.endTime,
-        attachment: data.attachment,
-        remark: data.remark,
-        isSubmit: data.isSubmit || false
-      };
-      
-      // 回显商品列表(关键!需要字段映射)
-      productList.value = (data.contractProduct || []).map((item: any) => ({
-        productId: item.productId,
-        productCode: item.productNo,
-        productImage: item.productImage,
-        productName: item.itemName,
-        productType: item.categoryName,
-        brand: item.brandName,
-        unit: item.unitName,
-        basePrice: item.purchasingPrice || 0,
-        marketPrice: item.marketPrice || 0,
-        platformPrice: item.memberPrice || 0,
-        supplyPrice: item.offerPrice || '',
-        supplyCycle: item.supplyCycle || '',
-        upPrice: item.productStatus === 1 ? '上架' : '下架'
-      }));
-    } catch (e) {
-      console.error('获取详情失败:', e);
-      ElMessage.error('获取详情失败');
-    }
-  }
+/** 商品确认添加后,刷新列表 */
+const handleProductConfirm = () => {
+  getProductData();
 };
 
-/** 添加商品 */
-const handleAddProduct = () => {
-  productDialog.visible = true;
+/** 下载导入模板 */
+const handleDownloadTemplate = async () => {
+  try {
+    const res = await importTemplate();
+    const blob = new Blob([res as any], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
+    const url = window.URL.createObjectURL(blob);
+    const link = document.createElement('a');
+    link.href = url;
+    link.download = '合同产品导入模板.xlsx';
+    link.click();
+    window.URL.revokeObjectURL(url);
+    ElMessage.success('模板下载成功');
+  } catch (e) {
+    console.error('下载模板失败:', e);
+    ElMessage.error('下载模板失败');
+  }
 };
 
-/** 删除商品 */
-const handleDeleteProduct = (index: number) => {
-  productList.value.splice(index, 1);
+/** 触发文件选择 */
+const handleImportClick = () => {
+  fileInputRef.value?.click();
 };
 
-/** 提交表单 */
-const handleSubmit = async () => {
-  formRef.value?.validate(async (valid: boolean) => {
-    if (valid) {
-      try {
-        // 组装提交数据,包含表单数据和商品列表
-        const submitData = {
-          ...form.value,
-          contractProduct: productList.value.map(item => ({
-            productId: item.productId,
-            productNo: item.productCode,
-            offerPrice: item.supplyPrice || '',
-            supplyCycle: item.supplyCycle || ''
-          }))
-        };
-        
-        console.log('提交的数据:', submitData);
-        console.log('商品列表:', productList.value);
-        
-        await updateContractsupply(submitData);
-        ElMessage.success('保存成功');
-        router.back();
-      } catch (e) {
-        console.error('保存失败:', e);
-        ElMessage.error('保存失败');
-      }
+/** 导入文件 */
+const handleFileChange = async (event: Event) => {
+  const input = event.target as HTMLInputElement;
+  const file = input.files?.[0];
+  if (!file) return;
+
+  try {
+    await proxy?.$modal.confirm('是否确认导入该文件中的商品数据?');
+    await importData(file);
+    proxy?.$modal.msgSuccess('导入成功');
+    await getProductData();
+  } catch (e) {
+    // 用户取消或请求失败时不提示
+    if (e !== 'cancel') {
+      console.error('导入失败:', e);
     }
-  });
+  } finally {
+    // 重置文件选择,以便可以重复选择同一文件
+    input.value = '';
+  }
 };
 
 onMounted(() => {
-  getSupplierData();
-  getDetail();
-  getCompanyData();
+  getProductData();
 });
 </script>
 
@@ -362,14 +232,6 @@ onMounted(() => {
   padding: 24px;
 }
 
-.large-form :deep(.el-form-item__label) {
-  font-weight: 500;
-}
-
-.form-text {
-  color: #303133;
-}
-
 .section-title {
   margin: 20px 0;
   padding-bottom: 12px;

+ 20 - 199
src/views/supplier/contractsupply/index.vue

@@ -4,38 +4,17 @@
       <div v-show="showSearch" class="mb-[10px]">
         <el-card shadow="hover">
           <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px">
-            <el-form-item label="协议单号" prop="contractSupplyNo">
-              <el-input v-model="queryParams.contractSupplyNo" placeholder="请输入协议单号" clearable @keyup.enter="handleQuery" />
+            <el-form-item label="供应商编号" prop="supplierNo">
+              <el-input v-model="queryParams.supplierNo" placeholder="请输入供应商编号" clearable @keyup.enter="handleQuery" />
             </el-form-item>
 
-            <el-form-item label="供应商名称" prop="supplierName">
-              <el-input v-model="queryParams.supplierName" placeholder="供应商名称" clearable @keyup.enter="handleQuery" />
-            </el-form-item>
-
-            <el-form-item label="开始时间" prop="startTime">
-              <el-date-picker clearable
-                v-model="queryParams.startTime"
-                type="date"
-                value-format="YYYY-MM-DD"
-                placeholder="请选择开始时间"
-              />
-            </el-form-item>
-            <el-form-item label="结束时间" prop="endTime">
-              <el-date-picker clearable
-                v-model="queryParams.endTime"
-                type="date"
-                value-format="YYYY-MM-DD"
-                placeholder="请选择结束时间"
-              />
+            <el-form-item label="供应商名称" prop="enterpriseName">
+              <el-input v-model="queryParams.enterpriseName" placeholder="请输入供应商名称" clearable @keyup.enter="handleQuery" />
             </el-form-item>
             <el-form-item>
               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
               <el-button icon="Refresh" @click="resetQuery">重置</el-button>
-              <el-button type="primary" icon="Plus" @click="handleAdd" v-hasPermi="['supplier:contractsupply:add']">新增</el-button>
             </el-form-item>
-           
-              
-            
           </el-form>
         </el-card>
       </div>
@@ -44,36 +23,16 @@
     <el-card shadow="never">
       <template #header>
         <el-row :gutter="10" class="mb8">
-          协议供货信息列表
+          供应商列表
         </el-row>
       </template>
 
-      <el-table v-loading="loading" border :data="contractsupplyList">
+      <el-table v-loading="loading" border :data="supplierList">
         <el-table-column label="主键ID" align="center" prop="id" v-if="false" />
-        <el-table-column label="协议单号" align="center" prop="contractSupplyNo" />
-        <el-table-column label="供应商编号" align="center" prop="supplyNo" />
-        <el-table-column label="供应商名称" align="left" prop="supplierName" min-width="220" />
-        <el-table-column label="商品数量" align="center" prop="productNumber" />
-        <el-table-column label="开始时间" align="center" prop="startTime" width="180">
-          <template #default="scope">
-            <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="结束时间" align="center" prop="endTime" width="180">
-          <template #default="scope">
-            <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="剩余时限(天)" align="center" prop="timeRemaining" />
-        <el-table-column label="状态" align="center" prop="status">
-          <template #default="scope">
-            <dict-tag :options="contract_supplier_status" :value="scope.row.status"/>
-          </template>
-        </el-table-column>
+        <el-table-column label="供应商编号" align="center" prop="supplierNo" />
+        <el-table-column label="供应商名称" align="left" prop="enterpriseName" min-width="220" />
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template #default="scope">
-            <el-button link type="primary" @click="handleAudit(scope.row)" v-hasPermi="['supplier:contractsupply:edit']" v-if="scope.row.status !== 0 && scope.row.status !== '0' && scope.row.status !== 1 && scope.row.status !== '1'">审核</el-button>
-            <el-divider direction="vertical" />
             <el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['supplier:contractsupply:edit']">编辑</el-button>
           </template>
         </el-table-column>
@@ -81,89 +40,32 @@
 
       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
     </el-card>
-    <!-- 添加或修改协议供货对话框 -->
-    <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
-      <el-form ref="contractsupplyFormRef" :model="form" :rules="rules" label-width="80px">
-      </el-form>
-      <template #footer>
-        <div class="dialog-footer">
-          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
-          <el-button @click="cancel">取 消</el-button>
-        </div>
-      </template>
-    </el-dialog>
-
-    <!-- 审核对话框 -->
-    <el-dialog title="审核" v-model="auditDialog.visible" width="500px" append-to-body>
-      <el-form ref="auditFormRef" :model="auditForm" :rules="auditRules" label-width="100px">
-        <el-form-item label="审核结果" prop="status">
-          <el-select v-model="auditForm.status" placeholder="请选择" style="width: 100%;">
-            <el-option label="生效" :value="1" />
-            <el-option label="驳回" :value="0" />
-          </el-select>
-        </el-form-item>
-      </el-form>
-      <template #footer>
-        <div class="dialog-footer">
-          <el-button type="primary" @click="submitAudit">确 定</el-button>
-          <el-button @click="cancelAudit">取 消</el-button>
-        </div>
-      </template>
-    </el-dialog>
   </div>
 </template>
 
 <script setup name="Contractsupply" lang="ts">
-import { listContractsupply, getContractsupply, delContractsupply, addContractsupply, updateContractsupply, auditContractsupply } from '@/api/supplier/contractsupply';
-import { ContractsupplyVO, ContractsupplyQuery, ContractsupplyForm } from '@/api/supplier/contractsupply/types';
+import { getApproveList } from '@/api/customer/info';
+import { InfoVO, InfoQuery } from '@/api/customer/info/types';
 import { useRouter } from 'vue-router';
 
 const router = useRouter();
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
-const { contract_supplier_status } = toRefs<any>(proxy?.useDict('contract_supplier_status'));
 
-const contractsupplyList = ref<ContractsupplyVO[]>([]);
-const buttonLoading = ref(false);
+const supplierList = ref<InfoVO[]>([]);
 const loading = ref(true);
 const showSearch = ref(true);
 const total = ref(0);
 
 const queryFormRef = ref<ElFormInstance>();
-const contractsupplyFormRef = ref<ElFormInstance>();
-const auditFormRef = ref<ElFormInstance>();
-
-const dialog = reactive<DialogOption>({
-  visible: false,
-  title: ''
-});
-
-const auditDialog = reactive({
-  visible: false,
-  currentRow: null as ContractsupplyVO | null
-});
-
-const auditForm = ref({
-  status: undefined as number | undefined
-});
-
-const auditRules = {
-  status: [
-    { required: true, message: '请选择审核结果', trigger: 'change' }
-  ]
-};
 
-const initFormData: ContractsupplyForm = {
-}
-const data = reactive<PageData<ContractsupplyForm, ContractsupplyQuery>>({
-  form: {...initFormData},
+const data = reactive<PageData<Record<string, any>, InfoQuery>>({
+  form: {},
   queryParams: {
     pageNum: 1,
     pageSize: 10,
-    contractSupplyNo: undefined,
-    supplierName: undefined,
-    startTime: undefined,
-    endTime: undefined,
+    supplierNo: undefined,
+    enterpriseName: undefined,
     params: {
     }
   },
@@ -173,27 +75,15 @@ const data = reactive<PageData<ContractsupplyForm, ContractsupplyQuery>>({
 
 const { queryParams, form, rules } = toRefs(data);
 
-/** 查询协议供货列表 */
+/** 查询供应商列表 */
 const getList = async () => {
   loading.value = true;
-  const res = await listContractsupply(queryParams.value);
-  contractsupplyList.value = res.rows;
+  const res = await getApproveList(queryParams.value);
+  supplierList.value = res.rows;
   total.value = res.total;
   loading.value = false;
 }
 
-/** 取消按钮 */
-const cancel = () => {
-  reset();
-  dialog.visible = false;
-}
-
-/** 表单重置 */
-const reset = () => {
-  form.value = {...initFormData};
-  contractsupplyFormRef.value?.resetFields();
-}
-
 /** 搜索按钮操作 */
 const handleQuery = () => {
   queryParams.value.pageNum = 1;
@@ -211,8 +101,8 @@ const handleAdd = () => {
   router.push('/supplier/contractsupply/add');
 }
 
-/** 修改按钮操作 */
-const handleUpdate = async (row?: ContractsupplyVO) => {
+/** 修改按钮操作 - 跳转合约供货编辑页,传入供应商ID */
+const handleUpdate = async (row?: InfoVO) => {
   const _id = row?.id;
   if (!_id) {
     proxy?.$modal.msgWarning('请选择要编辑的数据');
@@ -221,75 +111,6 @@ const handleUpdate = async (row?: ContractsupplyVO) => {
   router.push(`/supplier/contractsupply/edit/${_id}`);
 }
 
-/** 审核按钮操作 */
-const handleAudit = (row: ContractsupplyVO) => {
-  auditDialog.currentRow = row;
-  auditForm.value.status = undefined;
-  auditDialog.visible = true;
-};
-
-/** 提交审核 */
-const submitAudit = () => {
-  auditFormRef.value?.validate(async (valid: boolean) => {
-    if (valid && auditDialog.currentRow) {
-      try {
-        await auditContractsupply({
-          id: auditDialog.currentRow.id!,
-          status: auditForm.value.status!
-        });
-        proxy?.$modal.msgSuccess("审核成功");
-        auditDialog.visible = false;
-        await getList();
-      } catch (e) {
-        console.error('审核失败:', e);
-      }
-    }
-  });
-};
-
-/** 取消审核 */
-const cancelAudit = () => {
-  auditDialog.visible = false;
-  auditForm.value.status = undefined;
-};
-
-/** 提交按钮 */
-const submitForm = () => {
-  contractsupplyFormRef.value?.validate(async (valid: boolean) => {
-    if (valid) {
-      buttonLoading.value = true;
-      if (form.value.id) {
-        await updateContractsupply(form.value).finally(() =>  buttonLoading.value = false);
-      } else {
-        await addContractsupply(form.value).finally(() =>  buttonLoading.value = false);
-      }
-      proxy?.$modal.msgSuccess("操作成功");
-      dialog.visible = false;
-      await getList();
-    }
-  });
-}
-
-/** 删除按钮操作 */
-const handleDelete = async (row?: ContractsupplyVO) => {
-  const _ids = row?.id;
-  if (!_ids) {
-    proxy?.$modal.msgWarning('请选择要删除的数据');
-    return;
-  }
-  await proxy?.$modal.confirm('是否确认删除协议供货编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
-  await delContractsupply(_ids);
-  proxy?.$modal.msgSuccess("删除成功");
-  await getList();
-}
-
-/** 导出按钮操作 */
-const handleExport = () => {
-  proxy?.download('supplier/contractsupply/export', {
-    ...queryParams.value
-  }, `contractsupply_${new Date().getTime()}.xlsx`)
-}
-
 onActivated(() => {
   getList();
 });