【修改】修改权限

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
+41 -52
View File
@@ -44,7 +44,7 @@ import reportTable from './components/reportTable'
import processMixin from "../../components/ProcessMixin";
import { PERMISSION } from '@/utils/Enum/enum'
export default {
name: 'launch',
components: {
@@ -56,6 +56,7 @@ export default {
mixins: [processMixin],
data() {
return {
PERMISSION,
delData:[],
showTableD: false,
initShow: false, // 控制审批历史是否显示 只有在不是第一次的时候才是true
@@ -127,8 +128,20 @@ export default {
this.prcNum = this.$store.getters.handleProcess?.prcNum
this.prcId = this.$store.getters.handleProcess?.prcId
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.initShow = true
this.formControlname = true
this.$set(this.processForm,'prcName',this.$route.query.prcName)
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)
// 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') {
@@ -156,16 +174,17 @@ export default {
this.formControl = true
this.initShow = true
this.showTableD = true
this.$set(this.processForm,'prcName', this.prcName)
this.getProcessDetail().then((res) => {
let dataJson = JSON.parse(this.processOld.dataJson)
let submitJson = JSON.parse(this.processOld.submitJson)
this.tableData[0]=dataJson
this.tableData[0].oneApproveName=submitJson.oneApproveName
this.tableData[0].twoApproveName=submitJson.twoApproveName
this.$set(this,'tableData',this.tableData)
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)
// this.applicationForm.applyReason = applyReason.applyReason
this.tableData.push({...JSON.parse(this.processOld.dataJson),...submitJson,powerName:powerName})
}
},
methods: {
@@ -185,18 +204,6 @@ export default {
// this.tableData=newValue;
// this.delData=jiaVlue
},
// 真删除接口
delDatas(){
return new Promise((resolve,reject)=>{
this.$api.permissionProcess.deletReport({powerApplyList:this.delData}).then(()=>{
resolve()
})
})
},
// 获取表格列表 吧查询到的值传给子组件
reportList(ids) {
this.$api.report.reportList({
@@ -262,30 +269,20 @@ export default {
obj.dataJson=JSON.stringify({...dataJson, createUser:this.userId, createUserName:this.userName})
return obj
})
if (this.initShow){
debugger
newParams[0].taskId=this.taskId
}
this.params=newParams
},
// 保存
handleSave(){
this.saveLoading = true
if(this.tableData.length > 0){
// 处理表格数据
this.organizeData()
}else{
this.tableData=[{...this.applicationForm}]
}
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.saveProcessALL(this.params).then(
()=>{
this.saveLoading = false
this.$message['success']('保存成功')
@@ -316,15 +313,7 @@ export default {
let flag= this.JuggleSub(this.taskId)
if(flag){
this.organizeData()
let dataJson = JSON.stringify(this.tableData)
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
})
this.completeProcess(this.params[0])
}
} else {
if(this.JuggleTableAll()){