employee.js 2.69 KB
import { http } from '@/main'
var defaultPath = 'merchants.api.'

const getListApi = params => {
  params.method = `${defaultPath}staff.findStaffByPage`
  return http({
    url: '/rop-merchants/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const getAllMerchantListApi = params => {
  params.method = `${defaultPath}menu.findAllMerchant`
  return http({
    url: '/rop-merchants/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const getRoleListApi = params => {
  params.method = 'merchants.api.role.list'
  return http({
    url: '/rop-merchants/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const getAllDictApi = params => {
  params.method = `${defaultPath}menu.findAllDictData`
  return http({
    url: '/rop-merchants/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const getMerchantTreeApi = params => {
  params.method = `${defaultPath}merchant.findMerchantTree`
  return http({
    url: '/rop-merchants/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const getDetailInfoApi = params => {
  params.method = `${defaultPath}staff.staffSearchRequest`
  return http({
    url: '/rop-merchants/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const getDetailLogApi = params => {
  params.method = `${defaultPath}menu.findLog`
  return http({
    url: '/rop-merchants/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const addEmployeeApi = params => {
  params.method = `${defaultPath}staff.saveStaff`
  return http({
    url: 'rop-merchants/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const updateEmployeeApi = params => {
  params.method = `${defaultPath}staff.updateStaff`
  return http({
    url: 'rop-merchants/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const deleteEmployeeApi = params => {
  params.method = `${defaultPath}staff.deleteStaff`
  return http({
    url: 'rop-merchants/router',
    method: 'POST',
    data: params,
    sign: true,
    returnAll: true
  })
}

const exportEmployeeApi = params => {
  params.method = `${defaultPath}staff.exportData`
  return http({
    url: 'rop-merchants/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

const updateStatusApi = params => {
  params.method = `${defaultPath}staff.updateStatus`
  return http({
    url: 'rop-merchants/router',
    method: 'POST',
    data: params,
    sign: true
  })
}

export default { getListApi, getAllMerchantListApi, getRoleListApi, getAllDictApi, getMerchantTreeApi, getDetailInfoApi, getDetailLogApi, addEmployeeApi, updateEmployeeApi, deleteEmployeeApi, exportEmployeeApi, updateStatusApi }