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

export default {
	list: function (params) {
		return request({
			url: prefix + "/cwProjectRecords/list",
			method: "get",
			params: params,
		});
	},
	getAllList: function (params) {
		return request({
			url: prefix + "/cwProjectRecords/getAllList",
			method: "get",
			params: params,
		});
	},
	zxList: function (params) {
		return request({
			url: prefix + "/cwProjectRecords/zxList",
			method: "get",
			params: params,
		});
	},
	list1: function (params) {
		return request({
			url: prefix + "/cwProjectReport/list",
			method: "get",
			params: params,
		});
	},
	queryById: function (id) {
		return request({
			url: prefix + "/cwProjectRecords/queryById",
			method: "get",
			params: { id: id },
		});
	},
	projectUpgrade: function (id) {
		return request({
			url: prefix + "/cwProjectRecords/projectUpgrade",
			method: "post",
			params: { id: id },
		});
	},
	save: function (inputForm) {
		return request({
			url: prefix + `/cwProjectRecords/save`,
			method: "post",
			data: inputForm,
		});
	},
	saveForm: function (inputForm) {
		return request({
			url: prefix + `/cwProjectRecords/saveForm`,
			method: "post",
			data: inputForm,
		});
	},
	delete: function (ids) {
		return request({
			url: prefix + "/cwProjectRecords/delete",
			method: "delete",
			params: { ids: ids },
		});
	},
	updateStatusById: function (data) {
		return request({
			url: prefix + "/cwProjectRecords/updateStatusById",
			method: "post",
			data: data,
		});
	},
	exportFile: function (params) {
		return request({
			url: prefix + "/cwProjectRecords/export",
			method: "get",
			params: params,
			responseType: "blob",
		});
	},
	getByClientId: function (id, projectForm) {
		return request({
			url: prefix + "/cwProjectRecords/getByClientId",
			method: "get",
			params: { clientId: id, ...projectForm },
		});
	},
	getByContractId: function (id, projectForm) {
		return request({
			url: prefix + "/cwProjectRecords/getByContractId",
			method: "get",
			params: { contractId: id, ...projectForm },
		});
	},
	updateMembers: function (inputForm) {
		return request({
			url: prefix + `/cwProjectRecords/updateMembers`,
			method: "post",
			data: inputForm,
		});
	},
	getHaveProjectIds: function () {
		return request({
			url: prefix + "/cwProjectRecords/getHaveProjectIds",
			method: "get",
		});
	},
	partialCustomerInfoList: function (params) {
		return request({
			url: prefix + "/cwProjectRecords/partialCustomerInfoList",
			method: "get",
			params: params,
		});
	},
	getContractClientList: function (params) {
		return request({
			url: prefix + "/cw_work_client/info/getContractClientList",
			method: "get",
			params: params,
		});
	},
	getReportById: function (params) {
		return request({
			url:prefix + "/cwProjectRecords/getReportById",
			params:params
		})
	},

	getReportByProjectId:function (id,projectId) {
		return request({
			url:prefix + "/cwProjectRecords/getReportByProjectId",
			params:{id:id,projectId:projectId}
		})

	},
	queryPlanById: function (id) {
		return request({
			url: prefix + "/cwProjectRecords/queryPlanById",
			method: "get",
			params: { id: id },
		});
	},
	exportPlan: function (params) {
		return request({
			url: prefix + "/cwProjectRecords/exportPlan",
			method: "get",
			params: params,
			responseType: "blob",
		});
	},

	userTree (name,id) {
		return request({
			url: prefix + '/cwProjectRecords/userTree',
			method: 'get',
			params: {name: name,id:id}
		})
	},

	savePlanForm: function (inputForm) {
		return request({
			url: prefix + `/cwProjectRecords/savePlanForm`,
			method: "post",
			data: inputForm,
		});
	},

	getTaskPhase: function () {
		return request({
			url: prefix + "/cwProjectRecords/getTaskPhase",
			method: "get",
		});
	},


};
