// 高级采购价格管理API接口
|
import request from "@/utils/request";
|
|
// 分页查询价格列表
|
export function getPriceList(query) {
|
return request({
|
url: "/procurement/price/list",
|
method: "get",
|
params: query,
|
});
|
}
|
|
// 获取价格详情
|
export function getPriceDetail(id) {
|
return request({
|
url: `/procurement/price/detail/${id}`,
|
method: "get",
|
});
|
}
|
|
// 新增价格
|
export function addPrice(data) {
|
return request({
|
url: "/procurement/price/add",
|
method: "post",
|
data: data,
|
});
|
}
|
|
// 更新价格
|
export function updatePrice(data) {
|
return request({
|
url: "/procurement/price/update",
|
method: "put",
|
data: data,
|
});
|
}
|
|
// 删除价格
|
export function deletePrice(id) {
|
return request({
|
url: `/procurement/price/delete/${id}`,
|
method: "delete",
|
});
|
}
|
|
// 批量删除价格
|
export function batchDeletePrice(ids) {
|
return request({
|
url: "/procurement/price/batchDelete",
|
method: "delete",
|
data: { ids },
|
});
|
}
|
|
// 复制价格
|
export function copyPrice(id) {
|
return request({
|
url: `/procurement/price/copy/${id}`,
|
method: "post",
|
});
|
}
|
|
// 应用价格(将待生效状态改为有效)
|
export function applyPrice(id) {
|
return request({
|
url: `/procurement/price/apply/${id}`,
|
method: "put",
|
});
|
}
|
|
// 暂停价格
|
export function suspendPrice(id) {
|
return request({
|
url: `/procurement/price/suspend/${id}`,
|
method: "put",
|
});
|
}
|
|
// 批量设置折扣
|
export function batchSetDiscount(data) {
|
return request({
|
url: "/procurement/price/batchDiscount",
|
method: "post",
|
data: data,
|
});
|
}
|
|
// 获取折扣配置
|
export function getDiscountConfig(id) {
|
return request({
|
url: `/procurement/price/discount/${id}`,
|
method: "get",
|
});
|
}
|
|
// 设置单个商品折扣
|
export function setDiscount(data) {
|
return request({
|
url: "/procurement/price/setDiscount",
|
method: "post",
|
data: data,
|
});
|
}
|
|
// 获取阶梯折扣配置
|
export function getTieredDiscount(id) {
|
return request({
|
url: `/procurement/price/tieredDiscount/${id}`,
|
method: "get",
|
});
|
}
|
|
// 设置阶梯折扣
|
export function setTieredDiscount(data) {
|
return request({
|
url: "/procurement/price/setTieredDiscount",
|
method: "post",
|
data: data,
|
});
|
}
|
|
// 获取价格控制设置
|
export function getPriceControlConfig() {
|
return request({
|
url: "/procurement/price/controlConfig",
|
method: "get",
|
});
|
}
|
|
// 更新价格控制设置
|
export function updatePriceControlConfig(data) {
|
return request({
|
url: "/procurement/price/controlConfig",
|
method: "put",
|
data: data,
|
});
|
}
|
|
// 获取价格预警列表
|
export function getPriceWarnings(query) {
|
return request({
|
url: "/procurement/price/warnings",
|
method: "get",
|
params: query,
|
});
|
}
|
|
// 处理价格预警
|
export function handlePriceWarning(id, action) {
|
return request({
|
url: `/procurement/price/warning/${id}`,
|
method: "put",
|
data: { action },
|
});
|
}
|
|
// 获取价格历史记录
|
export function getPriceHistory(id, query) {
|
return request({
|
url: `/procurement/price/history/${id}`,
|
method: "get",
|
params: query,
|
});
|
}
|
|
// 获取价格统计数据
|
export function getPriceStatistics(query) {
|
return request({
|
url: "/procurement/price/statistics",
|
method: "get",
|
params: query,
|
});
|
}
|
|
// 导出价格数据
|
export function exportPriceData(query) {
|
return request({
|
url: "/procurement/price/export",
|
method: "get",
|
params: query,
|
responseType: 'blob',
|
});
|
}
|
|
// 导入价格数据
|
export function importPriceData(file) {
|
const formData = new FormData();
|
formData.append('file', file);
|
return request({
|
url: "/procurement/price/import",
|
method: "post",
|
data: formData,
|
headers: {
|
'Content-Type': 'multipart/form-data',
|
},
|
});
|
}
|
|
// 获取价格模板
|
export function downloadPriceTemplate() {
|
return request({
|
url: "/procurement/price/template",
|
method: "get",
|
responseType: 'blob',
|
});
|
}
|
|
// 价格审批
|
export function approvePrice(id, data) {
|
return request({
|
url: `/procurement/price/approve/${id}`,
|
method: "put",
|
data: data,
|
});
|
}
|
|
// 价格驳回
|
export function rejectPrice(id, data) {
|
return request({
|
url: `/procurement/price/reject/${id}`,
|
method: "put",
|
data: data,
|
});
|
}
|
|
// 获取供应商列表(用于下拉选择)
|
export function getSupplierOptions() {
|
return request({
|
url: "/procurement/price/suppliers",
|
method: "get",
|
});
|
}
|
|
// 获取商品列表(用于下拉选择)
|
export function getProductOptions(query) {
|
return request({
|
url: "/procurement/price/products",
|
method: "get",
|
params: query,
|
});
|
}
|
|
// 获取商品详细信息
|
export function getProductInfo(productId) {
|
return request({
|
url: `/procurement/price/productInfo/${productId}`,
|
method: "get",
|
});
|
}
|
|
// 价格比较分析
|
export function comparePrices(data) {
|
return request({
|
url: "/procurement/price/compare",
|
method: "post",
|
data: data,
|
});
|
}
|
|
// 获取价格趋势数据
|
export function getPriceTrend(id, period) {
|
return request({
|
url: `/procurement/price/trend/${id}`,
|
method: "get",
|
params: { period },
|
});
|
}
|
|
// 价格预测
|
export function predictPrice(id, data) {
|
return request({
|
url: `/procurement/price/predict/${id}`,
|
method: "post",
|
data: data,
|
});
|
}
|
|
// 获取市场价格参考
|
export function getMarketPriceReference(productCode) {
|
return request({
|
url: `/procurement/price/marketRef/${productCode}`,
|
method: "get",
|
});
|
}
|
|
// 价格变动通知设置
|
export function updateNotificationSettings(data) {
|
return request({
|
url: "/procurement/price/notifications",
|
method: "put",
|
data: data,
|
});
|
}
|
|
// 获取价格变动通知设置
|
export function getNotificationSettings() {
|
return request({
|
url: "/procurement/price/notifications",
|
method: "get",
|
});
|
}
|