修改审核页面,添加积分审核代办,积分审核已办,协议审核代办,协议审核代办,修改规则分页显示bug,修改订购问题BUG
| | |
| | | unitId?:any |
| | | roleCodes?:any |
| | | userInfo?:any |
| | | departmentId?: string |
| | | } |
| | | |
| | | export interface TaskItem { |
| | |
| | | empCode:'', |
| | | userId:'', |
| | | unitId:'',//租户ID |
| | | departmentId: '', |
| | | roleCodes:[], |
| | | userInfo:{ |
| | | adminToken: '', // 管理后台的token |
| | |
| | | this.fullUnitName = user.fullUnitName |
| | | this.userId = user.id |
| | | this.unitId = user.unitId |
| | | this.departmentId = user.departmentId |
| | | this.roleCodes = user.roleCodes |
| | | this.userInfo=user |
| | | }, |
| | |
| | | getUnitId: (state) => { |
| | | return state.unitId |
| | | }, |
| | | getDepartmentId: (state) => { |
| | | return state.departmentId |
| | | }, |
| | | getRoleCodes: (state) => { |
| | | return state.roleCodes |
| | | }, |
| | |
| | | // 订单状态枚举(按照流程顺序) |
| | | export enum OrderStatus { |
| | | WAIT_UPLOAD = '待上传文件', // 1 |
| | | WAIT_AUTHORIZE = '待授权', // 2 |
| | | WAIT_AUTHORIZE = '待授权', // 2 |
| | | WAIT_APPROVAL_AUTHORIZE = '待审批授权', |
| | | WAIT_CONFIRM = '待交易确认', // 3 |
| | | COMPLETED = '已完成', // 4 |
| | | EVALUATED = '已评价' // 5 (最终状态) |
| | |
| | | CONFIRM_TRADE = '交易确认', |
| | | EVALUATE = '评价', |
| | | CANCEL_ORDER = '取消订单', |
| | | COMPLETED = '已完成' |
| | | COMPLETED = '已完成', |
| | | WAIT_APPROVAL_AUTHORIZE = '审批' |
| | | } |
| | | |
| | | // 页面类型枚举 |
| | |
| | | { 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 } |
| | |
| | | { 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' }, |
| | |
| | | { 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 } |
| | |
| | | |
| | | // 状态流转映射(当前状态 -> 下一个状态) |
| | | 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 // 最终状态,无下一状态 |
| | |
| | | return OrderStatus.WAIT_UPLOAD |
| | | case '待授权': |
| | | return OrderStatus.WAIT_AUTHORIZE |
| | | case '待审批授权': |
| | | return OrderStatus.WAIT_APPROVAL_AUTHORIZE |
| | | case '待交易确认': |
| | | return OrderStatus.WAIT_CONFIRM |
| | | case '已完成': |
| | |
| | | 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("工作流id为空不能进行工作流任务提交") |
| | | 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("工作流id为空不能进行工作流任务提交") |
| | | // 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 || '审批通过失败') |
| | |
| | | |
| | | 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 || '驳回失败') |
| | |
| | | <!-- 第三行:操作按钮(右对齐) --> |
| | | <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"> |
| | |
| | | > |
| | | 授权 |
| | | </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> |
| | |
| | | </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' |
| | | |
| | |
| | | { 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' }, |
| | |
| | | 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, |
| | |
| | | [OrderStatus.WAIT_CONFIRM]: 'WAIT_CONFIRM', |
| | | [OrderStatus.COMPLETED]: 'COMPLETED', |
| | | [OrderStatus.EVALUATED]: 'EVALUATED', |
| | | [OrderStatus.WAIT_APPROVAL_AUTHORIZE]: 'WAIT_APPROVAL_AUTHORIZE' |
| | | } |
| | | |
| | | const formatDateTime = (val?: string) => { |
| | |
| | | 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', |
| | |
| | | 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) { |
| | |
| | | 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, { |
| | |
| | | case ActionType.TRACK: |
| | | toTrack(order) |
| | | break |
| | | case ActionType.WAIT_APPROVAL_AUTHORIZE: |
| | | case ActionType.AUTHORIZE: |
| | | toAuthorize(order) |
| | | break |
| | |
| | | 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> |
| | | |
| | | |
| | |
| | | <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') |
| | |
| | | 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) |
| | |
| | | |
| | | // 处理保存成功 |
| | | const handleSaveSuccess = () => { |
| | | ElMessage.success('保存成功') |
| | | // ElMessage.success('保存成功') |
| | | goBackToList() |
| | | // 重新加载列表数据 |
| | | queryData() |
| | |
| | | <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> |
| | |
| | | |
| | | 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 : [] |
| | |
| | | }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 |
| | | } |
| | | |
| | | // 组装创建订单参数(CreateOrderDTO) |
| | | const payload = { |
| | | userId: currentUserId.value, |
| | |
| | | providerId: productHeader.value.createUserId, |
| | | paymentType: paymentType, |
| | | buyerRemarks: '', |
| | | processdefId: processdefId, |
| | | items: items.map(it => ({ |
| | | pricingId: it.id, |
| | | productId: it.productId, |
| | |
| | | applyTime: data.applyTime ? String(data.applyTime) : new Date().toLocaleString() |
| | | } |
| | | // 调用工作流接口发起审批流程,拿到流程实例ID后回写订单workflow_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 = [] |
| | |
| | | |
| | | 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 { |
| | |
| | | } |
| | | } |
| | | |
| | | const updateCartItem = async (pricingId: number, quantity: number, duration: number) => { |
| | | const updateCartItem = async (pricingId: number, quantity: number | null, duration: number | null) => { |
| | | try { |
| | | // 这里需要根据实际接口调整,可能需要传递更多参数 |
| | | 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('购物车已更新') |
| | |
| | | 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 || [] |
| | | // 将购物车数据转换为订单套件格式 |
| | |
| | | // 文件上传前的验证 |
| | | 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 |
| | | } |
| | | |
| | |
| | | fileType: fileItem.type || 'application/octet-stream', |
| | | fileSize: fileItem.size, |
| | | fileUrl: fileUrl, |
| | | bucketName: 'order-attachments', |
| | | bucketName: 'dev', |
| | | objectName: fileUrl.split('/').pop(), |
| | | uploadUserId: userId, |
| | | uploadUserName: userName, |
| | |
| | | fileType: file.type || 'application/octet-stream', |
| | | fileSize: file.size, |
| | | fileUrl: fileUrl, |
| | | bucketName: 'order-attachments', |
| | | bucketName: 'dev', |
| | | objectName: fileUrl.split('/').pop(), |
| | | uploadUserId: userId, |
| | | uploadUserName: userName, |