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

export default {
	list: function (params) {
		return request({
			url: prefix + "/cw_work_client/info/list",
			method: "get",
			params: params,
		});
	},
	listTree: function (params) {
		return request({
			url: prefix + "/cw_work_client/info/list_tree",
			method: "get",
			params: params,
		});
	},
	findAllList: function (params) {
		return request({
			url: prefix + "/cw_work_client/info/findAllList",
			method: "get",
			params: params,
		});
	},
	queryById: function (id) {
		return request({
			url: prefix + "/cw_work_client/info/queryById",
			method: "get",
			params: { id: id },
		});
	},
	save: function (inputForm) {
		return request({
			url: prefix + `/cw_work_client/info/save`,
			method: "post",
			data: inputForm,
		});
	},
	saveForm: function (inputForm) {
		return request({
			url: prefix + `/cw_work_client/info/saveForm`,
			method: "post",
			data: inputForm,
		});
	},
	delete: function (ids) {
		return request({
			url: prefix + "/cw_work_client/info/delete",
			method: "delete",
			params: { ids: ids },
		});
	},
	updateStatusById: function (data) {
		return request({
			url: prefix + "/cw_work_client/info/updateStatusById",
			method: "post",
			data: data,
		});
	},
	exportFile: function (params) {
		return request({
			url: prefix + "/cw_work_client/info/export",
			method: "get",
			params: params,
			responseType: "blob",
		});
	},
	pushUpdate: function (id) {
		return request({
			url: prefix + "/cw_work_client/info/pushUpdate",
			method: "get",
			params: { id: id },
		});
	},
	stopUpdate: function (id) {
		return request({
			url: prefix + "/cw_work_client/info/stopUpdate",
			method: "get",
			params: { id: id },
		});
	},
	rejectUpdate: function (id) {
		return request({
			url: prefix + "/cw_work_client/info/rebackOrAgreeUpdate",
			method: "get",
			params: { id: id, type: "reject" },
		});
	},
	rebackUpdate: function (id) {
		return request({
			url: prefix + "/cw_work_client/info/rebackOrAgreeUpdate",
			method: "get",
			params: { id: id, type: "reback" },
		});
	},
	rebackPushUpdate: function (id) {
		return request({
			url: prefix + "/cw_work_client/info/rebackOrAgreeUpdate",
			method: "get",
			params: { id: id, type: "reback_push" },
		});
	},
	agreeUpdate: function (id) {
		return request({
			url: prefix + "/cw_work_client/info/rebackOrAgreeUpdate",
			method: "get",
			params: { id: id, type: "agree" },
		});
	},
	reapplyUpdate: function (id) {
		return request({
			url: prefix + "/cw_work_client/info/rebackOrAgreeUpdate",
			method: "get",
			params: { id: id, type: "reapply" },
		});
	},
	queryUscCodeIsUse: function (uscCode) {
		return request({
			url: prefix + "/cw_work_client/info/queryUscCodeIsUse",
			method: "get",
			params: { uscCode: uscCode },
		});
	},
	queryUscCodeById: function (id) {
		return request({
			url: prefix + "/cw_work_client/info/queryUscCodeById",
			method: "get",
			params: { id: id },
		});
	},
	queryNameIsUse: function (name) {
		return request({
			url: prefix + "/cw_work_client/info/queryNameIsUse",
			method: "get",
			params: { name: name },
		});
	},
	queryNameById: function (id) {
		return request({
			url: prefix + "/cw_work_client/info/queryNameById",
			method: "get",
			params: { id: id },
		});
	},
	queryUpdateLogList: function (params) {
		return request({
			url: prefix + "/cw_work_client/info/queryUpdateLogList",
			method: "get",
			params: params,
		});
	},
	getBillingListByClientId: function (params) {
		return request({
			url: prefix + "/cw_work_client/info/getBillingListByClientId",
			method: "get",
			params: params,
		});
	},
};
