283 lines
8.1 KiB
Vue
283 lines
8.1 KiB
Vue
<template>
|
||
<div class="content-height content-center">
|
||
<div class="title">
|
||
<span>流程中心</span>
|
||
</div>
|
||
<div class="search">
|
||
<el-row>
|
||
<el-col :span="20">
|
||
<div class="search-box-left">
|
||
<label>流程编号:</label>
|
||
<el-input v-model="form.prcNum" placeholder="请输入流程编号"></el-input>
|
||
<label>发起人:</label>
|
||
<el-input v-model="form.creatUserName" placeholder="请输入发起人"></el-input>
|
||
<label>报告名称:</label>
|
||
<el-input v-model="form.prcName" placeholder="请输入报告名称"></el-input>
|
||
<label>流程类型:</label>
|
||
<el-select v-model="form.prcType" collapse-tags placeholder="请选择流程类型">
|
||
<template v-for="item in processTypeList">
|
||
<el-option :label="item.label" :value="item.value" :key="item.value"></el-option>
|
||
</template>
|
||
</el-select>
|
||
|
||
</div>
|
||
</el-col>
|
||
<el-col :span="4" align="right">
|
||
<div class="search-box-right">
|
||
<el-button type="primary" @click="search">查询</el-button>
|
||
<el-button type="" @click="reset">重置</el-button>
|
||
</div>
|
||
</el-col>
|
||
</el-row>
|
||
|
||
</div>
|
||
<el-row class="agreeBtn" v-if="isShowbtn">
|
||
<el-button size="small" type="primary" @click="allAgree('yes')">批量同意</el-button>
|
||
<el-button size="small" type="danger" @click="allAgree('no')">批量不同意</el-button>
|
||
|
||
</el-row>
|
||
<div class="tabs">
|
||
<tabs @clearForm="reset"/>
|
||
</div>
|
||
<el-dialog title="审核意见" width="20%" :visible.sync="dialogVisible"
|
||
@close="cancel">
|
||
<el-form ref="examineForm"
|
||
:model="approveForm"
|
||
size="medium"
|
||
class="label-input-form prc-content-border approveForm">
|
||
<el-form-item label-width="132px" class="add-form-item" prop="approvalOpinion"
|
||
:rules="[{required:flag==1?false:true,message:'请输入审核意见',trigger:'change'}]">
|
||
<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>
|
||
</template>
|
||
|
||
<script>
|
||
import ProcessMixin from "../../components/ProcessMixin";
|
||
import tabs from '../userCenter/processCenter/tabs.vue'
|
||
export default {
|
||
name:'processCenter',
|
||
mixins: [ProcessMixin],
|
||
components:{
|
||
tabs
|
||
},
|
||
data() {
|
||
return {
|
||
approveForm:{approvalOpinion:''},
|
||
approveFormRules:{
|
||
approvalOpinion:[{
|
||
required:true,
|
||
message:'请填写审核意见'
|
||
}]
|
||
},
|
||
dialogVisible:false,
|
||
form: {
|
||
prcNum:'',
|
||
prcName:''
|
||
},
|
||
checkList:[],
|
||
flag:'',//是不是同意
|
||
isShowbtn:this.$store.getters.activeTab =='' || this.$store.getters.activeTab =='first'
|
||
}
|
||
},
|
||
watch:{
|
||
// dialogVisible(value){
|
||
// if(!value && this.flag){
|
||
// this.reset()
|
||
// }
|
||
// }
|
||
},
|
||
created () {
|
||
},
|
||
mounted () {
|
||
this.$bus.$on('clearForm',()=>{
|
||
this.form={}
|
||
});
|
||
this.$bus.$on('handleClick',(data)=>{
|
||
console.log(data)
|
||
this.checkList=data
|
||
});
|
||
},
|
||
methods: {
|
||
cancel(){
|
||
this.flag = ''
|
||
this.dialogVisible=false
|
||
},
|
||
submitForm(){
|
||
this.$refs.examineForm.validate(v=>{
|
||
if(v){
|
||
this.arrangeData()
|
||
this.completeProcessALL(this.checkList)
|
||
this.dialogVisible=false
|
||
}
|
||
})
|
||
},
|
||
allAgree(type){
|
||
this.approveForm.approvalOpinion=''
|
||
if(this.checkList.length>0){
|
||
//判断选中的有没有重新发起的
|
||
let List=this.checkList.filter(item=>{
|
||
if(item.taskDefinitionKey == 'reEdit'){
|
||
return item
|
||
}
|
||
})
|
||
if(List.length>0){
|
||
this.$message("您当前选择的数据存在正处于重新发起节点的流程,请重新选择")
|
||
return
|
||
}
|
||
this.dialogVisible=true
|
||
if(type=='no'){
|
||
|
||
this.flag=2
|
||
}else{
|
||
this.flag=1
|
||
}
|
||
this.$nextTick(()=>{
|
||
this.$refs.examineForm.clearValidate()
|
||
})
|
||
|
||
}else{
|
||
this.$message.warning("请至少选择一条数据")
|
||
}
|
||
|
||
},
|
||
// 处理数据
|
||
arrangeData() {
|
||
this.checkList= this.checkList.map(item=>{
|
||
let obj={
|
||
prcType:item.prcType,
|
||
reportId:item.dataId,
|
||
taskId: item.taskId,
|
||
userId: this.userId,
|
||
submitJson:''
|
||
}
|
||
let temp=JSON.parse(item.submitJson)
|
||
temp.flag = this.flag
|
||
temp.approvalOpinion=this.approveForm.approvalOpinion
|
||
obj.submitJson =JSON.stringify(temp)
|
||
return obj
|
||
})
|
||
},
|
||
//查询
|
||
search() {
|
||
console.log(this.form)
|
||
this.$bus.$emit('getSearchItem',this.form)
|
||
// this.$api.processCenter.search({})
|
||
},
|
||
//重置
|
||
reset(name){
|
||
if(name=='first'){
|
||
this.isShowbtn=true
|
||
}else{
|
||
this.isShowbtn=false
|
||
}
|
||
this.form= {
|
||
prcNum:'',
|
||
prcName:''
|
||
}
|
||
this.$bus.$emit('getSearchItem',this.form)
|
||
}
|
||
},
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.content-center{
|
||
.title {
|
||
border-bottom: 1px solid #EBEEF5;
|
||
height: 42px;
|
||
line-height: 42px;
|
||
margin: 0 18px 0 22px;
|
||
|
||
span {
|
||
font-size: 16px;
|
||
font-weight: 600;
|
||
color: #262626;
|
||
}
|
||
}
|
||
.search {
|
||
.search-box-left {
|
||
padding-top: 20px;
|
||
display: flex;
|
||
justify-content: flex-start;
|
||
align-items: center;
|
||
|
||
label {
|
||
font-size: 14px;
|
||
font-weight: 400;
|
||
color: #595959;
|
||
margin-right: 5px;
|
||
padding-left: 22px;
|
||
}
|
||
|
||
.year {
|
||
::v-deep .el-input__inner {
|
||
padding: 0 15px !important;
|
||
}
|
||
}
|
||
|
||
::v-deep .el-input {
|
||
width: 167px;
|
||
margin-right: 5px;
|
||
}
|
||
|
||
@media screen and (max-width: 1366px) {
|
||
::v-deep .el-input {
|
||
width: 135px;
|
||
margin-right: 5px;
|
||
}
|
||
}
|
||
|
||
::v-deep .el-button {
|
||
float: right;
|
||
}
|
||
}
|
||
|
||
.search-box-right {
|
||
padding-top: 20px;
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
align-items: center;
|
||
padding-right: 14px;
|
||
}
|
||
|
||
.operate-box {
|
||
padding-left: 13px;
|
||
padding-bottom: 11px;
|
||
padding-top: 18px;
|
||
}
|
||
}
|
||
.tabs{
|
||
margin: 10px 0 0 13px;
|
||
}
|
||
.agreeBtn{
|
||
margin: 20px 20px 0;
|
||
}
|
||
|
||
}
|
||
.add-form-item{
|
||
margin-top: 20px;
|
||
}
|
||
.approveForm{
|
||
position: relative;
|
||
|
||
}
|
||
.done{
|
||
margin: 10px;
|
||
text-align: right;
|
||
}
|
||
</style>
|