add:按钮权限、6.007库存同步中鼎
This commit is contained in:
16
nladmin-ui/src/components/Permission/hasUser.js
Normal file
16
nladmin-ui/src/components/Permission/hasUser.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import store from '@/store'
|
||||
|
||||
export default {
|
||||
inserted(el, binding) {
|
||||
const { value } = binding
|
||||
const username = store.getters.user && store.getters.user.username
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const hasPermission = value.includes(username)
|
||||
if (!hasPermission) {
|
||||
el.parentNode && el.parentNode.removeChild(el)
|
||||
}
|
||||
} else {
|
||||
throw new Error(`使用方式: v-has-user="['admin','zhangsan']"`)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
import permission from './permission'
|
||||
import hasUser from './hasUser'
|
||||
|
||||
const install = function(Vue) {
|
||||
Vue.directive('permission', permission)
|
||||
Vue.directive('hasUser', hasUser)
|
||||
}
|
||||
|
||||
if (window.Vue) {
|
||||
|
||||
@@ -74,8 +74,8 @@ export default {
|
||||
codeUrl: '',
|
||||
cookiePass: '',
|
||||
loginForm: {
|
||||
username: 'admin',
|
||||
password: '123456',
|
||||
username: '',
|
||||
password: '',
|
||||
rememberMe: false,
|
||||
code: '',
|
||||
uuid: ''
|
||||
|
||||
@@ -548,7 +548,7 @@ export default {
|
||||
deptTree() {
|
||||
setTimeout(() => {
|
||||
crudDept.getDeptTree().then(res => {
|
||||
this.deptDatas = res.data
|
||||
this.deptDatas = res.data.content
|
||||
})
|
||||
}, 100)
|
||||
},
|
||||
@@ -625,7 +625,7 @@ export default {
|
||||
// 获取弹窗内角色数据
|
||||
getRoles() {
|
||||
getAll().then(res => {
|
||||
this.roles = res
|
||||
this.roles = res.data
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
v-has-user="['admin']"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-refresh"
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
v-has-user="['admin']"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-s-promotion"
|
||||
@@ -202,9 +203,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['admin', 'purchasemst:add'],
|
||||
edit: ['admin', 'purchasemst:edit'],
|
||||
del: ['admin', 'purchasemst:del']
|
||||
add: ['purchasemst:add'],
|
||||
edit: ['purchasemst:edit'],
|
||||
del: ['purchasemst:del']
|
||||
},
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation>
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传EAS</el-button>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" v-has-user="['admin']" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传EAS</el-button>
|
||||
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :disabled="isPushDisabled()" @click="handleBatchPush">下推出库</el-button>
|
||||
</crudOperation>
|
||||
<el-table ref="table" v-loading="crud.loading" size="mini" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange" @select="handleSelectionChange">
|
||||
@@ -108,9 +108,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['admin', 'purchasemst:add'],
|
||||
edit: ['admin', 'purchasemst:edit'],
|
||||
del: ['admin', 'purchasemst:del']
|
||||
add: ['purchasemst:add'],
|
||||
edit: ['purchasemst:edit'],
|
||||
del: ['purchasemst:del']
|
||||
},
|
||||
multipleSelection: [],
|
||||
viewShow: false,
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">下发回传单</el-button>
|
||||
<el-button slot="right" v-has-user="['admin']" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">下发回传单</el-button>
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
@@ -126,9 +126,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['admin', 'purchasemst:add'],
|
||||
edit: ['admin', 'purchasemst:edit'],
|
||||
del: ['admin', 'purchasemst:del']
|
||||
add: ['purchasemst:add'],
|
||||
edit: ['purchasemst:edit'],
|
||||
del: ['purchasemst:del']
|
||||
},
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button slot="right" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传EAS</el-button>
|
||||
<el-button slot="right" v-has-user="['admin']" class="filter-item" type="warning" icon="el-icon-s-promotion" size="mini" :disabled="audit_flag" @click="issueReturnBill">强制回传EAS</el-button>
|
||||
<el-button slot="right" class="filter-item" type="success" icon="el-icon-s-promotion" size="mini" :disabled="isPushDisabled()" @click="handleBatchPush">下推出库</el-button>
|
||||
</crudOperation>
|
||||
<el-table ref="table" v-loading="crud.loading" size="mini" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange" @select="handleSelectionChange">
|
||||
@@ -107,9 +107,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['admin', 'purchasemst:add'],
|
||||
edit: ['admin', 'purchasemst:edit'],
|
||||
del: ['admin', 'purchasemst:del']
|
||||
add: ['purchasemst:add'],
|
||||
edit: ['purchasemst:edit'],
|
||||
del: ['purchasemst:del']
|
||||
},
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
v-has-user="['admin']"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-s-promotion"
|
||||
@@ -49,6 +50,7 @@
|
||||
</el-button>
|
||||
<el-switch
|
||||
slot="right"
|
||||
v-has-user="['admin']"
|
||||
v-model="forwardAllZD"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#dcdfe6"
|
||||
@@ -58,7 +60,7 @@
|
||||
</crudOperation>
|
||||
<el-table ref="table" v-loading="crud.loading" size="mini" :data="crud.data" highlight-current-row style="width: 100%;" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange" @select="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-permission="['admin','purchasemst:del','purchasemst:edit']" label="操作" width="115" align="center" fixed="right">
|
||||
<el-table-column v-permission="['purchasemst:edit']" label="操作" width="115" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation :data="scope.row" :permission="permission" :disabled-edit="canUd(scope.row)" :disabled-dle="canUd(scope.row)" />
|
||||
</template>
|
||||
@@ -167,9 +169,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['admin', 'purchasemst:add'],
|
||||
edit: ['admin', 'purchasemst:edit'],
|
||||
del: ['admin', 'purchasemst:del']
|
||||
add: ['purchasemst:add'],
|
||||
edit: ['purchasemst:edit'],
|
||||
del: ['purchasemst:del']
|
||||
},
|
||||
viewShow: false,
|
||||
mstrow: {},
|
||||
|
||||
@@ -199,9 +199,9 @@ export default {
|
||||
viewShow: false,
|
||||
currentRow: {},
|
||||
permission: {
|
||||
add: ['admin', 'receiveOutReturn:add'],
|
||||
edit: ['admin', 'receiveOutReturn:edit'],
|
||||
del: ['admin', 'receiveOutReturn:del']
|
||||
add: ['purchasemst:add'],
|
||||
edit: ['purchasemst:edit'],
|
||||
del: ['purchasemst:del']
|
||||
},
|
||||
statusOptions: [
|
||||
{ value: '0', label: '待回传' },
|
||||
|
||||
@@ -231,7 +231,11 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
permission: {
|
||||
add: ['purchasemst:add'],
|
||||
edit: ['purchasemst:edit'],
|
||||
del: ['purchasemst:del']
|
||||
},
|
||||
statusOptions: [
|
||||
{ value: 1, label: '待执行' },
|
||||
{ value: 2, label: '执行中' },
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
v-has-user="['admin']"
|
||||
type="warning"
|
||||
icon="el-icon-refresh"
|
||||
size="mini"
|
||||
|
||||
Reference in New Issue
Block a user