|
|
|
@ -3,8 +3,12 @@ import { computed, onMounted, onUnmounted, reactive, ref, unref, watch } from 'v
|
|
|
|
|
import { chunk, clone } from 'lodash-es'
|
|
|
|
|
import { useDialog, useMessage } from 'naive-ui'
|
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
import NotPassed from '@/components/Approval/NotPassed.vue'
|
|
|
|
|
import BatchModal from '../modal/BatchModal.vue'
|
|
|
|
|
import CustomSettingModal from '../modal/CustomSettingModal.vue'
|
|
|
|
|
import PictureTable from './PictureTable.vue'
|
|
|
|
|
import TaskTable from './TaskTable.vue'
|
|
|
|
|
import History from './History.vue'
|
|
|
|
|
import NotPassed from '@/components/Approval/NotPassed.vue'
|
|
|
|
|
import { getAllfieldList, getfieldList } from '@/api/home/filter'
|
|
|
|
|
import { TASK_STATUS_OBJ } from '@/enums/index'
|
|
|
|
|
|
|
|
|
@ -14,12 +18,6 @@ import { useUser } from '@/store/modules/user'
|
|
|
|
|
import { isEmpty } from '@/utils'
|
|
|
|
|
import { formatToDateHMS } from '@/utils/dateUtil'
|
|
|
|
|
import { hideDownload } from '@/utils/image'
|
|
|
|
|
import emitter from '@/utils/mitt'
|
|
|
|
|
import CustomSettingModal from '../modal/CustomSettingModal.vue'
|
|
|
|
|
import PictureTable from './PictureTable.vue'
|
|
|
|
|
import TaskTable from './TaskTable.vue'
|
|
|
|
|
import History from './History.vue'
|
|
|
|
|
import type { ApprovalParam } from '/#/api'
|
|
|
|
|
|
|
|
|
|
const batch = ref(false)
|
|
|
|
|
const selectItems = ref<any[]>([])
|
|
|
|
@ -28,12 +26,14 @@ const dialog = useDialog()
|
|
|
|
|
const notPassModalRef = ref(null)
|
|
|
|
|
const batchModalRef = ref(null)
|
|
|
|
|
const totalCount = ref(0)
|
|
|
|
|
const taskId: any = ref('') // 任务id
|
|
|
|
|
const packageId: any = ref('') // 包id
|
|
|
|
|
const CustomSettingModalRef = ref(null)
|
|
|
|
|
const taskTableData = ref<any[]>([])
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
|
|
|
|
|
const sortBy: any = {
|
|
|
|
|
orderType: 'asc',
|
|
|
|
|
orderType: 'desc',
|
|
|
|
|
orderName: 'similarityScore',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -77,8 +77,11 @@ let processItems: any[] = []
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
window.addEventListener('keydown', handleKeydown)
|
|
|
|
|
if (route.query.id)
|
|
|
|
|
getDetail(route.query.id, route.query.packageid)
|
|
|
|
|
if (route.query.id) {
|
|
|
|
|
taskId.value = route.query.id
|
|
|
|
|
packageId.value = route.query.packageid
|
|
|
|
|
getDetail()
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 键盘左右箭头快捷切换
|
|
|
|
@ -91,12 +94,6 @@ function handleKeydown(event) {
|
|
|
|
|
// 在这里执行右箭头的逻辑
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 从任务终审列表跳转过来的
|
|
|
|
|
async function getDetail(taskId, packageid) {
|
|
|
|
|
taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid)
|
|
|
|
|
getTableData()
|
|
|
|
|
getImgList()
|
|
|
|
|
}
|
|
|
|
|
// states:1未提交,2待审批,3通过,4不通过
|
|
|
|
|
function validate(items: any[]) {
|
|
|
|
|
if (items.length === 0)
|
|
|
|
@ -140,13 +137,32 @@ function approvalHandler(items?: any) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const list: any = []
|
|
|
|
|
processItems.forEach((item) => {
|
|
|
|
|
list.push({
|
|
|
|
|
formId: item.id,
|
|
|
|
|
taskId: item.taskId,
|
|
|
|
|
taskName: item.fromTaskName,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const param = {
|
|
|
|
|
result: true,
|
|
|
|
|
comment: '',
|
|
|
|
|
disposeType: '',
|
|
|
|
|
disposeTypeId: '',
|
|
|
|
|
failCauseId: '',
|
|
|
|
|
failCauseName: '',
|
|
|
|
|
flowTaskInfoList: list,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dialog.info({
|
|
|
|
|
title: '确认提示',
|
|
|
|
|
content: '确认给该任务审批为【通过】吗?',
|
|
|
|
|
positiveText: '确定',
|
|
|
|
|
negativeText: '取消',
|
|
|
|
|
onPositiveClick: () => {
|
|
|
|
|
approval()
|
|
|
|
|
doAudit(param)
|
|
|
|
|
},
|
|
|
|
|
onNegativeClick: () => {},
|
|
|
|
|
})
|
|
|
|
@ -176,46 +192,17 @@ function rejectHandler(items?: any) {
|
|
|
|
|
modal.showModal(selectItems.value)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function approval() {
|
|
|
|
|
const formIds: string[] = processItems.map(item => item.id)
|
|
|
|
|
const taskIds: string[] = processItems.map(item => item.taskId)
|
|
|
|
|
const tasknames: string[] = processItems.map(item => item.taskname)
|
|
|
|
|
|
|
|
|
|
const param: ApprovalParam = {
|
|
|
|
|
formid: formIds,
|
|
|
|
|
taskId: taskIds,
|
|
|
|
|
approvd: true,
|
|
|
|
|
taskComment: 'approval',
|
|
|
|
|
taskname: tasknames,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
doAudit(param)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function doAudit(param: any) {
|
|
|
|
|
audit(param).then((res) => {
|
|
|
|
|
const { code } = res
|
|
|
|
|
setBatch(false)
|
|
|
|
|
if (code === 'OK')
|
|
|
|
|
emitter.emit('refresh')
|
|
|
|
|
else message.error(res.message)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function reject(idOrDesc: string, backId: string, isOther: boolean) {
|
|
|
|
|
const formIds: string[] = processItems.map(item => item.id)
|
|
|
|
|
const taskIds: string[] = processItems.map(item => item.taskId)
|
|
|
|
|
const tasknames: string[] = processItems.map(item => item.taskname)
|
|
|
|
|
|
|
|
|
|
const param: ApprovalParam = {
|
|
|
|
|
formid: formIds,
|
|
|
|
|
taskId: taskIds,
|
|
|
|
|
approvd: false,
|
|
|
|
|
taskComment: idOrDesc,
|
|
|
|
|
taskname: isOther ? tasknames : ['其他'],
|
|
|
|
|
}
|
|
|
|
|
if (code === 'OK') {
|
|
|
|
|
message.success('审核成功')
|
|
|
|
|
reloadList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
doAudit(param)
|
|
|
|
|
else { message.error(res.message) }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showModal(modalRef: any) {
|
|
|
|
@ -286,20 +273,6 @@ async function getImgList() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
|
() => [taskStore.activeId],
|
|
|
|
|
async () => {
|
|
|
|
|
const packageid = taskStore.getPackageid
|
|
|
|
|
const taskId = taskStore.getActiveId
|
|
|
|
|
setBatch(false)
|
|
|
|
|
if (isEmpty(taskId))
|
|
|
|
|
return
|
|
|
|
|
taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid)
|
|
|
|
|
getTableData()
|
|
|
|
|
getImgList()
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// 从store里面获取任务id
|
|
|
|
|
const currentTaskId = computed(() => {
|
|
|
|
|
const index = taskStore.getCurrentIndex
|
|
|
|
@ -343,9 +316,26 @@ function previewHandler(event: MouseEvent) {
|
|
|
|
|
(imageRef.value as any).mergedOnClick()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function reloadList() {
|
|
|
|
|
watch(
|
|
|
|
|
() => [taskStore.activeId],
|
|
|
|
|
() => {
|
|
|
|
|
packageId.value = taskStore.getPackageid
|
|
|
|
|
taskId.value = taskStore.getActiveId
|
|
|
|
|
getDetail()
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// 获取数据
|
|
|
|
|
async function getDetail() {
|
|
|
|
|
taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value)
|
|
|
|
|
setBatch(false)
|
|
|
|
|
getTableData()
|
|
|
|
|
getImgList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function reloadList() {
|
|
|
|
|
getDetail()
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
@ -415,16 +405,9 @@ function reloadList() {
|
|
|
|
|
</template>
|
|
|
|
|
返回
|
|
|
|
|
</n-button>
|
|
|
|
|
<div
|
|
|
|
|
style="cursor: pointer; margin-left: 16px"
|
|
|
|
|
@click.stop="rejectHandler"
|
|
|
|
|
>
|
|
|
|
|
<SvgIcon width="64" height="28" name="a1" />
|
|
|
|
|
</div>
|
|
|
|
|
<img class="btn-approval btn-left" src="@/assets/images/task/btn-not-pass.png" alt="" @click.stop="rejectHandler">
|
|
|
|
|
<SvgIcon size="24" name="vs" />
|
|
|
|
|
<div style="cursor: pointer" @click.stop="approvalHandler">
|
|
|
|
|
<SvgIcon width="64" height="28" name="a2" />
|
|
|
|
|
</div>
|
|
|
|
|
<img class="btn-approval" src="@/assets/images/task/btn-pass.png" alt="" @click.stop="approvalHandler">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -733,6 +716,16 @@ function reloadList() {
|
|
|
|
|
.batch {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.btn-approval{
|
|
|
|
|
width: 68px;
|
|
|
|
|
height: 28px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn-left{
|
|
|
|
|
margin-left: 16px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|