| | |
| | | method: 'get' |
| | | }) as ApiPromise |
| | | }, |
| | | |
| | | |
| | | updateOrderStatusToIsEvaluate(orderId: string): ApiPromise { |
| | | return createAxios({ |
| | | url: `${url}/status/isEvaluate`, |
| | | method: 'post', |
| | | params: { |
| | | orderId |
| | | } |
| | | }) as ApiPromise |
| | | }, |
| | | |
| | | updateOrderStatusToNext(orderId: string): ApiPromise { |
| | | return createAxios({ |
| | | url: `${url}/status/next`, |
| | |
| | | // 获取用户详情 |
| | | getUserdetail(data: object = {}): ApiPromise { |
| | | return createAxios({ |
| | | baseURL: '/api', |
| | | url: `${url}/detail`, |
| | | headers: { |
| | | 'Content-Type': 'application/json;charset=UTF-8' |
New file |
| | |
| | | import createAxios from '@/utils/axios' |
| | | |
| | | const workFlowApi = { |
| | | getWorkFlowParams(data: object = {}) : ApiPromise{ |
| | | return createAxios({ |
| | | baseURL: '/api', |
| | | url: `/approval/templateRelation/relationByType`, |
| | | headers: { |
| | | 'Content-Type': 'application/json;charset=UTF-8' |
| | | }, |
| | | data: data |
| | | }) as ApiPromise |
| | | } |
| | | } |
| | | export default workFlowApi |
| | |
| | | // import pagination from '@/components/Pagination/index.vue' |
| | | import store from '@/stores' // pinia状态管理器全局调用 |
| | | import directives from '@/directives/index' |
| | | import FcDesigner from '@form-create/designer'; |
| | | import formCreate from '@form-create/element-ui'; // 引入 FormCreate |
| | | // import FcDesigner from '@form-create/designer'; |
| | | // import formCreate from '@form-create/element-ui'; // 引入 FormCreate |
| | | |
| | | const app = createApp(App) |
| | | app.use(store) |
| | | app.use(router) |
| | | app.use(ElementPlus) |
| | | app.use(directives) |
| | | app.use(FcDesigner); |
| | | app.use(FcDesigner.formCreate); |
| | | app.use(formCreate); |
| | | // app.use(FcDesigner); |
| | | // app.use(FcDesigner.formCreate); |
| | | // app.use(formCreate); |
| | | for (const [key, component] of Object.entries(ElementPlusIconsVue)) { |
| | | app.component(key, component) |
| | | } |
| | |
| | | AUTHORIZE = '授权', |
| | | CONFIRM_TRADE = '交易确认', |
| | | EVALUATE = '评价', |
| | | CANCEL_ORDER = '取消订单' |
| | | CANCEL_ORDER = '取消订单', |
| | | COMPLETED = '已完成' |
| | | } |
| | | |
| | | // 页面类型枚举 |
| | |
| | | gap: 20px; |
| | | align-items: center; |
| | | overflow: hidden; |
| | | |
| | | |
| | | .status-item{ |
| | | flex-direction: row-reverse; |
| | | } |
| | | .order-item { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 8px; |
| | | flex-shrink: 0; |
| | | flex: 1; |
| | | |
| | | .label { |
| | | color: #909399; |
| | |
| | | |
| | | .content-wrapper { |
| | | width: 100%; |
| | | height: calc(100vh - 70px); |
| | | height: calc(100vh); |
| | | display: flex; |
| | | } |
| | | .content-wrapperall{ |
| | |
| | | import { useUserInfo } from '@/stores/modules/userInfo' |
| | | import { queryUserDetail } from '@/api/userInfo' |
| | | import productApi from '@/api/productApi' |
| | | import workFlowApi from '@/api/workFlowApi' |
| | | |
| | | const route = useRoute() |
| | | |
| | |
| | | // 调用工作流接口发起审批流程,拿到流程实例ID后回写订单workflow_id |
| | | try { |
| | | // 根据是否包含协议明细,配置不同流程定义与业务Key(先用静态值占位) |
| | | const processdefId = hasAGREEMENT ? 'Process_Agreement_Static' : 'Process_Points_Static' |
| | | // const processdefId = hasAGREEMENT ? 'Process_Agreement_Static' : 'Process_Points_Static' |
| | | const businessKey = hasAGREEMENT ? 'agreement_biz_key' : 'points_biz_key' |
| | | const wfRes: any = await orderApi.startWorkflowAndComplete({ |
| | | processdefId, |
| | | userid: String(currentUserId.value || ''), |
| | | businessKey |
| | | const type = hasAGREEMENT ? 'trade_agreement' : 'trade_point'; |
| | | // 获取工作流参数 |
| | | const wkParamsRes: any = await workFlowApi.getWorkFlowParams({ |
| | | type: type, |
| | | unitId: '1' |
| | | }) |
| | | if (wfRes?.code === 200 && wfRes.data?.processinstId) { |
| | | await orderApi.updateWorkflowId(data.orderId, wfRes.data.processinstId) |
| | | if(wkParamsRes?.code === 200 && wkParamsRes.data?.processTemplateId){ |
| | | const wfRes: any = await orderApi.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) |
| | | } |
| | |
| | | 交易确认 |
| | | </el-button> |
| | | <el-button |
| | | v-else-if="action.type === ActionType.EVALUATE" |
| | | v-else-if="action.type === ActionType.EVALUATE && row.parentOrder.isEvaluate === '未评价'" |
| | | type="primary" |
| | | link |
| | | size="small" |
| | |
| | | <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' |
| | | |
| | |
| | | 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) => ({ |
| | |
| | | }) |
| | | |
| | | if (result && result.code === 200) { |
| | | // 更新订单状态进入下一个状态 |
| | | await orderApi.updateOrderStatusToNext(orderId) |
| | | // 更新订单评价状态为已评价 |
| | | await orderApi.updateOrderStatusToIsEvaluate(orderId) |
| | | ElMessage.success('评价提交成功') |
| | | router.back() |
| | | evaluationLoading.value = false |
| | |
| | | |
| | | .content-wrapper { |
| | | width: 100%; |
| | | height: calc(100vh - 70px); |
| | | height: calc(100vh); |
| | | display: flex; |
| | | } |
| | | .content-wrapperall{ |