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

export default {
	order:{
		mail:{
			list:{
				url: `${config.API_URL}/mail.sync.list`,
				name: "邮件同步记录 （数据确认列表）",
				get: async function (params) {
					return await http.post(this.url, params);
				},
			},
			info:{
				url: `${config.API_URL}/mail.sync.body.info`,
				name: "邮件正文",
				post: async function (params) {
					return await http.post(this.url, params);
				},
			},
			detail:{
				url: `${config.API_URL}/mail.sync.repair.detail`,
				name: "邮件同步记录维修清单列表",
				post: async function (params) {
					return await http.post(this.url, params);
				},
			},
			delete:{
				url: `${config.API_URL}/mail.sync.repair.delete`,
				name: "邮件同步记录维修清单删除",
				post: async function (params) {
					return await http.post(this.url, params);
				},
			},
			detailIds:{
				url: `${config.API_URL}/maintenance.order.detail.ids`,
				name: "邮件维修清单列表ids",
				post: async function (params) {
					return await http.post(this.url, params);
				},
			},
			manual:{
				url: `${config.API_URL}/mail.sync.manual`,
				name: "手动同步邮件",
				post: async function (params) {
					return await http.post(this.url, params);
				},
			},
			confirm:{
				url: `${config.API_URL}/mail.sync.repair.confirm`,
				name: "确认入保",
				post: async function (params) {
					return await http.post(this.url, params);
				},
			},

		},
		maintenance:{
			list:{
				url: `${config.API_URL}/maintenance.order.list`,
				name: "维保工单列表",
				get: async function (params) {
					return await http.post(this.url, params);
				},
			},
			export:{
				url: `${config.API_URL}/maintenance.order.export`,
				name: "维保工单导出",
				post: async function (params) {
					return await http.post(this.url, params);
				}
			},
			template:{
				url: `${config.API_URL}/maintenance.order.import.template`,
				name: "维保工单导入模版",
				post: async function (params) {
					return await http.get(this.url,params,{responseType: 'arraybuffer'});
				}
			},
			import:{
				url: `${config.API_URL}/maintenance.order.import`,
				name: "维保工单导入",
				post: async function (params) {
					return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
				}
			},
		},
		list: {
			url: `${config.API_URL}/order.list`,
			name: "获取加工单列表",
			get: async function (params) {
				return await http.post(this.url, params);
			},
		},
		add: {
			url: `${config.API_URL}/order.add`,
			name: "获取加工单添加",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		delete: {
			url: `${config.API_URL}/order.delete`,
			name: "获取加工单删除",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		cancel:{
			url: `${config.API_URL}/order.cancel`,
			name: "加工单撤回",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		info:{
			url: `${config.API_URL}/order.info`,
			name: "加工单详情",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		review: {
			url: `${config.API_URL}/order.review`,
			name: "加工单审核",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		active: {
			url: `${config.API_URL}/order.active.list`,
			name: "已排期工单",
			get: async function (params) {
				return await http.post(this.url, params);
			},
		}
	}
};
