|
|
|
@ -1,9 +1,8 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { audit } from '@/api/task/task';
|
|
|
|
|
import {
|
|
|
|
|
clearTF, getTaskDetailInfo,
|
|
|
|
|
getTaskDetailPictureList,
|
|
|
|
|
setTF
|
|
|
|
|
getTaskDetailInfo,
|
|
|
|
|
getTaskDetailPictureList
|
|
|
|
|
} from "@/api/work/work";
|
|
|
|
|
import { fieldMap } from "@/config/workorder";
|
|
|
|
|
import { TASK_STATUS_OBJ } from '@/enums/index';
|
|
|
|
@ -19,7 +18,7 @@ import { clone, debounce, pickBy } from "lodash-es";
|
|
|
|
|
import { useDialog, useMessage } from "naive-ui";
|
|
|
|
|
import { computed, onUnmounted, onUpdated, reactive, ref, unref, watch } from "vue";
|
|
|
|
|
import ConfrimModal from "../modal/ConfrimModal.vue";
|
|
|
|
|
import type { ApprovalParam, SetTFParam, SimilarityPictureSortParam } from "/#/api";
|
|
|
|
|
import type { ApprovalParam, SimilarityPictureSortParam } from "/#/api";
|
|
|
|
|
|
|
|
|
|
const batch = ref(false);
|
|
|
|
|
const selectItems = ref<any[]>([]);
|
|
|
|
@ -63,7 +62,6 @@ const sortBy: SimilarityPictureSortParam = {
|
|
|
|
|
const workStore = useWorkOrder();
|
|
|
|
|
const selectTask = ref<any>(null);
|
|
|
|
|
const overTask = ref<any>(null);
|
|
|
|
|
const taskList = ref<any[]>([]);
|
|
|
|
|
const taskDetailInfo = ref<any>({});
|
|
|
|
|
const confrimModalRef = ref(null);
|
|
|
|
|
const imageRef = ref<ComponentElRef | null>();
|
|
|
|
@ -71,6 +69,8 @@ const listData = ref<any[]>([]);
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
const el = ref<HTMLDivElement | null>(null);
|
|
|
|
|
const selectedSortName = ref('');
|
|
|
|
|
const isFullScreen = ref(false);
|
|
|
|
|
|
|
|
|
|
let canloadMore = true;
|
|
|
|
|
|
|
|
|
|
let processItems: any[] = [];
|
|
|
|
@ -93,102 +93,6 @@ function validate(items: any[]) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function falseHandler() {
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const modal = unref(confrimModalRef)! as any;
|
|
|
|
|
modal.showModal();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function trueHandler() {
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dialog.info({
|
|
|
|
|
title: "确认提示",
|
|
|
|
|
content: "确认给该任务图判真吗?",
|
|
|
|
|
positiveText: "确定",
|
|
|
|
|
negativeText: "取消",
|
|
|
|
|
onPositiveClick: () => {
|
|
|
|
|
setTrue();
|
|
|
|
|
},
|
|
|
|
|
onNegativeClick: () => { },
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setTrue() {
|
|
|
|
|
const ids: any[] = processItems.map((item) => item.id);
|
|
|
|
|
|
|
|
|
|
const param: SetTFParam = {
|
|
|
|
|
taskchildpictureids: ids.join(","),
|
|
|
|
|
iztrueorfalse: 1,
|
|
|
|
|
packageid: workStore.getActiveId,
|
|
|
|
|
judgeid: "0",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
doSetTF(param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setFalse(id: string, desc: null | string) {
|
|
|
|
|
const ids: any[] = processItems.map((item) => item.id);
|
|
|
|
|
|
|
|
|
|
const param: SetTFParam = {
|
|
|
|
|
taskchildpictureids: ids.join(","),
|
|
|
|
|
iztrueorfalse: 0,
|
|
|
|
|
packageid: workStore.getActiveId,
|
|
|
|
|
judgeid: id,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (desc) param.judgedesc = desc;
|
|
|
|
|
|
|
|
|
|
doSetTF(param);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function doSetTF(param: SetTFParam) {
|
|
|
|
|
setTF(param).then((res) => {
|
|
|
|
|
const { code } = res;
|
|
|
|
|
processItems.length = 0;
|
|
|
|
|
if (code === "OK") updateList(param);
|
|
|
|
|
else message.error(res.message);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updateList(param: SetTFParam) {
|
|
|
|
|
const list = listData.value;
|
|
|
|
|
const ids = param.taskchildpictureids.split(",");
|
|
|
|
|
|
|
|
|
|
for (const item of list) {
|
|
|
|
|
if (ids.includes(item.id)) item.iztrueorfalse = param.iztrueorfalse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ids.includes(taskDetailInfo.value.id))
|
|
|
|
|
taskDetailInfo.value.iztrueorfalse = param.iztrueorfalse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function forwardHandler() {
|
|
|
|
|
workStore.forward();
|
|
|
|
|
}
|
|
|
|
@ -230,7 +134,7 @@ async function featchList() {
|
|
|
|
|
try {
|
|
|
|
|
taskpagination.pageNo += 1;
|
|
|
|
|
const { data, total, pageCount } = await getTaskDetailPictureList(
|
|
|
|
|
{ ...taskpagination, ...sortBy, checkDuplicateId: workStore.activeId }
|
|
|
|
|
{ ...taskpagination, ...sortBy, checkDuplicateId: workStore.activeId, pictureId: taskDetailInfo.value.pictureid}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
totalCount.value = total;
|
|
|
|
@ -238,7 +142,6 @@ async function featchList() {
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
} catch (error) {
|
|
|
|
|
debugger
|
|
|
|
|
canloadMore = false;
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
@ -260,6 +163,22 @@ const layout = debounce(() => {
|
|
|
|
|
});
|
|
|
|
|
}, 300);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const fullscreenStyles = computed<any>(() => ({
|
|
|
|
|
'width': isFullScreen.value ? '100vw' : '',
|
|
|
|
|
'height': isFullScreen.value ? '100vh' : '',
|
|
|
|
|
'position': isFullScreen.value ? 'fixed' : '',
|
|
|
|
|
'top': isFullScreen.value ? '0' : '',
|
|
|
|
|
'left': isFullScreen.value ? '0' : '',
|
|
|
|
|
'zIndex': isFullScreen.value ? '9999' : '',
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
// 切换全屏状态
|
|
|
|
|
const toggleFullScreen = () => {
|
|
|
|
|
isFullScreen.value = !isFullScreen.value;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onUpdated(() => {
|
|
|
|
|
layout();
|
|
|
|
|
});
|
|
|
|
@ -327,30 +246,6 @@ const propertys = computed(() => {
|
|
|
|
|
});
|
|
|
|
|
return v;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
async function clearHandler() {
|
|
|
|
|
dialog.info({
|
|
|
|
|
title: "确认提示",
|
|
|
|
|
content: "确认给该任务图片的标记印记吗?",
|
|
|
|
|
positiveText: "确定",
|
|
|
|
|
negativeText: "取消",
|
|
|
|
|
onPositiveClick: () => {
|
|
|
|
|
clearMark();
|
|
|
|
|
},
|
|
|
|
|
onNegativeClick: () => { },
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function clearMark() {
|
|
|
|
|
const res = await clearTF(workStore.activeId, selectTask.value.id);
|
|
|
|
|
if (res.code === "OK") {
|
|
|
|
|
taskDetailInfo.value.iztrueorfalse = null;
|
|
|
|
|
message.info("清除标记成功");
|
|
|
|
|
} else {
|
|
|
|
|
message.error(res.message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function overTaskHandelr(item: any) {
|
|
|
|
|
if (item?.userapprove?.statshis === 2 || item?.userapprove?.statshis == 3) {
|
|
|
|
|
overTask.value = null;
|
|
|
|
@ -368,21 +263,10 @@ onUnmounted(() => {
|
|
|
|
|
workStore.reset();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function getPercent(pictureid: string) {
|
|
|
|
|
const { ocpictureid, pictureresult } = taskDetailInfo.value;
|
|
|
|
|
const index = ocpictureid ? ocpictureid.split(",").indexOf(String(pictureid)) : '';
|
|
|
|
|
const results = pictureresult ? pictureresult.split(",") : '';
|
|
|
|
|
const percent = results[index] || "0";
|
|
|
|
|
const val = Math.floor(Number.parseFloat(percent));
|
|
|
|
|
return `${val}%`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const mark = computed(() => {
|
|
|
|
|
return taskDetailInfo.value.iztrueorfalse === null ? "未标记" : "已标记";
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function immersionHandler() {
|
|
|
|
|
workStore.updateImmersion();
|
|
|
|
|
// class="wrapper"
|
|
|
|
|
// workStore.updateImmersion();
|
|
|
|
|
toggleFullScreen();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showAction() {
|
|
|
|
@ -443,7 +327,7 @@ function doAudit(param: any) {
|
|
|
|
|
audit(param).then((res) => {
|
|
|
|
|
const { code } = res
|
|
|
|
|
setBatch(false)
|
|
|
|
|
if (code === 'OK'){
|
|
|
|
|
if (code === 'OK') {
|
|
|
|
|
emitter.emit('refresh')
|
|
|
|
|
refreshHandler()
|
|
|
|
|
}
|
|
|
|
@ -479,7 +363,7 @@ function approvalHandler(items?: any) {
|
|
|
|
|
onPositiveClick: () => {
|
|
|
|
|
approval()
|
|
|
|
|
},
|
|
|
|
|
onNegativeClick: () => {},
|
|
|
|
|
onNegativeClick: () => { },
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function approval() {
|
|
|
|
@ -500,7 +384,7 @@ function approval() {
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div class="wrapper">
|
|
|
|
|
<div class="wrapper fullscreen-container" :style="fullscreenStyles">
|
|
|
|
|
<div class="wrapper-header">
|
|
|
|
|
<div class="left">
|
|
|
|
|
<span class="font">{{ packageName }}</span>
|
|
|
|
@ -514,11 +398,7 @@ function approval() {
|
|
|
|
|
批量审批
|
|
|
|
|
</div>
|
|
|
|
|
<div class="icon-wrap">
|
|
|
|
|
<SvgIcon
|
|
|
|
|
size="20"
|
|
|
|
|
name="immersion-model"
|
|
|
|
|
@click="immersionHandler"
|
|
|
|
|
/>
|
|
|
|
|
<SvgIcon size="20" name="immersion-model" @click="immersionHandler" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -529,10 +409,7 @@ function approval() {
|
|
|
|
|
</template>
|
|
|
|
|
返回
|
|
|
|
|
</n-button>
|
|
|
|
|
<div
|
|
|
|
|
style="cursor: pointer; margin-left: 16px"
|
|
|
|
|
@click.stop="rejectHandler"
|
|
|
|
|
>
|
|
|
|
|
<div style="cursor: pointer; margin-left: 16px" @click.stop="rejectHandler">
|
|
|
|
|
<SvgIcon width="64" height="28" name="a1" />
|
|
|
|
|
</div>
|
|
|
|
|
<SvgIcon size="24" name="vs" />
|
|
|
|
@ -612,10 +489,15 @@ function approval() {
|
|
|
|
|
<n-scrollbar style="max-height: 100%">
|
|
|
|
|
<span class="task-name">任务ID:{{ taskDetailInfo.taskname }}</span>
|
|
|
|
|
<div class="tags">
|
|
|
|
|
<div class="tag tag-submiting" v-if="taskDetailInfo.states==1">{{ TASK_STATUS_OBJ[taskDetailInfo.states] }}</div>
|
|
|
|
|
<div class="tag tag-approve" v-else-if="taskDetailInfo.states==2">{{ TASK_STATUS_OBJ[taskDetailInfo.states] }}</div>
|
|
|
|
|
<div class="tag tag-passed" v-else-if="taskDetailInfo.states==3">{{ TASK_STATUS_OBJ[taskDetailInfo.states] }}</div>
|
|
|
|
|
<div class="tag tag-approved" v-else-if="taskDetailInfo.states==4">{{ TASK_STATUS_OBJ[taskDetailInfo.states] }}</div>
|
|
|
|
|
<div class="tag tag-submiting" v-if="taskDetailInfo.states == 1">{{ TASK_STATUS_OBJ[taskDetailInfo.states]
|
|
|
|
|
}}</div>
|
|
|
|
|
<div class="tag tag-approve" v-else-if="taskDetailInfo.states == 2">{{
|
|
|
|
|
TASK_STATUS_OBJ[taskDetailInfo.states] }}</div>
|
|
|
|
|
<div class="tag tag-passed" v-else-if="taskDetailInfo.states == 3">{{
|
|
|
|
|
TASK_STATUS_OBJ[taskDetailInfo.states]
|
|
|
|
|
}}</div>
|
|
|
|
|
<div class="tag tag-approved" v-else-if="taskDetailInfo.states == 4">{{
|
|
|
|
|
TASK_STATUS_OBJ[taskDetailInfo.states] }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<n-divider class="divider-line" />
|
|
|
|
|
<div class="property">
|
|
|
|
@ -712,7 +594,7 @@ function approval() {
|
|
|
|
|
{{ item?.maxSimilarity && Number(item?.maxSimilarity).toFixed(0) }}%
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="pass-status" v-if="item.historyStates === 2">
|
|
|
|
|
<SvgIcon name="pass-icon" style="width:52;height:24px" />
|
|
|
|
|
</div>
|
|
|
|
@ -737,6 +619,13 @@ function approval() {
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.fullscreen-container {
|
|
|
|
|
/* 可添加其他样式 */
|
|
|
|
|
width: 100vw;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
margin: 0px !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.wrapper {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex: 1;
|
|
|
|
@ -899,7 +788,7 @@ function approval() {
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
background-color: rgba(0,0,0,0.48);
|
|
|
|
|
background-color: rgba(0, 0, 0, 0.48);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.info {
|
|
|
|
@ -914,13 +803,14 @@ function approval() {
|
|
|
|
|
padding: 16px 0 0 23px;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
.icon-wrap{
|
|
|
|
|
|
|
|
|
|
.icon-wrap {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
width: 30px;
|
|
|
|
|
height: 30px;
|
|
|
|
|
background: rgba(80,122,253,.1);
|
|
|
|
|
background: rgba(80, 122, 253, .1);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
@ -1020,14 +910,17 @@ function approval() {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
line-height: 16px;
|
|
|
|
|
}
|
|
|
|
|
.tag-submiting{
|
|
|
|
|
|
|
|
|
|
.tag-submiting {
|
|
|
|
|
color: #feaf2d;
|
|
|
|
|
border: 1px solid #feaf2d;
|
|
|
|
|
}
|
|
|
|
|
.tag-approve{
|
|
|
|
|
|
|
|
|
|
.tag-approve {
|
|
|
|
|
color: #398ade;
|
|
|
|
|
border: 1px solid #398ade;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.tag-passed {
|
|
|
|
|
color: #02C984;
|
|
|
|
|
border: 1px solid #02C984;
|
|
|
|
@ -1178,7 +1071,7 @@ function approval() {
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
background-color: rgba(0,0,0,0.48);
|
|
|
|
|
background-color: rgba(0, 0, 0, 0.48);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|