|
|
|
@ -1,17 +1,24 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { computed, onUnmounted, reactive, ref, unref, watch } from 'vue'
|
|
|
|
|
import { useDialog } from 'naive-ui'
|
|
|
|
|
import { useDialog, useMessage } from 'naive-ui'
|
|
|
|
|
import { clone } from 'lodash-es'
|
|
|
|
|
import ConfrimModal from '../modal/ConfrimModal.vue'
|
|
|
|
|
import BatchModal from '../modal/BatchModal.vue'
|
|
|
|
|
import TaskTable from './TaskTable.vue'
|
|
|
|
|
import PictureTable from './PictureTable.vue'
|
|
|
|
|
import { useTask } from '@/store/modules/task'
|
|
|
|
|
import { approval } from '@/api/task/task'
|
|
|
|
|
import { audit } from '@/api/task/task'
|
|
|
|
|
import type { ApprovalParam, PictureSortParam } from '/#/api'
|
|
|
|
|
import { getTaskDetailInfo, getTaskDetailPictureList } from '@/api/work/work'
|
|
|
|
|
|
|
|
|
|
const batch = ref(false)
|
|
|
|
|
const selectItems = ref<any[]>([])
|
|
|
|
|
const message = useMessage()
|
|
|
|
|
const dialog = useDialog()
|
|
|
|
|
const confrimModalRef = ref(null)
|
|
|
|
|
const batchModalRef = ref(null)
|
|
|
|
|
const totalCount = ref(0)
|
|
|
|
|
|
|
|
|
|
const sortBy: PictureSortParam = {
|
|
|
|
|
orderbyname: 'asc',
|
|
|
|
|
orderbyvalue: 'fromuptime',
|
|
|
|
@ -40,74 +47,112 @@ const showActions = computed(() => {
|
|
|
|
|
return selectItems.value.length > 0 && batch
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const dialog = useDialog()
|
|
|
|
|
const taskpagination = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
})
|
|
|
|
|
const taskStore = useTask()
|
|
|
|
|
const overTask = ref<any>(null)
|
|
|
|
|
const taskDetailInfo = ref<any>({})
|
|
|
|
|
const taskDetailPictureList = ref<any[]>([])
|
|
|
|
|
let processItems: any[] = []
|
|
|
|
|
|
|
|
|
|
function validate(items: any[]) {
|
|
|
|
|
if (items.length === 0)
|
|
|
|
|
return '至少选中一个任务'
|
|
|
|
|
|
|
|
|
|
for (const item of items) {
|
|
|
|
|
// const { iztrueorfalse, history, states } = item
|
|
|
|
|
// if (iztrueorfalse !== null)
|
|
|
|
|
// return '存在已经辨识过的任务'
|
|
|
|
|
|
|
|
|
|
// else if (history)
|
|
|
|
|
// return '包含历史数据'
|
|
|
|
|
|
|
|
|
|
// else if (states !== 1 && states !== 2)
|
|
|
|
|
// return '审批状态不合法'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function approvalHandler() {
|
|
|
|
|
let cloneItem: any
|
|
|
|
|
if (batch.value) { processItems = selectItems.value }
|
|
|
|
|
else if (overTask.value) {
|
|
|
|
|
cloneItem = clone(overTask.value)
|
|
|
|
|
processItems = [cloneItem]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const msg = validate(processItems)
|
|
|
|
|
|
|
|
|
|
if (msg !== null) {
|
|
|
|
|
message.error(msg)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function handleConfirm() {
|
|
|
|
|
dialog.info({
|
|
|
|
|
title: '确认提示',
|
|
|
|
|
content: '确认给该任务审批为【通过】吗?',
|
|
|
|
|
positiveText: '确定',
|
|
|
|
|
negativeText: '取消',
|
|
|
|
|
onPositiveClick: () => {
|
|
|
|
|
approvalHandler()
|
|
|
|
|
approval()
|
|
|
|
|
},
|
|
|
|
|
onNegativeClick: () => { },
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const taskpagination = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
})
|
|
|
|
|
const taskStore = useTask()
|
|
|
|
|
const overTask = ref<any>(null)
|
|
|
|
|
const taskDetailInfo = ref<any>({})
|
|
|
|
|
const taskDetailPictureList = ref<any[]>([])
|
|
|
|
|
function rejectHandler() {
|
|
|
|
|
let cloneItem: any
|
|
|
|
|
if (batch.value) { processItems = selectItems.value }
|
|
|
|
|
else if (overTask.value) {
|
|
|
|
|
cloneItem = clone(overTask.value)
|
|
|
|
|
processItems = [cloneItem]
|
|
|
|
|
}
|
|
|
|
|
const msg = validate(processItems)
|
|
|
|
|
|
|
|
|
|
function approvalHandler() {
|
|
|
|
|
let ids: any[] = []
|
|
|
|
|
if (msg !== null) {
|
|
|
|
|
message.error(msg)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (batch.value === true)
|
|
|
|
|
ids = selectItems.value.map(item => item.id)
|
|
|
|
|
else if (overTask.value !== null)
|
|
|
|
|
ids = [overTask.value.id]
|
|
|
|
|
const modal = unref(confrimModalRef)! as any
|
|
|
|
|
modal.showModal()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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: '',
|
|
|
|
|
taskId: '',
|
|
|
|
|
formid: formIds,
|
|
|
|
|
taskId: taskIds,
|
|
|
|
|
approvd: true,
|
|
|
|
|
taskComment: '',
|
|
|
|
|
taskname: tasknames,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
approval(param)
|
|
|
|
|
audit(param)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function rejectHandler(idOrDesc: string, isOther: boolean) {
|
|
|
|
|
let ids: any[] = []
|
|
|
|
|
|
|
|
|
|
if (batch.value === true)
|
|
|
|
|
ids = selectItems.value.map(item => item.id)
|
|
|
|
|
else if (overTask.value !== null)
|
|
|
|
|
ids = [overTask.value.id]
|
|
|
|
|
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: '',
|
|
|
|
|
taskId: '',
|
|
|
|
|
formid: formIds,
|
|
|
|
|
taskId: taskIds,
|
|
|
|
|
approvd: false,
|
|
|
|
|
taskComment: '',
|
|
|
|
|
taskComment: idOrDesc,
|
|
|
|
|
taskname: isOther ? tasknames : ['其他'],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isOther)
|
|
|
|
|
param.taskComment = idOrDesc
|
|
|
|
|
else
|
|
|
|
|
param.taskComment = idOrDesc
|
|
|
|
|
|
|
|
|
|
approval(param)
|
|
|
|
|
audit(param)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const confrimModalRef = ref(null)
|
|
|
|
|
const batchModalRef = ref(null)
|
|
|
|
|
|
|
|
|
|
function showModal(modalRef: any) {
|
|
|
|
|
const modal = unref(modalRef)! as any
|
|
|
|
|
modal.showModal()
|
|
|
|
@ -126,8 +171,9 @@ watch(() => taskStore.activeId, async (newValue, oldValue) => {
|
|
|
|
|
const taskId = taskStore.getActiveId
|
|
|
|
|
taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid)
|
|
|
|
|
|
|
|
|
|
const res = await getTaskDetailPictureList(packageid, taskId, { ...taskpagination, ...sortBy })
|
|
|
|
|
taskDetailPictureList.value = res.data
|
|
|
|
|
const { data, total } = await getTaskDetailPictureList(packageid, taskId, { ...taskpagination, ...sortBy })
|
|
|
|
|
taskDetailPictureList.value = data
|
|
|
|
|
totalCount.value = total
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const currentTaskId = computed(() => {
|
|
|
|
@ -135,8 +181,10 @@ const currentTaskId = computed(() => {
|
|
|
|
|
return taskStore.getApprovalList[index]?.formid || ''
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function overTaskHandelr(item: any) {
|
|
|
|
|
// TODO:如果此item没有判定过真假,显示快速审批操作
|
|
|
|
|
function overTaskHandle() {
|
|
|
|
|
const item = taskDetailInfo.value
|
|
|
|
|
|
|
|
|
|
if (validate([item]) == null && batch.value === false)
|
|
|
|
|
overTask.value = item
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -147,6 +195,10 @@ function leaveTaskHandler() {
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
taskStore.reset()
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const mark = computed(() => {
|
|
|
|
|
return taskDetailInfo.value.iztrueorfalse === null ? '未标记' : '已标记'
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
@ -169,11 +221,11 @@ onUnmounted(() => {
|
|
|
|
|
</template>
|
|
|
|
|
返回
|
|
|
|
|
</n-button>
|
|
|
|
|
<div style="cursor: pointer;margin-left: 16px;" @click="showModal(confrimModalRef)">
|
|
|
|
|
<div style="cursor: pointer;margin-left: 16px;" @click="rejectHandler">
|
|
|
|
|
<SvgIcon width="64" height="28" name="a1" />
|
|
|
|
|
</div>
|
|
|
|
|
<SvgIcon size="24" name="vs" />
|
|
|
|
|
<div style="cursor: pointer;" @click="handleConfirm">
|
|
|
|
|
<div style="cursor: pointer;" @click="approvalHandler">
|
|
|
|
|
<SvgIcon width="64" height="28" name="a2" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -181,20 +233,62 @@ onUnmounted(() => {
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="wrapper-detail">
|
|
|
|
|
<div class="left">
|
|
|
|
|
<img style="overflow: hidden;" src="../../../assets/images/test.png">
|
|
|
|
|
<div
|
|
|
|
|
class="left" :style="{ 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})` }"
|
|
|
|
|
@mouseover="overTaskHandle" @mouseleave="leaveTaskHandler"
|
|
|
|
|
>
|
|
|
|
|
<div v-show="overTask" class="action">
|
|
|
|
|
<SvgIcon style="cursor: pointer;" width="168" height="48" name="r6" @click.stop @click="approvalHandler" />
|
|
|
|
|
<SvgIcon
|
|
|
|
|
style="cursor: pointer;margin-left: 30px;" width="168" height="48" name="r7" @click.stop
|
|
|
|
|
@click="rejectHandler"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mark">
|
|
|
|
|
<SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 0" size="128" name="jia" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mark">
|
|
|
|
|
<SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 1" size="128" name="zhen" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="info">
|
|
|
|
|
<n-grid x-gap="12" y-gap="10" :cols="12">
|
|
|
|
|
<n-gi span="4" class="gi1">
|
|
|
|
|
<span>
|
|
|
|
|
<SvgIcon size="40" name="m1" />
|
|
|
|
|
</span>
|
|
|
|
|
</n-gi>
|
|
|
|
|
<n-gi span="8" class="gi2">
|
|
|
|
|
<span style="font-size: bold;font-size: 18px;">{{ mark }}</span>
|
|
|
|
|
<span>审批状态</span>
|
|
|
|
|
</n-gi>
|
|
|
|
|
<n-gi span="4" class="gi1">
|
|
|
|
|
<span>
|
|
|
|
|
<SvgIcon size="40" name="m2" />
|
|
|
|
|
</span>
|
|
|
|
|
</n-gi>
|
|
|
|
|
<n-gi span="8" class="gi2">
|
|
|
|
|
<span style="font-size: bold;font-size: 18px;">{{ totalCount }}</span>
|
|
|
|
|
<span>相似匹配</span>
|
|
|
|
|
</n-gi>
|
|
|
|
|
</n-grid>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="time">
|
|
|
|
|
<SvgIcon color="#FFF" size="16" name="time" />
|
|
|
|
|
<span>2023-09-17 13:09:10</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right">
|
|
|
|
|
<n-scrollbar style="max-height: 100%;">
|
|
|
|
|
<div class="header">
|
|
|
|
|
<span>相似图片(9)</span>
|
|
|
|
|
<SvgIcon style="margin-right: 20px;cursor: pointer;" name="max" size="24" @click="showModal(batchModalRef)" />
|
|
|
|
|
<SvgIcon
|
|
|
|
|
style="margin-right: 20px;cursor: pointer;" name="max" size="24"
|
|
|
|
|
@click="showModal(batchModalRef)"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="list">
|
|
|
|
|
<div v-for="(item, index) in taskDetailPictureList" :key="index" class="item">
|
|
|
|
|
<div style="overflow: hidden;">
|
|
|
|
|
<img src="../../../assets/images/test.png">
|
|
|
|
|
</div>
|
|
|
|
|
<div class="img-wrapper" :style="{ 'background-image': `url(${item.imgurl})` }" />
|
|
|
|
|
<div class="check">
|
|
|
|
|
<n-checkbox
|
|
|
|
|
v-show="batch" v-model:checked="item.checked" @click.stop
|
|
|
|
@ -224,7 +318,7 @@ onUnmounted(() => {
|
|
|
|
|
</n-tab-pane>
|
|
|
|
|
<n-tab-pane name="history" tab="历史审查" />
|
|
|
|
|
</n-tabs>
|
|
|
|
|
<ConfrimModal ref="confrimModalRef" @commit="rejectHandler" />
|
|
|
|
|
<ConfrimModal ref="confrimModalRef" @commit="reject" />
|
|
|
|
|
<BatchModal ref="batchModalRef" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
@ -308,10 +402,73 @@ onUnmounted(() => {
|
|
|
|
|
|
|
|
|
|
.left {
|
|
|
|
|
flex: 0.6;
|
|
|
|
|
background-size: cover;
|
|
|
|
|
background-position: center;
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
|
|
.mark {
|
|
|
|
|
position: absolute;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
right: 15%;
|
|
|
|
|
top: 0px;
|
|
|
|
|
width: 128px;
|
|
|
|
|
height: 80px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
|
|
svg {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: -48px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.action {
|
|
|
|
|
position: absolute;
|
|
|
|
|
z-index: 3;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
background-color: rgba(102, 102, 102, 0.5);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.info {
|
|
|
|
|
position: absolute;
|
|
|
|
|
z-index: 3;
|
|
|
|
|
right: 2%;
|
|
|
|
|
bottom: 2%;
|
|
|
|
|
width: 136px;
|
|
|
|
|
height: 119px;
|
|
|
|
|
background: rgba(216, 216, 216, 0.4);
|
|
|
|
|
border-radius: 7px;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
color: #FFF;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.time {
|
|
|
|
|
position: absolute;
|
|
|
|
|
z-index: 3;
|
|
|
|
|
left: 2%;
|
|
|
|
|
bottom: 2%;
|
|
|
|
|
color: #FFF;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.gi1 {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
img {
|
|
|
|
|
max-height: 100%;
|
|
|
|
|
width: auto;
|
|
|
|
|
.gi2 {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: left;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: center
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -347,6 +504,16 @@ onUnmounted(() => {
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
margin: 0px 16px 27px 0px;
|
|
|
|
|
|
|
|
|
|
.img-wrapper {
|
|
|
|
|
width: 230px;
|
|
|
|
|
height: 130px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
background-size: cover;
|
|
|
|
|
background-position: center;
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.check {
|
|
|
|
|
position: absolute;
|
|
|
|
|
z-index: 5;
|
|
|
|
|