From 22cc8ce22157a32bfcd4ee14d824769c6e318cec Mon Sep 17 00:00:00 2001
From: p-honggang.li <p-honggang.li@pcitc.com>
Date: 星期一, 08 九月 2025 23:30:57 +0800
Subject: [PATCH] 修改取消订单列表展示的问题

---
 src/views/tradeManage/buyer/index.vue |  168 ++++++++++++++++++++++++++++---------------------------
 1 files changed, 85 insertions(+), 83 deletions(-)

diff --git a/src/views/tradeManage/buyer/index.vue b/src/views/tradeManage/buyer/index.vue
index 4c67314..84e7ce4 100644
--- a/src/views/tradeManage/buyer/index.vue
+++ b/src/views/tradeManage/buyer/index.vue
@@ -35,11 +35,11 @@
               <el-option v-for="item in productTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
             </el-select>
           </el-form-item>
-          <el-form-item label="" class="col-17">
-            <el-select v-model="query.productSubType" placeholder="璇烽�夋嫨浜у搧绫诲瀷瀛愮骇" clearable style="width: 100%">
-              <el-option v-for="item in productSubTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
-            </el-select>
-          </el-form-item>
+<!--          <el-form-item label="" class="col-17">-->
+<!--            <el-select v-model="query.productSubType" placeholder="璇烽�夋嫨浜у搧绫诲瀷瀛愮骇" clearable style="width: 100%">-->
+<!--              <el-option v-for="item in productSubTypeOptions" :key="item.value" :label="item.label" :value="item.value" />-->
+<!--            </el-select>-->
+<!--          </el-form-item>-->
           <el-form-item label="鐢宠鏃堕棿" class="col-30">
             <el-date-picker
               v-model="query.dateRange"
@@ -74,7 +74,7 @@
               <template #default="{ row }">
                 <div v-if="row.isMainOrder" class="main-order-info">
                   <div class="order-header">
-                    
+
                     <div class="order-item">
                       <span class="label">鐢宠鏃堕棿:</span>
                       <span class="value">{{ row.applyTime }}</span>
@@ -103,7 +103,7 @@
               </template>
             </el-table-column>
           </el-table-column>
-          
+
           <!-- 璐拱鏂瑰紡 -->
           <el-table-column label="璐拱鏂瑰紡" align="center">
             <el-table-column label="閿�鍞舰寮�/璐︽埛鏁伴噺" width="150">
@@ -137,7 +137,7 @@
               </template>
             </el-table-column>
           </el-table-column>
-          
+
           <!-- 鎬讳环 -->
           <el-table-column label="鎬讳环" align="center">
             <el-table-column label="鍗曚环" prop="unitPrice" width="90">
@@ -166,7 +166,7 @@
               </template>
             </el-table-column>
           </el-table-column>
-          
+
           <!-- 鏈熼檺(骞�) -->
           <el-table-column label="鏈熼檺(骞�)" align="center" width="80">
             <el-table-column label="" prop="period" width="80">
@@ -179,7 +179,7 @@
               </template>
             </el-table-column>
           </el-table-column>
-          
+
           <!-- 鎿嶄綔 -->
           <el-table-column label="鎿嶄綔" align="center" width="120" class="operation-column">
             <el-table-column label="" width="120">
@@ -190,56 +190,56 @@
                     <div class="action-item">
                       <div class="action-buttons">
                         <template v-for="action in getAvailableActions(row.parentOrder)" :key="action.type">
-                          <el-button 
+                          <el-button
                             v-if="action.type === ActionType.VIEW"
-                            type="primary" 
-                            link 
-                            size="small" 
+                            type="primary"
+                            link
+                            size="small"
                             @click="handleAction(action, row.parentOrder)"
                           >
                             鏌ョ湅
                           </el-button>
-                          <el-button 
+                          <el-button
                             v-else-if="action.type === ActionType.TRACK"
-                            type="primary" 
-                            link 
-                            size="small" 
+                            type="primary"
+                            link
+                            size="small"
                             @click="handleAction(action, row.parentOrder)"
                           >
                             杩借釜
                           </el-button>
-                          <el-button 
+                          <el-button
                             v-else-if="action.type === ActionType.UPLOAD_FILE"
-                            type="primary" 
-                            link 
-                            size="small" 
+                            type="primary"
+                            link
+                            size="small"
                             @click="handleAction(action, row.parentOrder)"
                           >
                             鎻愪氦鏂囦欢
                           </el-button>
-                          <el-button 
+                          <el-button
                             v-else-if="action.type === ActionType.CONFIRM_TRADE"
-                            type="primary" 
-                            link 
-                            size="small" 
+                            type="primary"
+                            link
+                            size="small"
                             @click="handleAction(action, row.parentOrder)"
                           >
                             浜ゆ槗纭
                           </el-button>
-                          <el-button 
-                            v-else-if="action.type === ActionType.EVALUATE"
-                            type="primary" 
-                            link 
-                            size="small" 
+                          <el-button
+                            v-else-if="action.type === ActionType.EVALUATE && row.parentOrder.isEvaluate === '鏈瘎浠�'"
+                            type="primary"
+                            link
+                            size="small"
                             @click="handleAction(action, row.parentOrder)"
                           >
                             璇勪环
                           </el-button>
