【修改】修改流程传参 修改名称样式
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<div class="process">
|
||||
<div class="process_box">
|
||||
<process-header :title="'发起流程'"></process-header>
|
||||
<process-header v-if="initShow" :title="'发起流程'"></process-header>
|
||||
<process-header v-else :title="'发起人修改'" :proceesNum="this.processOld.prcNum"></process-header>
|
||||
<div class="procedure">
|
||||
<div class="process_content">
|
||||
<span class="base_title">基础信息</span>
|
||||
@@ -10,7 +11,7 @@
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<el-form-item label="流程名称:" prop="prcName">
|
||||
<el-input readonly :disabled="formControl || formControlname" v-model="processForm.prcName" @click.native="handleCheck('spr1')"
|
||||
<el-input :disabled="formControl || formControlname" v-model="processForm.prcName"
|
||||
placeholder="请输入流程名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -25,13 +26,13 @@
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<el-form-item label="申请原因:" prop="name">
|
||||
<el-input :disabled="formControl" type="textarea" v-model="applicationForm.name" placeholder="请输入申请原因"></el-input>
|
||||
<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-col :span="9" :offset="6">
|
||||
<el-form-item label="选择申请权限:" prop="send">
|
||||
<el-select :disabled="formControl" v-model="applicationForm.send" placeholder="请选择申请权限">
|
||||
<el-form-item label="选择申请权限:" prop="power">
|
||||
<el-select :disabled="formControl" v-model="applicationForm.power" placeholder="请选择申请权限">
|
||||
<el-option
|
||||
v-for="item in PERMISSION"
|
||||
:key="item.value"
|
||||
@@ -102,10 +103,10 @@
|
||||
@reset="handleReset"
|
||||
@submit="handleSubmit"
|
||||
></process-footer>
|
||||
<orgTable :visible.sync="visibleOrgTable" title="人员列表" dialog-model :config="{
|
||||
<orgTable :visible.sync="visibleOrgTable" title="人员列表" dialog-model :config="{
|
||||
value: orgTableVal,
|
||||
valueName: orgTableValName
|
||||
}" :workNumFlag="true" :maxSelected="1" @confirm="isTreeOk"></orgTable>
|
||||
}" :workNumFlag="true" :maxSelected="1" @confirm="isTreeOk"></orgTable>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -143,12 +144,14 @@ export default {
|
||||
formControlname: false,
|
||||
assignForm: {
|
||||
oneApprove: '',
|
||||
twoApprove: ''
|
||||
twoApprove: '',
|
||||
twoApproveName:'',
|
||||
oneApproveName:''
|
||||
},
|
||||
tableData: [],
|
||||
applicationForm: {
|
||||
name:'',
|
||||
send:''
|
||||
applyReason:'',
|
||||
power:''
|
||||
},
|
||||
q: {
|
||||
pageSize: 10000,
|
||||
@@ -170,10 +173,10 @@ export default {
|
||||
}]
|
||||
},
|
||||
applicationFormRule: {
|
||||
name: [{
|
||||
applyReason: [{
|
||||
max: 1000, message: '申请原因最多填写1000字符'
|
||||
}],
|
||||
send: [{
|
||||
power: [{
|
||||
required: true,
|
||||
message: '请选择申请权限'
|
||||
}]
|
||||
@@ -192,45 +195,59 @@ export default {
|
||||
remark: [{
|
||||
max: 1000, message: '说明最多填写1000字符'
|
||||
}]
|
||||
}
|
||||
},
|
||||
taskIds:''
|
||||
}
|
||||
},
|
||||
created () {
|
||||
// 第一次进入此页面 需要清楚校验
|
||||
if (this.$route.query.ids) {
|
||||
this.reportList(this.$route.query.ids)
|
||||
if(this.$route.query.ids.split(',').length>0){
|
||||
this.reportList(this.$route.query.ids)
|
||||
}
|
||||
this.handleReset()
|
||||
}
|
||||
if(this.$route.query.taskDefinitionKey){
|
||||
if(this.$route.query.taskDefinitionKey == 'aid4'){
|
||||
this.taskIds=this.$route.query.taskIds
|
||||
this.initShow = true
|
||||
this.formControlname=true
|
||||
this.getProcessDetail().then(res =>{
|
||||
//指派信息
|
||||
this.applicationForm.name = JSON.parse(this.processOld.dataJson).name
|
||||
this.applicationForm.send = JSON.parse(this.processOld.dataJson).send
|
||||
this.tableData = JSON.parse(this.processOld.dataJson).tableData
|
||||
this.processForm.prcName = JSON.parse(this.processOld.dataJson).prcName
|
||||
//基础信息
|
||||
this.applicationForm.applyReason = JSON.parse(this.processOld.dataJson).applyReason
|
||||
this.applicationForm.power = JSON.parse(this.processOld.dataJson).power
|
||||
this.tableData = JSON.parse(this.processOld.dataJson).dataMsg
|
||||
this.processForm.prcName = JSON.parse(this.processOld.dataJson).prcName
|
||||
//指派信息
|
||||
this.assignForm=JSON.parse(this.processOld.submitJson)
|
||||
})
|
||||
}
|
||||
if(this.$route.query.yiban){
|
||||
|
||||
this.taskIds=this.$route.query.taskIds
|
||||
this.getProcessDetail().then(()=>{
|
||||
this.applicationForm.applyReason = JSON.parse(this.processOld.dataJson).applyReason
|
||||
this.applicationForm.power = JSON.parse(this.processOld.dataJson).power
|
||||
this.tableData = JSON.parse(this.processOld.dataJson).dataMsg
|
||||
this.processForm.prcName = JSON.parse(this.processOld.dataJson).prcName
|
||||
//指派信息
|
||||
this.assignForm=JSON.parse(this.processOld.submitJson)
|
||||
})
|
||||
}
|
||||
console.log(this.PERMISSION, 'ddd')
|
||||
},
|
||||
methods: {
|
||||
|
||||
handleCheck (name) {
|
||||
if(this.initShow){
|
||||
return false
|
||||
}
|
||||
this.treeType = name
|
||||
this.orgTableVal = ''
|
||||
this.orgTableValName = ''
|
||||
if (name === 'spr1') {
|
||||
this.orgTableVal = this.assignForm.Approve
|
||||
this.orgTableValName = this.assignForm.oneApproveName
|
||||
this.orgTableVal = this.assignForm.oneApprove ?this.assignForm.oneApprove:''
|
||||
this.orgTableValName = this.assignForm.oneApproveName ?this.assignForm.oneApproveName:''
|
||||
} else {
|
||||
this.orgTableVal = this.assignForm.twoApprove
|
||||
this.orgTableValName = this.assignForm.twoApproveName
|
||||
this.orgTableVal = this.assignForm.twoApprove?this.assignForm.twoApprove:''
|
||||
this.orgTableValName = this.assignForm.twoApproveName?this.assignForm.twoApproveName:''
|
||||
}
|
||||
this.visibleOrgTable = true
|
||||
},
|
||||
@@ -256,26 +273,33 @@ export default {
|
||||
},
|
||||
// 获取表格列表 吧查询到的值传给子组件
|
||||
reportList (ids) {
|
||||
this.$api.report.reportList({ id: ids }).then(({ data }) => {
|
||||
this.tableData = data.records
|
||||
this.$api.report.reportList({ ids: ids.split(',') }).then(({ data }) => {
|
||||
this.tableData = data.records.map(item=>{
|
||||
item.reportId=item['id']
|
||||
delete item['id']
|
||||
return item
|
||||
})
|
||||
})
|
||||
},
|
||||
handleReset () {
|
||||
this.applicationForm = {
|
||||
name:'',
|
||||
send:''
|
||||
applyReason:'',
|
||||
power:''
|
||||
}
|
||||
this.processForm.prcName=''
|
||||
this.assignForm = {
|
||||
oneApprove: '',
|
||||
twoApprove: ''
|
||||
}
|
||||
this.$refs.applicationFormRef.clearValidate()
|
||||
this.$refs.assignFormRef.clearValidate()
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.applicationFormRef.clearValidate()
|
||||
this.$refs.assignFormRef.clearValidate()
|
||||
})
|
||||
|
||||
},
|
||||
// 整理数据
|
||||
organizeData() {
|
||||
let userId = this.$store.getters.userInfo.USID
|
||||
let userId = this.$store.getters.userInfo.usid
|
||||
this.tableData=this.tableData.map(item=>{
|
||||
item = {...item, ... this.applicationForm,userId:userId}
|
||||
return item
|
||||
@@ -283,6 +307,7 @@ export default {
|
||||
},
|
||||
// 提交
|
||||
handleSubmit () {
|
||||
console.log( this.$store.getters.userInfo.usid," this.$store.getters.userInfo.USID")
|
||||
this.$refs.assignFormRef.validate(v => {
|
||||
this.$refs.applicationFormRef.validate(m => {
|
||||
this.$refs.processFormRef.validate(z =>{
|
||||
@@ -298,10 +323,11 @@ export default {
|
||||
this.organizeData()
|
||||
//如果不是第一次
|
||||
if(this.initShow){
|
||||
this.completeProcess()
|
||||
let dataJson=JSON.stringify({...this.applicationForm,...this.processForm,dataMsg:this.tableData})
|
||||
let submitJson=JSON.stringify(this.assignForm)
|
||||
this.completeProcess({dataJson,submitJson,taskId:this.taskIds,userId:form.userId})
|
||||
}else{
|
||||
this.startProcess()
|
||||
this.completeProcess()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -311,8 +337,21 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
startProcess() {
|
||||
//修改参数
|
||||
changeParam(){
|
||||
|
||||
},
|
||||
startProcess() {
|
||||
let form = {}
|
||||
form={...this.assignForm,approveData:{...this.applicationForm,...this.processForm},dataMsg:this.tableData}
|
||||
form.prcType= '1'
|
||||
form.prcName= this.processForm.prcName
|
||||
form.userId= this.$store.getters.userInfo.usid
|
||||
let dataJson=JSON.stringify({...this.applicationForm,...this.processForm,dataMsg:this.tableData})
|
||||
let submitJson=JSON.stringify(this.assignForm)
|
||||
this.$api.process.startProcess(form).then( ({data}) =>{
|
||||
this.completeProcess({dataJson,submitJson,taskId:data.result,userId:form.userId})
|
||||
})
|
||||
},
|
||||
//获取流程详细信息
|
||||
|
||||
|
||||
Reference in New Issue
Block a user