import { get, put, putJ, postJ } from "@/utils/request"; import Vue from "vue"; //获取我的消息列表 export async function notifyMessagePageAPI(params, loding = true) { const res = await postJ( Vue.prototype.apiUrl + `/sys/notifymessage/page`, params, loding ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } //更新已读-指定消息ID export async function updateNotifyMessageReadByIdAPI(params, loding = true) { const res = await postJ( Vue.prototype.apiUrl + `/sys/notifymessage/updateNotifyMessageRead`, params, loding ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } //获取某用户的未读消息条数 export async function getUnreadNotifyMessageCountAPI() { const res = await get( Vue.prototype.apiUrl + `/sys/notifymessage/getUnreadNotifyMessageCount`, '', false ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } //获取待办事项列表 export async function getTodoTaskPage(query, loding = true) { const res = await get( Vue.prototype.apiUrl + `/bpm/task/todo-page`, query, loding ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } export async function getTodoList(query, loding = true) { const res = await postJ( Vue.prototype.apiUrl + `/bpm/task/todo-page`, query, loding ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } //获取已办事项列表 export async function getDoneTaskPage(query) { const res = await get( Vue.prototype.apiUrl + `/bpm/task/done-page`, query, true ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } //获取流程详情 export async function getTaskListByProcessinstanceid(query) { const res = await get( Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`, query, true ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } //获取流程任务实例 export async function getProcessInstance(id) { const res = await get(Vue.prototype.apiUrl + `/bpm/process-instance/get`, id, true) if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } export async function getTaskListByProcessInstanceId(processInstanceId) { const res = await get(Vue.prototype.apiUrl + `/bpm/task/list-by-process-instance-id`, processInstanceId, true) if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 通用流程审核接口 export async function approveTaskWithVariables(data) { const res = await putJ(Vue.prototype.apiUrl + `/bpm/task/approveTaskWithVariables`, data, true) if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** *销售退货审批流程审核接口 */ export async function approveTaskSalesOrderReturn(params) { const res = await postJ(Vue.prototype.apiUrl + `/bpm/salesOrderReturnApprove/approve`, params, true) if (res.code == 0) { return res; } return Promise.reject(new Error(res.message)); } //费用申请 // 编辑 export async function feeApplyUpdateAPI(data) { const res = await putJ(Vue.prototype.apiUrl + `/eom/finfeeapply/update`, data, true) if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 信息 export async function getFeeApplyInfoAPI(id) { const res = await get(Vue.prototype.apiUrl + `/eom/finfeeapply/getById/${id}`, {}, true) if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // // // //销售合同 /** * 获取信息详情 */ export async function getDetail(id) { const res = await get(Vue.prototype.apiUrl + `/eom/contract/getById/${id}`, {}, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // // // // //客户申请 /** * 客户申请列表 */ export async function contactApplyList(id) { const res = await get(Vue.prototype.apiUrl + `/eom/contactlistapply/getById/${id}`, {}, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // // // // //商机管理 /** * /商机管理-获取信息详情 */ export async function getBusinessOpportunityDetailAPI(id) { const res = await get(Vue.prototype.apiUrl + `/eom/businessopportunity/getById/${id}`, {}, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * 更新信息 */ export async function businessOpportunityUpdateAPI(data) { const res = await postJ(Vue.prototype.apiUrl + `/eom/businessopportunity/updateProduct`, data, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // // // // //销售订单 /** * /销售订单-获取信息详情 */ export async function getSaleOrderDetailAPI(id) { const res = await get(Vue.prototype.apiUrl + `/eom/saleorder/getById/${id}`, {}, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // // // // //销售退货单 /** * /销售退货单-获取信息详情 */ export async function getSaleOrderReturnGetByIdAPI(id) { const res = await get(Vue.prototype.apiUrl + `/eom/saleorderreturnrecord/getById/${id}`, {}, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // // // // //获取发货单 /** * /获取发货单信息详情-获取信息详情 */ export async function getSaleOrderSendRecordDetailAPI(id) { const res = await get(Vue.prototype.apiUrl + `/eom/saleordersendrecord/getById/${id}`, {}, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // // // // //获取仓库信息 /** * /获取仓库信息 */ export async function getWarehouseListByIdsAPI(data) { const res = await postJ(Vue.prototype.apiUrl + `/wms/warehouse/getWarehouseListByIds`, data, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // // // // // //采购需求 /** * /获取需求单信息 */ export async function getPurchaseRequirementByIdsAPI(id) { const res = await get(Vue.prototype.apiUrl + `/eom/purchaserequirement/getById/${id}`, {}, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } //获取采购计划单信息 export async function getPurchasePlanByIdsAPI(id) { const res = await get(Vue.prototype.apiUrl + `/eom/purchaseplan/getById/${id}`, {}, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * /新增采购需求负责人 */ export async function AssignPurchasePlanUserAPI(data) { const res = await postJ(Vue.prototype.apiUrl + `/bpm/purchasePlanApprove/assign`, data, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // // // // /** * /采购订单 */ //获取采购订单信息 export async function purchaseOrderGetByIdAPI(id) { const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorder/getById/${id}`, {}, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // // // // /** * /采购收货 */ //获取采购收货单信息 export async function purchaseOrderReceiveGetByIdAPI(id) { const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorderreceive/getById/${id}`, {}, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // // // // /** * /采购退货 */ //获取采购退货单信息 export async function purchaseOrderReturnGetByIdAPI(id) { const res = await get(Vue.prototype.apiUrl + `/eom/purchaseorderreturn/getById/${id}`, {}, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // // // // /** * /量具送检 */ //查询量具送检信息 export async function processById(params) { const res = await get(Vue.prototype.apiUrl + `/eam/planmaintenance/processById`, params ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.data.message)); } // // 个人日志列表 export async function getList(params) { const res = await get('/eom/planToolLog/list', params ); if (res.data.code == 0) { return res.data; } return Promise.reject(new Error(res.data.message)); } // // // //动态表单 工作流自定义权限过滤表单集合 export async function getBpmCustomFormList(params) { const res = await get(Vue.prototype.apiUrl + '/flowable/bpmcustomform/list', params ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.data.message)); }; //动态表单 我发起的申请 export async function getProcessInstancePage(params) { const res = await get(Vue.prototype.apiUrl + '/bpm/process-instance/my-page', params ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.data.message)); }; //动态表单 部门发起的申请 export async function getProcessInstanceDeptPage(query) { const res = await get(Vue.prototype.apiUrl + '/bpm/process-instance/my-dept-page', params ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.data.message)); }; //动态表单 通知我的申请 export async function getProcessInstanceNoticePage(data) { const res = await postJ(Vue.prototype.apiUrl + '/bpm/process-instance/my-notice-page', data ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.data.message)); }; //发起流程通用接口 export async function processInstanceCreateAPI(params, loding = true) { const res = await postJ( Vue.prototype.apiUrl + `/bpm/process-instance/create`, params, loding ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } //流程列表 export async function processInstancePage(params, loding = false) { const res = await get( Vue.prototype.apiUrl + `/bpm/model/page`, params, loding ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); }