import request from "../../common/request"
import { PSI_MANAGEMANT as prefix } from "@/api/AppPath";

export default class CollectService {
  updateStatusById(data) {
    return request({
      url: prefix + "/psi/collect/updateStatusById",
      method: "post",
      data: data,
    });
  }

  remove(id) {
    return request({
      url: prefix + "/psi/collect/remove",
      method: "get",
      params: { id: id },
    });
  }

  save(data) {
    return request({
      url: prefix + "/psi/collect/save",
      method: "post",
      data: data,
    });
  }

  findById(id) {
    return request({
      url: prefix + "/psi/collect/findById",
      method: "get",
      params: { id: id },
    });
  }

  list(params) {
    return request({
      url: prefix + "/psi/collect/list",
      method: "get",
      params: params,
    });
  }

  wareHouseList(params) {
    return request({
      url: prefix + "/psi/collect/wareHouseList",
      method: "get",
      params: params,
    });
  }

  createReturnData(data) {
    return request({
      url: prefix + "/psi/collect/createReturnData",
      method: "post",
      data: data,
    });
  }

  saveReturn(data) {
    return request({
      url: prefix + "/psi/collect/saveReturn",
      method: "post",
      data: data,
    });
  }

  saveReturnAgree(data) {
    return request({
      url: prefix + "/psi/collect/saveReturnAgree",
      method: "post",
      data: data,
    });
  }

  updateStatusByIdReturn(data) {
    return request({
      url: prefix + "/psi/collect/updateStatusByIdReturn",
      method: "post",
      data: data,
    });
  }

  findByReturnId(id) {
    return request({
      url: prefix + "/psi/collect/findByReturnId",
      method: "get",
      params: { returnId: id },
    });
  }

  returnRequest(data) {
    return request({
      url: prefix + "/psi/collect/returnRequest",
      method: "post",
      data: data,
    });
  }

  findHiById(id) {
    return request({
      url: prefix + "/psi/collect/findHiById",
      method: "get",
      params: { collectId: id },
    });
  }

  findHiByHiId(id) {
    return request({
      url: prefix + "/psi/collect/findHiByHiId",
      method: "get",
      params: { id: id },
    });
  }

  findLastHiByid(id) {
    return request({
      url: prefix + "/psi/collect/findLastHiByid",
      method: "get",
      params: { collectId: id },
    });
  }
}
