import request from "@/utils/request";
// 获取路线列表
export function getProductsList() {
  return request({
    url: "admin/products/list",
    method: "get",
  });
}

export function addProducts(data) {
  return request({
    url: "/admin/products/add",
    method: "post",
    data,
  });
}
// 获取商品列表
export function getProductsListsApi(data) {
  return request({
    url: `/admin/products/list?page=${data.page}&limit=${data.limit}&product_name=${data.product_name??''}&third_product_id=${data.third_product_id ?? ''}`,
    method: "get",
  });
}
// 添加商品
export function postAddProductApi(data) {
  return request({
    url: `/admin/products/add`,
    method: "post",
    data,
  });
}

// 商品排期详情
export function getProductSchedules(data) {
  return request({
    url: `/admin/products/productschedules?id=${data.id}&date=${data.date}`,
    method: "get",
  });
}
// 添加商品排期
export function addProductSchedulesApi(data) {
  return request({
    url: `/admin/products/addproductschedules`,
    method: "post",
    data,
  });
}

// 合同管理列表
export function getContractListsApi() {
  return request({
    url: `/admin/setting/getContractSetting`,
    method: "get",
  });
}
// 保存合同信息
export function postSubmitContractApi(data) {
  return request({
    url: `/admin/setting/savecontractsetting`,
    method: "post",
    data,
  });
}
// 下载合同信息
export function postDownloadContractApi() {
  return request({
    url: `/admin/setting/getContractSetting`,
    method: "get",
  });
}