-                          <el-button 
+                          <el-button
                             v-else-if="action.type === ActionType.CANCEL_ORDER"
-                            type="danger" 
-                            link 
-                            size="small" 
+                            type="danger"
+                            link
+                            size="small"
                             @click="handleAction(action, row.parentOrder)"
                           >
                             鍙栨秷璁㈠崟
@@ -268,11 +268,11 @@
         />
       </div>
     </el-card>
-    
+
     <!-- 璁㈠崟鐘舵�佸璇濇 -->
-    <!-- <ProductOrderStatusDialog 
-      v-model="orderStatusDialogVisible" 
-      :order-id="currentOrderId" 
+    <!-- <ProductOrderStatusDialog
+      v-model="orderStatusDialogVisible"
+      :order-id="currentOrderId"
     /> -->
   </div>
 </template>
@@ -280,12 +280,10 @@
 <script setup lang="ts">
 import { onMounted, reactive, ref } from 'vue'
 import { useRouter } from 'vue-router'
-import { Search, Refresh } from '@element-plus/icons-vue'
 import { ElMessage, ElMessageBox } from 'element-plus'
 import orderApi from '@/api/orderApi'
 import productApi from '@/api/productApi'
 import { useUserInfo } from '@/stores/modules/userInfo'
-import ProductOrderStatusDialog from '@/views/productManage/productOrderStatusDialog/index.vue'
 import { OrderWorkflowController, OrderStatus, ActionType, PageType, StatusMapper } from '@/utils/orderWorkflow'
 import { queryUserDetail } from '@/api/userInfo'
 
@@ -345,6 +343,7 @@
   [OrderStatus.WAIT_CONFIRM]: 'WAIT_CONFIRM',
   [OrderStatus.COMPLETED]: 'COMPLETED',
   [OrderStatus.EVALUATED]: 'EVALUATED',
+  [OrderStatus.CANCELED]: 'CANCELED'
 }
 
 const formatDateTime = (val?: string) => {
@@ -379,7 +378,8 @@
 // 鑾峰彇浜у搧绫诲瀷閫夐」
 const getProductTypeOptions = async () => {
   try {
-    const res = await productApi.getCategoryByParent({ parentCode: 'product_type' })
+      // product_type
+    const res = await productApi.getCategoryByParent({ parentCode: 'ProductTechnologyType' })
     if (res?.code === 200 && res.data) {
       productTypeOptions.value = res.data.map((item: any) => ({
         label: item.name,
@@ -444,7 +444,7 @@
   // 娓呯┖浜у搧瀛愮骇閫夋嫨
   query.productSubType = ''
   // 鑾峰彇瀵瑰簲鐨勪骇鍝佸瓙绾ч�夐」
-  await getProductSubTypeOptions(value)
+ //  await getProductSubTypeOptions(value)
 }
 
 // 鑾峰彇鐘舵�佺被鍨�
@@ -455,6 +455,7 @@
     WAIT_CONFIRM: 'warning',
     COMPLETED: 'success',
     EVALUATED: 'success',
+    CANCELED: 'danger'
   }
   return statusMap[status] || 'info'
 }
@@ -552,7 +553,7 @@
     payload.applyTimeStart = query.dateRange[0]
     payload.applyTimeEnd = query.dateRange[1]
   }
-  
+
   // 娣诲姞浜у搧鏉′欢鏌ヨ
   if (query.industry) payload.industryId = query.industry
   if (query.unitProject) payload.unitProjectId = query.unitProject
@@ -562,7 +563,7 @@
   // 鏍规嵁鏄惁鏈変骇鍝佹潯浠堕�夋嫨涓嶅悓鐨凙PI
   const hasProductConditions = query.industry || query.unitProject || query.productType || query.productSubType
   const apiMethod = hasProductConditions ? orderApi.getBuyerOrderPageWithProductConditions : orderApi.getBuyerOrderPage
-  
+
   const res = (await apiMethod(payload)) as any
   const pageData = res?.data
   const list: any[] = Array.isArray(pageData?.list) ? pageData.list : []
@@ -581,7 +582,8 @@
       status: uiStatus,
       statusName: order.orderStatus || '',
       orderStatus: StatusMapper.toUIStatus(order.orderStatus), // 杞崲涓烘爣鍑嗙姸鎬佹灇涓�
-      workFlowId: order.workflowId || ''
+      workFlowId: order.workflowId || '',
+      isEvaluate: order.isEvaluate || ''
     }
     const subOrders: any[] = Array.isArray(order?.orderDetails)
       ? order.orderDetails.map((d: any, i: number) => ({
@@ -690,9 +692,9 @@
       type: 'warning',
       confirmButtonClass: 'el-button--danger'
     })
-    
+
     const res = await orderApi.cancelOrder(order.id)
-    
+
     if (res && res.code === 200) {
       ElMessage.success('璁㈠崟鍙栨秷鎴愬姛')
       handleSearch() // 鍒锋柊鍒楄〃
@@ -724,13 +726,13 @@
       return
     }
   }
-  
+
   // 鑾峰彇鍒濆閫夐」鏁版嵁
   await Promise.all([
     getIndustryOptions(),
     getProductTypeOptions()
   ])
-  
+
   // 鎵ц鎼滅储
   handleSearch()
 })
