import config from "@/config";
import http from "@/utils/request";

export default {
	cost:{
		add: {
			url: `${config.API_URL}/cost.add`,
			name: "服务、快递费用添加",     			// 1 服务费	2 快递费
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		list: {
			url: `${config.API_URL}/cost.list`,
			name: "服务、快递费用列表",
			get: async function (params) {
				return await http.post(this.url, params);
			},
		},
		field:{
			url: `${config.API_URL}/cost.field.list`,
			name: "费用流水检索",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		typeList: {
			url: `${config.API_URL}/cost.type.const.list`,
			name: "费用类型常量列表",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		categoryList: {
			url: `${config.API_URL}/cost.category.const.list`,
			name: "费用类别常量列表",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		delete:{
			url: `${config.API_URL}/cost.delete`,
			name: "删除费用流水",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		info:{
			url: `${config.API_URL}/cost.detail.list`,
			name: "费用流水详情",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		export:{
			url: `${config.API_URL}/cost.flow.export`,
			name: "费用流水导出",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		template:{
			url: `${config.API_URL}/cost.flow.import.template`,
			name: "费用流水导入模版",
			post: async function (params) {
				return await http.get(this.url,params,{responseType: 'arraybuffer'});
			}
		},
		import:{
			url: `${config.API_URL}/cost.flow.import`,
			name: "费用流水导入",
			post: async function (params) {
				return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
			}
		},
		summary:{
			url: `${config.API_URL}/cost.summary.list`,
			name: "成本汇总",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		summaryExport:{
			url: `${config.API_URL}/cost.summary.download`,
			name: "成本汇总导出",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
	},
};
