员工权限校验

This commit is contained in:
GaoHao 2024-10-17 11:46:00 +08:00
parent 2c54a2a1d1
commit 489baa80d8
2 changed files with 16 additions and 3 deletions

View File

@ -68,6 +68,8 @@
<script>
import { formatDecimal } from '@/utils'
import { tbConCheck, tbConCheckGet } from '@/api/invoicing'
import { hasPermission } from '@/utils/limits.js'
export default {
data() {
return {
@ -149,7 +151,9 @@ export default {
}
})
},
show(obj) {
async show(obj) {
let res = await hasPermission('允许耗材盘点');
if ( !res) { return; }
this.form.remark = ''
this.form.stocktakinNum = 0
this.form.lpNum = 0

View File

@ -36,8 +36,8 @@
</div>
<div class="row">
<el-button type="primary" icon="el-icon-plus" @click="clickdialogframe('add')">添加</el-button>
<el-button @click="$router.push({ name: 'operation_in' })">入库</el-button>
<el-button @click="$router.push({ name: 'operation_out' })">出库</el-button>
<el-button @click="routerGo('operation_in')">入库</el-button>
<el-button @click="routerGo('operation_out')">出库</el-button>
<el-button @click="$router.push({ name: 'cons_record' })">耗材记录</el-button>
<el-button @click="$router.push({ name: 'type' })">分类管理</el-button>
<el-button @click="$router.push({ name: 'supplier_manage' })">供应商管理</el-button>
@ -592,6 +592,7 @@ import { tbConsInfodownload, tbConsInfoinputStock } from '@/api/invoicing'
import { downloadFile } from "@/utils";
import UploadExcel from '@/components/UploadExcel'
import consRecordDetail from "../components/cons_record_detail";
import { hasPermission } from '@/utils/limits.js'
export default {
components: { AddConsTakin, UploadExcel, consRecordDetail },
@ -723,6 +724,14 @@ export default {
this.getTableDatatype();
},
methods: {
async routerGo (name) {
let text;
if ( name == 'operation_in') { text = "允许耗材入库"}
if ( name == 'operation_out') { text = "允许耗材出库"}
let res = await hasPermission(text);
if ( !res) { return; }
this.$router.push({ name: name})
},
lookDetail(row) {
this.$refs.recodeDetail.open({
"consId": row.consId,