/** * 职工信息接口请求 * @param params * @returns {Promise} */ import request from '@/utils/request' export function getList(params) { return request({ url: '/mgr/staff/page', method: 'POST', loading: true, data: params, headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }) } /** 新增职工 */ export function add(params) { return request({ url: '/mgr/staff', method: 'POST', loading: true, data: params }) } /** 删除职工 */ export function remove(params) { const ids = params.toString() return request({ url: `/mgr/staff/${ids}`, method: 'DELETE', loading: true, data: params }) } /** 更新职工 */ export function update(id, params) { return request({ url: `/mgr/staff/${id}`, method: 'put', data: params }) } /** 查询单个职工 */ export function get(id, params) { return request({ url: `/mgr/staff/${id}`, method: 'get', loading: false, params }) } /** 查询某类职工 */ export function getStaffByType(partId, staffType) { return request({ url: `/mgr/staff/${partId}/${staffType}`, method: 'get', loading: false }) }