[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: { watch: {
paramsManifest(newVal, oldVal) { currentPersonRole: {
this.getData() handler: function(){
this.getLoginUserType() this.getTableList()
}, this.getData()
currentPersonRole(newVal,oldVal){ },
console.log(newVal,oldVal) immediate: true
} }
} }
} }
@@ -241,6 +241,20 @@
</a-row> </a-row>
</a-form-model> </a-form-model>
</a-modal> </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> </a-card>
</template> </template>
@@ -255,7 +269,6 @@ import AssignedBy from '@/components/AssignedBy/index'
import axios from 'axios' import axios from 'axios'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue' import Vue from 'vue'
import moment from 'moment'
export default { export default {
name: 'ParameterItemCollectionList', name: 'ParameterItemCollectionList',
components:{ components:{
@@ -330,9 +343,6 @@ export default {
getquerySdtList: 'params/collectManifest/querySdtList', // 获取工程接口人的列表 getquerySdtList: 'params/collectManifest/querySdtList', // 获取工程接口人的列表
updateSdt: 'params/collectManifest/updateSdt', // 提交工程接口人 updateSdt: 'params/collectManifest/updateSdt', // 提交工程接口人
deleteBatch: 'params/collectManifest/deleteBatch', deleteBatch: 'params/collectManifest/deleteBatch',
// deleteAll: 'params/manifest/deleteBatch',
// conAdd: 'params/config/addBatch',
// conList: 'params/config/list',
}, },
loading: false, loading: false,
dataSource: [], dataSource: [],
@@ -349,15 +359,13 @@ export default {
itemId: '', itemId: '',
selectedRowKeysValue: [], // table列表所选得数据 selectedRowKeysValue: [], // table列表所选得数据
token:Vue.ls.get(ACCESS_TOKEN), token:Vue.ls.get(ACCESS_TOKEN),
homo: 0, // 认证工程师
sdt: 0, // 工程接口人
dre: 0, // 填写人
Dateline: {}, Dateline: {},
areaVisibleFreeze: false, // 冻结配置 areaVisibleFreeze: false, // 冻结配置
areaVisibleAssignedby: false, // 分配填写人弹框 areaVisibleAssignedby: false, // 分配填写人弹框
areaVisibleTaskCutOffTime: false, // 截至时间弹框 areaVisibleTaskCutOffTime: false, // 截至时间弹框
areaVisiblereferenceparameter: false, // 引用参数弹框 areaVisiblereferenceparameter: false, // 引用参数弹框
areaVisibsynchronous: false, // 同步上报库弹框 areaVisibsynchronous: false, // 同步上报库弹框
visibleoperationFailed: false, // 数据失败的弹框
currentPersonRole: '', // 当前人角色 currentPersonRole: '', // 当前人角色
wrapperCol: { wrapperCol: {
xs: { span: 24 }, xs: { span: 24 },
@@ -381,8 +389,8 @@ export default {
} }
] ]
}, },
RoleType: [ // 控件类型 RoleType: [ ],// 控件类型
], NotSelectedRowKeysValue: [],
} }
}, },
props: { props: {
@@ -412,6 +420,31 @@ export default {
GetgetTableList() { GetgetTableList() {
this.$refs.CollectionTabel.getTableList() 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() { homoJurisdictionBatchdelete() {
// 定义开关 0为没有权限 1为有权限 // 定义开关 0为没有权限 1为有权限
let flag = 1 let flag = 1
if(this.homo) {
if(this.selectedRowKeysValue.length == 0) { if(this.selectedRowKeysValue.length == 0) {
flag = 0 flag = 0
this.$message.warning(this.$t('selectLeastOne')) 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')) 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 return flag
}, },
// 认证工程师 同步上报库 权限 // 认证工程师 同步上报库 权限
@@ -722,11 +746,12 @@ export default {
return flag return flag
}, },
LoginUserType(val) { LoginUserType(val) {
console.log(val)
this.RoleType = []
this.currentPersonRole = val.length > 1 ? val[0].value : '' this.currentPersonRole = val.length > 1 ? val[0].value : ''
this.RoleType = val this.RoleType = val
this.formInlineRoleSwitching.roleSwitchingCode = this.currentPersonRole this.formInlineRoleSwitching.roleSwitchingCode = this.currentPersonRole
this.formInlineRoleSwitching = {...this.formInlineRoleSwitching} this.formInlineRoleSwitching = {...this.formInlineRoleSwitching}
}, },
// 表格所选中得行内容 // 表格所选中得行内容
rowValue(val) { rowValue(val) {
@@ -821,12 +846,15 @@ export default {
}, },
// 下发收集的权限 // 下发收集的权限
distributionAndCollectionJurisdiction() { distributionAndCollectionJurisdiction() {
let homoJurisdictionBatchdelete = this.homoJurisdictionBatchdelete() let homodistributionAndCollection = this.homodistributionAndCollection()
if(homoJurisdictionBatchdelete) { if(homodistributionAndCollection == 1) {
this.distributionAndCollection() this.distributionAndCollection()
} else if(homodistributionAndCollection == 0){
this.visibleoperationFailed = true
console.log(this.NotSelectedRowKeysValue,'!===')
} }
}, },
// 下发收集 // 下发收集---请求接口
distributionAndCollection() { distributionAndCollection() {
let _array = [] let _array = []
this.selectedRowKeysValue.forEach((item, index) => { this.selectedRowKeysValue.forEach((item, index) => {
@@ -877,12 +905,8 @@ export default {
}, },
// 添加 // 添加
handleAdd() { handleAdd() {
if(this.homo) { // 认证工程师 任意状态 都有此权限
// 认证工程师 任意状态 都有此权限 this.areaVisible = true
this.areaVisible = true
} else {
this.$message.warning(this.$t('certifiedEngineer')+this.$t('toHavePermission'))
}
}, },
// 提交 // 提交
handleSubmit() { handleSubmit() {