提交 0d456e34 authored 作者: 王鹏飞's avatar 王鹏飞

chore: 新增demo; 显示面包屑导航;

上级 0c342f24
......@@ -29,8 +29,8 @@ export default {
path: '/finance',
icon: 'el-icon-money',
children: [
{ name: '支付管理', path: '/finance/pay' },
{ name: '发票管理', path: '/finance/invoice' }
{ name: '支付记录', path: '/finance/pay' },
{ name: '发票记录', path: '/finance/invoice' }
]
}
]
......
......@@ -20,7 +20,7 @@ export default {
</script>
<style lang="scss">
.app-breadcrumb {
padding: 40px 0 32px;
padding: 20px 0 32px;
.el-breadcrumb {
font-size: 24px;
......
const routes = [
{
path: 'finance/invoice',
component: () => import('./views/List.vue')
},
{
path: 'finance/invoice/:id',
component: () => import('./views/Detail.vue')
path: '/finance',
redirect: '/finance/pay',
component: () => import('@/components/layout/Index.vue'),
meta: { title: '财务管理' },
children: [
{
path: 'invoice',
component: () => import('./views/List.vue'),
meta: { title: '发票记录' }
},
{
name: 'invoiceView',
path: 'invoice/:id',
component: () => import('./views/Detail.vue'),
meta: { title: '发票详情' }
}
]
}
]
......
<template>
<div>12312</div>
</template>
<script>
export default {}
</script>
<style></style>
<template>
<app-card>
<app-list v-bind="tableOptions" ref="list" @selection-change="handleSelectionChange">
<template #header-aside>
<el-button type="primary">新增</el-button>
</template>
<template v-slot:table-x="{ row }">
<router-link :to="{ name: 'goodsEdit', params: { id: row.spu_id } }">
<el-button type="text">编辑</el-button>
<router-link :to="{ name: 'invoiceView', params: { id: row.id } }">
<el-button type="text">查看</el-button>
</router-link>
<el-button type="text" @click="onRemove(row)">删除</el-button>
</template>
</app-list>
</app-card>
......@@ -36,10 +32,23 @@ export default {
// beforeRequest: this.beforeRequest
// },
filters: [
{
type: 'select',
prop: 'group_id',
options: this.groupList,
labelKey: 'group_name',
valueKey: 'group_id',
placeholder: '项目'
},
{
type: 'input',
prop: 'spu_name',
placeholder: '商品名称'
placeholder: '客户姓名'
},
{
type: 'input',
prop: 'spu_name',
placeholder: '手机号码'
},
{
type: 'select',
......@@ -47,9 +56,16 @@ export default {
options: this.groupList,
labelKey: 'group_name',
valueKey: 'group_id',
placeholder: '商品分组'
placeholder: '发票状态'
},
{ prop: 'price_zone', slots: 'filter-price' }
{
type: 'select',
prop: 'group_id',
options: this.groupList,
labelKey: 'group_name',
valueKey: 'group_id',
placeholder: '发票类型'
}
],
columns: [
{ label: '发票代码', prop: 'date', minWidth: 140 },
......@@ -59,21 +75,25 @@ export default {
],
data: [
{
id: '1',
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
},
{
id: '2',
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄'
},
{
id: '3',
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
},
{
id: '4',
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄'
......@@ -93,56 +113,14 @@ export default {
params.price_zone = `${params.price_min || ''},${params.price_max || ''}`
return params
},
handleClick() {
this.$refs.list.refetch(true)
},
// 编辑
handleUpdate(row) {
this.$router.push({ name: 'goodsEdit', params: { id: row.spu_id } })
},
// 删除
onRemove() {
this.$confirm('商品删除请谨慎操作,确定删除?', '删除商品', {
confirmButtonText: '删除',
cancelButtonText: '取消',
type: 'warning'
}).then(this.handleRemove)
},
// 删除
handleRemove() {
// const data = this.multipleSelection.map(item => ({ spu_id: item.spu_id }))
// deleteGoods({ shop_id: this.shopId, data }).then(res => {
// this.$refs.list.refetch(true)
// })
},
// 推广
handlePromote(row) {
this.shareUrl = `${import.meta.env.VITE_H5_PREVIEW_URL}/buy?shop_id=${row.shop_id}&spu_id=${row.spu_id}`
this.shareDialogVisible = true
},
// 复制
handleCopy(row) {
this.$router.push({ name: 'goodsAdd', query: { id: row.spu_id } })
},
// 选择
handleSelectionChange(value) {
this.multipleSelection = value
},
// 上架
handleUpdateStatus(status) {
// const data = this.multipleSelection.map(item => ({ spu_id: item.spu_id, status }))
// updateGoodsStatus({ shop_id: this.shopId, data }).then(res => {
// this.$refs.list.refetch()
// })
}
}
}
</script>
<style lang="scss">
.filter-price {
.el-input {
width: 140px;
}
}
</style>
const routes = [
{
path: 'finance',
redirect: 'finance/pay'
},
{
path: 'finance/pay',
component: () => import('./views/List.vue')
},
{
path: 'finance/pay/:id',
component: () => import('./views/Detail.vue')
path: '/finance',
redirect: '/finance/pay',
component: () => import('@/components/layout/Index.vue'),
meta: { title: '财务管理' },
children: [
{
path: 'pay',
component: () => import('./views/List.vue'),
meta: { title: '支付记录' }
},
{
name: 'payView',
path: 'pay/:id',
component: () => import('./views/Detail.vue'),
meta: { title: '支付详情' }
}
]
}
]
......
<template>
<div>
<app-card title="订单信息"></app-card>
<app-card title="学员信息"></app-card>
<app-card title="发票信息"></app-card>
</div>
</template>
<script>
// 组件
import AppCard from '@/components/base/AppCard.vue'
export default {
components: { AppCard }
}
</script>
<style></style>
......@@ -2,10 +2,9 @@
<app-card>
<app-list v-bind="tableOptions" ref="list" @selection-change="handleSelectionChange">
<template v-slot:table-x="{ row }">
<router-link :to="{ name: 'goodsEdit', params: { id: row.spu_id } }">
<el-button type="text">编辑</el-button>
<router-link :to="{ name: 'payView', params: { id: row.id } }">
<el-button type="text">查看</el-button>
</router-link>
<el-button type="text" @click="onRemove(row)">删除</el-button>
</template>
</app-list>
</app-card>
......@@ -33,10 +32,26 @@ export default {
// beforeRequest: this.beforeRequest
// },
filters: [
{
type: 'select',
prop: 'group_id',
options: this.groupList,
labelKey: 'group_name',
valueKey: 'group_id',
placeholder: '项目'
},
{
type: 'input',
prop: 'spu_name',
placeholder: '商品名称'
placeholder: '客户姓名'
},
{
type: 'select',
prop: 'group_id',
options: this.groupList,
labelKey: 'group_name',
valueKey: 'group_id',
placeholder: '发票状态'
},
{
type: 'select',
......@@ -44,9 +59,18 @@ export default {
options: this.groupList,
labelKey: 'group_name',
valueKey: 'group_id',
placeholder: '商品分组'
placeholder: '发票类型'
},
{ prop: 'price_zone', slots: 'filter-price' }
{
type: 'select',
prop: 'spu_name',
placeholder: '允许开具发票',
options: [
{ label: '全部', value: '0' },
{ label: '开启', value: '1' },
{ label: '关闭', value: '2' }
]
}
],
columns: [
{ label: '客户名称', prop: 'date', minWidth: 140 },
......@@ -56,21 +80,25 @@ export default {
],
data: [
{
id: '1',
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
},
{
id: '2',
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄'
},
{
id: '3',
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
},
{
id: '4',
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄'
......@@ -90,56 +118,14 @@ export default {
params.price_zone = `${params.price_min || ''},${params.price_max || ''}`
return params
},
handleClick() {
this.$refs.list.refetch(true)
},
// 编辑
handleUpdate(row) {
this.$router.push({ name: 'goodsEdit', params: { id: row.spu_id } })
},
// 删除
onRemove() {
this.$confirm('商品删除请谨慎操作,确定删除?', '删除商品', {
confirmButtonText: '删除',
cancelButtonText: '取消',
type: 'warning'
}).then(this.handleRemove)
},
// 删除
handleRemove() {
// const data = this.multipleSelection.map(item => ({ spu_id: item.spu_id }))
// deleteGoods({ shop_id: this.shopId, data }).then(res => {
// this.$refs.list.refetch(true)
// })
},
// 推广
handlePromote(row) {
this.shareUrl = `${import.meta.env.VITE_H5_PREVIEW_URL}/buy?shop_id=${row.shop_id}&spu_id=${row.spu_id}`
this.shareDialogVisible = true
},
// 复制
handleCopy(row) {
this.$router.push({ name: 'goodsAdd', query: { id: row.spu_id } })
},
// 选择
handleSelectionChange(value) {
this.multipleSelection = value
},
// 上架
handleUpdateStatus(status) {
// const data = this.multipleSelection.map(item => ({ spu_id: item.spu_id, status }))
// updateGoodsStatus({ shop_id: this.shopId, data }).then(res => {
// this.$refs.list.refetch()
// })
}
}
}
</script>
<style lang="scss">
.filter-price {
.el-input {
width: 140px;
}
}
</style>
......@@ -2,8 +2,9 @@ const modules = Object.values(import.meta.globEager('./**/index.js'))
export default function ({ router }) {
modules.forEach(({ routes }) => {
// 注册路由
routes.forEach(route => {
;/^\//.test(route.path) ? router.addRoute(route) : router.addRoute('layout', route)
router.addRoute(route)
})
})
}
......@@ -3,15 +3,7 @@ import VueRouter from 'vue-router'
Vue.use(VueRouter)
const routes = [
{ path: '*', redirect: '/finance/pay' },
{
name: 'layout',
path: '/',
redirect: '/finance/pay',
component: () => import('@/components/layout/Index.vue')
}
]
const routes = [{ path: '*', redirect: '/finance/pay' }]
const router = new VueRouter({
mode: 'history',
......
......@@ -14,7 +14,7 @@ export default defineConfig({
cert: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.pem'))
},
proxy: {
'/api': 'https://shop-admin.ezijing.com'
'/api': 'https://project-api.ezijing.com'
}
},
resolve: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论