import request from "@/utils/request";

export function getSalesData(data: object) {
  return request({
    url: "/api/v1/sales/page",
    method: "post",
    data,
  });
}

// 获取订单列表
export function getOrderList(data: object) {
  return request({
    url: "/api/v1/sales/orderPage",
    method: "post",
    data,
  });
}

export function getCheckList(data: object) {
  return request({
    url: "/api/v1/sales/checkCode/list",
    method: "post",
    data,
  });
}

export function getMaterialList(checkCode: string, materialModel: string) {
  return request({
    url: "/api/v1/sales/checkCode/getMaterialModel",
    method: "get",
    params: {
      checkCode,
      materialModel
    }
  });
}

export function getSeqNoList(checkCode: string, materialModel: string, seqNo: string) {
  return request({
    url: "/api/v1/sales/checkCode/getSeqNoList",
    method: "get",
    params: {
      checkCode,
      materialModel,
      seqNo
    }
  });
}

// 用户列表
export function getUserList(data: object) {
  return request({
    url: "/api/v1/sales/queryUserList",
    method: "get",
    data,
  });
}

// 新增销售反馈表

export function addFeedback(data: object) {
  return request({
    url: "/api/v1/sales/add",
    method: "post",
    data,
  });
}

// 删除销售反馈表

export function deleteFeedback(id: number) {
  return request({
    url: "/api/v1/sales/del",
    method: "post",
    data: {id},
  });
}

//处理反馈表

export function dealFeedback(data: object) {
  return request({
    url: "/api/v1/sales/handle",
    method: "post",
    data,
  });
}

export function updateSalesData(data: object) {
  return request({
    url: "/api/v1/sales/update",
    method: "post",
    data,
  });
}
