Просмотр исходного кода

feat: 库存管理 - 管理端API调用

Xiaogang Liao 1 месяц назад
Родитель
Сommit
1a20f519e9
1 измененных файлов с 113 добавлено и 0 удалено
  1. 113 0
      cfc-web/src/api/admin.js

+ 113 - 0
cfc-web/src/api/admin.js

@@ -1660,3 +1660,116 @@ export function changeAssessmentGuide(orderId, guideId) {
     data: { orderId, guideId }
   })
 }
+
+// ========== 库存管理 API ==========
+
+export function createInboundOrder(data) {
+  return request({
+    url: '/api/admin/inventory/inbound/create',
+    method: 'post',
+    data
+  })
+}
+
+export function getInboundOrderList(params) {
+  return request({
+    url: '/api/admin/inventory/inbound/list',
+    method: 'post',
+    data: params
+  })
+}
+
+export function getInboundOrderDetail(id) {
+  return request({
+    url: '/api/admin/inventory/inbound/detail',
+    method: 'post',
+    data: { id }
+  })
+}
+
+export function confirmInbound(id) {
+  return request({
+    url: '/api/admin/inventory/inbound/confirm',
+    method: 'post',
+    data: { id }
+  })
+}
+
+export function cancelInbound(id) {
+  return request({
+    url: '/api/admin/inventory/inbound/cancel',
+    method: 'post',
+    data: { id }
+  })
+}
+
+export function getInventoryTransactions(params) {
+  return request({
+    url: '/api/admin/inventory/transactions/list',
+    method: 'post',
+    data: params
+  })
+}
+
+export function createCountingRecord(data) {
+  return request({
+    url: '/api/admin/inventory/counting/create',
+    method: 'post',
+    data
+  })
+}
+
+export function confirmCounting(id) {
+  return request({
+    url: '/api/admin/inventory/counting/confirm',
+    method: 'post',
+    data: { id }
+  })
+}
+
+export function getCountingList(params) {
+  return request({
+    url: '/api/admin/inventory/counting/list',
+    method: 'post',
+    data: params
+  })
+}
+
+export function getStockAlerts() {
+  return request({
+    url: '/api/admin/inventory/alert/list',
+    method: 'post'
+  })
+}
+
+export function getProductStock(productId) {
+  return request({
+    url: '/api/admin/inventory/product/stock',
+    method: 'post',
+    data: { productId }
+  })
+}
+
+export function saveBundleItems(bundleProductId, items) {
+  return request({
+    url: '/api/admin/inventory/bundle/items',
+    method: 'post',
+    data: { bundleProductId, items }
+  })
+}
+
+export function getBundleItems(bundleProductId) {
+  return request({
+    url: '/api/admin/inventory/bundle/items/list',
+    method: 'post',
+    data: { bundleProductId }
+  })
+}
+
+export function checkBundleStock(bundleProductId, quantity) {
+  return request({
+    url: '/api/admin/inventory/bundle/check-stock',
+    method: 'post',
+    data: { bundleProductId, quantity }
+  })
+}