|
@@ -351,6 +351,8 @@ import {
|
|
|
doPay,
|
|
|
getMemberInfoById,
|
|
|
} from '@/api/cashier'
|
|
|
+import { Message } from 'element-ui'
|
|
|
+import { useUserStore } from '@/store/user'
|
|
|
import { getOrderInfo } from '@/api/order'
|
|
|
import { getUserId, setUserId, removeUserId } from '@/utils/auth'
|
|
|
import switchMemberDialog from './components/switchMemberDialog'
|
|
@@ -364,6 +366,8 @@ import memberList from './components/memberList'
|
|
|
import couponConfirm from './components/couponConfirm'
|
|
|
import noGoodsCashier from './components/noGoodsCashier'
|
|
|
import bindStaffDialog from './components/bindStaffDialog'
|
|
|
+
|
|
|
+const { logOut } = useUserStore()
|
|
|
export default {
|
|
|
name: 'Cashier',
|
|
|
components: {
|
|
@@ -545,8 +549,27 @@ export default {
|
|
|
},
|
|
|
// 菜单切换
|
|
|
switchMenu(menuKey) {
|
|
|
- this.activeMenu = menuKey
|
|
|
- return menuKey
|
|
|
+ if ((menuKey = 'exit')) {
|
|
|
+ this.$confirm('确定注销并退出系统吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ logOut().then(() => {
|
|
|
+ Message({
|
|
|
+ message: '退出成功',
|
|
|
+ type: 'success',
|
|
|
+ })
|
|
|
+ removeUserId()
|
|
|
+ this.$router.push('/login')
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ } else {
|
|
|
+ this.activeMenu = menuKey
|
|
|
+ return menuKey
|
|
|
+ }
|
|
|
},
|
|
|
// tab切换
|
|
|
switchTab(el) {
|