[update] 按钮权限

This commit is contained in:
zhaomeijing
2022-06-14 18:22:10 +08:00
parent 5076085fc3
commit c86707bdeb
2 changed files with 59 additions and 35 deletions
@@ -481,12 +481,12 @@
}
},
watch: {
paramsManifest(newVal, oldVal) {
this.getData()
this.getLoginUserType()
},
currentPersonRole(newVal,oldVal){
console.log(newVal,oldVal)
currentPersonRole: {
handler: function(){
this.getTableList()
this.getData()
},
immediate: true
}
}
}
@@ -241,6 +241,20 @@
</a-row>
</a-form-model>
</a-modal>
<!-- 错误数据提示-->
<a-modal
:title="$t('operationFailed')"
:width="500"
:visible="visibleoperationFailed"
:maskClosable="false"
:footer="null"
>
<div class="imports-footer">
<div class="imports-footer-wrap">
<a-button class="imports-btn" type="primary" @click="cancleoperationFailed">{{$t('cancel')}}</a-button>
</div>
</div>
</a-modal>
</a-card>
</template>
@@ -255,7 +269,6 @@ import AssignedBy from '@/components/AssignedBy/index'
import axios from 'axios'
import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'
import moment from 'moment'
export default {
name: 'ParameterItemCollectionList',
components:{
@@ -330,9 +343,6 @@ export default {
getquerySdtList: 'params/collectManifest/querySdtList', // 获取工程接口人的列表
updateSdt: 'params/collectManifest/updateSdt', // 提交工程接口人
deleteBatch: 'params/collectManifest/deleteBatch',
// deleteAll: 'params/manifest/deleteBatch',
// conAdd: 'params/config/addBatch',
// conList: 'params/config/list',
},
loading: false,
dataSource: [],
@@ -349,15 +359,13 @@ export default {
itemId: '',
selectedRowKeysValue: [], // table列表所选得数据
token:Vue.ls.get(ACCESS_TOKEN),
homo: 0, // 认证工程师
sdt: 0, // 工程接口人
dre: 0, // 填写人
Dateline: {},
areaVisibleFreeze: false, // 冻结配置
areaVisibleAssignedby: false, // 分配填写人弹框
areaVisibleTaskCutOffTime: false, // 截至时间弹框
areaVisiblereferenceparameter: false, // 引用参数弹框
areaVisibsynchronous: false, // 同步上报库弹框
visibleoperationFailed: false, // 数据失败的弹框
currentPersonRole: '', // 当前人角色
wrapperCol: {
xs: { span: 24 },
@@ -381,8 +389,8 @@ export default {
}
]
},
RoleType: [ // 控件类型
],
RoleType: [ ],// 控件类型
NotSelectedRowKeysValue: [],
}
},
props: {
@@ -412,6 +420,31 @@ export default {
GetgetTableList() {
this.$refs.CollectionTabel.getTableList()
},
// 错误数据的弹框
cancleoperationFailed() {
this.visibleoperationFailed = false
this.GetgetTableList()
},
// 一下为认证工程师
// 认证工程师 下发收集 权限
// 仅仅状态为 待发起收集 工程接口人退回 变更 可以下发收集
homodistributionAndCollection() {
this.NotSelectedRowKeysValue = []
// 定义开关 0为没有权限 1为有权限
let flag = 1
if(this.selectedRowKeysValue.length == 0) {
flag = 2
this.$message.warning(this.$t('selectLeastOne'))
} else {
this.selectedRowKeysValue.forEach((item, index) => {
if(item.state !== '待发起收集' && item.state !== '工程接口人退回' && item.state !== '变更') {
this.NotSelectedRowKeysValue.push(item)
flag = 0
}
})
}
return flag
},
// 认证工程师的权限
// 认证工程师 退回 权限
// 仅仅状态为 已提交 可以退回
@@ -498,9 +531,9 @@ export default {
// 认证工程师 批量删除 权限
// 仅仅状态为 待发起收集 工程接口人退回 变更 可以批量删除
homoJurisdictionBatchdelete() {
// 定义开关 0为没有权限 1为有权限
let flag = 1
if(this.homo) {
if(this.selectedRowKeysValue.length == 0) {
flag = 0
this.$message.warning(this.$t('selectLeastOne'))
@@ -516,15 +549,6 @@ export default {
this.$message.warning(this.$t('Statusis')+this.$t('CollectionInitiated')+this.$t('ReturnedPerson')+this.$t('alteration')+this.$t('toHavePermission'))
}
}
// 工程接口人没有权限
}else if(this.sdt) {
flag = 0
this.$message.warning(this.$t('operatethisbutton'))
} else {
flag = 0
console.log('ppp')
this.$message.warning(this.$t('operatethisbutton'))
}
return flag
},
// 认证工程师 同步上报库 权限
@@ -722,11 +746,12 @@ export default {
return flag
},
LoginUserType(val) {
console.log(val)
this.RoleType = []
this.currentPersonRole = val.length > 1 ? val[0].value : ''
this.RoleType = val
this.formInlineRoleSwitching.roleSwitchingCode = this.currentPersonRole
this.formInlineRoleSwitching = {...this.formInlineRoleSwitching}
},
// 表格所选中得行内容
rowValue(val) {
@@ -821,12 +846,15 @@ export default {
},
// 下发收集的权限
distributionAndCollectionJurisdiction() {
let homoJurisdictionBatchdelete = this.homoJurisdictionBatchdelete()
if(homoJurisdictionBatchdelete) {
let homodistributionAndCollection = this.homodistributionAndCollection()
if(homodistributionAndCollection == 1) {
this.distributionAndCollection()
} else if(homodistributionAndCollection == 0){
this.visibleoperationFailed = true
console.log(this.NotSelectedRowKeysValue,'!===')
}
},
// 下发收集
// 下发收集---请求接口
distributionAndCollection() {
let _array = []
this.selectedRowKeysValue.forEach((item, index) => {
@@ -877,12 +905,8 @@ export default {
},
// 添加
handleAdd() {
if(this.homo) {
// 认证工程师 任意状态 都有此权限
this.areaVisible = true
} else {
this.$message.warning(this.$t('certifiedEngineer')+this.$t('toHavePermission'))
}
// 认证工程师 任意状态 都有此权限
this.areaVisible = true
},
// 提交
handleSubmit() {