import { baseRequest } from '@/utils/request'

const request = (url, ...arg) => baseRequest(`/biz/depotRepayOrder/` + url, ...arg)

/**
 * 出库还款Api接口管理器
 *
 * @author xiang
 * @date  2023/09/18 16:45
 **/
export default {
	// 获取出库还款分页
	depotRepayOrderPage(data) {
		return request('page', data, 'get')
	},
	// 获取出库还款列表
	depotRepayOrderList(data) {
		return request('list', data, 'get')
	},
	// 提交出库还款表单 edit为true时为编辑，默认为新增
	depotRepayOrderSubmitForm(data, edit = false) {
		return request(edit ? 'add' : 'edit', data)
	},
	// 预约控制
	depotRepayOrderEditBookFlag(data) {
		return request( 'editBookFlag', data)
	},
	// 关单
	depotRepayOrderEditOffOrder(data) {
		return request( 'offOrder', data)
	},
	// 删除出库还款
	depotRepayOrderDelete(data) {
		return request('delete', data)
	},
	// 获取出库还款详情
	depotRepayOrderDetail(data) {
		return request('detail', data, 'get')
	},
	// 二级审批通过
	bankOpApproval(data) {
		return request('bankOpApproval', data)
	},
	// 候补车牌
	depotRepayOrderPlug(data) {
		return request('plug', data)
	},
	// 候补车牌审批
	depotRepayOrderApprovalPlug(data) {
		return request('approvalPlug', data)
	},
	// 添加新单时获取并校验最近一次还款单
	depotRepayOrderGetBeforeAdd(data) {
		return request('getBeforeAdd', data, 'get')
	},
}
