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

export default class ProjectReportArchiveService {
	list(params) {
		return request({
			url: prefix + "/cwProjectReportArchive/list",
			method: "get",
			params: params,
		});
	}

	reportList(params) {
		return request({
			url: prefix + "/cwProjectReportArchive/reportList",
			method: "get",
			params: params,
		});
	}
	queryById(id) {
		return request({
			url: prefix + "/cwProjectReportArchive/queryById",
			method: "get",
			params: { id: id },
		});
	}
	queryReportById(id) {
		return request({
			url: prefix + "/cwProjectReportArchiveApply/queryReportById",
			method: "get",
			params: { id: id },
		});
	}
	save(inputForm) {
		return request({
			url: prefix + `/cwProjectReportArchive/save`,
			method: "post",
			data: inputForm,
		});
	}
	saveForm(inputForm) {
		return request({
			url: prefix + `/cwProjectReportArchive/saveForm`,
			method: "post",
			data: inputForm,
		});
	}
	applySave(inputForm) {
		return request({
			url: prefix + `/cwProjectReportArchiveApply/applySave`,
			method: "post",
			data: inputForm,
		});
	}
	delete(ids) {
		return request({
			url: prefix + "/cwProjectReportArchive/delete",
			method: "delete",
			params: { ids: ids },
		});
	}

	deleteById(id) {
		return request({
			url: prefix + "/cwProjectReportArchive/deleteById",
			method: "delete",
			params: { id: id },
		});
	}

	updateStatusById(data) {
		return request({
			url: prefix + "/cwProjectReportArchive/updateStatusById",
			method: "post",
			data: data,
		});
	}
	updateApplyStatusById(data) {
		return request({
			url: prefix + "/cwProjectReportArchiveApply/updateStatusById",
			method: "post",
			data: data,
		});
	}
	exportFile(params) {
		return request({
			url: prefix + "/cwProjectReportArchive/export",
			method: "get",
			params: params,
			responseType: "blob",
		});
	}
	newExportFile(params) {
		return request({
			url: prefix + "/cwProjectReportArchive/newExport",
			method: "get",
			params: params,
			responseType: "blob",
		});
	}

	findReportUse(reportNo) {
		return request({
			url: prefix + "/cwProjectReportArchive/findReportUse",
			method: "get",
			params: { reportNo: reportNo },
		});
	}

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

	getLastAuditDateByReportId(reportId) {
		return request({
			url: prefix + "/cwProjectReportArchive/getLastAuditDateByReportId",
			method: "get",
			params: { reportId: reportId },
		});
	}
	findCompletedList(params) {
		return request({
			url: prefix + "/cwProjectReportArchive/findCompletedList",
			method: "get",
			params: params,
		});
	}

	getFileBoxNumber(params) {
		return request({
			url: prefix + "/cwProjectReportArchive/getFileBoxNumber",
			method: "get",
			params: params,
		});
	}
	//根据报告年份修改文档存放位置
	updatePlaceByYear(data) {
		return request({
			url: prefix + "/cwProjectReportArchive/updatePlaceByYear",
			method: "post",
			data: data,
		});
	}
}