@@ -768,7 +770,7 @@
       border-bottom: 2px solid #e4e7ed; // 涓庡垎闅旇涓�鑷寸殑涓嬭竟妗�
     }
   }
-  
+
   // 璋冩暣琛ㄥご楂樺害
   tr:first-child {
     th {
@@ -785,18 +787,18 @@
 
 .search-card {
   margin-bottom: 20px;
-  
+
   .query-form {
     .form-row {
       display: flex;
       gap: 0;
       width: 100%;
       margin-bottom: 8px;
-      
+
       &.actions {
         justify-content: flex-end;
       }
-      
+
       .el-form-item { margin-right: 0 !important; }
       > .el-form-item { padding-right: 8px; }
       > .el-form-item:last-child { padding-right: 0; }
@@ -810,7 +812,7 @@
     .el-form-item {
       margin-bottom: 16px;
       margin-right: 20px;
-      
+
       &:last-child {
         margin-right: 0;
       }
@@ -821,7 +823,7 @@
 .table-container {
   position: relative;
   z-index: 1;
-  
+
   .custom-table {
     // 琛ㄥご绗簩琛屾枃瀛楀ぇ灏忚皟鏁�
     .el-table__header-wrapper {
@@ -834,7 +836,7 @@
         }
       }
     }
-    
+
     // 纭繚琛ㄥご鎵�鏈夎鐨勬枃瀛楀ぇ灏忎竴鑷�
     .el-table__header {
       th {
@@ -844,23 +846,23 @@
         }
       }
     }
-    
+
     .el-table {
       position: relative;
       z-index: 1;
-      
+
       .main-order-row {
         background-color: #f8f9fa;
         font-weight: 600;
-        
+
         td {
           border-bottom: 2px solid #e4e7ed;
         }
       }
-      
+
       .sub-order-row {
         background-color: #ffffff;
-        
+
         td {
           border-bottom: 1px solid #ebeef5;
         }
@@ -886,14 +888,14 @@
       gap: 8px;
       flex-shrink: 0;
       flex: 1;
-      
+
       .label {
         color: #909399;
         font-size: 12px;
         min-width: 60px;
         flex-shrink: 0;
       }
-      
+
       .value {
         color: #303133;
         font-size: 12px;
@@ -908,22 +910,22 @@
 
 .price-info {
   font-size: 12px;
-  
+
   .price-points {
     color: #e6a23c;
     font-weight: 500;
   }
-  
+
   .price-currency {
     color: #67c23a;
     font-weight: 500;
   }
-  
+
   .price-agreement {
     color: #409eff;
     font-weight: 500;
   }
-  
+
   .price-free {
     color: #909399;
     font-style: italic;
@@ -935,7 +937,7 @@
   align-items: center;
   gap: 8px;
   font-size: 12px;
-  
+
   .permanent {
     color: #909399;
     font-size: 12px;
@@ -967,18 +969,18 @@
     display: flex;
     align-items: center;
     margin-bottom: 4px;
-    
+
     &:last-child {
       margin-bottom: 0;
     }
-    
+
     .label {
       color: #909399;
       font-size: 12px;
       min-width: 60px;
       flex-shrink: 0;
     }
-    
+
     .value {
       color: #303133;
       font-size: 12px;
@@ -999,7 +1001,7 @@
   color: #303133;
   text-align: center;
   line-height: 1.4;
-  
+
   .all-actions {
     display: flex;
     flex-direction: column;
@@ -1007,10 +1009,10 @@
     justify-content: center;
     gap: 6px;
     width: 100%;
-    
+
     .action-item {
       width: 100%;
-      
+
       .action-buttons {
         display: flex;
         flex-direction: column;
@@ -1018,7 +1020,7 @@
         align-items: center;
         justify-content: center;
         width: 100%;
-        
+
         .el-button {
           width: 100%;
           text-align: center;
@@ -1030,7 +1032,7 @@
           height: auto;
           line-height: 1.2;
         }
-        
+
         .op-text {
           margin: 4px 0;
           text-align: center;
@@ -1050,12 +1052,12 @@
   flex-wrap: wrap;
 }
 
-.op-text { 
-  color: #606266; 
+.op-text {
+  color: #606266;
   font-size: 12px;
 }
-.op-text.warning { 
-  color: #f59e0b; 
+.op-text.warning {
+  color: #f59e0b;
   font-size: 12px;
 }
 
@@ -1076,11 +1078,11 @@
   .el-table__fixed-right {
     z-index: 2 !important;
   }
-  
+
   .el-table__fixed-right-patch {
     z-index: 2 !important;
   }
-  
+
   // 鎿嶄綔鍒楁牱寮忎紭鍖�
   .operation-column {
     .cell {

--
Gitblit v1.8.0