import request from "@/utils/httpRequest";
import { PSI_MANAGEMANT as prefix } from "../AppPath";

export default class CollectService {
	updateStatusById(param) {
		return request({
			url: prefix + "/psi/collect/updateStatusById",
			method: "post",
			data: param,
		});
	}
	remove(id) {
		return request({
			url: prefix + "/psi/collect/remove",
			method: "get",
			params: { id: id },
		});
	}
	save(param) {
		return request({
			url: prefix + "/psi/collect/save",
			method: "post",
			data: param,
		});
	}
	findById(id) {
		return request({
			url: prefix + "/psi/collect/findById",
			method: "get",
			params: { id: id },
		});
	}
	list(param) {
		return request({
			url: prefix + "/psi/collect/list",
			method: "get",
			params: param,
		});
	}
	exportFile(params) {
		return request({
			url: prefix + "/psi/collect/exportFile",
			method: "get",
			params: params,
			responseType: "blob",
		});
	}
	exportFileByTemplate(params) {
		return request({
			url: prefix + "/psi/collect/exportFileByTemplate",
			method: "get",
			params: params,
			responseType: "blob",
		});
	}
	templateImageData(params) {
		return request({
			url: prefix + "/psi/collect/templateImageData",
			method: "get",
			params: params,
		});
	}
	wareHouseList(params) {
		return request({
			url: prefix + "/psi/collect/wareHouseList",
			method: "get",
			params: params,
		});
	}
	createReturnData(param) {
		return request({
			url: prefix + "/psi/collect/createReturnData",
			method: "post",
			data: param,
		});
	}
	saveReturn(param) {
		return request({
			url: prefix + "/psi/collect/saveReturn",
			method: "post",
			data: param,
		});
	}
	saveReturnAgree(param) {
		return request({
			url: prefix + "/psi/collect/saveReturnAgree",
			method: "post",
			data: param,
		});
	}
	updateStatusByIdReturn(param) {
		return request({
			url: prefix + "/psi/collect/updateStatusByIdReturn",
			method: "post",
			data: param,
		});
	}
	findByReturnId(id) {
		return request({
			url: prefix + "/psi/collect/findByReturnId",
			method: "get",
			params: { returnId: id },
		});
	}
	returnRequest(param) {
		return request({
			url: prefix + "/psi/collect/returnRequest",
			method: "post",
			data: param,
		});
	}
	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 },
		});
	}
	userTree(name) {
		return request({
			url: prefix + "/psi/collect/userTree",
			method: "get",
			params: { name: name },
		});
	}
}
