11-mes-new/src/api/basicData/Cache/storage.js
2022-11-07 08:45:49 +08:00

196 lines
4.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* @Author: lb
* @Date: 2022-03-23 14:40:00
* @LastEditors: lb
* @LastEditTime: 2022-03-23 14:40:00
* @Description: 出入库操作 的后端接口
*/
import request from '@/utils/request'
/**
* 获取分页仓储出入库信息
* @param {object} data
* @param {number} data.current
* @param {number} data.size
* @param {number} [data.operateType]
* @param {number} [data.shelfCode]
* @param {number} [data.enabled]
*/
export function list(data) {
return request({
url: '/stock/SemiFinishedLog/page',
method: 'post',
data
})
}
/**
* 删除某条操作记录
* @param {number} id
*/
export function del(id) {
return request({
url: '/stock/SemiFinishedLog/delete',
method: 'post',
data: { id }
})
}
/**
* 新增出入库记录
* @param {object} data
* @param {object} data.id
* @param {object} data.operateType
* @param {object} data.shelfId
* @param {object} data.stockId
* @param {object} data.semifinishedProductId
* @param {object} data.num
* @param {object} data.source
* @param {object} [data.remark]
*/
export function add(data) {
const url = '/stock/SemiFinishedLog' + (data.operateType === 1 ? '/output' : '/input')
return request({
url,
method: 'post',
data
})
}
/**
* 获取出入库信息单条数据 ==> 后端没有对应接口
* @param {number|string} id
*/
export function detail(id) {
return request({
url: '/stock/SemiFinishedLog/get',
method: 'post',
data: { id }
})
}
/**
* 更新出入库信息单条数据
* @param {object} data
* @param {number|string} data.id
* @param {number|string} data.semifinishedProductId
* @param {number|string} data.shelfId
* @param {number|string} data.stockId
* @param {number} data.operateType
* @param {number} data.num
* @param {number} data.source
* @param {string} [data.remark]
*/
export function update(data) {
return request({
url: '/stock/SemiFinishedLog/update',
method: 'post',
data
})
}
/**
* 分页获取货架信息
* @param {object} data
* @param {number} data.size
* @param {number} data.current
* @param {string} [data.name]
* @param {number} [data.enabled]
*/
export function getShelfList(data) {
return request({
url: '/basic/shelf/page',
method: 'post',
data
})
}
/**
* 分页获取缓存区列表
* @param {object} data
* @param {number} data.size
* @param {number} data.current
* @param {string} [data.name]
* @param {number} [data.enabled]
* @param {string} [data.code]
*/
export function getCacheList(data) {
return request({
url: '/basic/cache/page',
method: 'post',
data
})
}
/**
* 分页获取区域信息列表
* @param {object} data
* @param {number} data.size
* @param {number} data.current
* @param {string} [data.name]
* @param {number} [data.enabled]
* @param {number|string} [data.cacheId]
*/
export function getAreaList(data) {
return request({
url: '/basic/area/page',
method: 'post',
data
})
}
/**
* 分页获取库位信息列表, 如果data里有cacheId则按照缓存区搜索如果有areaId就按照区域搜索
* @param {object} data
* @param {number} data.size
* @param {number} data.current
* @param {string} [data.name]
* @param {number} [data.enabled]
* @param {number|string} [data.cacheId]
* @param {number|string} [data.areaId]
*/
export function getStockList(data) {
const url = '/basic/stock' + (data.cacheId ? '/pageOfCache' : '/pageOfArea')
return request({
url,
method: 'post',
data
})
}
/**
* 分页获取产品池列表
* @param {object} data
* @param {number} data.current
* @param {number} data.size
* @param {string} [data.key]
* @param {number} [data.enabled]
*/
export function getProductsList(data) {
// 获取产品池列表
return request({
url: '/basic/product/page',
method: 'post',
data
})
}
/**
* 获取可用库位
* @param {object} data
* @param {number} [data.cacheId]
* @param {number} [data.areaId]
* @param {number} data.operateType
* @param {number} data.current
* @param {number} data.size
* @param {number} [data.enabled]
*/
export function getAvailableStocks(data) {
const url = '/basic/stock/availableStock'
return request({
url,
method: 'post',
data
})
}