import request from "@/utils/request";

//系统配置
export function systemconfig(params) {
  return request({
    url: "/ums/umsSystemConfig/getSystemConfig",
    method: "get",
    params: params,
  });
}

//分销比例设置
export function distributionSet(data) {
  return request({
    url: "/ums/umsSystemConfig/updateSystemConfig",
    method: "post",
    data: data,
  });
}

//用户列表
export function userList(params) {
  return request({
    url: "/ums/umsAdminUser/getDistributionList",
    method: "get",
    params: params,
  });
}

//分销商列表
export function peopleList(params) {
  return request({
    url: "/ums/umsAdminUser/list",
    method: "get",
    params: params,
  });
}

//分销员下级列表
export function getJuniorList(params) {
  return request({
    url: "/ums/umsAdminUser/getSubordinate",
    method: "get",
    params: params,
  });
}

//业绩统计列表
export function performanceList(params) {
  return request({
    url: "/ums/umsAdminUser/getPerformanceStatisticsList",
    method: "get",
    params: params,
  });
}

//提现申请
export function withdrawRequest(params) {
  return request({
    url: "/ums/umsAdminUser/requestWithdraw",
    method: "get",
    params: params,
  });
}

//设置分销等级
export function settingType(data) {
  return request({
    url: "/ums/umsAdminUser/setDistribution",
    method: "post",
    data: data,
  });
}

//获取二维码
export function getQrcode(params) {
  return request({
    responseType: 'blob',
    url: "/ums/fileCtl/qrcode",
    method: "get",
    params: params,
  });
}

// 分销记录列表
export function recordsList(params) {
  return request({
    url: "/ums/umsAdminUser/getAdminUserSettleRecordList",
    method: "get",
    params: params,
  });
}

// 更新财务结算状态
export function updateStatus(id,params) {
  return request({
    url: "/ums/umsAdminUser/financialSettlement?settleRecordIds="+id,
    method: "post",
    params: params,
  });
}

// 分销员编辑
export function peopleEdit(data) {
  return request({
    url: "/ums/umsAdminUser/updateDistributionInfo",
    method: "post",
    data: data,
  });
}

// 修改密码
export function updatePassword(data) {
  return request({
    url:'admin/updatePassword',
    method:'post',
    data:data
  })
}

// 结算记录列表
export function financeList(params) {
  return request({
    url: "/ums/umsAdminUser/getSettleRecordList",
    method: "get",
    params: params,
  });
}

// 充电桩列表
export function chargeList(params) {
  return request({
    url: "/pms/cChargeStation/list",
    method: "get",
    params: params,
  });
}

// 分销站时间段销售价
export function priceList(params) {
  return request({
    url: "/ums/distributionStationTimePrice/getStationTimePrice",
    method: "get",
    params: params,
  });
}

// 设置时段佣金
export function settingsPrice(data) {
  return request({
    url:'/ums/distributionStationTimePrice/setDistributionPrice',
    method:'post',
    data:data
  })
}
