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);
				},
			},
			emailDelete:{
				url: `${config.API_URL}/mail.sync.delete`,
				name: "邮件同步记录删除",
				post: 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);
				},
			},
			selectField:{
				url: `${config.API_URL}/mail.select.field.list`,
				name: "数据确认检索下拉",
				post: async function (params) {
					return await http.post(this.url, params);
				},
			},
		},
		repair:{
			list:{
				url: `${config.API_URL}/repair.order.list`,
				name: "维修工单列表",
				get: async function (params) {
					return await http.post(this.url, params);
				},
			},
			info:{
				url: `${config.API_URL}/repair.order.detail`,
				name: "维修单详情",
				post: async function (params) {
					return await http.post(this.url, params);
				},
			},
			confirm:{
				url: `${config.API_URL}/repair.order.confirm`,
				name: "维修工单确认",
				post: async function (params) {
					return await http.post(this.url, params);
				},
			},
			repairing:{
				url: `${config.API_URL}/repair.order.repairing`,
				name: "正在维修",
				post: async function (params) {
					return await http.post(this.url, params);
				},
			},
			submit:{
				url: `${config.API_URL}/repair.order.submit`,
				name: "提交维修工单",
				post: async function (params) {
					return await http.post(this.url, params);
				},
			},
			status:{
				url: `${config.API_URL}/repair.status.list`,
				name: "维修业务状态",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			field:{
				url: `${config.API_URL}/repair.order.field.list`,
				name: "维修工单检索",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			search:{
				url: `${config.API_URL}/repair.order.search.list`,
				name: "维修工单搜索",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			template:{
				url: `${config.API_URL}/repair.order.import.template`,
				name: "维修工单导入模版",
				post: async function (params) {
					return await http.get(this.url,params,{responseType: 'arraybuffer'});
				}
			},
			import:{
				url: `${config.API_URL}/repair.order.import`,
				name: "维修工单导入",
				post: async function (params) {
					return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
				}
			},
		},
		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'});
				}
			},
			logs:{
				url: `${config.API_URL}/order.op.log.list`,
				name: "维保工单操作日志",
				get: async function (params) {
					return await http.post(this.url,params);
				}
			},
			info:{
				url: `${config.API_URL}/maintenance.order.detail`,
				name: "维保工单详情",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			delete:{
				url: `${config.API_URL}/maintenance.order.delete`,
				name: "删除维保工单",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			add:{
				url: `${config.API_URL}/maintenance.order.add`,
				name: "创建维保工单",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			field:{
				url: `${config.API_URL}/maintenance.order.field.list`,
				name: "维保工单检索",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			review:{
				url: `${config.API_URL}/maintenance.order.approval`,
				name: "维保工单审核",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			submit:{
				url: `${config.API_URL}/maintenance.order.submit`,
				name: "提交维保工单",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			send:{
				url: `${config.API_URL}/maintenance.order.send.supplier`,
				name: "下发维保工单",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			status:{
				url: `${config.API_URL}/maintenance.order.business.status.list`,
				name: "维保工单业务状态",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			optionList:{
				url: `${config.API_URL}/maintenance.repair.options.const.list`,
				name: "维保工单常量下拉",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			search:{
				url: `${config.API_URL}/maintenance.order.search.list`,
				name: "维保工单搜索",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			wbCompanyField:{
				url: `${config.API_URL}/wb.company.field.list`,
				name: "维保厂商下拉",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			}
		},
		plan:{
			list:{
				url: `${config.API_URL}/maintenance.plan.list`,
				name: "维保计划列表",
				get: async function (params) {
					return await http.post(this.url, params);
				},
			},
			field:{
				url: `${config.API_URL}/`,
				name: "维保计划检索",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			confirm:{
				url: `${config.API_URL}/repair.order.confirm`,
				name: "维保计划确认",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			}
		},
		sock: {
			list:{
				url: `${config.API_URL}/inventory.list`,
				name: "库存列表",
				get: async function (params) {
					return await http.post(this.url, params);
				},
			},
			field:{
				url: `${config.API_URL}/inventory.field.list`,
				name: "库存列表检索",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
			import:{
				url: `${config.API_URL}/inventory.import`,
				name: "库存导入",
				post: async function (params) {
					return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
				}
			},
			template:{
				url: `${config.API_URL}/stock.import.template`,
				name: "库存导入模版",
				post: async function (params) {
					return await http.get(this.url,params,{responseType: 'arraybuffer'});
				}
			},
			export:{
				url: `${config.API_URL}/inventory.export`,
				name: "库存导出",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			},
		},
		out:{
			list:{
				url: `${config.API_URL}/out.stock.list`,
				name: "销售出库清单列表",
				get: async function (params) {
					return await http.post(this.url, params);
				},
			},
			field:{
				url: `${config.API_URL}/out.stock.field.list`,
				name: "销售出库清单检索",
				post: async function (params) {
					return await http.post(this.url,params);
				}
			}
		}
	}
};
