Merge remote-tracking branch 'refs/remotes/yudao/dev' into dev-crm

This commit is contained in:
puhui999
2024-08-19 09:59:32 +08:00
53 changed files with 8031 additions and 5490 deletions

View File

@@ -56,7 +56,7 @@
width="180"
:formatter="dateFormatter"
/>
<el-table-column label="操作" align="center">
<el-table-column label="操作" align="center" min-width="180">
<template #default="scope">
<el-button
link
@@ -66,6 +66,15 @@
>
编辑
</el-button>
<el-button
link
type="primary"
v-if="scope.row.parentId > 0"
@click="handleViewSpu(scope.row.id)"
v-hasPermi="['product:spu:query']"
>
查看商品
</el-button>
<el-button
link
type="danger"
@@ -142,6 +151,15 @@ const handleDelete = async (id: number) => {
} catch {}
}
/** 查看商品操作 */
const router = useRouter() // 路由
const handleViewSpu = (id: number) => {
router.push({
name: 'ProductSpu',
query: { categoryId: id }
})
}
/** 初始化 **/
onMounted(() => {
getList()

View File

@@ -63,7 +63,7 @@ import SkuForm from './SkuForm.vue'
import DeliveryForm from './DeliveryForm.vue'
import { convertToInteger, floatToFixed2, formatToFraction } from '@/utils'
defineOptions({ name: 'ProductSpuForm' })
defineOptions({ name: 'ProductSpuAdd' })
const { t } = useI18n() // 国际化
const message = useMessage() // 消息弹窗

View File

@@ -244,6 +244,7 @@ import * as ProductCategoryApi from '@/api/mall/product/category'
defineOptions({ name: 'ProductSpu' })
const message = useMessage() // 消息弹窗
const route = useRoute() // 路由
const { t } = useI18n() // 国际化
const { push } = useRouter() // 路由跳转
@@ -431,6 +432,11 @@ onActivated(() => {
/** 初始化 **/
onMounted(async () => {
// 解析路由的 categoryId
if (route.query.categoryId) {
queryParams.value.categoryId = Number(route.query.categoryId)
}
// 获得商品信息
await getTabsCount()
await getList()
// 获得分类树