diff --git a/manager/src/api/procurement.js b/manager/src/api/procurement.js new file mode 100644 index 00000000..372202d6 --- /dev/null +++ b/manager/src/api/procurement.js @@ -0,0 +1,38 @@ +import { + getRequest, + postRequest, + putRequest, + deleteRequest, +} from "@/libs/axios"; + +// ========== 采购单(只读) ========== +export const getProcurementOrderPage = params => getRequest("/procurement/order", params); +export const getProcurementOrderDetail = id => getRequest(`/procurement/order/${id}`); + +// ========== 采购入库单(只读) ========== +export const getProcurementInboundPage = params => getRequest("/procurement/inbound", params); +export const getProcurementInboundDetail = id => getRequest(`/procurement/inbound/${id}`); +export const getProcurementInboundItems = id => getRequest(`/procurement/inbound/${id}/items`); + +// ========== 盘点单(只读) ========== +export const getInventoryCountPage = params => getRequest("/procurement/inventory-count/page", params); +export const getInventoryCountDetail = id => getRequest(`/procurement/inventory-count/${id}`); +export const getInventoryCountItemsPage = (id, params) => + getRequest(`/procurement/inventory-count/${id}/items/page`, params); +export const downloadInventoryCountItems = id => + getRequest(`/procurement/inventory-count/${id}/download`); +export const exportInventoryCountItems = id => + getRequest(`/procurement/inventory-count/${id}/export`, {}, "blob"); + +// ========== 报损单(只读) ========== +export const getDamageReportPage = params => getRequest("/procurement/damage-report/page", params); +export const getDamageReportDetail = id => getRequest(`/procurement/damage-report/${id}`); +export const getDamageReportItems = id => getRequest(`/procurement/damage-report/${id}/items`); + +// ========== 出入库原因 CRUD ========== +export const getStockReasonPage = params => getRequest("/procurement/reason", params); +export const addStockReason = params => + postRequest("/procurement/reason", params, { "Content-Type": "application/json" }); +export const updateStockReason = params => + putRequest("/procurement/reason", params, { "Content-Type": "application/json" }); +export const deleteStockReason = id => deleteRequest(`/procurement/reason/${id}`); diff --git a/manager/src/router/router.js b/manager/src/router/router.js index 07106b98..ab17a940 100644 --- a/manager/src/router/router.js +++ b/manager/src/router/router.js @@ -454,6 +454,30 @@ export const otherRouter = { name: "goodsSalesSummaryReport", meta: { title: "商品销售汇总报表" }, component: () => import("@/views/statistics/goods-sales-summary.vue") + }, + { + path: "procurement/purchase-order/detail", + title: "采购单详情", + name: "manager-procurement-order-detail", + component: () => import("@/views/procurement/purchase-order/detail.vue") + }, + { + path: "procurement/inbound/detail", + title: "入库单详情", + name: "manager-procurement-inbound-detail", + component: () => import("@/views/procurement/inbound/detail.vue") + }, + { + path: "procurement/inventory-count/detail", + title: "盘点单详情", + name: "manager-inventory-count-detail", + component: () => import("@/views/procurement/inventory-count/detail.vue") + }, + { + path: "procurement/damage-report/detail", + title: "报损单详情", + name: "manager-damage-report-detail", + component: () => import("@/views/procurement/damage-report/detail.vue") } ] }; diff --git a/manager/src/views/procurement/constants.js b/manager/src/views/procurement/constants.js new file mode 100644 index 00000000..8e988f8b --- /dev/null +++ b/manager/src/views/procurement/constants.js @@ -0,0 +1,91 @@ +export const PROCUREMENT_STATUS = { + DRAFT: "待提交", + SUBMITTED: "已提交", + PENDING_INBOUND: "待入库", + PARTIAL_INBOUND: "部分入库", + CLOSED: "已关闭", + COMPLETED: "已完成", + REJECTED: "已拒绝", +}; + +export const PROCUREMENT_STATUS_TAG = { + DRAFT: "info", + SUBMITTED: "warning", + PENDING_INBOUND: "primary", + PARTIAL_INBOUND: "warning", + CLOSED: "info", + COMPLETED: "success", + REJECTED: "danger", +}; + +export const DAMAGE_STATUS = { + DRAFT: "待提交", + SUBMITTED: "待审核", + APPROVED: "已通过", + REJECTED: "已驳回", + CANCELLED: "已作废", + COMPLETED: "已完成", +}; + +export const DAMAGE_STATUS_TAG = { + DRAFT: "info", + SUBMITTED: "warning", + APPROVED: "primary", + REJECTED: "danger", + CANCELLED: "info", + COMPLETED: "success", +}; + +export const MARKET_ENABLE = { + UPPER: "上架", + DOWN: "下架", +}; + +export const STOCK_REASON_CATEGORY = { + INBOUND: "入库", + OUTBOUND: "出库", + DAMAGE: "报损", +}; + +export function stockReasonCategoryText(category) { + return STOCK_REASON_CATEGORY[category] || category || "-"; +} + +export function procurementStatusText(status) { + return PROCUREMENT_STATUS[status] || status || "-"; +} + +export function procurementStatusTag(status) { + return PROCUREMENT_STATUS_TAG[status] || "info"; +} + +export function damageStatusText(status) { + return DAMAGE_STATUS[status] || status || "-"; +} + +export function damageStatusTag(status) { + return DAMAGE_STATUS_TAG[status] || "info"; +} + +export function formatMoney(val) { + if (val === null || val === undefined || val === "") return "0.00"; + return Number(val).toFixed(2); +} + +export function exportCsv(filename, headers, rows) { + const escape = (v) => { + const s = v == null ? "" : String(v); + if (s.includes(",") || s.includes('"') || s.includes("\n")) { + return `"${s.replace(/"/g, '""')}"`; + } + return s; + }; + const lines = [headers.map(escape).join(",")]; + rows.forEach((row) => lines.push(row.map(escape).join(","))); + const blob = new Blob(["\uFEFF" + lines.join("\n")], { type: "text/csv;charset=utf-8;" }); + const link = document.createElement("a"); + link.href = URL.createObjectURL(blob); + link.download = filename; + link.click(); + URL.revokeObjectURL(link.href); +} diff --git a/manager/src/views/procurement/damage-report/detail.vue b/manager/src/views/procurement/damage-report/detail.vue new file mode 100644 index 00000000..f9ea35d5 --- /dev/null +++ b/manager/src/views/procurement/damage-report/detail.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/manager/src/views/procurement/damage-report/list.vue b/manager/src/views/procurement/damage-report/list.vue new file mode 100644 index 00000000..6088b720 --- /dev/null +++ b/manager/src/views/procurement/damage-report/list.vue @@ -0,0 +1,95 @@ + + + diff --git a/manager/src/views/procurement/inbound/detail.vue b/manager/src/views/procurement/inbound/detail.vue new file mode 100644 index 00000000..80eeaf7e --- /dev/null +++ b/manager/src/views/procurement/inbound/detail.vue @@ -0,0 +1,78 @@ + + + + + diff --git a/manager/src/views/procurement/inbound/list.vue b/manager/src/views/procurement/inbound/list.vue new file mode 100644 index 00000000..0ac88320 --- /dev/null +++ b/manager/src/views/procurement/inbound/list.vue @@ -0,0 +1,83 @@ + + + diff --git a/manager/src/views/procurement/inventory-count/detail.vue b/manager/src/views/procurement/inventory-count/detail.vue new file mode 100644 index 00000000..1890d9b9 --- /dev/null +++ b/manager/src/views/procurement/inventory-count/detail.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/manager/src/views/procurement/inventory-count/list.vue b/manager/src/views/procurement/inventory-count/list.vue new file mode 100644 index 00000000..7a9652f1 --- /dev/null +++ b/manager/src/views/procurement/inventory-count/list.vue @@ -0,0 +1,66 @@ + + + diff --git a/manager/src/views/procurement/purchase-order/detail.vue b/manager/src/views/procurement/purchase-order/detail.vue new file mode 100644 index 00000000..aef4a8bd --- /dev/null +++ b/manager/src/views/procurement/purchase-order/detail.vue @@ -0,0 +1,92 @@ + + + + + diff --git a/manager/src/views/procurement/purchase-order/list.vue b/manager/src/views/procurement/purchase-order/list.vue new file mode 100644 index 00000000..7146f804 --- /dev/null +++ b/manager/src/views/procurement/purchase-order/list.vue @@ -0,0 +1,100 @@ + + + diff --git a/manager/src/views/procurement/reason/reasonManage.vue b/manager/src/views/procurement/reason/reasonManage.vue new file mode 100644 index 00000000..c913134a --- /dev/null +++ b/manager/src/views/procurement/reason/reasonManage.vue @@ -0,0 +1,169 @@ + + + + + diff --git a/seller/src/api/procurement.js b/seller/src/api/procurement.js new file mode 100644 index 00000000..9c776161 --- /dev/null +++ b/seller/src/api/procurement.js @@ -0,0 +1,51 @@ +import { + getRequest, + postRequest, + putRequest, +} from "@/libs/axios"; + +// ========== 采购单 ========== +export const getProcurementOrderPage = params => getRequest("/procurement/order", params); +export const getProcurementOrderStatusCount = params => getRequest("/procurement/order/status-count", params); +export const getProcurementOrderDetail = id => getRequest(`/procurement/order/${id}`); +export const createProcurementOrder = params => + postRequest("/procurement/order", params, { "Content-Type": "application/json" }); +export const submitProcurementOrder = id => putRequest(`/procurement/order/submit/${id}`); +export const auditProcurementOrder = (id, params) => + putRequest(`/procurement/order/audit/${id}`, params, { "Content-Type": "application/json" }); +export const closeProcurementOrder = id => putRequest(`/procurement/order/close/${id}`); + +// ========== 采购入库单 ========== +export const getProcurementInboundPage = params => getRequest("/procurement/inbound", params); +export const getProcurementInboundDetail = id => getRequest(`/procurement/inbound/${id}`); +export const getProcurementInboundItems = id => getRequest(`/procurement/inbound/${id}/items`); +export const createProcurementInbound = params => + postRequest("/procurement/inbound", params, { "Content-Type": "application/json" }); + +// ========== 盘点单 ========== +export const createInventoryCount = () => postRequest("/procurement/inventory-count"); +export const getInventoryCountPage = params => getRequest("/procurement/inventory-count/page", params); +export const getInventoryCountDetail = id => getRequest(`/procurement/inventory-count/${id}`); +export const getInventoryCountItemsPage = (id, params) => + getRequest(`/procurement/inventory-count/${id}/items/page`, params); +export const downloadInventoryCountItems = id => + getRequest(`/procurement/inventory-count/${id}/download`); +export const exportInventoryCountItems = id => + getRequest(`/procurement/inventory-count/${id}/export`, {}, "blob"); + +// ========== 报损单 ========== +export const getDamageReportPage = params => getRequest("/procurement/damage-report/page", params); +export const getDamageReportStatusCount = params => getRequest("/procurement/damage-report/status-count", params); +export const getDamageReportDetail = id => getRequest(`/procurement/damage-report/${id}`); +export const getDamageReportItems = id => getRequest(`/procurement/damage-report/${id}/items`); +export const createDamageReport = params => + postRequest("/procurement/damage-report", params, { "Content-Type": "application/json" }); +export const submitDamageReport = id => putRequest(`/procurement/damage-report/${id}/submit`); +export const approveDamageReport = id => putRequest(`/procurement/damage-report/${id}/approve`); +export const rejectDamageReport = (id, remark) => + putRequest(`/procurement/damage-report/${id}/reject?remark=${encodeURIComponent(remark || "")}`); +export const cancelDamageReport = id => putRequest(`/procurement/damage-report/${id}/cancel`); +export const completeDamageReport = id => putRequest(`/procurement/damage-report/${id}/complete`); + +// ========== 出入库原因 ========== +export const getStockReasonList = params => getRequest("/procurement/reason", params); diff --git a/seller/src/router/router.js b/seller/src/router/router.js index d1ba73d4..8ffbd782 100644 --- a/seller/src/router/router.js +++ b/seller/src/router/router.js @@ -197,6 +197,42 @@ export const otherRouter = { name: "goodsSalesSummaryReport", meta: { title: "商品销售汇总报表" }, component: () => import("@/views/statistics/goods-sales-summary.vue") + }, + { + path: "procurement/purchase-order/operation", + title: "采购单", + name: "procurement-purchase-order-operation", + component: () => import("@/views/procurement/purchase-order/operation.vue") + }, + { + path: "procurement/inbound/operation", + title: "采购入库", + name: "procurement-inbound-operation", + component: () => import("@/views/procurement/inbound/operation.vue") + }, + { + path: "procurement/inventory-count/detail", + title: "盘点明细", + name: "procurement-inventory-count-detail", + component: () => import("@/views/procurement/inventory-count/detail.vue") + }, + { + path: "procurement/damage-report/operation", + title: "报损单", + name: "procurement-damage-report-operation", + component: () => import("@/views/procurement/damage-report/operation.vue") + }, + { + path: "alertQuantityWarnList", + title: "预警商品", + name: "alertQuantityWarnList", + component: () => import("@/views/goods/goods-seller/alertQuantityWarn.vue") + }, + { + path: "alertQuantityWarnSetting", + title: "设置预警", + name: "alertQuantityWarnSetting", + component: () => import("@/views/goods/goods-seller/alertQuantityWarn.vue") } ] }; diff --git a/seller/src/views/goods/goods-seller/alertQuantity.vue b/seller/src/views/goods/goods-seller/alertQuantity.vue index 551855cf..f26bce7c 100644 --- a/seller/src/views/goods/goods-seller/alertQuantity.vue +++ b/seller/src/views/goods/goods-seller/alertQuantity.vue @@ -34,96 +34,56 @@ - - -
- 批量导出 - 批量导入 -
- - - + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - -
@@ -188,38 +118,28 @@ diff --git a/seller/src/views/goods/goods-seller/alertQuantityWarn.vue b/seller/src/views/goods/goods-seller/alertQuantityWarn.vue new file mode 100644 index 00000000..03487c77 --- /dev/null +++ b/seller/src/views/goods/goods-seller/alertQuantityWarn.vue @@ -0,0 +1,295 @@ + + + + + diff --git a/seller/src/views/my-components/lili/upload-pic-thumb.vue b/seller/src/views/my-components/lili/upload-pic-thumb.vue index 12b8c0e3..5b0f6086 100644 --- a/seller/src/views/my-components/lili/upload-pic-thumb.vue +++ b/seller/src/views/my-components/lili/upload-pic-thumb.vue @@ -226,7 +226,14 @@ export default { setData(v, init) { if (typeof v == "string") { if (this.multiple) { - this.$Message.warning("多张上传仅支持数组数据类型"); + if (!v) { + this.uploadList = []; + return; + } + this.setData( + v.split(",").map((s) => s.trim()).filter(Boolean), + init + ); return; } if (!v) { diff --git a/seller/src/views/procurement/constants.js b/seller/src/views/procurement/constants.js new file mode 100644 index 00000000..3e456234 --- /dev/null +++ b/seller/src/views/procurement/constants.js @@ -0,0 +1,81 @@ +export const PROCUREMENT_STATUS = { + DRAFT: "待提交", + SUBMITTED: "已提交", + PENDING_INBOUND: "待入库", + PARTIAL_INBOUND: "部分入库", + CLOSED: "已关闭", + COMPLETED: "已完成", + REJECTED: "已拒绝", +}; + +export const PROCUREMENT_STATUS_TAG = { + DRAFT: "info", + SUBMITTED: "warning", + PENDING_INBOUND: "primary", + PARTIAL_INBOUND: "warning", + CLOSED: "info", + COMPLETED: "success", + REJECTED: "danger", +}; + +export const DAMAGE_STATUS = { + DRAFT: "待提交", + SUBMITTED: "待审核", + APPROVED: "已通过", + REJECTED: "已驳回", + CANCELLED: "已作废", + COMPLETED: "已完成", +}; + +export const DAMAGE_STATUS_TAG = { + DRAFT: "info", + SUBMITTED: "warning", + APPROVED: "primary", + REJECTED: "danger", + CANCELLED: "info", + COMPLETED: "success", +}; + +export const MARKET_ENABLE = { + UPPER: "上架", + DOWN: "下架", +}; + +export function procurementStatusText(status) { + return PROCUREMENT_STATUS[status] || status || "-"; +} + +export function procurementStatusTag(status) { + return PROCUREMENT_STATUS_TAG[status] || "info"; +} + +export function damageStatusText(status) { + return DAMAGE_STATUS[status] || status || "-"; +} + +export function damageStatusTag(status) { + return DAMAGE_STATUS_TAG[status] || "info"; +} + +export function formatMoney(val) { + if (val === null || val === undefined || val === "") return "0.00"; + return Number(val).toFixed(2); +} + +export function exportCsv(filename, headers, rows) { + const escape = (v) => { + const s = v == null ? "" : String(v); + if (s.includes(",") || s.includes('"') || s.includes("\n")) { + return `"${s.replace(/"/g, '""')}"`; + } + return s; + }; + const lines = [headers.map(escape).join(",")]; + rows.forEach((row) => lines.push(row.map(escape).join(","))); + const blob = new Blob(["\uFEFF" + lines.join("\n")], { type: "text/csv;charset=utf-8;" }); + const link = document.createElement("a"); + link.href = URL.createObjectURL(blob); + link.download = filename; + link.click(); + URL.revokeObjectURL(link.href); +} diff --git a/seller/src/views/procurement/damage-report/list.vue b/seller/src/views/procurement/damage-report/list.vue new file mode 100644 index 00000000..3ac4434b --- /dev/null +++ b/seller/src/views/procurement/damage-report/list.vue @@ -0,0 +1,303 @@ + + + + + diff --git a/seller/src/views/procurement/damage-report/operation.vue b/seller/src/views/procurement/damage-report/operation.vue new file mode 100644 index 00000000..01a31462 --- /dev/null +++ b/seller/src/views/procurement/damage-report/operation.vue @@ -0,0 +1,378 @@ + + + + + diff --git a/seller/src/views/procurement/inbound/list.vue b/seller/src/views/procurement/inbound/list.vue new file mode 100644 index 00000000..da49f5f9 --- /dev/null +++ b/seller/src/views/procurement/inbound/list.vue @@ -0,0 +1,109 @@ + + + diff --git a/seller/src/views/procurement/inbound/operation.vue b/seller/src/views/procurement/inbound/operation.vue new file mode 100644 index 00000000..bb3987d4 --- /dev/null +++ b/seller/src/views/procurement/inbound/operation.vue @@ -0,0 +1,294 @@ + + + + + diff --git a/seller/src/views/procurement/inventory-count/detail.vue b/seller/src/views/procurement/inventory-count/detail.vue new file mode 100644 index 00000000..ce52c3a2 --- /dev/null +++ b/seller/src/views/procurement/inventory-count/detail.vue @@ -0,0 +1,180 @@ + + + + + diff --git a/seller/src/views/procurement/inventory-count/list.vue b/seller/src/views/procurement/inventory-count/list.vue new file mode 100644 index 00000000..5166bcaf --- /dev/null +++ b/seller/src/views/procurement/inventory-count/list.vue @@ -0,0 +1,105 @@ + + + + + diff --git a/seller/src/views/procurement/purchase-order/list.vue b/seller/src/views/procurement/purchase-order/list.vue new file mode 100644 index 00000000..562cd377 --- /dev/null +++ b/seller/src/views/procurement/purchase-order/list.vue @@ -0,0 +1,297 @@ + + + + + diff --git a/seller/src/views/procurement/purchase-order/operation.vue b/seller/src/views/procurement/purchase-order/operation.vue new file mode 100644 index 00000000..a578e243 --- /dev/null +++ b/seller/src/views/procurement/purchase-order/operation.vue @@ -0,0 +1,350 @@ + + + + +