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 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 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 rejectTask(data) { const res = await putJ(Vue.prototype.apiUrl + `/bpm/task/reject`, data, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 作废 export async function cancelTask(data) { const res = await postJ( Vue.prototype.apiUrl + `/bpm/process-instance/cancel`, data, ); 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 getDoneTaskList(query) { const res = await postJ( 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 getByIdOnlyReplaceAPI(id) { const res = await get( Vue.prototype.apiUrl + `/eom/saleordersendrecord/getByIdOnlyReplace/${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 postJ( 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)); } /** * /获取领料单信息 */ export async function getPickOrderById(id) { const res = await get( Vue.prototype.apiUrl + `/pda/mes/pickorder/getPickOrderById/${id}`, {}, true, ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * 根据来源单号查出库详情 */ export async function getOutInBySourceBizNo(sourceBizNo) { const res = await get( Vue.prototype.apiUrl + `/wms/outintwo/getInfoBySourceBizNo/${sourceBizNo}`, {}, true, ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * 查询所有物品分类 */ export async function allCategoryLevel() { const res = await get( Vue.prototype.apiUrl + `/main/categoryLevel/allCategoryLevel`, {}, false, ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } export async function getLoginUser(data) { const res = await get( Vue.prototype.apiUrl + "/system/account/getLoginUser", data, true, ); if (res.code == 0) { return res.data; } if (res.data && res.data.code == 0) { return res.data.data; } return Promise.reject( new Error(res.message || res.data?.message || "获取登录用户数据失败"), ); } // 生产入库审批(申请入库) export async function approveTaskWithVariablesOther(data) { const res = await postJ( Vue.prototype.apiUrl + `/bpm/inwarehouse/assign`, data, true, ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * 获取部门列表(树) */ export async function getGroupList() { const res = await get( Vue.prototype.apiUrl + `/main/group/getGroupList`, {}, false, ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * 根据部门获取员工列表 */ export async function getUserPageByGroupId(params) { const res = await get( Vue.prototype.apiUrl + `/main/user/getUserPage`, params, true, ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * 根据人员id获取用户信息(含部门) */ export async function getUserById(id) { const res = await get( Vue.prototype.apiUrl + `/main/user/getById/${id}`, {}, true, ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } /** * 生产入库申请单详情 */ export async function getStorageDetail(id) { const res = await get( Vue.prototype.apiUrl + `/mes/applystorage/getById/${id}`, {}, true, ); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); } // 动态表头 export async function fieldModel(params) { const res = await get(Vue.prototype.apiUrl + `/main/fieldmodel/list`, params, true); if (res.code == 0) { return res.data; } return Promise.reject(new Error(res.message)); }