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()