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

export default class ReportArchieveService {
	list(param) {
		return request({
			url: prefix + "/zsReportArchieve/info/list",
			method: "get",
			params: param,
		});
	}

	exportTemplate() {
		return request({
			url: prefix + "/zsReportArchieve/info/import/template",
			method: "get",
			responseType: "blob",
		});
	}

	importExcel(data) {
		return request({
			url: prefix + "/zsReportArchieve/info/importDetail",
			method: "post",
			data: data,
		});
	}

	getOfficeNameList() {
		return request({
			url: prefix + "/zsReportArchieve/info/getOfficeNameList",
			method: "get",
		});
	}
	queryById(id) {
		return request({
			url: prefix + "/zsReportArchieve/info/queryById",
			method: "get",
			params: { id: id },
		});
	}
	remove(id) {
		return request({
			url: prefix + "/zsReportArchieve/info/remove",
			method: "get",
			params: { id: id },
		});
	}
	getReportNo(reportNoType) {
		return request({
			url: prefix + "/zsReportArchieve/info/getReportNo",
			method: "get",
			params: { reportNoType: reportNoType },
		});
	}
	getFileBoxNumber(reportNo) {
		return request({
			url: prefix + "/zsReportArchieve/info/getFileBoxNumber",
			method: "get",
			params: { reportNo: reportNo },
		});
	}
	checkFileBoxNumber(fileBoxNumber, reportNoType) {
		return request({
			url: prefix + "/zsReportArchieve/info/checkFileBoxNumber",
			method: "get",
			params: {
				fileBoxNumber: fileBoxNumber,
				reportNoType: reportNoType,
			},
		});
	}
	checkReportTypeAndReportNo(reportNoType, reportNo) {
		return request({
			url: prefix + "/zsReportArchieve/info/checkReportTypeAndReportNo",
			method: "get",
			params: { reportNoType: reportNoType, reportNo: reportNo },
		});
	}
	saveForm(param) {
		return request({
			url: prefix + "/zsReportArchieve/info/saveForm",
			method: "post",
			data: param,
		});
	}
	exportFile(params) {
		return request({
			url: prefix + "/zsReportArchieve/info/exportFile",
			method: "get",
			params: params,
			responseType: "blob",
		});
	}
	//根据报告年份修改文档存放位置
	updatePlaceByYear(data) {
		return request({
			url: prefix + "/zsReportArchieve/info/updatePlaceByYear",
			method: "post",
			data: data,
		});
	}
}
