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

export default {
	list: function (param) {
		return request({
			url: prefix + "/contract/registration/list",
			method: "get",
			params: param,
		});
	},
	save: function (param) {
		return request({
			url: prefix + "/contract/registration/save",
			method: "post",
			data: param,
		});
	},
	remove: function (url) {
		return request({
			url: prefix + "/contract/registration/remove",
			method: "get",
			params: { id: url },
		});
	},
	findById: function (id) {
		return request({
			url: prefix + "/contract/registration/findById",
			method: "get",
			params: { id: id },
		});
	},
	findFileInfoById: function (id) {
		return request({
			url: prefix + "/contract/registration/findFileInfoById",
			method: "get",
			params: { id: id },
		});
	},
	findByContractId: function (id) {
		return request({
			url: prefix + "/contract/registration/findByContractId",
			method: "get",
			params: { id: id },
		});
	},
	updateStatusById: function (param) {
		return request({
			url: prefix + "/contract/registration/updateStatusById",
			method: "post",
			data: param,
		});
	},
	updateInfo: function (param) {
		return request({
			url: prefix + "/contract/registration/updateInfo",
			method: "post",
			data: param,
		});
	},
	updatePaperInfo: function (param) {
		return request({
			url: prefix + "/contract/registration/updatePaperInfo",
			method: "post",
			data: param,
		});
	},
	getByClientId: function (id, contractForm) {
		return request({
			url: prefix + "/contract/registration/getByClientId",
			method: "get",
			params: { contractId: id, ...contractForm },
		});
	},
	exportFile: function (params) {
		return request({
			url: prefix + "/contract/registration/exportFile",
			method: "get",
			params: params,
			responseType: "blob",
		});
	},
};
