From b9271e9537308854e20d7e6c7af2c77d8475a288 Mon Sep 17 00:00:00 2001
From: p-honggang.li <p-honggang.li@pcitc.com>
Date: 星期六, 06 九月 2025 03:17:38 +0800
Subject: [PATCH] 修改审核页面,添加积分审核代办,积分审核已办,协议审核代办,协议审核代办,修改规则分页显示bug,修改订购问题BUG

---
 src/views/tradeManage/upload/index.vue               |    8 
 src/stores/interface/index.ts                        |    1 
 src/views/pointsManage/ruleList/index.vue            |    9 
 src/views/productManage/productPriceViewer/index.vue |   81 ++++++++-----
 src/views/approveManage/tradeApproval/approve.vue    |   74 ++++++-----
 src/views/approveManage/tradeApproval/list.vue       |  155 ++++++++++++++++++++++++-
 src/stores/modules/userInfo.ts                       |    5 
 src/utils/orderWorkflow.ts                           |   26 +++
 8 files changed, 270 insertions(+), 89 deletions(-)

diff --git a/src/stores/interface/index.ts b/src/stores/interface/index.ts
index b57d094..b514b28 100644
--- a/src/stores/interface/index.ts
+++ b/src/stores/interface/index.ts
@@ -93,6 +93,7 @@
     unitId?:any
     roleCodes?:any
     userInfo?:any
+    departmentId?: string
 }
 
 export interface TaskItem {
diff --git a/src/stores/modules/userInfo.ts b/src/stores/modules/userInfo.ts
index 68a3b15..b6a7371 100644
--- a/src/stores/modules/userInfo.ts
+++ b/src/stores/modules/userInfo.ts
@@ -14,6 +14,7 @@
       empCode:'',
       userId:'',
       unitId:'',//绉熸埛ID
+      departmentId: '',
       roleCodes:[],
       userInfo:{
         adminToken: '', // 绠$悊鍚庡彴鐨則oken
@@ -66,6 +67,7 @@
       this.fullUnitName = user.fullUnitName
       this.userId = user.id
       this.unitId = user.unitId
+      this.departmentId = user.departmentId
       this.roleCodes = user.roleCodes
       this.userInfo=user
     },
@@ -113,6 +115,9 @@
     getUnitId: (state) => {
       return state.unitId
     },
+    getDepartmentId: (state) => {
+      return state.departmentId
+    },
     getRoleCodes: (state) => {
       return state.roleCodes
     },
diff --git a/src/utils/orderWorkflow.ts b/src/utils/orderWorkflow.ts
index a13246c..14ba710 100644
--- a/src/utils/orderWorkflow.ts
+++ b/src/utils/orderWorkflow.ts
@@ -6,7 +6,8 @@
 // 璁㈠崟鐘舵�佹灇涓撅紙鎸夌収娴佺▼椤哄簭锛�
 export enum OrderStatus {
   WAIT_UPLOAD = '寰呬笂浼犳枃浠�',      // 1
-  WAIT_AUTHORIZE = '寰呮巿鏉�',       // 2  
+  WAIT_AUTHORIZE = '寰呮巿鏉�',       // 2
+  WAIT_APPROVAL_AUTHORIZE = '寰呭鎵规巿鏉�',
   WAIT_CONFIRM = '寰呬氦鏄撶‘璁�',     // 3
   COMPLETED = '宸插畬鎴�',           // 4
   EVALUATED = '宸茶瘎浠�'            // 5 (鏈�缁堢姸鎬�)
@@ -21,7 +22,8 @@
   CONFIRM_TRADE = '浜ゆ槗纭',
   EVALUATE = '璇勪环',
   CANCEL_ORDER = '鍙栨秷璁㈠崟',
-  COMPLETED = '宸插畬鎴�'
+  COMPLETED = '宸插畬鎴�',
+  WAIT_APPROVAL_AUTHORIZE = '瀹℃壒'
 }
 
 // 椤甸潰绫诲瀷鏋氫妇
@@ -50,6 +52,11 @@
       { type: ActionType.TRACK },
       { type: ActionType.AUTHORIZE, routeName: 'tradeApproval' }
     ],
