修改发起流程

This commit is contained in:
zhoulingpo
2023-04-23 14:04:52 +08:00
parent 399ef76577
commit ee5a84368d
13 changed files with 228 additions and 62 deletions
+1
View File
@@ -46,6 +46,7 @@ import tabs from '../userCenter/processCenter/tabs.vue'
created () {
},
mounted () {
this.$bus.$on('clearForm',()=>{
this.form={}
});
@@ -75,8 +75,14 @@ export default {
this.q.current = val;
this.loadData();
},
handle() {
alert(111);
handle(type) {
switch (type) {
case '1' :
this.$router.push({
path:'',
query:''
})
}
},
},
beforeDestroy(){
@@ -78,11 +78,14 @@ export default {
this.q.current = val;
this.loadData();
},
view() {
view(row) {
this.$router.push({
path: 'monitorViews',
query:{
id: this.$route.query.id
id: this.$route.query.id,
prcNum: row.prcNum,
prcType: row.prcType,
tabsName: 'MonitorProcess'
}
})
}
@@ -14,9 +14,20 @@
</div>
<div class="action-bar">
<div class="btn">
<el-button type="primary" class="inner-btn" @click="showDialog">
<el-button type="primary" class="inner-btn" @click="showDialog"
v-if="tabsName !=='AlreadyProcess'">
调整处理人
</el-button>
<div v-if="tabsName=='AlreadyProcess'" class="alreadbtn">
<el-button
type="primary" class="inner-btn"
@click="urgeRow"
>催办</el-button>
<el-button
type="primary" class="inner-btn"
@click="exportStandard"
>导出</el-button>
</div>
</div>
<!-- <el-button-->
<!-- v-if="urgeRowFlag"-->
@@ -77,8 +88,8 @@ export default {
processStep: null,
// 当前节点
taskKey: 0,
// 当前流程类型(1待办/2已办)
processType: 1,
// 当前流程类型
prcType: '',
// 流程列表
detailData: [],
taskNames: '',
@@ -90,10 +101,93 @@ export default {
shunxu: '',
paixu: '',
checkIds: [],
checkList: []
checkList: [],
tabsName:'',
}
},
methods: {
exportStandard (){
let exportName=''
let pramas={prcNum: this.$route.query.prcNum,
sortWord: this.shunxu ? this.paixu : '',
shunxu: this.shunxu,
exportName: exportName}
this.processTypeList.some(item=>{
if(item.value == this.prcType){
exportName=item.label
}
})
this.$api.process.exportStandard(pramas,data=>{
const disposition = data.headers['content-disposition'];
let fileName = disposition.substring(disposition.indexOf('fileName=') + 9, disposition.length);
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
var isOpera = userAgent.indexOf("Opera") > -1;
//判断是否IE浏览器
if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
fileName = decodeUtf8(fileName)
} else {
// iso8859-1的字符转换成中文
fileName = decodeURI(escape(fileName));
// 去掉双引号
fileName = fileName.replace(/\"/g, "");
}
// console.log(fileName, 666)
function decodeUtf8(bytes) {
var encoded = "";
for (var i = 0; i < bytes.length; i++) {
encoded += '%' + bytes[i].toString(16);
}
return decodeURIComponent(encoded);
}
if (!data.data || data.data.size === 0) {
this.$message.warning("文件下载失败")
return
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data.data], {type: 'application/zip'}), fileName)
} else {
let url = window.URL.createObjectURL(new Blob([data.data], {type: 'application/zip'}))
let link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
document.body.removeChild(link) //下载完成移除元素
window.URL.revokeObjectURL(url) //释放掉blob对象
}
})
},
urgeRow (){
if (this.checkList.length === 1 && !this.checkList[0].endTime) {
this.$confirm('您确认要催办该任务吗', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
}).then(() => {
this.urge(this.checkList[0])
})
} else {
this.$message.warning('请选择一条未完成的数据')
}
},
urge (row) {
let params= {
msgContent: '流程编号为' + row.prcNum + '的流程,请尽快办理。',
msgTitle: '流程编号' + row.prcNum,
userId: row.assigneeId,
msgType: 'TEXT'
}
this.$api.process.urgePerson(params,
res => {
this.processTable()
this.$message.success('催办成功')
}, e => {
})
},
selectAllEvent ({ checked }) {
const records = this.$refs.xTable.getCheckboxRecords()
this.checkIds = records.map(item => {
@@ -126,14 +220,9 @@ export default {
}
},
back () {
this.$router.push({
path: '/userCenter/processCenter',
query: {
id:'AEHJB8YNJ3',
tabsName: "fourth"
}
})
this.$store.commit('setActiveTabIndex',this.tabsName=='AlreadyProcess'?"third":"fourth" )
//要返回上一级
this.$router.back(-1)
},
// 请求转换流程图
processNum (row) {
@@ -173,6 +262,8 @@ export default {
},
props: {},
mounted () {
this.tabsName=this.$route.query.tabsName
this.prcType=this.$route.query.prcType
this.processNum()
this.processTable()
}
@@ -231,6 +322,9 @@ export default {
justify-content: center;
align-items: center;
}
.alreadbtn{
display: flex;
}
}
.back{
width: 45px;
@@ -10,7 +10,11 @@
</vxe-column>
<vxe-column show-overflow show-header-overflow field="prcNum"
title="流程编号"></vxe-column>
<vxe-column show-overflow show-header-overflow field="prcName" title="流程名称"></vxe-column>
<vxe-column show-overflow show-header-overflow field="prcName" title="流程名称">
<template #default="{ row,index }">
<div @click="viewDetails(row)">{{prcName}}</div>
</template>
</vxe-column>
<vxe-column show-overflow show-header-overflow field="creatUserName"
title="发起人"></vxe-column>
<vxe-column show-overflow show-header-overflow field="taskAssignee" title="当前处理人"></vxe-column>
@@ -22,7 +26,7 @@
<vxe-column show-overflow show-header-overflow field="status" title="状态"></vxe-column>
<vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right">
<template #default="{ row,index }">
<el-button type="text" size="small">
<el-button type="text" size="small" @click="view(row)">
查看
</el-button>
<el-button type="text" size="small" @click="withdraw">
@@ -67,6 +71,35 @@ export default {
this.loadData()
},
methods: {
viewDetails(row) {
const prcType = row.prcType
console.log(prcType);
this.loading = true
this.$api.getAlreadData({taskIds:row.taskIds})
.then(res=>{
switch (prcType) {
case '1':
res.isViewDetails = 1
res.prcType = prcType
res.prcNum = row.prcNum
if (res.taskDefinitionKey == 'aid1' ||
res.taskDefinitionKey == 'aid4' ) {
this.$router.push({
path: '/permission/launch',
query: res,
})
return
}
else{
this.$router.push({
path: '/permission/examine',
query: res,
})
}
}
})
},
//撤回
withdraw(row){
this.$confirm('确认强制撤回该条数据?', '强制撤回', {
@@ -105,8 +138,16 @@ export default {
this.q.current = val;
this.loadData();
},
view() {
alert(111);
view(row) {
this.$router.push({
path: 'monitorViews',
query: {
id: this.$route.query.id,
prcNum: row.prcNum,
prcType: row.prcType,
tabsName: 'AlreadyProcess'
}
})
},
back(index, tableData) {
console.log('index', index);
+3 -4
View File
@@ -45,19 +45,18 @@ export default {
created () {
},
mounted () {
let tabName=this.$route.query.tabsName?this.$route.query.tabsName:'first'
this.activeName=tabName
this.activeName=this.$store.getters.activeTab ?this.$store.getters.activeTab:'first'
},
methods: {
handleClick(tab, event) {
this.$router.push({
path: '/userCenter/processCenter',
query: {
id:'AEHJB8YNJ3',
tabsName: this.activeName
id:'AEHJB8YNJ3'
}
})
this.$emit('clearForm')
this.$store.commit('setActiveTabIndex','')
}
}
}