【修改】修改权限

This commit is contained in:
zhoulingpo
2023-05-11 11:05:17 +08:00
parent 358bc5e143
commit 2e9736d830
7 changed files with 156 additions and 58 deletions
+11
View File
@@ -98,6 +98,7 @@ export default {
data: data data: data
}) })
}, },
// 通用流程详细信息查询 // 通用流程详细信息查询
getProcessDetail( data ){ getProcessDetail( data ){
return request({ return request({
@@ -142,6 +143,16 @@ export default {
}) })
}, },
// quan保存到草稿
saveProcessALL(data) {
return request({
url: '/api/batchSaveTaskFirst',
method: 'post',
data: data
})
},
// 判断当前人是不是审批人 // 判断当前人是不是审批人
// /selectTask // /selectTask
jugeProcess(data) { jugeProcess(data) {
+10
View File
@@ -161,6 +161,16 @@
}) })
}) })
}, },
//保存到草稿
saveProcessALL(param){
return new Promise((resolve,reject)=> {
this.$api.process.saveProcessALL(param).then(res => {
resolve()
}).catch(()=>{
reject()
})
})
},
// 获取草稿详细信息 // 获取草稿详细信息
getDraftDetail(){ getDraftDetail(){
let dataId=this.$store.getters.handleProcess.dataId let dataId=this.$store.getters.handleProcess.dataId
+1 -1
View File
@@ -337,7 +337,7 @@ export default {
.preview-content { .preview-content {
//margin: 0 14px 0 13px; //margin: 0 14px 0 13px;
padding-bottom: 11px; padding-bottom: 11px;
overflow: auto;
img { img {
max-width: 100% !important; max-width: 100% !important;
} }
+4 -2
View File
@@ -304,12 +304,14 @@ export default {
} }
// 有预览权限的时候是否还让继续申请 // 有预览权限的时候是否还让继续申请
let temp=this.checkList.filter(item =>{ let temp=this.checkList.filter(item =>{
if(+item.power == 1 || +item.power == 2){ if( +item.power == 2){
return item.name return item.name
} }
}) })
console.log(temp)
if(temp.length>0) { if(temp.length>0) {
this.$message.warning("当前选择的"+temp.toString()+"已经有权限,无须申请!") let name=temp.map(item=>item.name)
this.$message.warning("当前选择的"+name.join(',')+"已经有权限,无须申请!")
return return
} }
+41 -52
View File
@@ -44,7 +44,7 @@ import reportTable from './components/reportTable'
import processMixin from "../../components/ProcessMixin"; import processMixin from "../../components/ProcessMixin";
import { PERMISSION } from '@/utils/Enum/enum'
export default { export default {
name: 'launch', name: 'launch',
components: { components: {
@@ -56,6 +56,7 @@ export default {
mixins: [processMixin], mixins: [processMixin],
data() { data() {
return { return {
PERMISSION,
delData:[], delData:[],
showTableD: false, showTableD: false,
initShow: false, // 控制审批历史是否显示 只有在不是第一次的时候才是true initShow: false, // 控制审批历史是否显示 只有在不是第一次的时候才是true
@@ -127,8 +128,20 @@ export default {
this.prcNum = this.$store.getters.handleProcess?.prcNum this.prcNum = this.$store.getters.handleProcess?.prcNum
this.prcId = this.$store.getters.handleProcess?.prcId this.prcId = this.$store.getters.handleProcess?.prcId
this.prcName = this.$store.getters.handleProcess?.prcName this.prcName = this.$store.getters.handleProcess?.prcName
this.getDraftDetail().then(res => { this.dataId= this.$store.getters.handleProcess?.dataId
this.getProcessDetail().then(res => {
let powerName=''
let dataJson=JSON.parse(this.processOld.dataJson)
if(dataJson.power){
this.PERMISSION.forEach(item=>{
if(item.value == dataJson.power){
powerName=item.label
}
})
}
let submitJson = JSON.parse(this.processOld.submitJson)
// this.applicationForm.applyReason = applyReason.applyReason
this.tableData.push({...dataJson,...submitJson,powerName:powerName})
}) })
@@ -141,11 +154,16 @@ export default {
this.prcName = JSON.stringify(this.prcName) this.prcName = JSON.stringify(this.prcName)
this.initShow = true this.initShow = true
this.formControlname = true this.formControlname = true
this.$set(this.processForm,'prcName',this.$route.query.prcName)
await this.getProcessDetail() await this.getProcessDetail()
let powerName=''
this.PERMISSION.forEach(item=>{
if(item.value == JSON.parse(this.processOld.dataJson).power ){
powerName=item.label
}
})
let submitJson = JSON.parse(this.processOld.submitJson) let submitJson = JSON.parse(this.processOld.submitJson)
// this.applicationForm.applyReason = applyReason.applyReason // this.applicationForm.applyReason = applyReason.applyReason
this.tableData = JSON.parse(this.processOld.dataJson) this.tableData.push({...JSON.parse(this.processOld.dataJson),...JSON.parse(this.processOld.submitJson),powerName:powerName})
} }
if (this.$route.query.type == 'yiban') { if (this.$route.query.type == 'yiban') {
@@ -156,16 +174,17 @@ export default {
this.formControl = true this.formControl = true
this.initShow = true this.initShow = true
this.showTableD = true this.showTableD = true
this.$set(this.processForm,'prcName', this.prcName) await this.getProcessDetail()
this.getProcessDetail().then((res) => { let powerName=''
let dataJson = JSON.parse(this.processOld.dataJson) this.PERMISSION.forEach(item=>{
let submitJson = JSON.parse(this.processOld.submitJson) if(item.value == JSON.parse(this.processOld.dataJson).power ){
powerName=item.label
this.tableData[0]=dataJson }
this.tableData[0].oneApproveName=submitJson.oneApproveName
this.tableData[0].twoApproveName=submitJson.twoApproveName
this.$set(this,'tableData',this.tableData)
}) })
let submitJson = JSON.parse(this.processOld.submitJson)
// this.applicationForm.applyReason = applyReason.applyReason
this.tableData.push({...JSON.parse(this.processOld.dataJson),...submitJson,powerName:powerName})
} }
}, },
methods: { methods: {
@@ -185,18 +204,6 @@ export default {
// this.tableData=newValue; // this.tableData=newValue;
// this.delData=jiaVlue // this.delData=jiaVlue
}, },
// 真删除接口
delDatas(){
return new Promise((resolve,reject)=>{
this.$api.permissionProcess.deletReport({powerApplyList:this.delData}).then(()=>{
resolve()
})
})
},
// 获取表格列表 吧查询到的值传给子组件 // 获取表格列表 吧查询到的值传给子组件
reportList(ids) { reportList(ids) {
this.$api.report.reportList({ this.$api.report.reportList({
@@ -262,30 +269,20 @@ export default {
obj.dataJson=JSON.stringify({...dataJson, createUser:this.userId, createUserName:this.userName}) obj.dataJson=JSON.stringify({...dataJson, createUser:this.userId, createUserName:this.userName})
return obj return obj
}) })
if (this.initShow){
debugger
newParams[0].taskId=this.taskId
}
this.params=newParams this.params=newParams
}, },
// 保存 // 保存
handleSave(){ handleSave(){
this.saveLoading = true this.saveLoading = true
if(this.tableData.length > 0){
// 处理表格数据 // 处理表格数据
this.organizeData() this.organizeData()
}else{
this.tableData=[{...this.applicationForm}] this.saveProcessALL(this.params).then(
}
let submitJson = JSON.stringify({...this.assignForm, userId: this.$store.getters.userInfo.usid,approvalOpinion:this.assignForm.remark})
let dataJson = JSON.stringify(this.tableData)
let params = {
prcName: this.processForm.prcName,
userId: this.$store.getters.userInfo.usid,
prcType: this.prcType,
createUserName: this.$store.getters.userInfo.usname,
createUser: this.$store.getters.userInfo.usid,
submitJson,
dataJson,
id: this.$store.getters.handleProcess?.id
}
this.saveProcess(params).then(
()=>{ ()=>{
this.saveLoading = false this.saveLoading = false
this.$message['success']('保存成功') this.$message['success']('保存成功')
@@ -316,15 +313,7 @@ export default {
let flag= this.JuggleSub(this.taskId) let flag= this.JuggleSub(this.taskId)
if(flag){ if(flag){
this.organizeData() this.organizeData()
let dataJson = JSON.stringify(this.tableData) this.completeProcess(this.params[0])
let submitJson = JSON.stringify({...this.assignForm, userId: this.$store.getters.userInfo.usid,approvalOpinion:this.assignForm.remark})
this.completeProcess({
dataJson,
submitJson,
taskId: this.taskId,
userId: this.$store.getters.userInfo.usid,
prcType: this.prcType
})
} }
} else { } else {
if(this.JuggleTableAll()){ if(this.JuggleTableAll()){
+71 -2
View File
@@ -40,6 +40,28 @@
<div class="tabs"> <div class="tabs">
<tabs @clearForm="reset"/> <tabs @clearForm="reset"/>
</div> </div>
<el-dialog title="审批意见" width="20%" :visible.sync="dialogVisible" >
<el-form ref="examineForm"
:model="approveForm"
:rules="approveFormRules"
size="medium"
class="label-input-form prc-content-border approveForm">
<el-form-item label-width="132px" class="add-form-item" prop="approvalOpinion">
<template slot="label">审批意见:</template>
<el-input :maxlength='1000'
v-model="approveForm.approvalOpinion"
placeholder="请输入审批意见"
:autosize="{ minRows: 2, maxRows: 4}"
type="textarea"
/>
</el-form-item>
</el-form>
<div class="done">
<el-button size="medium" @click="cancel" class="btn">取消</el-button>
<el-button size="medium" type="primary" @click="submitForm" class="btn">确定</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@@ -54,26 +76,63 @@ import tabs from '../userCenter/processCenter/tabs.vue'
}, },
data() { data() {
return { return {
approveForm:{},
approveFormRules:{
approvalOpinion:[{
required:true,
message:'请填写审批意见'
}]
},
dialogVisible:false,
form: { form: {
prcNum:'', prcNum:'',
prcName:'' prcName:''
}, },
checkList:[],
isShowbtn:this.$store.getters.activeTab =='' || this.$store.getters.activeTab =='first' isShowbtn:this.$store.getters.activeTab =='' || this.$store.getters.activeTab =='first'
} }
}, },
created () { created () {
}, },
mounted () { mounted () {
this.$bus.$on('clearForm',()=>{ this.$bus.$on('clearForm',()=>{
this.form={} this.form={}
}); });
this.$bus.$on('handleClick',(data)=>{ this.$bus.$on('handleClick',(data)=>{
console.log(data) console.log(data)
console.log("jjjjdata") this.checkList=data
}); });
}, },
methods: { methods: {
cancel(){
this.dialogVisible=false
},
submitForm(){
this.$refs.examineForm.validate(v=>{
if(v){
this.checkList= this.checkList.map(item=>{
item.flag=2
item.approvalOpinion = this.approveForm.approvalOpinion
return item
})
this.completeProcessALL(this.checkList).then(res=>{
})
}
})
},
allAgree(type){
if(this.checkList.length>0){
if(type=='no'){
this.dialogVisible=true
}else{
}
}else{
this.$message.warning("请至少选择一条数据")
}
},
//查询 //查询
search() { search() {
console.log(this.form) console.log(this.form)
@@ -171,5 +230,15 @@ import tabs from '../userCenter/processCenter/tabs.vue'
} }
} }
.add-form-item{
margin-top: 20px;
}
.approveForm{
position: relative;
}
.done{
margin: 10px;
text-align: right;
}
</style> </style>
@@ -125,6 +125,22 @@ export default {
isDraft: 1, isDraft: 1,
} }
});break; });break;
case '2' :
this.$router.push({
path: '/permission/launch',
query: {
id: this.$route.query.id,
isDraft: 1,
}
});break;
case '3' :
this.$router.push({
path: '/permission/launch',
query: {
id: this.$route.query.id,
isDraft: 1,
}
});break;
case '4' : case '4' :
this.$router.push({ this.$router.push({
path: '/reportprocess/launch', path: '/reportprocess/launch',
@@ -132,7 +148,8 @@ export default {
id: this.$route.query.id, id: this.$route.query.id,
isDraft: 1 isDraft: 1
} }
}) });break;
} }
}, },
}, },