From 349091f54dab47b15ca81613f02765490a2ce7d0 Mon Sep 17 00:00:00 2001 From: p-honggang.li <p-honggang.li@pcitc.com> Date: 星期四, 11 九月 2025 10:50:36 +0800 Subject: [PATCH] 修改买家中心卖家中心产品类型等条件查询问题 --- src/views/productManage/productPriceViewer/index.vue | 84 +++++++++++++++++++++++++---------------- 1 files changed, 51 insertions(+), 33 deletions(-) diff --git a/src/views/productManage/productPriceViewer/index.vue b/src/views/productManage/productPriceViewer/index.vue index 3c9e4fa..38cada1 100644 --- a/src/views/productManage/productPriceViewer/index.vue +++ b/src/views/productManage/productPriceViewer/index.vue @@ -321,7 +321,7 @@ <td class="value">{{ statusText(orderStatus.status) }}</td> <td></td> <td class="value link"> - <el-link type="primary" @click="viewOrder">鏌ョ湅璁㈠崟淇℃伅</el-link> +<!-- <el-link type="primary" @click="viewOrder">鏌ョ湅璁㈠崟淇℃伅</el-link>--> </td> </tr> </tbody> @@ -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> @@ -548,6 +548,7 @@ try { await removeFromCart(String(suite.id)) orderSuites.value.splice(index, 1) + selectedSuiteIds.value.delete(suite.id) } catch (e) { } } @@ -639,7 +640,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 +797,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 +821,7 @@ providerId: productHeader.value.createUserId, paymentType: paymentType, buyerRemarks: '', + processdefId: processdefId, items: items.map(it => ({ pricingId: it.id, productId: it.productId, @@ -839,34 +856,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 +937,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 +949,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 +973,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 || [] // 灏嗚喘鐗╄溅鏁版嵁杞崲涓鸿鍗曞浠舵牸寮� -- Gitblit v1.8.0