Files
zhgh_whcp/target/classes/views/platform/sys/union/branchUnionCadreAudit.js
T
2026-01-08 14:58:16 +08:00

152 lines
6.2 KiB
JavaScript

const branchUnionCadreAudit = {
template: /*language=HTML*/ `
<el-card shadow="never" class="mt10">
<table-tool label="基层干部">
<el-radio-group @change="doSearch" class="mr5" size="small" v-model="pageForm.audit">
<el-radio-button label="true">已审核</el-radio-button>
<el-radio-button label="false">未审核</el-radio-button>
</el-radio-group>
<!-- <el-button size="small" @click="doAudit(true)" :disabled="!multipleSelection.length" type="primary"-->
<!-- icon="el-icon-check">批量通过-->
<!-- </el-button>-->
<!-- <el-button size="small" @click="doAudit(false)" :disabled="!multipleSelection.length" type="danger"-->
<!-- icon="el-icon-check">批量拒绝-->
<!-- </el-button>-->
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder" ref="table" row-key="id"
style="width: 100%" @selection-change="handleSelectionChange" height="65vh">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column align="center" header-align="center" type="index" :index="indexMethod"
label="序号" width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop==='isJoin'" scope="{row:{isJoin}}">
<span v-if="isJoin" class="text-info">加入</span>
<span v-else class="text-danger">退出</span>
</template>
<template scope="{row}" v-else-if="column.prop=='instanceState'">
<enum-tag :value="row.instanceState" name="ProcessInstanceStateEnum" label_key="message"
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="180px" v-if="!pageForm.audit">
<template scope="{row}">
<template v-if="row.taskState === 10">
<el-button @click="handleTaskAction(row, 1)" size="mini" type="primary">通过</el-button>
<el-button @click="handleTaskAction(row, 2)" size="mini" type="danger">拒绝</el-button>
</template>
<el-button v-if="row.canRevoke" @click="openRevoke(row)" size="mini" type="danger">
撤回
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
`,
mixins: [initTableMixins],
data() {
return {
pageForm: {
audit: false
},
tableColumns: [
{ prop: 'loginName', label: '工号' },
{ prop: 'userName', label: '姓名' },
{ prop: 'unionName', label: '所属工会' },
{ prop: 'mobile', label: '联系方式' },
{ prop: 'roleName', label: '职务' },
{ prop: 'isJoin', label: '申请类型' },
{ prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" }
],
multipleSelection: [],
}
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val;
},
doAudit(pass) {
this.$confirm('是否确认提交?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const ids = JSON.stringify(this.multipleSelection.map(v => v.id))
this.$axios.post('/platform/sys/union/cadreDoAudit', {ids, pass})
.then(resp => {
if (resp.code === 0) {
this.pageData()
this.$refs.table.clearSelection();
this.$message.success(resp.msg)
}else{
this.$message.error(resp.msg)
}
})
})
},
handleTaskAction(row, val) {
const msg = val === 1 ? "通过" : "拒绝"
this.$confirm("您确定要" + msg + "吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const loading = createLoading()
this.formData = {
origin: row.origin,
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.$axios.post("/flow/common/executeTask", {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then((res) => {
if (res.code === 0) {
this.$message.success(res.msg)
this.doSearch()
}
}).finally(() => {
loading.close()
})
})
},
pageData() {
this.$axios.post('/platform/sys/union/cadrePageData', this.pageForm)
.then(resp => {
if (resp.code === 0) {
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
}
})
}
}
}