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

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

/**
 * 过磅记录Api接口管理器
 *
 * @author 徐超
 * @date  2025/01/02 16:34
 **/
export default {
	// 获取过磅记录分页
	bizRecordPage(data) {
		return request('page', data, 'get')
	},
	// 提交过磅记录表单 edit为true时为编辑，默认为新增
	bizRecordSubmitForm(data, edit = false) {
		return request(edit ? 'edit' : 'add', data)
	},
	// 删除过磅记录
	bizRecordDelete(data) {
		return request('delete', data)
	},
	// 获取过磅记录详情
	bizRecordDetail(data) {
		return request('detail', data, 'get')
	},
	// 导出过磅记录
	bizRecordExport(data) {
		return request('export', data, 'post', {
			responseType: 'blob'
		})
	},
	// 获取过磅记录七日统计
	bizRecordSevenDaysList(data) {
		return request('sevenDaysList', data, 'get')
	},
	// 获取重量统计
	bizRecordCountWeight(data) {
		return request('sevenDaysCountWeight', data, 'get')
	},
	// 获取收货单位统计
	receiptCompanyList(data) {
		return request('receiptCompanyCountList', data, 'get')
	},
	// 导出收货单位统计
	receiptCompanyExport(data) {
		return request('receiptCompanyExport', data, 'post', {
			responseType: 'blob'
		})
	},
	// 获取发货单位统计
	shippingCompanyList(data) {
		return request('shippingCompanyCountList', data, 'get')
	},
	// 导出发货单位统计
	shippingCompanyExport(data) {
		return request('shippingCompanyExport', data, 'post', {
			responseType: 'blob'
		})
	},
	// 获取运输单位统计
	transportCompanyList(data) {
		return request('transportCompanyCountList', data, 'get')
	},
	// 导出运输单位统计
	transportCompanyExport(data) {
		return request('transportCompanyExport', data, 'post', {
			responseType: 'blob'
		})
	},
	// 获取货品统计
	goodsList(data) {
		return request('goodsCountList', data, 'get')
	},
	// 导出货品统计
	goodsCountExport(data) {
		return request('goodsCountExport', data, 'post', {
			responseType: 'blob'
		})
	},
	// 获取车牌统计
	carCountList(data) {
		return request('carCountList', data, 'get')
	},
	// 导出车牌统计
	carCountExport(data) {
		return request('carCountExport', data, 'post', {
			responseType: 'blob'
		})
	},
	//发货确认
	confirmRecord(data){
		return request('confirmRecord',data)
	},
	//二次过磅司机签名确认
	updateDriverSign(data){
		return request('updateDriverSign',data)
	}
}
