api.js 9.26 KB
import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'
import Vue from 'vue'
import {UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"

//角色管理
export const addRole = (params)=>postAction("/sys/role/add",params);
export const editRole = (params)=>putAction("/sys/role/edit",params);
export const checkRoleCode = (params)=>getAction("/sys/role/checkRoleCode",params);
export const queryall = (params)=>getAction("/sys/role/queryall",params);

//用户管理
export const addUser = (params)=>postAction("/sys/user/add",params);
export const editUser = (params)=>putAction("/sys/user/edit",params);
export const queryUserRole = (params)=>getAction("/sys/user/queryUserRole",params);
export const getUserList = (params)=>getAction("/sys/user/list",params);
export const frozenBatch = (params)=>putAction("/sys/user/frozenBatch",params);
//验证用户是否存在
export const checkOnlyUser = (params)=>getAction("/sys/user/checkOnlyUser",params);
//改变密码
export const changePassword = (params)=>putAction("/sys/user/changePassword",params);

//权限管理
export const addPermission= (params)=>postAction("/sys/permission/add",params);
export const editPermission= (params)=>putAction("/sys/permission/edit",params);
export const getPermissionList = (params)=>getAction("/sys/permission/list",params);
export const getSystemMenuList = (params)=>getAction("/sys/permission/getSystemMenuList",params);
export const getSystemSubmenu = (params)=>getAction("/sys/permission/getSystemSubmenu",params);
export const getSystemSubmenuBatch = (params) => getAction('/sys/permission/getSystemSubmenuBatch', params)
export const queryTreeList = (params)=>getAction("/sys/permission/queryTreeList",params);
export const queryTreeListForRole = (params)=>getAction("/sys/role/queryTreeList",params);
export const queryListAsync = (params)=>getAction("/sys/permission/queryListAsync",params);
export const queryRolePermission = (params)=>getAction("/sys/permission/queryRolePermission",params);
export const saveRolePermission = (params)=>postAction("/sys/permission/saveRolePermission",params);
export const queryPermissionsByUser = ()=>getAction("/sys/permission/getUserPermissionByToken");
export const loadAllRoleIds = (params)=>getAction("/sys/permission/loadAllRoleIds",params);
export const getPermissionRuleList = (params)=>getAction("/sys/permission/getPermRuleListByPermId",params);
export const queryPermissionRule = (params)=>getAction("/sys/permission/queryPermissionRule",params);

// 部门管理
export const queryDepartTreeList = (params)=>getAction("/sys/sysDepart/queryTreeList",params);
export const queryIdTree = (params)=>getAction("/sys/sysDepart/queryIdTree",params);
export const queryParentName   = (params)=>getAction("/sys/sysDepart/queryParentName",params);
export const searchByKeywords   = (params)=>getAction("/sys/sysDepart/searchBy",params);
export const deleteByDepartId   = (params)=>deleteAction("/sys/sysDepart/delete",params);

//二级部门管理
export const queryDepartPermission = (params)=>getAction("/sys/permission/queryDepartPermission",params);
export const saveDepartPermission = (params)=>postAction("/sys/permission/saveDepartPermission",params);
export const queryTreeListForDeptRole = (params)=>getAction("/sys/sysDepartPermission/queryTreeListForDeptRole",params);
export const queryDeptRolePermission = (params)=>getAction("/sys/sysDepartPermission/queryDeptRolePermission",params);
export const saveDeptRolePermission = (params)=>postAction("/sys/sysDepartPermission/saveDeptRolePermission",params);
export const queryMyDepartTreeList = (params)=>getAction("/sys/sysDepart/queryMyDeptTreeList",params);

//日志管理
//const getLogList = (params)=>getAction("/sys/log/list",params);
export const deleteLog = (params)=>deleteAction("/sys/log/delete",params);
export const deleteLogList = (params)=>deleteAction("/sys/log/deleteBatch",params);

//数据字典
export const addDict = (params)=>postAction("/sys/dict/add",params);
export const editDict = (params)=>putAction("/sys/dict/edit",params);
export const treeList = (params)=>getAction("/sys/dict/treeList",params);
export const addDictItem = (params)=>postAction("/sys/dictItem/add",params);
export const editDictItem = (params)=>putAction("/sys/dictItem/edit",params);

//字典标签专用(通过code获取字典数组)
export const ajaxGetDictItems = (code, params)=>getAction(`/sys/dict/getDictItems/${code}`,params);

export const getIndexTab = (params)=>getAction("/sys/index/atab", params);

//系统通告
export const doReleaseData = (params)=>getAction("/sys/annountCement/doReleaseData",params);
export const doReovkeData = (params)=>getAction("/sys/annountCement/doReovkeData",params);
//获取系统访问量
export const getLoginfo = (params)=>getAction("/sys/loginfo",params);
export const getVisitInfo = (params)=>getAction("/sys/visitInfo",params);

// 根据部门主键查询用户信息
export const queryUserByDepId = (params)=>getAction("/sys/user/queryUserByDepId",params);

// 重复校验
export const duplicateCheck = (params)=>getAction("/sys/duplicate/check",params);
// 加载分类字典
export const loadCategoryData = (params)=>getAction("/sys/category/loadAllData",params);
export const checkRuleByCode = (params) => getAction('/sys/checkRule/checkByCode', params)
//加载我的通告信息
export const getUserNoticeInfo= (params)=>getAction("/sys/sysAnnouncementSend/getMyAnnouncementSend",params);
export const getTransitURL = url => `/sys/common/transitRESTful?url=${encodeURIComponent(url)}`

// 工艺类型
export const getTechnologyType = (params)=>getAction("/sys/technologyType/getType", params);
export const addTechnologyType = (params)=>postAction("/sys/technologyType/add", params);
export const editTechnologyType = (params)=>putAction("/sys/technologyType/edit", params);

// 工艺
export const getTechnology = (params)=>getAction("/sys/technology/getByHeader", params);
export const addTechnology = (params)=>postAction("/sys/technology/add", params);
export const editTechnology = (params)=>putAction("/sys/technology/edit", params);

//物料
export const addMaterial = (params)=>postAction("/sys/material/add", params);
export const editMaterial = (params)=>postAction("/sys/material/edit", params);

//工时统计
export const calculateWorking = (params)=>getAction("/working/working/calculateTotal", params);
export const calculateDelay = (params)=>getAction("/scheduler/schedulerHeader/calculateDelay", params);

export const getBomId = (params)=>getAction("/config/bom/getBomId", params);
export const getProjectName = (params)=>getAction("/oa/projectc/getProjectName", params);
export const getWorkNo = (params)=>getAction("/oa/projectc/getWordNo", params);
export const getProjectNo = (params)=>getAction("/oa/projectc/getProjectNo", params);
export const getBomTree = (params)=>getAction("/config/bom/getBomTree", params);
export const getBomIdList = (params)=>getAction("/config/bom/getBomIdList", params);
export const getSchedulerPrint = (params)=>postAction("/scheduler/schedulerHeader/report?id="+params);
export const getSchedulerPrintDetail = (params)=>postAction("/scheduler/schedulerHeader/searchReport", params);
export const getOutsourcingPrint = (params)=>postAction("/outsource/outsource/report", params)
export const getOutsourcingPrintDetail = (params)=>postAction("/outsource/outsource/searchReport", params);
export const editBom = (params)=>postAction("/config/bom", params);
export const confirmMaterial = (params)=> putAction("/config/bom/confirm", params);
export const getOutsourcing = (params)=>getAction('/material/outsourcing/list', params);
export const editOutsourcing = (params)=>putAction('/material/outsourcing/edit', params);
export const getPurchase = (params)=>getAction('/material/purchase/list', params);
export const editPurchase = (params)=>putAction('/material/purchase/edit', params);
export const jie = (params)=>putAction('/material/outsourcing', params);
export const getPartLib = (params)=>getAction('/config/bom/getPlmBom', params);
export const editBatchPurchase = (params)=>putAction('/material/purchase/editBatch', params);
export const getInventoryIn = (params)=>getAction('/material/inventory/in', params);
export const getInventoryOut = (params)=>getAction('/material/inventory/out', params);
export const getPurchaseByIds = (params)=>getAction('/material/purchase/queryListByIds', params);
export const mergePurchase = (params)=>putAction('/material/purchase/merge', params);

//查询导入bom计划
export const importBom = (params)=>postAction('/scheduler/bominfo/importBom', params);
export const queryBom = (params)=>getAction('/scheduler/bominfo/bomList', params);
export const checkName = (params)=>getAction('/scheduler/bominfo/checkName', params);
export const getBomInfoId = (params)=>getAction("/scheduler/bominfo/getBomId", params);
export const queryProcess = (params)=>getAction('/plm/partlib/list', params);
export const queryPBom2 = (params)=>getAction('/plm/partlib/bomTree', params);
export const queryPBomByWms = (params)=>getAction('/pbom/pbom/list', params);
// 中转HTTP请求
export const transitRESTful = {
  get: (url, parameter) => getAction(getTransitURL(url), parameter),
  post: (url, parameter) => postAction(getTransitURL(url), parameter),
  put: (url, parameter) => putAction(getTransitURL(url), parameter),
  http: (url, parameter) => httpAction(getTransitURL(url), parameter),
}