【修改】修改权限申请流程
This commit is contained in:
@@ -0,0 +1,233 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-drawer
|
||||
title="编辑"
|
||||
:visible.sync="isShow"
|
||||
size="35%"
|
||||
class="drawerLog"
|
||||
:wrapperClosable="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="applicationFormRef" :model="applicationForm" label-width="150px"
|
||||
class="label-input-form" size="medium" :rules="applicationFormRule"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="22">
|
||||
<el-form-item label="报告名称:" prop="name">
|
||||
<el-input disabled v-model="applicationForm.name"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="22">
|
||||
<el-form-item label="报告涉密等级:" prop="confidentialLevel">
|
||||
<el-input disabled v-model="applicationForm.confidentialLevel"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="22">
|
||||
<el-form-item label="报告隐私等级:" prop="privacyLevel">
|
||||
<el-input disabled v-model="applicationForm.privacyLevel"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="22">
|
||||
<el-form-item label="审批人:" prop="oneApprove">
|
||||
<el-input readonly :disabled="formControl" v-model="applicationForm.oneApproveName"
|
||||
@click.native="handleCheck('spr1')"
|
||||
placeholder="请选择审批人"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="22">
|
||||
<el-form-item label="二级审批人:" prop="twoApprove">
|
||||
<el-input readonly :disabled="formControl" v-model="applicationForm.twoApproveName"
|
||||
@click.native="handleCheck('spr2')"
|
||||
placeholder="请选择二级审批人"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="22">
|
||||
<el-form-item label="选择申请权限:" prop="power">
|
||||
<el-select :disabled="formControl" v-model="applicationForm.power" placeholder="请选择申请权限"
|
||||
@change="changeType">
|
||||
<el-option
|
||||
v-for="item in PERMISSION"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="22">
|
||||
<el-form-item label="申请原因:" prop="applyReason">
|
||||
<el-input :disabled="formControl" type="textarea" v-model="applicationForm.applyReason"
|
||||
placeholder="请输入申请原因"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="done">
|
||||
<el-button type="primary" size="medium" @click.native="savaCheck">确定</el-button>
|
||||
<el-button type="default" size="medium" @click.native="handleClose">取消</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
<orgTable :visible.sync="visibleOrgTable" title="人员列表" dialog-model :config="{
|
||||
value: orgTableVal,
|
||||
valueName: orgTableValName
|
||||
}" :workNumFlag="true" :maxSelected="1" @confirm="isTreeOk"></orgTable>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {PERMISSION} from '@/utils/Enum/enum'
|
||||
|
||||
export default {
|
||||
name: "reportDrawer",
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
visibleOrgTable: false,
|
||||
treeType: '',
|
||||
orgTableVal: '',
|
||||
orgTableValName: '',
|
||||
formControl: false,
|
||||
PERMISSION,
|
||||
applicationForm: {},
|
||||
applicationFormRule: {
|
||||
applyReason: [{
|
||||
max: 500, message: '申请原因最多填写500字符'
|
||||
}],
|
||||
power: [{
|
||||
required: true,
|
||||
message: '请选择申请权限'
|
||||
}],
|
||||
oneApprove: [{
|
||||
required: true,
|
||||
message: '请选择审批人',
|
||||
trigger: 'change'
|
||||
}],
|
||||
twoApprove: [{
|
||||
required: true,
|
||||
message: '请选择二级审批人',
|
||||
trigger: 'change'
|
||||
}],
|
||||
},
|
||||
|
||||
}
|
||||
},
|
||||
props: {
|
||||
form: {
|
||||
type: Object,
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
changeType(i) {
|
||||
let newItem = this.PERMISSION.filter(item=>{
|
||||
if(i==item.value){
|
||||
return item
|
||||
}
|
||||
})
|
||||
this.form.powerName = newItem[0].label
|
||||
},
|
||||
handleClose() {
|
||||
this.isShow = false
|
||||
},
|
||||
open(form) {
|
||||
this.isShow = true
|
||||
if (!form.twoApprove) {
|
||||
form.oneApprove = ''
|
||||
form.oneApproveName = ''
|
||||
form.twoApprove = ''
|
||||
form.twoApproveName = ''
|
||||
form.power = ''
|
||||
form.applyReason = ''
|
||||
form.prcType = ''
|
||||
form.powerName=''
|
||||
}
|
||||
this.applicationForm = JSON.parse(JSON.stringify(form))
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs.applicationFormRef.clearValidate()
|
||||
|
||||
})
|
||||
},
|
||||
savaCheck() {
|
||||
this.$refs.applicationFormRef.validate(v => {
|
||||
if (v) {
|
||||
this.$emit('update', this.applicationForm)
|
||||
this.isShow = false
|
||||
} else {
|
||||
this.$message.warning("请检查表单")
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
handleCheck(name) {
|
||||
if (this.formControl) {
|
||||
return false
|
||||
}
|
||||
this.treeType = name
|
||||
this.orgTableVal = ''
|
||||
this.orgTableValName = ''
|
||||
if (name === 'spr1') {
|
||||
this.orgTableVal = this.applicationForm.oneApprove ? this.applicationForm.oneApprove : ''
|
||||
this.orgTableValName = this.applicationForm.oneApproveName ? this.applicationForm.oneApproveName : ''
|
||||
} else {
|
||||
this.orgTableVal = this.applicationForm.twoApprove ? this.applicationForm.twoApprove : ''
|
||||
this.orgTableValName = this.applicationForm.twoApproveName ? this.applicationForm.twoApproveName : ''
|
||||
}
|
||||
this.visibleOrgTable = true
|
||||
},
|
||||
// 树点击
|
||||
isTreeOk(checkedList) {
|
||||
// console.log(checkedList)
|
||||
const parts = []
|
||||
const partsName = []
|
||||
console.log(checkedList, '0009999')
|
||||
checkedList.map((item, index) => {
|
||||
parts.push(item.userId || item.USID)
|
||||
partsName.push(item.uname)
|
||||
})
|
||||
if (this.treeType === 'spr1') {
|
||||
this.applicationForm.oneApprove = parts.toString()
|
||||
this.applicationForm.oneApproveName = partsName.toString()
|
||||
} else if (this.treeType === 'spr2') {
|
||||
this.applicationForm.twoApprove = parts.toString()
|
||||
this.applicationForm.twoApproveName = partsName.toString()
|
||||
}
|
||||
// console.log(this.assignForm.name1Id, this.assignForm.name2Id)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.drawerLog {
|
||||
::v-deep .el-drawer__header {
|
||||
padding: 10px 15px;
|
||||
color: #555;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.done {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user