import { baseRequest } from '@/utils/request'
const request = (url, ...arg) => baseRequest(`/grainReserves/reserveQuantity/` + url, ...arg)
const request1 = (url, ...arg) => baseRequest(`/grainReserves/grReserveScale/` + url, ...arg)
const request2 = (url, ...arg) => baseRequest(`/grainReserves/gopsPlan/` + url, ...arg)

// 获取储备数量分页
export default {
	reserveQuantityPage(data) {
		return request('page', data, 'get')
	},
	// 获取储备数量分页(库区)
	storagePageList(data) {
		return request('storagePage', data, 'get')
	},

	// ---------------------储备规模----------------------
	// 获取储备规模分页
	reserveScalePage(data) {
		return request1('page', data, 'get')
	},
	// 新增
	reserveScaleAdd(data) {
		return request1('add', data, 'post')
	},
	// 编辑
	reserveScaleEdit(data) {
		return request1('edit', data, 'post')
	},
	// 查看详情
	reserveScaleDetail(data) {
		return request1('detail', data, 'get')
	},
	// 删除
	reserveScaleDelete(data) {
		return request1('delete', data, 'post')
	},
	// 企业单位
	getUnitInfoData(data) {
		return request1('getUnitInfo', data, 'get')
	},
	// 库区名称
	getOrgInfoData(data) {
		return request1('getOrgInfo', data, 'get')
	},
	// 粮食品种
	getLspzInfoData(data) {
		return request1('getLspzInfo', data, 'get')
	},
	// 粮食性质
	getLsxzInfoData(data) {
		return request1('getLsxzInfo', data, 'get')
	},
	// 下发
	reserveScaleIissued(data) {
		return request1('issued', data, 'post')
	},

	// --------------购销计划管理页面接口------------------
	// 购销计划管理列表接口
	purchaseSalesPage(data) {
		return request2('page', data, 'get')
	},
	// 新增接口
	purchaseSalesAdd(data) {
		return request2('add', data, 'post')
	},
	// 编辑修改接口
	purchaseSalesEdit(data) {
		return request2('edit', data, 'post')
	},
	// 删除接口
	purchaseSalesDelete(data) {
		return request2('delete', data, 'post')
	},
	// 查看详情接口
	purchaseSalesDetail(data) {
		return request2('detail', data, 'get')
	},
	// 库区接收
	purchaseSalesOrgId(data) {
		return request2('getOrgIdList', data, 'get')
	},
	// 获取仓房数据
	storeHouseList(data) {
		return request2(`getStoreHouseList/${data.orgId}`, data, 'get')
	},
	// 获取货位数据
	warehouseDataList(data) {
		return request2(`getWarehouseList/${data.storehouseId}`, data, 'get')
	},
	// 通过仓房id，货位id。接收库区id三个调取销售的品种性质等数据
	getListDetailData(data) {
		return request2('getListDetail', data, 'get')
	},
	// 收购数据的品种 性质等级接口 (品种:1060,等级:1002,粮食性质:1032)
	purchaseSalesListDetail(data) {
		return request2(`getEnumTreeList/${data.parentId}`, data, 'get')
	},
	// 批量下发
	purchaseSalesListUpdate(data) {
		return request2('getCollectionsToUpdate', data, 'post')
	},

	// 计划进度模块列表接口
	plannedProgress(data) {
		return request2('getPlanRatePage', data, 'get')
	}
}
