修改发起流程

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
@@ -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;