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,
		});
	},
	list1: function (params) {
		return request({
			url: prefix + "/cwProjectReport/list",
			method: "get",
			params: params,
		});
	},
	chooseList: function (params) {
		return request({
			url: prefix + "/cwProjectReport/chooseList",
			method: "get",
			params: params,
		});
	},

	getSignatureScribeList: function (params) {
		return request({
			url: prefix + "/cwProjectReport/getSignatureScribeList",
			method: "get",
			params: params,
		});
	},

	preInvoiceList: function (params) {
		return request({
			url: prefix + "/cwProjectRecords/preInvoiceList",
			method: "get",
			params: params,
		});
	},
	getList: function (params) {
		return request({
			url: prefix + "/cwProjectRecords/getList",
			method: "get",
			params: params,
		});
	},
	list2: function (params) {
		return request({
			url: prefix + "/cwProjectRecords/newList",
			method: "get",
			params: params,
		});
	},
	noReportList: function (params) {
		return request({
			url: prefix + "/cwProjectRecords/noReportList",
			method: "get",
			params: params,
		});
	},
	queryById: function (id) {
		return request({
			url: prefix + "/cwProjectRecords/queryById",
			method: "get",
			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",
		});
	},
	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 },
		});
	},
	getInvoiceTotal: function (id) {
		return request({
			url: prefix + "/cwProjectRecords/getInvoiceTotal",
			method: "get",
			params: { id: id },
		});
	},
	importProjectRecords: function (data) {
		return request({
			url: prefix + "/cwProjectRecords/importProjectRecords",
			method: "post",
			data: data,
		});
	},
	exportProjectRecordsTemplate: function () {
		return request({
			url: prefix + "/cwProjectRecords/importFinance/template",
			method: "get",
			responseType: "blob",
		});
	},
};