+    [OrderStatus.WAIT_APPROVAL_AUTHORIZE]: [
+      { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
+      { type: ActionType.TRACK },
+      { type: ActionType.WAIT_APPROVAL_AUTHORIZE, routeName: 'tradeApproval' }
+    ],
     [OrderStatus.WAIT_CONFIRM]: [
       { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
       { type: ActionType.TRACK }
@@ -74,6 +81,11 @@
       { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
       { type: ActionType.TRACK },
       { type: ActionType.CANCEL_ORDER }
+    ],
+    [OrderStatus.WAIT_APPROVAL_AUTHORIZE]: [
+      { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
+      { type: ActionType.TRACK },
+      { type: ActionType.WAIT_APPROVAL_AUTHORIZE, routeName: 'tradeApproval' }
     ],
     [OrderStatus.WAIT_CONFIRM]: [
       { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
@@ -100,6 +112,11 @@
       { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
       { type: ActionType.TRACK }
     ],
+    [OrderStatus.WAIT_APPROVAL_AUTHORIZE]: [
+      { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
+      { type: ActionType.TRACK },
+      { type: ActionType.WAIT_APPROVAL_AUTHORIZE, routeName: 'tradeApproval' }
+    ],
     [OrderStatus.WAIT_CONFIRM]: [
       { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
       { type: ActionType.TRACK }
@@ -117,8 +134,9 @@
 
 // 鐘舵�佹祦杞槧灏勶紙褰撳墠鐘舵�� -> 涓嬩竴涓姸鎬侊級
 const STATUS_FLOW_MAP: Record<OrderStatus, OrderStatus | null> = {
-  [OrderStatus.WAIT_UPLOAD]: OrderStatus.WAIT_AUTHORIZE,
+  [OrderStatus.WAIT_UPLOAD]: OrderStatus.WAIT_APPROVAL_AUTHORIZE,
   [OrderStatus.WAIT_AUTHORIZE]: OrderStatus.WAIT_CONFIRM,
+  [OrderStatus.WAIT_APPROVAL_AUTHORIZE]: OrderStatus.WAIT_CONFIRM,
   [OrderStatus.WAIT_CONFIRM]: OrderStatus.COMPLETED,
   [OrderStatus.COMPLETED]: OrderStatus.EVALUATED,
   [OrderStatus.EVALUATED]: null // 鏈�缁堢姸鎬侊紝鏃犱笅涓�鐘舵��
@@ -245,6 +263,8 @@
         return OrderStatus.WAIT_UPLOAD
       case '寰呮巿鏉�':
         return OrderStatus.WAIT_AUTHORIZE
+      case '寰呭鎵规巿鏉�':
+        return OrderStatus.WAIT_APPROVAL_AUTHORIZE
       case '寰呬氦鏄撶‘璁�':
         return OrderStatus.WAIT_CONFIRM
       case '宸插畬鎴�':
diff --git a/src/views/approveManage/tradeApproval/approve.vue b/src/views/approveManage/tradeApproval/approve.vue
index c9da9b0..87f98ee 100644
--- a/src/views/approveManage/tradeApproval/approve.vue
+++ b/src/views/approveManage/tradeApproval/approve.vue
@@ -501,37 +501,41 @@
       approverId: userId,
       approverName: userStore.getUserDetail || '绠$悊鍛�',
       approvalType: isAgreementOrder.value ? '瀹℃壒' : '鎺堟潈',
-      approvalResult: '閫氳繃'
+      approvalResult: '閫氳繃',
+      orderDetails: form.items.map((item: any) => ({
+        id: item.id,
+        remarks: item.remark || '' // 浣跨敤琛ㄥ崟涓殑澶囨敞
+      }))
     })
     
     if (result && result.code === 200) {
       // 鏇存柊浜ゆ槗淇℃伅澶囨敞锛堝彧鏇存柊remarks锛屼笉鏇存柊璁㈠崟鐘舵�侊級
-      const updateData = {
-        orderId: orderId,
-        orderDetails: form.items.map((item: any) => ({
-          id: item.id,
-          remarks: item.remark || '' // 浣跨敤琛ㄥ崟涓殑澶囨敞
-        }))
-      }
-      
-      await orderApi.updateOrderDetailRemarksOnly(updateData)
-      
-      // 瀹℃壒閫氳繃鍚庯紝浣跨敤鏂扮殑API鎺ュ彛鏇存柊璁㈠崟鐘舵�佸埌涓嬩竴涓姸鎬�
-      await orderApi.updateOrderStatusToNext(orderId)
+      // const updateData = {
+      //   orderId: orderId,
+      //   orderDetails: form.items.map((item: any) => ({
+      //     id: item.id,
+      //     remarks: item.remark || '' // 浣跨敤琛ㄥ崟涓殑澶囨敞
+      //   }))
+      // }
+      //
+      // await orderApi.updateOrderDetailRemarksOnly(updateData)
+      //
+      // // 瀹℃壒閫氳繃鍚庯紝浣跨敤鏂扮殑API鎺ュ彛鏇存柊璁㈠崟鐘舵�佸埌涓嬩竴涓姸鎬�
+      // await orderApi.updateOrderStatusToNext(orderId)
       ElMessage.success('瀹℃壒閫氳繃鎴愬姛')
-      if(!detail.workflowId.value){
-        ElMessage.error("宸ヤ綔娴乮d涓虹┖涓嶈兘杩涜宸ヤ綔娴佷换鍔℃彁浜�")
-        return
-      }
-      // 璋冪敤宸ヤ綔娴�
-      const wfRes: any = await workFlowApi.completeWorkflow({
-        taskId: String(detail.workflowId.value),
-        userid: userStore.getUserId,
-        commponet: '瀹℃牳閫氳繃'
-      })
-      if (wfRes?.code === 200 && wfRes.data?.processinstId) {
-         console.log('宸ヤ綔娴佹彁浜ゆ垚鍔�')
-      }
+      // if(!detail.workflowId.value){
+      //   ElMessage.error("宸ヤ綔娴乮d涓虹┖涓嶈兘杩涜宸ヤ綔娴佷换鍔℃彁浜�")
+      //   return
+      // }
+      // // 璋冪敤宸ヤ綔娴�
+      // const wfRes: any = await workFlowApi.completeWorkflow({
+      //   taskId: String(detail.workflowId.value),
+      //   userid: userStore.getUserId,
+      //   commponet: '瀹℃牳閫氳繃'
+      // })
+      // if (wfRes?.code === 200 && wfRes.data?.processinstId) {
+      //    console.log('宸ヤ綔娴佹彁浜ゆ垚鍔�')
+      // }
       router.back()
     } else {
       ElMessage.error(result?.msg || '瀹℃壒閫氳繃澶辫触')
@@ -583,17 +587,17 @@
     
     if (result && result.code === 200) {
       // 椹冲洖璁㈠崟锛屾洿鏂拌鍗曠姸鎬佸埌涓婁竴涓姸鎬�
-      await orderApi.updateOrderStatusToPrevious(orderId)
+      // await orderApi.updateOrderStatusToPrevious(orderId)
       ElMessage.success('椹冲洖鎴愬姛')
       // 璋冪敤宸ヤ綔娴�
-      const wfRes: any = await workFlowApi.rejectStartNodeWorkflow({
-        taskId: String(detail.workflowId.value),
-        userid: userStore.getUserId,
-        commponet: '椹冲洖'
-      })
-      if (wfRes?.code === 200 && wfRes.data?.processinstId) {
-        console.log('宸ヤ綔娴侀┏鍥炴垚鍔�')
-      }
+      // const wfRes: any = await workFlowApi.rejectStartNodeWorkflow({
+      //   taskId: String(detail.workflowId.value),
+      //   userid: userStore.getUserId,
+      //   commponet: '椹冲洖'
+      // })
+      // if (wfRes?.code === 200 && wfRes.data?.processinstId) {
+      //   console.log('宸ヤ綔娴侀┏鍥炴垚鍔�')
+      // }
       router.back()
     } else {
       ElMessage.error(result?.msg || '椹冲洖澶辫触')
diff --git a/src/views/approveManage/tradeApproval/list.vue b/src/views/approveManage/tradeApproval/list.vue
index d123d48..dda1fe7 100644
--- a/src/views/approveManage/tradeApproval/list.vue
+++ b/src/views/approveManage/tradeApproval/list.vue
@@ -57,12 +57,54 @@
         <!-- 绗笁琛岋細鎿嶄綔鎸夐挳锛堝彸瀵归綈锛� -->
         <div class="form-row actions">
           <el-form-item class="row-actions">
-            <el-button type="primary" @click="handleSearch" :icon="Search">鏌ヨ</el-button>
-            <el-button @click="reset" :icon="Refresh">閲嶇疆</el-button>
+            <el-button type="primary" @click="handleSearch" icon="Search">鏌ヨ</el-button>
+            <el-button @click="reset" icon="Refresh">閲嶇疆</el-button>
           </el-form-item>
         </div>
       </el-form>
     </el-card>
+
+    <div class="buttonDiv">
+      <el-row>
+        <el-col :span="6" style="margin-top: 10px"> </el-col>
+        <el-col :span="18" align="right" style="margin-top: 10px">
+          <div class="btnBox">
+            <div
+                class="btnDiv"
+                :class="{ btnDivClass: workFlowStatus.btnClassShow == 'trade_point0' }"
+                @click="btnClick('0','trade_point')"
+            >
+              <span class="numjx">绉垎寰呭姙</span>
+<!--              <span>{{ workFlowStatus.tradePointDealData }}</span>-->
+            </div>
+            <div
+                class="btnDiv"
+                :class="{ btnDivClass: workFlowStatus.btnClassShow == 'trade_point1' }"
+                @click="btnClick('1','trade_point')"
+            >
+              <span class="numjx">绉垎宸插姙</span>
+<!--              <span>{{ workFlowStatus.completedData }}</span>-->
+            </div>
+            <div
+                class="btnDiv"
+                :class="{ btnDivClass: workFlowStatus.btnClassShow == 'trade_agreement0' }"
+                @click="btnClick('0','trade_agreement')"
+            >
+              <span class="numjx">鍗忚寰呭姙</span>
+<!--              <span>{{ workFlowStatus.dealwithData }}</span>-->
+            </div>
+            <div
+                class="btnDiv"
+                :class="{ btnDivClass: workFlowStatus.btnClassShow == 'trade_agreement1' }"
+                @click="btnClick('1','trade_agreement')"
+            >
+              <span class="numjx">鍗忚宸插姙</span>
+<!--              <span>{{ workFlowStatus.completedData }}</span>-->
+            </div>
+          </div>
+        </el-col>
+      </el-row>
+    </div>
 
     <!-- 璁㈠崟鍒楄〃鍖哄煙 -->
     <el-card class="mt15" shadow="never">
@@ -220,6 +262,16 @@
                           >
                             鎺堟潈
                           </el-button>
+                          <el-button
+                              v-else-if="action.type === ActionType.WAIT_APPROVAL_AUTHORIZE"
+                              type="primary"
+                              link
+                              size="small"
+                              @click="handleAction(action, row.parentOrder)"
+                          >
+
+                            瀹℃壒
+                          </el-button>
                         </template>
                       </div>
                     </div>
@@ -246,24 +298,20 @@
     </el-card>
     
     <!-- 璁㈠崟鐘舵�佸璇濇 -->
-    <ProductOrderStatusDialog 
-      v-model="orderStatusDialogVisible" 
-      :order-id="currentOrderId" 
-    />
+<!--    <ProductOrderStatusDialog -->
+<!--      v-model="orderStatusDialogVisible" -->
+<!--      :order-id="currentOrderId" -->
+<!--    />-->
   </div>
 </template>
 
 <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 } from 'element-plus'
 import { fetchApprovalPage, fetchApprovalPageWithProductConditions } from '@/api/approvalManage'
-import orderApi from '@/api/orderApi'
 import productApi from '@/api/productApi'
-import { authorizeApproval, fetchApprovalByOrderId } from '@/api/approvalManage'
 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'
 
@@ -275,6 +323,7 @@
   { label: '鍏ㄩ儴', value: '' },
   { label: '寰呬笂浼犳枃浠�', value: 'WAIT_UPLOAD' },
   { label: '寰呮巿鏉�', value: 'WAIT_AUTHORIZE' },
+  { label: '寰呭鎵规巿鏉�', value: 'WAIT_APPROVAL_AUTHORIZE' },
   { label: '寰呬氦鏄撶‘璁�', value: 'WAIT_CONFIRM' },
   { label: '宸插畬鎴�', value: 'COMPLETED' },
   { label: '宸茶瘎浠�', value: 'EVALUATED' },
@@ -308,6 +357,12 @@
 const orderStatusDialogVisible = ref(false)
 const currentOrderId = ref<string>('')
 
+const workFlowStatus = reactive<any>({
+  btnClassShow: 'trade_point0',
+  workFlowType: 0,
+  businessType: 'trade_point' // trade_point
+})
+
 // 浣跨敤宸ヤ綔娴佺▼鎺у埗鍣ㄧ殑鐘舵�佹槧灏�
 const statusUiToServer: Record<string, string> = {
   WAIT_UPLOAD: OrderStatus.WAIT_UPLOAD,
@@ -323,6 +378,7 @@
   [OrderStatus.WAIT_CONFIRM]: 'WAIT_CONFIRM',
   [OrderStatus.COMPLETED]: 'COMPLETED',
   [OrderStatus.EVALUATED]: 'EVALUATED',
+  [OrderStatus.WAIT_APPROVAL_AUTHORIZE]: 'WAIT_APPROVAL_AUTHORIZE'
 }
 
 const formatDateTime = (val?: string) => {
@@ -431,6 +487,7 @@
   const statusMap: Record<string, 'warning' | 'danger' | 'success' | 'info'> = {
     WAIT_UPLOAD: 'warning',
     WAIT_AUTHORIZE: 'warning',
+    WAIT_APPROVAL_AUTHORIZE: 'warning',
     WAIT_CONFIRM: 'warning',
     COMPLETED: 'success',
     EVALUATED: 'success',
@@ -524,6 +581,11 @@
     pageSize: page.size,
     productName: query.productName || undefined,
     orderId: query.orderNo || undefined,
+    userId: userStore.getUserId,
+    unitId: userStore.getUnitId,
+    workFlowType: workFlowStatus.workFlowType,
+    businessType: workFlowStatus.businessType,
+    departmentId: userStore.getDepartmentId
   }
   if (query.status) payload.orderStatus = statusUiToServer[query.status]
   if (Array.isArray(query.dateRange) && query.dateRange.length === 2) {
@@ -591,6 +653,15 @@
   orderList.value = flatData
 }
 
+const btnClick = (workFlowType?: any,businessType?: any) => {
+  workFlowStatus.btnClassShow = businessType+workFlowType
+  workFlowStatus.workFlowType = workFlowType
+  workFlowStatus.businessType = businessType
+
+  // 鑾峰彇list鏁版嵁
+  handleSearch()
+}
+
 // 閲嶇疆
 const reset = () => {
   Object.assign(query, {
@@ -643,6 +714,7 @@
     case ActionType.TRACK:
       toTrack(order)
       break
+    case ActionType.WAIT_APPROVAL_AUTHORIZE:
     case ActionType.AUTHORIZE:
       toAuthorize(order)
       break
@@ -1075,6 +1147,69 @@
   padding-bottom: 0 !important;
   border-bottom: 2px solid #e4e7ed; // 鏄剧ず鍒嗛殧杈规绾�
 }
+.buttonDiv {
+  width: 100%;
+  height: 33px;
+}
+.btnBox {
+  width: 505px;
+  height: 33px;
+  //background-color: pink;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-between;
+
+  .btnDivClass {
+    background-color: #2f4589 !important;
+    color: #fff;
+  }
+
+  .btnDiv {
+    width: 120px;
+    height: 33px;
+    border-radius: 5px;
+    border: 1px solid #ebeef5;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: center;
+    font-size: 14px;
+    //color: #919399;
+    cursor: pointer;
+    background-color: #FFFFFF;
+
+    span :nth-child(2) {
+      color: #f04844;
+    }
+  }
+
+  .elFormDiv {
+    width: 100%;
+    height: 100px;
+    display: flex;
+    flex-direction: row;
+    align-items: center;
+    justify-content: space-between;
+
+    .searchFormDiv {
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+    }
+
+    .searchBtnDiv {
+      //width: 20%;
+      height: 100%;
+      display: flex;
+      flex-direction: row;
+      align-items: center;
+    }
+  }
+}
+.numjx {
+  padding-right: 5px;
+}
 </style>
 
 
diff --git a/src/views/pointsManage/ruleList/index.vue b/src/views/pointsManage/ruleList/index.vue
index 6fab5c7..8663aad 100644
--- a/src/views/pointsManage/ruleList/index.vue
+++ b/src/views/pointsManage/ruleList/index.vue
@@ -101,11 +101,10 @@
 <script setup lang="ts">
 import { ref, reactive, onMounted } from 'vue'
 import { dayjs, ElMessage } from 'element-plus'
-import { Search, Refresh } from '@element-plus/icons-vue'
 import pointsApi from '@/api/pointsApi'
 import type { PointsRule, PointsQueryParams } from '@/types/points'
-import SettingsComponent from '../settings/index.vue'
-import RuleDetailComponent from '../ruleDetail/index.vue'
+import SettingsComponent from '@/views/pointsManage/settings/index.vue'
+import RuleDetailComponent from '@/views/pointsManage/ruleDetail/index.vue'
 
 // 褰撳墠瑙嗗浘鐘舵�侊細'list' | 'edit' | 'view'
 const currentView = ref<'list' | 'edit' | 'view'>('list')
@@ -137,7 +136,7 @@
     const res = await pointsApi.getPointsRules(queryParams)
     // 妯℃嫙鍒嗛〉鏁版嵁
     ruleList.value = res.data.list || []
-    total.value = ruleList.value.length
+    total.value = res.data.total
   } catch (error) {
     ElMessage.error('鑾峰彇绉垎瑙勫垯澶辫触')
     console.error('鑾峰彇绉垎瑙勫垯澶辫触:', error)
@@ -197,7 +196,7 @@
 
 // 澶勭悊淇濆瓨鎴愬姛
 const handleSaveSuccess = () => {
-  ElMessage.success('淇濆瓨鎴愬姛')
+  // ElMessage.success('淇濆瓨鎴愬姛')
   goBackToList()
   // 閲嶆柊鍔犺浇鍒楄〃鏁版嵁
   queryData()
diff --git a/src/views/productManage/productPriceViewer/index.vue b/src/views/productManage/productPriceViewer/index.vue
index 3c9e4fa..0a7690d 100644
--- a/src/views/productManage/productPriceViewer/index.vue
+++ b/src/views/productManage/productPriceViewer/index.vue
@@ -337,7 +337,7 @@
     <div class="footer" v-if="showPricePanel">
      <el-button type="primary" @click="handleOrder">绔嬪嵆璁㈣喘</el-button>
     </div>
-    <div class="footer" v-else>
+    <div class="footer" v-if="showOrderPanel">
       <el-button @click="returnPricePanel">杩斿洖浠锋牸瀵规瘮</el-button>
       <el-button type="primary" @click="submitOrder">鎻愪氦鐢宠</el-button>
     </div>
@@ -639,7 +639,7 @@
 
   loading.value = true
   try {
-    // 鍙煡璇竴璧风敤鐨勫畾浠�
+    // 鍙煡璇㈠凡鍚敤鐨勫畾浠�
     const res: any = await productPricingApi.listBycondition({ productId: productId,isActive: true })
     if (res?.code === 200) {
       const list = Array.isArray(res.data) ? res.data : []
@@ -796,6 +796,21 @@
   }else{
      paymentType = '鍗忚'
   }
+     let processdefId: string = ''
+     const type = hasAGREEMENT ? 'trade_agreement' : 'trade_point';
+     // 鑾峰彇宸ヤ綔娴佸弬鏁�
+     const  wkParamsRes: any = await workFlowApi.getWorkFlowParams({
+      type: type,
+      unitId: '1',
+      businessKey: type
+    })
+  if(wkParamsRes?.code === 200 && wkParamsRes.data?.processTemplateId){
+    processdefId = wkParamsRes.data.processTemplateId
+  }else {
+    ElMessage.error('鑾峰彇宸ヤ綔娴佸弬鏁板け璐�!')
+    return
+  }
+
   // 缁勮鍒涘缓璁㈠崟鍙傛暟锛圕reateOrderDTO锛�
   const payload = {
     userId: currentUserId.value,
@@ -805,6 +820,7 @@
     providerId: productHeader.value.createUserId,
     paymentType: paymentType,
     buyerRemarks: '',
+    processdefId: processdefId,
     items: items.map(it => ({
       pricingId: it.id,
       productId: it.productId,
@@ -839,34 +855,35 @@
         applyTime: data.applyTime ? String(data.applyTime) : new Date().toLocaleString()
       }
       // 璋冪敤宸ヤ綔娴佹帴鍙e彂璧峰鎵规祦绋嬶紝鎷垮埌娴佺▼瀹炰緥ID鍚庡洖鍐欒鍗晈orkflow_id
-      try {
-        // 鏍规嵁鏄惁鍖呭惈鍗忚鏄庣粏锛岄厤缃笉鍚屾祦绋嬪畾涔変笌涓氬姟Key锛堝厛鐢ㄩ潤鎬佸�煎崰浣嶏級
-        // const processdefId = hasAGREEMENT ? 'Process_Agreement_Static' : 'Process_Points_Static'
-        const businessKey = hasAGREEMENT ? 'agreement_biz_key' : 'points_biz_key'
-        const type = hasAGREEMENT ? 'trade_agreement' : 'trade_point';
-        // 鑾峰彇宸ヤ綔娴佸弬鏁�
-        const  wkParamsRes: any = await workFlowApi.getWorkFlowParams({
-          type: type,
-          unitId: '1'
-        })
-        if(wkParamsRes?.code === 200 && wkParamsRes.data?.processTemplateId){
-          const wfRes: any = await workFlowApi.startWorkflowAndComplete({
-            processdefId: wkParamsRes.data.processTemplateId,
-            userid: String(currentUserId.value || ''),
-            businessKey: businessKey
-          })
-          if (wfRes?.code === 200 && wfRes.data?.processinstId) {
-            await orderApi.updateWorkflowId(data.orderId, wfRes.data.processinstId)
-          }
-        }
-
-      } catch (e) {
-        console.warn('鍚姩宸ヤ綔娴佸け璐ユ垨鏇存柊workflow_id澶辫触', e)
-      }
+      // 鏀惧悗绔鐞�
+      // try {
+      //   // 鏍规嵁鏄惁鍖呭惈鍗忚鏄庣粏锛岄厤缃笉鍚屾祦绋嬪畾涔変笌涓氬姟Key锛堝厛鐢ㄩ潤鎬佸�煎崰浣嶏級
+      //   // const processdefId = hasAGREEMENT ? 'Process_Agreement_Static' : 'Process_Points_Static'
+      //   const businessKey = hasAGREEMENT ? 'agreement_biz_key' : 'points_biz_key'
+      //   const type = hasAGREEMENT ? 'trade_agreement' : 'trade_point';
+      //   // 鑾峰彇宸ヤ綔娴佸弬鏁�
+      //   const  wkParamsRes: any = await workFlowApi.getWorkFlowParams({
+      //     type: type,
+      //     unitId: '1'
+      //   })
+      //   if(wkParamsRes?.code === 200 && wkParamsRes.data?.processTemplateId){
+      //     const wfRes: any = await workFlowApi.startWorkflowAndComplete({
+      //       processdefId: wkParamsRes.data.processTemplateId,
+      //       userid: String(currentUserId.value || ''),
+      //       businessKey: businessKey
+      //     })
+      //     if (wfRes?.code === 200 && wfRes.data?.processinstId) {
+      //       await orderApi.updateWorkflowId(data.orderId, wfRes.data.processinstId)
+      //     }
+      //   }
+      //
+      // } catch (e) {
+      //   console.warn('鍚姩宸ヤ綔娴佸け璐ユ垨鏇存柊workflow_id澶辫触', e)
+      // }
 
       // 娓呯┖璐墿杞︼紙鍚庣 + 鏈湴鐘舵�侊級
       try {
-        const clearRes: any = await cartApi.clearCart(currentUserId.value, currentUnitId.value,currentProductId.value)
+        const clearRes: any = await cartApi.clearCart(currentUserId.value, currentUnitId.value,currentProductId.value ? currentProductId.value : '')
         if (clearRes?.code === 200) {
           cartItems.value = []
           orderSuites.value = []
@@ -919,7 +936,7 @@
 
 const removeFromCart = async (pricingId: string) => {
   try {
-    const res: any = await cartApi.removeFromCart(currentUserId.value, currentUnitId.value, currentProductId.value,pricingId)
+    const res: any = await cartApi.removeFromCart(currentUserId.value, currentUnitId.value, currentProductId.value? currentProductId.value : '',pricingId)
     if (res?.code === 200) {
       ElMessage.success('宸蹭粠璐墿杞︾Щ闄�')
     } else {
@@ -931,15 +948,15 @@
   }
 }
 
-const updateCartItem = async (pricingId: number, quantity: number, duration: number) => {
+const updateCartItem = async (pricingId: number, quantity: number | null, duration: number | null) => {
   try {
     // 杩欓噷闇�瑕佹牴鎹疄闄呮帴鍙h皟鏁达紝鍙兘闇�瑕佷紶閫掓洿澶氬弬鏁�
     let res: any = {}
     if(quantity){
-      res = await cartApi.updateCartItem(currentUserId.value, currentUnitId.value, currentProductId.value, pricingId, quantity)
+      res = await cartApi.updateCartItem(currentUserId.value, currentUnitId.value, currentProductId.value? currentProductId.value : '', pricingId, quantity)
     }
     if(duration){
-      res = await cartApi.updateCartItemDuration(currentUserId.value, currentUnitId.value, currentProductId.value, pricingId, duration)
+      res = await cartApi.updateCartItemDuration(currentUserId.value, currentUnitId.value, currentProductId.value? currentProductId.value : '', pricingId, duration)
     }
     if (res?.code === 200) {
       ElMessage.success('璐墿杞﹀凡鏇存柊')
@@ -955,7 +972,7 @@
 const fetchCartItems = async () => {
   cartLoading.value = true
   try {
-    const res: any = await cartApi.getCartItems(currentUserId.value, currentUnitId.value, currentProductId.value)
+    const res: any = await cartApi.getCartItems(currentUserId.value, currentUnitId.value, currentProductId.value? currentProductId.value : '')
     if (res?.code === 200) {
       cartItems.value = res.data || []
       // 灏嗚喘鐗╄溅鏁版嵁杞崲涓鸿鍗曞浠舵牸寮�
diff --git a/src/views/tradeManage/upload/index.vue b/src/views/tradeManage/upload/index.vue
index c20eb14..fd644c8 100644
--- a/src/views/tradeManage/upload/index.vue
+++ b/src/views/tradeManage/upload/index.vue
@@ -388,9 +388,9 @@
 // 鏂囦欢涓婁紶鍓嶇殑楠岃瘉
 const beforeUpload = (file: File) => {
   // 妫�鏌ユ枃浠跺ぇ灏忥紙闄愬埗涓�100MB锛�
-  const maxSize = 100 * 1024 * 1024
+  const maxSize = 500 * 1024 * 1024
   if (file.size > maxSize) {
-    ElMessage.error('鏂囦欢澶у皬涓嶈兘瓒呰繃100MB')
+    ElMessage.error('鏂囦欢澶у皬涓嶈兘瓒呰繃500MB')
     return false
   }
   
@@ -575,7 +575,7 @@
           fileType: fileItem.type || 'application/octet-stream',
           fileSize: fileItem.size,
           fileUrl: fileUrl,
-          bucketName: 'order-attachments',
+          bucketName: 'dev',
           objectName: fileUrl.split('/').pop(),
           uploadUserId: userId,
           uploadUserName: userName,
@@ -848,7 +848,7 @@
       fileType: file.type || 'application/octet-stream',
       fileSize: file.size,
       fileUrl: fileUrl,
-      bucketName: 'order-attachments',
+      bucketName: 'dev',
       objectName: fileUrl.split('/').pop(),
       uploadUserId: userId,
       uploadUserName: userName,

--
Gitblit v1.8.0