feat: 添加审批历史页面,处于办公中心下
This commit is contained in:
@@ -108,8 +108,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { getTodoTaskByBiz, listFlowAction, listFlowFormData, listHistoryFlowTask } from '@/views/hrm/js/History'
|
||||
import { listHistoryFlowTask, listFlowAction, listFlowFormData } from '@/api/hrm/flow'
|
||||
|
||||
import { listByIds } from '@/api/system/oss'
|
||||
import { listUser } from '@/api/system/user'
|
||||
@@ -127,6 +126,7 @@ export default {
|
||||
return {
|
||||
query: { status: undefined, pageNum: 1, pageSize: 50 },
|
||||
list: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
detailTask: null,
|
||||
actionList: [],
|
||||
@@ -152,10 +152,18 @@ export default {
|
||||
|
||||
fetchList() {
|
||||
this.loading = true
|
||||
listHistoryFlowTask().then(res => {
|
||||
this.list = res.data || res.rows || []
|
||||
if (!this.detailTask && this.list.length) this.openDetail(this.list[0])
|
||||
}).finally(() => { this.loading = false })
|
||||
|
||||
listHistoryFlowTask(this.query).then(res => {
|
||||
|
||||
this.list = res.rows || []
|
||||
this.total = res.total || 0
|
||||
|
||||
if (!this.detailTask && this.list.length) {
|
||||
this.openDetail(this.list[0])
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
async openDetail(row) {
|
||||
@@ -165,9 +173,32 @@ export default {
|
||||
this.loadFormData(row)
|
||||
},
|
||||
|
||||
loadActions(row) { if (!row || !row.instId) return; this.actionLoading = true; listFlowAction({ instId: row.instId }).then(res => { this.actionList = res.rows || [] }).finally(() => { this.actionLoading = false }) },
|
||||
loadFormData(row) { if (!row || !row.instId) return; this.formLoading = true; listFlowFormData({ instId: row.instId }).then(res => { this.formData = res.rows || [] }).finally(() => { this.formLoading = false }) },
|
||||
copyTaskInfo() { if (!this.detailTask) return; const t = this.detailTask; const text = `任务ID:${t.taskId}\n实例:${t.instId}\n业务:${t.bizType}${t.bizId ? `#${t.bizId}` : ''}\n节点:${t.nodeId}\n状态:${t.status}`; navigator.clipboard.writeText(text).then(() => this.$message.success('已复制')) }
|
||||
loadActions(row) {
|
||||
if (!row || !row.instId) return;
|
||||
this.actionLoading = true;
|
||||
listFlowAction({ instId: row.instId }).then(res => {
|
||||
this.actionList = res.rows || []
|
||||
}).finally(() => {
|
||||
this.actionLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
loadFormData(row) {
|
||||
if (!row || !row.instId) return;
|
||||
this.formLoading = true;
|
||||
listFlowFormData({ instId: row.instId }).then(res => {
|
||||
this.formData = res.rows || []
|
||||
}).finally(() => {
|
||||
this.formLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
copyTaskInfo() {
|
||||
if (!this.detailTask) return;
|
||||
const t = this.detailTask;
|
||||
const text = `任务ID:${t.taskId}\n实例:${t.instId}\n业务:${t.bizType}${t.bizId ? `#${t.bizId}` : ''}\n节点:${t.nodeId}\n状态:${t.status}`;
|
||||
navigator.clipboard.writeText(text).then(() => this.$message.success('已复制'))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user