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

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

上级 0c342f24
...@@ -29,8 +29,8 @@ export default { ...@@ -29,8 +29,8 @@ export default {
path: '/finance', path: '/finance',
icon: 'el-icon-money', icon: 'el-icon-money',
children: [ children: [
{ name: '支付管理', path: '/finance/pay' }, { name: '支付记录', path: '/finance/pay' },
{ name: '发票管理', path: '/finance/invoice' } { name: '发票记录', path: '/finance/invoice' }
] ]
} }
] ]
......
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.app-breadcrumb { .app-breadcrumb {
padding: 40px 0 32px; padding: 20px 0 32px;
.el-breadcrumb { .el-breadcrumb {
font-size: 24px; font-size: 24px;
......
const routes = [ const routes = [
{ {
path: 'finance/invoice', path: '/finance',
component: () => import('./views/List.vue') redirect: '/finance/pay',
}, component: () => import('@/components/layout/Index.vue'),
{ meta: { title: '财务管理' },
path: 'finance/invoice/:id', children: [
component: () => import('./views/Detail.vue') {
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> <template>
<app-card> <app-card>
<app-list v-bind="tableOptions" ref="list" @selection-change="handleSelectionChange"> <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 }"> <template v-slot:table-x="{ row }">
<router-link :to="{ name: 'goodsEdit', params: { id: row.spu_id } }"> <router-link :to="{ name: 'invoiceView', params: { id: row.id } }">
<el-button type="text">编辑</el-button> <el-button type="text">查看</el-button>
</router-link> </router-link>
<el-button type="text" @click="onRemove(row)">删除</el-button>
</template> </template>
</app-list> </app-list>
</app-card> </app-card>
...@@ -36,10 +32,23 @@ export default { ...@@ -36,10 +32,23 @@ export default {
// beforeRequest: this.beforeRequest // beforeRequest: this.beforeRequest
// }, // },
filters: [ filters: [
{
type: 'select',
prop: 'group_id',
options: this.groupList,
labelKey: 'group_name',
valueKey: 'group_id',
placeholder: '项目'
},
{ {
type: 'input', type: 'input',
prop: 'spu_name', prop: 'spu_name',
placeholder: '商品名称' placeholder: '客户姓名'
},
{
type: 'input',
prop: 'spu_name',
placeholder: '手机号码'
}, },
{ {
type: 'select', type: 'select',
...@@ -47,9 +56,16 @@ export default { ...@@ -47,9 +56,16 @@ export default {
options: this.groupList, options: this.groupList,
labelKey: 'group_name', labelKey: 'group_name',
valueKey: 'group_id', 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: [ columns: [
{ label: '发票代码', prop: 'date', minWidth: 140 }, { label: '发票代码', prop: 'date', minWidth: 140 },
...@@ -59,21 +75,25 @@ export default { ...@@ -59,21 +75,25 @@ export default {
], ],
data: [ data: [
{ {
id: '1',
date: '2016-05-02', date: '2016-05-02',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄' address: '上海市普陀区金沙江路 1518 弄'
}, },
{ {
id: '2',
date: '2016-05-04', date: '2016-05-04',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄' address: '上海市普陀区金沙江路 1517 弄'
}, },
{ {
id: '3',
date: '2016-05-01', date: '2016-05-01',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄' address: '上海市普陀区金沙江路 1519 弄'
}, },
{ {
id: '4',
date: '2016-05-03', date: '2016-05-03',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄' address: '上海市普陀区金沙江路 1516 弄'
...@@ -93,56 +113,14 @@ export default { ...@@ -93,56 +113,14 @@ export default {
params.price_zone = `${params.price_min || ''},${params.price_max || ''}` params.price_zone = `${params.price_min || ''},${params.price_max || ''}`
return params return params
}, },
handleClick() {
this.$refs.list.refetch(true)
},
// 编辑 // 编辑
handleUpdate(row) { handleUpdate(row) {
this.$router.push({ name: 'goodsEdit', params: { id: row.spu_id } }) 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) { handleSelectionChange(value) {
this.multipleSelection = 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> </script>
<style lang="scss">
.filter-price {
.el-input {
width: 140px;
}
}
</style>
const routes = [ const routes = [
{ {
path: 'finance', path: '/finance',
redirect: 'finance/pay' redirect: '/finance/pay',
}, component: () => import('@/components/layout/Index.vue'),
{ meta: { title: '财务管理' },
path: 'finance/pay', children: [
component: () => import('./views/List.vue') {
}, path: 'pay',
{ component: () => import('./views/List.vue'),
path: 'finance/pay/:id', meta: { title: '支付记录' }
component: () => import('./views/Detail.vue') },
{
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 @@ ...@@ -2,10 +2,9 @@
<app-card> <app-card>
<app-list v-bind="tableOptions" ref="list" @selection-change="handleSelectionChange"> <app-list v-bind="tableOptions" ref="list" @selection-change="handleSelectionChange">
<template v-slot:table-x="{ row }"> <template v-slot:table-x="{ row }">
<router-link :to="{ name: 'goodsEdit', params: { id: row.spu_id } }"> <router-link :to="{ name: 'payView', params: { id: row.id } }">
<el-button type="text">编辑</el-button> <el-button type="text">查看</el-button>
</router-link> </router-link>
<el-button type="text" @click="onRemove(row)">删除</el-button>
</template> </template>
</app-list> </app-list>
</app-card> </app-card>
...@@ -33,10 +32,26 @@ export default { ...@@ -33,10 +32,26 @@ export default {
// beforeRequest: this.beforeRequest // beforeRequest: this.beforeRequest
// }, // },
filters: [ filters: [
{
type: 'select',
prop: 'group_id',
options: this.groupList,
labelKey: 'group_name',
valueKey: 'group_id',
placeholder: '项目'
},
{ {
type: 'input', type: 'input',
prop: 'spu_name', prop: 'spu_name',
placeholder: '商品名称' placeholder: '客户姓名'
},
{
type: 'select',
prop: 'group_id',
options: this.groupList,
labelKey: 'group_name',
valueKey: 'group_id',
placeholder: '发票状态'
}, },
{ {
type: 'select', type: 'select',
...@@ -44,9 +59,18 @@ export default { ...@@ -44,9 +59,18 @@ export default {
options: this.groupList, options: this.groupList,
labelKey: 'group_name', labelKey: 'group_name',
valueKey: 'group_id', 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: [ columns: [
{ label: '客户名称', prop: 'date', minWidth: 140 }, { label: '客户名称', prop: 'date', minWidth: 140 },
...@@ -56,21 +80,25 @@ export default { ...@@ -56,21 +80,25 @@ export default {
], ],
data: [ data: [
{ {
id: '1',
date: '2016-05-02', date: '2016-05-02',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄' address: '上海市普陀区金沙江路 1518 弄'
}, },
{ {
id: '2',
date: '2016-05-04', date: '2016-05-04',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1517 弄' address: '上海市普陀区金沙江路 1517 弄'
}, },
{ {
id: '3',
date: '2016-05-01', date: '2016-05-01',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄' address: '上海市普陀区金沙江路 1519 弄'
}, },
{ {
id: '4',
date: '2016-05-03', date: '2016-05-03',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1516 弄' address: '上海市普陀区金沙江路 1516 弄'
...@@ -90,56 +118,14 @@ export default { ...@@ -90,56 +118,14 @@ export default {
params.price_zone = `${params.price_min || ''},${params.price_max || ''}` params.price_zone = `${params.price_min || ''},${params.price_max || ''}`
return params return params
}, },
handleClick() {
this.$refs.list.refetch(true)
},
// 编辑 // 编辑
handleUpdate(row) { handleUpdate(row) {
this.$router.push({ name: 'goodsEdit', params: { id: row.spu_id } }) 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) { handleSelectionChange(value) {
this.multipleSelection = 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> </script>
<style lang="scss">
.filter-price {
.el-input {
width: 140px;
}
}
</style>
...@@ -2,8 +2,9 @@ const modules = Object.values(import.meta.globEager('./**/index.js')) ...@@ -2,8 +2,9 @@ const modules = Object.values(import.meta.globEager('./**/index.js'))
export default function ({ router }) { export default function ({ router }) {
modules.forEach(({ routes }) => { modules.forEach(({ routes }) => {
// 注册路由
routes.forEach(route => { 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' ...@@ -3,15 +3,7 @@ import VueRouter from 'vue-router'
Vue.use(VueRouter) Vue.use(VueRouter)
const routes = [ const routes = [{ path: '*', redirect: '/finance/pay' }]
{ path: '*', redirect: '/finance/pay' },
{
name: 'layout',
path: '/',
redirect: '/finance/pay',
component: () => import('@/components/layout/Index.vue')
}
]
const router = new VueRouter({ const router = new VueRouter({
mode: 'history', mode: 'history',
......
...@@ -14,7 +14,7 @@ export default defineConfig({ ...@@ -14,7 +14,7 @@ export default defineConfig({
cert: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.pem')) cert: fs.readFileSync(path.join(__dirname, './https/dev.ezijing.com.pem'))
}, },
proxy: { proxy: {
'/api': 'https://shop-admin.ezijing.com' '/api': 'https://project-api.ezijing.com'
} }
}, },
resolve: { resolve: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论