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

export default class ProjectInfoService {
	list (param) {
		return request({
			url: prefix + '/jyProject/list',
			method: 'get',
			params: param
		})
	}
	getHaveProjectIds () {
		return request({
			url: prefix + '/jyProject/getHaveProjectIds',
			method: 'get'
		})
	}
	findContractPageList (params) {
		return request({
			url: prefix + '/jyProject/findContractPageList',
			method: 'get',
			params: params
		})
	}
	saveForm (inputForm) {
		return request({
			url: prefix + `/jyProject/saveForm`,
			method: 'post',
			data: inputForm
		})
	}
	findById (id) {
		return request({
			url: prefix + '/jyProject/findById',
			method: 'get',
			params: {id: id}
		})
	}

	updateStatusById (data) {
		return request({
			url: prefix + '/jyProject/updateStatusById',
			method: 'post',
			data: data
		})
	}

	delete (ids) {
		return request({
			url: prefix + '/jyProject/deleteById',
			method: 'get',
			params: {id: ids}
		})
	}
	deleteAll (ids) {
		return request({
			url: prefix + '/jyProject/delete',
			method: 'delete',
			params: {ids: ids}
		})
	}

	listByCreateId(param){
		return request({
			url: prefix + '/jyProject/getByCreate',
			method: 'get',
			params: param
		})
	}

	listByCreateOffice(param){
		return request({
			url: prefix + '/jyProject/getByCreateOffice',
			method: 'get',
			params: param
		})
	}

	getByCreateOut(param){
		return request({
			url: prefix + '/jyProject/getByCreateOut',
			method: 'get',
			params: param
		})
	}

	findByIdAudit(id){
		return request({
			url: prefix + '/jyProject/findByIdAudit',
			method: 'get',
			params: {id:id}
		})
	}

	saveFormThree (inputForm) {
		return request({
			url: prefix + `/jyProject/saveFormThree`,
			method: 'post',
			data: inputForm
		})
	}

	updateStatusByAuditId (data) {
		return request({
			url: prefix + '/jyProject/updateStatusByAuditId',
			method: 'post',
			data: data
		})
	}

	saveFormOut (inputForm) {
		return request({
			url: prefix + `/jyProject/saveFormOut`,
			method: 'post',
			data: inputForm
		})
	}

	updateStatusByOutId (data) {
		return request({
			url: prefix + '/jyProject/updateStatusByOutId',
			method: 'post',
			data: data
		})
	}

	/* 一级校审文档下载 */
	downloadFirstAuditTpl (id, projectId) {
		return request({
			url: prefix + '/jyProject/downloadFirstAuditTpl',
			method: 'get',
			params: {id: id, projectId: projectId},
		})
	}
	/* 二级校审文档下载 */
	downloadSecondAuditTpl (id, projectId) {
		return request({
			url: prefix + '/jyProject/downloadSecondAuditTpl',
			method: 'get',
			params: {id: id, projectId: projectId},
		})
	}
	/* 三级校审文档下载 */
	downloadThirdlyAuditTpl (id, projectId) {
		return request({
			url: prefix + '/jyProject/downloadThirdlyAuditTpl',
			method: 'get',
			params: {id: id, projectId: projectId},
		})
	}
	/*
	根据id查找外审信息
	 */
	findByIdOut(id){
		return request({
			url: prefix + '/jyProject/findByIdOut',
			method: 'get',
			params: {id:id}
		})
	}
	/*
	根据id查找外审信息
	 */
	getAttachmentList(projectId,id){
		return request({
			url: prefix + '/jyProject/getAttachmentList',
			method: 'get',
			params: {projectId:projectId, id: id}
		})
	}

	/**
	 * 根据id查找报批签发信息
	 * @param id
	 */
	queryReportsById (id) {
		return request({
			url: prefix + '/jyProject/queryReportsById',
			method: 'get',
			params: {id: id}
		})
	}

	saveReportsSubmit (inputForm) {
		return request({
			url: prefix + "/jyProject/saveReportsSubmit",
			method: 'post',
			data: inputForm
		})
	}

	updateReportsSubmitById (params) {
		return request({
			url: prefix + '/jyProject/updateReportsSubmitById',
			method: 'post',
			params: params
		})
	}

	saveFormArchive (inputForm) {
		return request({
			url: prefix + `/jyProject/saveFormArchive`,
			method: 'post',
			data: inputForm
		})
	}

	updateStatusByArchiveId (data) {
		return request({
			url: prefix + '/jyProject/updateStatusByArchiveId',
			method: 'post',
			data: data
		})
	}

	/*
	根据id查找归档信息
	 */
	findByIdArchive(id){
		return request({
			url: prefix + '/jyProject/findByIdArchive',
			method: 'get',
			params: {id:id}
		})
	}

	saveFormEia (inputForm) {
		return request({
			url: prefix + `/jyProject/saveFormEia`,
			method: 'post',
			data: inputForm
		})
	}

	updateStatusByEiaId (data) {
		return request({
			url: prefix + '/jyProject/updateStatusByEiaId',
			method: 'post',
			data: data
		})
	}

	/*
	根据id查找归档信息
	 */
	findByIdEia(id){
		return request({
			url: prefix + '/jyProject/findByIdEia',
			method: 'get',
			params: {id:id}
		})
	}

	updateMembers(inputForm) {
		return request({
			url: prefix + `/jyProject/updateMembers`,
			method: "post",
			data: inputForm,
		});
	}

	exportFile(params) {
		return request({
			url: prefix + "/jyProject/export",
			method: "get",
			params: params,
			responseType: "blob",
		});
	}

	getByContractId (id, projectForm) {
		return request({
			url: prefix + "/jyProject/getByContractId",
			method: "get",
			params: { contractId: id, ...projectForm },
		});
	}





}
