员工权限校验

This commit is contained in:
GaoHao
2024-10-17 11:35:03 +08:00
parent b2a3854f2b
commit c75ff0ee68
8 changed files with 206 additions and 10 deletions

View File

@@ -75,6 +75,7 @@
<script>
import { tbHandoverGet } from '@/api/homes/record.js'
import { hasPermission } from '@/utils/limits.js'
import XLSX from 'xlsx';
import dayjs from "dayjs";
export default {
@@ -147,6 +148,8 @@ export default {
this.getTableData();
},
async getTableData() {
let res = await hasPermission('允许查看所有交班记录');
if ( !res) { return; }
this.tableData.loading = true;
try {
let urlData = null

View File

@@ -37,6 +37,8 @@
<script>
import uploadImg from '@/components/uploadImg'
import { tbShopCategoryPost } from '@/api/shop'
import { hasPermission } from '@/utils/limits.js'
export default {
components: {
uploadImg
@@ -89,7 +91,9 @@ export default {
}
})
},
show(obj) {
async show(obj) {
let res = await hasPermission('允许修改分类');
if ( !res) { return; }
// console.log(obj)
this.dialogVisible = true
if (obj && obj.pid) {

View File

@@ -68,6 +68,8 @@
<script>
import { tbProductGroupPost, tbProductGroupPut, productListGet } from '@/api/shop'
import shopList from '@/components/shopList'
import { hasPermission } from '@/utils/limits.js'
export default {
components: {
shopList
@@ -178,7 +180,9 @@ export default {
console.log(error)
}
},
show(obj) {
async show(obj) {
let res = await hasPermission('允许修改分组');
if ( !res) { return; }
// if()
this.form.useTime = 0
if (obj && obj.id) {

View File

@@ -189,9 +189,7 @@
style="margin-left: 20px !important;">
<el-button type="text" icon="el-icon-edit">编辑</el-button>
</router-link> -->
<router-link :to="{ path: '/product/add_shop', query: { goods_id: scope.row.id } }">
<el-button type="text" icon="el-icon-edit">编辑</el-button>
</router-link>
<el-button type="text" icon="el-icon-edit" @click="toPath( '/product/add_shop' ,scope.row )">编辑</el-button>
<el-popconfirm title="确定删除吗?" @confirm="delTableHandle([scope.row.id])">
<el-button type="text" icon="el-icon-delete" style="margin-left: 20px !important;"
slot="reference">删除</el-button>
@@ -243,6 +241,8 @@ import settings from '@/settings'
import BindCons from './components/bindCons.vue'
import StockHistory from './components/stockHistory.vue'
import { tbProductListV2, tbShopCategoryGet, tbProductDelete, tbProductIsHot, upProSort, updateProductData, tbProductStockDetailStockCount, stockWarnLine } from '@/api/shop'
import { hasPermission } from '@/utils/limits.js'
export default {
components: {
BindCons,
@@ -314,6 +314,12 @@ export default {
this.tbProductStockDetailStockCount()
},
methods: {
// 是否允许修改商品
async toPath ( path , row) {
let res = await hasPermission('允许修改商品');
if ( !res) { return; }
this.$router.push({path: path, query: { goods_id: row.id }})
},
// 显示修改商品警告线
showStockWarningHandle() {
this.showStockWarning = true
@@ -371,7 +377,16 @@ export default {
this.getTableData()
},
changeGrounding(event, row, key) {
async changeGrounding(event, row, key) {
let text;
if (key == 'grounding') { text = "允许上下架商品"}
if (key == 'pauseSale') { text = "允许售罄商品"}
let res = await hasPermission(text);
if ( !res) {
if (key == 'grounding') { row.isGrounding = (event == 0 ? 1 : 0);}
if (key == 'pauseSale') { row.isPauseSale = (event == 0 ? 1 : 0);}
return;
}
this.editorForm.key = key
this.editorForm.id = row.id
this.editorForm.isSku = !row.typeEnum
@@ -393,8 +408,10 @@ export default {
this.editorFormLoading = false
}
},
// 修改售价
changePrice(type, row) {
// 修改库存
async changePrice(type, row) {
let res = await hasPermission('允许修改商品库存');
if ( !res) { return; }
this.editorVisable = true
this.editorForm.key = type
this.editorForm.id = row.id

View File

@@ -217,6 +217,8 @@
<script>
import { queryAllShopUser, queryAllShopInfo, midfiyAccount, tbShopUseredit, queryShopUserFlow } from "@/api/shop";
import dayjs from "dayjs";
import { hasPermission } from '@/utils/limits.js'
let cacheData = {};
export default {
data() {
@@ -321,14 +323,18 @@ export default {
this.$message.success('修改成功')
this.getTableData();
},
editPop(d) {
async editPop(d) {
let res = await hasPermission('允许修改会员余额');
if ( !res) { return; }
this.dialogVisible = true
this.userinfo.nickName = d.nickName
this.userinfo.amounts = d.amount
this.userinfo.id = d.id
this.userinfo.amount = ""
},
edituser(d) {
async edituser(d) {
let res = await hasPermission('允许管理会员信息');
if ( !res) { return; }
let obj = { ...d }
if (d.sex == '男') {
obj.sex = '1'