From 96c950084fe1453110d9437ffddbde896ff2142f Mon Sep 17 00:00:00 2001
From: yangmf_0726 <13243152557@163.com>
Date: Sun, 24 Aug 2025 17:52:49 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=95=86=E5=93=81?=
=?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=80=89=E6=8B=A9=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../product/summary/ProductTypeSelector.vue | 206 ++++++++++++++++++
src/views/mall/product/summary/index.vue | 46 +++-
2 files changed, 249 insertions(+), 3 deletions(-)
create mode 100644 src/views/mall/product/summary/ProductTypeSelector.vue
diff --git a/src/views/mall/product/summary/ProductTypeSelector.vue b/src/views/mall/product/summary/ProductTypeSelector.vue
new file mode 100644
index 00000000..6bc9158d
--- /dev/null
+++ b/src/views/mall/product/summary/ProductTypeSelector.vue
@@ -0,0 +1,206 @@
+
+
+
+
+
+
+
+
+
+
商城商品
+
适用于线上商城销售的商品
+
+
+
+
+
+
+
+
+
+
+
+
提货柜商品
+
适用于自助提货柜销售的商品
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/mall/product/summary/index.vue b/src/views/mall/product/summary/index.vue
index c346d55d..914a016e 100644
--- a/src/views/mall/product/summary/index.vue
+++ b/src/views/mall/product/summary/index.vue
@@ -146,7 +146,7 @@
新增
@@ -225,6 +225,13 @@
/> -->
+
+
+
@@ -234,19 +241,23 @@ import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { SummaryApi, SummaryVO } from '@/api/product/summary'
import SummaryForm from './SummaryForm.vue'
+import ProductTypeSelector from './ProductTypeSelector.vue'
/** 商品汇总 列表 */
defineOptions({ name: 'Summary' })
const message = useMessage() // 消息弹窗
const { t } = useI18n() // 国际化
+const { push } = useRouter() // 路由跳转
const loading = ref(true) // 列表的加载中
const list = ref([]) // 列表的数据
const total = ref(0) // 列表的总页数
+const showProductTypeDialog = ref(false) // 商品类型选择弹窗显示状态
+
const queryParams = reactive({
- pageNo:1,
- pageSize:10,
+ pageNo: 1,
+ pageSize: 10,
/*商品编号,自增 */
id: undefined,
@@ -328,6 +339,21 @@ const resetQuery = () => {
handleQuery()
}
+/** 处理商品类型确认选择 */
+const handleProductTypeConfirm = (type: 'mall' | 'pickup') => {
+ // 立即关闭弹窗
+ showProductTypeDialog.value = false
+
+ // 根据选择的类型跳转到对应的添加页面
+ if (type === 'mall') {
+ // 跳转到商城商品添加页面
+ push({ name: 'ProductSpuAdd' })
+ } else if (type === 'pickup') {
+ // 跳转到提货柜商品添加页面
+ push({ name: 'ProductPickupAdd' })
+ }
+}
+
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
@@ -362,6 +388,20 @@ const handleExport = async () => {
}
}
+const productTypeSelectorKey = ref(0) // 添加 key 控制组件重新渲染
+
+/** 页面激活时清除弹窗状态 */
+onActivated(() => {
+ // 确保从其他页面返回时弹窗是关闭的
+ showProductTypeDialog.value = false
+
+ // 强制重新渲染组件
+ productTypeSelectorKey.value++
+
+ // 重新获取数据
+ getList()
+})
+
/** 初始化 **/
onMounted(() => {
getList()