import fetch from "utils/fetch";

// 入驻申请列表

// export function settlement_list(query) {
//   return fetch({
//     url: 'vehicle/company/apply/selectList',
//     method: 'get',
//     params: query
//   });
// }

// // 设为已读
// export function set_to_read(query) {
//   return fetch({
//     url: 'vehicle/company/apply/upd',
//     method: 'post',
//     data: query
//   });
// }

export function company_list(query) {
  return fetch({
    url: "vehicle/company/info/selectList",
    method: "get",
    params: query,
  });
}

export function store_list(query) {
  return fetch({
    url: "vehicle/admin/branchCompany/search",
    method: "get",
    params: query,
  });
}
//所有公司列表
export function company_all_list() {
  return fetch({
    url: "vehicle/company/info/alls",
    method: "get",
  });
}

//所有门店列表 state: 1
export function branchCompany_all_list(query) {
  return fetch({
    url: "vehicle/branchCompany/alls",
    method: "get",
    params: query,
  });
}


// 添加公司
export function add_company(query) {
  return fetch({
    url: "vehicle/company/info/save",
    method: "post",
    data: query,
  });
}
// 删除公司
export function del_company(query) {
  return fetch({
    url: "vehicle/company/info/del",
    method: "post",
    data: query,
  });
}

//编辑公司

export function upd_company(query) {
  return fetch({
    url: "vehicle/company/info/upd",
    method: "post",
    data: query,
  });
}

//门店
// 删除门店

export function del_store(query) {
  return fetch({
    url: "vehicle/admin/branchCompany/del?id=" + query.id,
    method: "delete",
  });
}

//添加门店
export function add_store(query) {
  return fetch({
    url: "vehicle/admin/branchCompany",
    method: "post",
    data: query,
  });
}

//修改上下架
//修改门店
export function update_store(id, query) {
  return fetch({
    url: "vehicle/admin/branchCompany/" + id,
    method: "put",
    data: query,
  });
}
