|
|
|
@ -1,28 +1,28 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { computed, onMounted, onUnmounted, reactive, ref, unref, watch } from "vue";
|
|
|
|
|
import { chunk, clone } from "lodash-es";
|
|
|
|
|
import { useDialog, useMessage } from "naive-ui";
|
|
|
|
|
import { useRoute } from "vue-router";
|
|
|
|
|
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";
|
|
|
|
|
import { computed, onMounted, onUnmounted, reactive, ref, unref, watch } from 'vue'
|
|
|
|
|
import { chunk, clone } from 'lodash-es'
|
|
|
|
|
import { useDialog, useMessage } from 'naive-ui'
|
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
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'
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
audit,
|
|
|
|
|
dubiousfileyd,
|
|
|
|
|
getSimilarityList,
|
|
|
|
|
getTaskDetailInfo,
|
|
|
|
|
} from "@/api/task/task";
|
|
|
|
|
import { useTask } from "@/store/modules/task";
|
|
|
|
|
import { useUser } from "@/store/modules/user";
|
|
|
|
|
import { isEmpty } from "@/utils";
|
|
|
|
|
import { formatToDateHMS } from "@/utils/dateUtil";
|
|
|
|
|
import { hideDownload } from "@/utils/image";
|
|
|
|
|
} from '@/api/task/task'
|
|
|
|
|
import { useTask } from '@/store/modules/task'
|
|
|
|
|
import { useUser } from '@/store/modules/user'
|
|
|
|
|
import { isEmpty } from '@/utils'
|
|
|
|
|
import { formatToDateHMS } from '@/utils/dateUtil'
|
|
|
|
|
import { hideDownload } from '@/utils/image'
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['setAsideItemName'])
|
|
|
|
|
const batch = ref(false)
|
|
|
|
@ -39,57 +39,61 @@ const taskTableData = ref<any[]>([])
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
|
|
|
|
|
const sortBy: any = {
|
|
|
|
|
orderType: "desc",
|
|
|
|
|
orderName: "similarityScore",
|
|
|
|
|
};
|
|
|
|
|
orderType: 'desc',
|
|
|
|
|
orderName: 'similarityScore',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setBatch(value: boolean) {
|
|
|
|
|
if (totalCount.value === 0) return;
|
|
|
|
|
if (totalCount.value === 0)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
batch.value = value;
|
|
|
|
|
batch.value = value
|
|
|
|
|
|
|
|
|
|
if (value === false)
|
|
|
|
|
selectItems.value = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onCheckChange(checked: any, item: any) {
|
|
|
|
|
const index = selectItems.value.indexOf(item);
|
|
|
|
|
item.checked = checked;
|
|
|
|
|
const index = selectItems.value.indexOf(item)
|
|
|
|
|
item.checked = checked
|
|
|
|
|
|
|
|
|
|
if (index === -1 && checked) selectItems.value.push(item);
|
|
|
|
|
else selectItems.value.splice(index, 1);
|
|
|
|
|
if (index === -1 && checked)
|
|
|
|
|
selectItems.value.push(item)
|
|
|
|
|
else selectItems.value.splice(index, 1)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const showActions = computed(() => {
|
|
|
|
|
return selectItems.value.length > 0 && batch;
|
|
|
|
|
});
|
|
|
|
|
return selectItems.value.length > 0 && batch
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const taskpagination = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
});
|
|
|
|
|
const taskStore = useTask();
|
|
|
|
|
const overTask = ref<any>(null);
|
|
|
|
|
const taskDetailInfo = ref<any>({});
|
|
|
|
|
const taskDetailPictureList = ref<any[]>([]);
|
|
|
|
|
const userStore = useUser();
|
|
|
|
|
const imageRef = ref<ComponentElRef | null>();
|
|
|
|
|
let processItems: any[] = [];
|
|
|
|
|
})
|
|
|
|
|
const taskStore = useTask()
|
|
|
|
|
const overTask = ref<any>(null)
|
|
|
|
|
const taskDetailInfo = ref<any>({})
|
|
|
|
|
const taskDetailPictureList = ref<any[]>([])
|
|
|
|
|
const userStore = useUser()
|
|
|
|
|
const imageRef = ref<ComponentElRef | null>()
|
|
|
|
|
let processItems: any[] = []
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
window.addEventListener("keydown", handleKeydown);
|
|
|
|
|
window.addEventListener('keydown', handleKeydown)
|
|
|
|
|
if (route.query.id) {
|
|
|
|
|
taskId.value = route.query.id;
|
|
|
|
|
packageId.value = route.query.packageid;
|
|
|
|
|
getDetail();
|
|
|
|
|
taskId.value = route.query.id
|
|
|
|
|
packageId.value = route.query.packageid
|
|
|
|
|
getDetail()
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 键盘左右箭头快捷切换
|
|
|
|
|
function handleKeydown(event) {
|
|
|
|
|
if (event.key === "ArrowLeft") backHandler();
|
|
|
|
|
if (event.key === 'ArrowLeft')
|
|
|
|
|
backHandler()
|
|
|
|
|
// 在这里执行左箭头的逻辑
|
|
|
|
|
else if (event.key === "ArrowRight") forwardHandler();
|
|
|
|
|
else if (event.key === 'ArrowRight')
|
|
|
|
|
forwardHandler()
|
|
|
|
|
// 在这里执行右箭头的逻辑
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -101,7 +105,8 @@ function currentTaskId() {
|
|
|
|
|
|
|
|
|
|
// states:1未提交,2待审批,3通过,4不通过
|
|
|
|
|
function validate(items: any[]) {
|
|
|
|
|
if (items.length === 0) return "至少选中一个任务";
|
|
|
|
|
if (items.length === 0)
|
|
|
|
|
return '至少选中一个任务'
|
|
|
|
|
|
|
|
|
|
// const useInfo = userStore.getUserInfo
|
|
|
|
|
// const username = useInfo.loginname
|
|
|
|
@ -118,56 +123,58 @@ function validate(items: any[]) {
|
|
|
|
|
// return '审批人不一致'
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function approvalHandler(items?: any) {
|
|
|
|
|
let cloneItem: any;
|
|
|
|
|
let cloneItem: any
|
|
|
|
|
if (batch.value) {
|
|
|
|
|
processItems = selectItems.value;
|
|
|
|
|
} else if (overTask.value) {
|
|
|
|
|
cloneItem = clone(overTask.value);
|
|
|
|
|
processItems = [cloneItem];
|
|
|
|
|
processItems = selectItems.value
|
|
|
|
|
}
|
|
|
|
|
else if (overTask.value) {
|
|
|
|
|
cloneItem = clone(overTask.value)
|
|
|
|
|
processItems = [cloneItem]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (items !== undefined && !(items instanceof PointerEvent)) processItems = items;
|
|
|
|
|
if (items !== undefined && !(items instanceof PointerEvent))
|
|
|
|
|
processItems = items
|
|
|
|
|
|
|
|
|
|
const msg = validate(processItems);
|
|
|
|
|
const msg = validate(processItems)
|
|
|
|
|
|
|
|
|
|
if (msg !== null) {
|
|
|
|
|
message.error(msg);
|
|
|
|
|
return;
|
|
|
|
|
message.error(msg)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const list: any = [];
|
|
|
|
|
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: "",
|
|
|
|
|
comment: '',
|
|
|
|
|
disposeType: '',
|
|
|
|
|
disposeTypeId: '',
|
|
|
|
|
failCauseId: '',
|
|
|
|
|
failCauseName: '',
|
|
|
|
|
flowTaskInfoList: list,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dialog.info({
|
|
|
|
|
title: "确认提示",
|
|
|
|
|
content: "确认给该任务审批为【通过】吗?",
|
|
|
|
|
positiveText: "确定",
|
|
|
|
|
negativeText: "取消",
|
|
|
|
|
title: '确认提示',
|
|
|
|
|
content: '确认给该任务审批为【通过】吗?',
|
|
|
|
|
positiveText: '确定',
|
|
|
|
|
negativeText: '取消',
|
|
|
|
|
onPositiveClick: () => {
|
|
|
|
|
doAudit(param);
|
|
|
|
|
doAudit(param)
|
|
|
|
|
},
|
|
|
|
|
onNegativeClick: () => {},
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function rejectHandler(items?: any) {
|
|
|
|
@ -188,53 +195,54 @@ function doAudit(param: any) {
|
|
|
|
|
setBatch(false)
|
|
|
|
|
reloadList(param, '通过')
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showModal(modalRef: any) {
|
|
|
|
|
const modal = unref(modalRef)! as any;
|
|
|
|
|
modal.showModal();
|
|
|
|
|
const modal = unref(modalRef)! as any
|
|
|
|
|
modal.showModal()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function forwardHandler() {
|
|
|
|
|
taskStore.forward();
|
|
|
|
|
taskStore.forward()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function backHandler() {
|
|
|
|
|
taskStore.back();
|
|
|
|
|
taskStore.back()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function handleDragEnd(event, item) {
|
|
|
|
|
// 可以在这里添加拖拽结束后的逻辑
|
|
|
|
|
const flag = taskStore.getInFile;
|
|
|
|
|
const flag = taskStore.getInFile
|
|
|
|
|
if (flag) {
|
|
|
|
|
const res = await dubiousfileyd({ pictureid: item.pictureid });
|
|
|
|
|
if (res.code === "OK") {
|
|
|
|
|
message.success("加入成功");
|
|
|
|
|
getTableData();
|
|
|
|
|
} else {
|
|
|
|
|
message.error(res.message);
|
|
|
|
|
const res = await dubiousfileyd({ pictureid: item.pictureId })
|
|
|
|
|
if (res.code === 'OK') {
|
|
|
|
|
message.success('加入成功')
|
|
|
|
|
getTableData()
|
|
|
|
|
}
|
|
|
|
|
taskStore.setInFile(false);
|
|
|
|
|
else {
|
|
|
|
|
message.error(res.message)
|
|
|
|
|
}
|
|
|
|
|
taskStore.setInFile(false)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function getTableData() {
|
|
|
|
|
const useInfo = userStore.getUserInfo;
|
|
|
|
|
const listData = [];
|
|
|
|
|
const reviewType = 3; // 类型
|
|
|
|
|
let res = await getAllfieldList(reviewType);
|
|
|
|
|
const fieldList = (res as any)?.data;
|
|
|
|
|
res = await getfieldList(reviewType, useInfo.id);
|
|
|
|
|
const userFieldList = (res as any)?.data.userFieldFixed;
|
|
|
|
|
const useInfo = userStore.getUserInfo
|
|
|
|
|
const listData = []
|
|
|
|
|
const reviewType = 3 // 类型
|
|
|
|
|
let res = await getAllfieldList(reviewType)
|
|
|
|
|
const fieldList = (res as any)?.data
|
|
|
|
|
res = await getfieldList(reviewType, useInfo.id)
|
|
|
|
|
const userFieldList = (res as any)?.data.userFieldFixed
|
|
|
|
|
const blueList = [
|
|
|
|
|
"拜访终端名称",
|
|
|
|
|
"定位信息",
|
|
|
|
|
"拜访日期",
|
|
|
|
|
"定位距离",
|
|
|
|
|
"拜访小结",
|
|
|
|
|
"拜访项目类别",
|
|
|
|
|
];
|
|
|
|
|
'拜访终端名称',
|
|
|
|
|
'定位信息',
|
|
|
|
|
'拜访日期',
|
|
|
|
|
'定位距离',
|
|
|
|
|
'拜访小结',
|
|
|
|
|
'拜访项目类别',
|
|
|
|
|
]
|
|
|
|
|
fieldList.map((v) => {
|
|
|
|
|
if (userFieldList.includes(v.name)) {
|
|
|
|
|
const item = {
|
|
|
|
@ -242,11 +250,11 @@ async function getTableData() {
|
|
|
|
|
value: taskDetailInfo.value.ocrPicture[v.name],
|
|
|
|
|
key: v.name,
|
|
|
|
|
blue: blueList.includes(v.fieldDesc),
|
|
|
|
|
};
|
|
|
|
|
listData.push(item);
|
|
|
|
|
}
|
|
|
|
|
listData.push(item)
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
taskTableData.value = chunk(listData, 2);
|
|
|
|
|
})
|
|
|
|
|
taskTableData.value = chunk(listData, 2)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function getImgList() {
|
|
|
|
@ -255,49 +263,51 @@ async function getImgList() {
|
|
|
|
|
...taskpagination,
|
|
|
|
|
...sortBy,
|
|
|
|
|
pictureId: taskDetailInfo.value.ocrPicture.id,
|
|
|
|
|
});
|
|
|
|
|
taskDetailPictureList.value = data;
|
|
|
|
|
totalCount.value = total;
|
|
|
|
|
} else {
|
|
|
|
|
taskDetailPictureList.value.length = 0;
|
|
|
|
|
totalCount.value = 0;
|
|
|
|
|
})
|
|
|
|
|
taskDetailPictureList.value = data
|
|
|
|
|
totalCount.value = total
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
taskDetailPictureList.value.length = 0
|
|
|
|
|
totalCount.value = 0
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function overTaskHandle() {
|
|
|
|
|
const item = taskDetailInfo.value;
|
|
|
|
|
const item = taskDetailInfo.value
|
|
|
|
|
if (item?.userapprove?.statshis === 2 || item?.userapprove?.statshis == 3) {
|
|
|
|
|
overTask.value = null;
|
|
|
|
|
return;
|
|
|
|
|
overTask.value = null
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (validate([item]) == null && batch.value === false) overTask.value = item;
|
|
|
|
|
if (validate([item]) == null && batch.value === false)
|
|
|
|
|
overTask.value = item
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function leaveTaskHandler() {
|
|
|
|
|
overTask.value = null;
|
|
|
|
|
overTask.value = null
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function showActionsModal() {
|
|
|
|
|
const modal = unref(CustomSettingModalRef)! as any;
|
|
|
|
|
modal.showModal();
|
|
|
|
|
const modal = unref(CustomSettingModalRef)! as any
|
|
|
|
|
modal.showModal()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
taskStore.reset();
|
|
|
|
|
window.removeEventListener("keydown", handleKeydown);
|
|
|
|
|
});
|
|
|
|
|
taskStore.reset()
|
|
|
|
|
window.removeEventListener('keydown', handleKeydown)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function immersionHandler() {
|
|
|
|
|
taskStore.updateImmersion();
|
|
|
|
|
taskStore.updateImmersion()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function previewHandler(event: MouseEvent) {
|
|
|
|
|
event.stopImmediatePropagation();
|
|
|
|
|
event.stopPropagation();
|
|
|
|
|
event.stopImmediatePropagation()
|
|
|
|
|
event.stopPropagation()
|
|
|
|
|
|
|
|
|
|
if (imageRef.value && (imageRef.value as any).src)
|
|
|
|
|
(imageRef.value as any).mergedOnClick();
|
|
|
|
|
(imageRef.value as any).mergedOnClick()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
@ -313,10 +323,10 @@ watch(
|
|
|
|
|
|
|
|
|
|
// 获取数据
|
|
|
|
|
async function getDetail() {
|
|
|
|
|
taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value);
|
|
|
|
|
setBatch(false);
|
|
|
|
|
getTableData();
|
|
|
|
|
getImgList();
|
|
|
|
|
taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value)
|
|
|
|
|
setBatch(false)
|
|
|
|
|
getTableData()
|
|
|
|
|
getImgList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function reloadList(param, text) {
|
|
|
|
@ -386,14 +396,14 @@ function reloadList(param, text) {
|
|
|
|
|
src="@/assets/images/task/btn-not-pass.png"
|
|
|
|
|
alt=""
|
|
|
|
|
@click.stop="rejectHandler"
|
|
|
|
|
/>
|
|
|
|
|
>
|
|
|
|
|
<SvgIcon size="24" name="vs" />
|
|
|
|
|
<img
|
|
|
|
|
class="btn-approval"
|
|
|
|
|
src="@/assets/images/task/btn-pass.png"
|
|
|
|
|
alt=""
|
|
|
|
|
@click.stop="approvalHandler"
|
|
|
|
|
/>
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -438,13 +448,13 @@ function reloadList(param, text) {
|
|
|
|
|
class="img-status"
|
|
|
|
|
src="@/assets/images/task/pass.png"
|
|
|
|
|
alt=""
|
|
|
|
|
/>
|
|
|
|
|
>
|
|
|
|
|
<img
|
|
|
|
|
v-show="taskDetailInfo?.userapprove?.statshis === 3"
|
|
|
|
|
class="img-status"
|
|
|
|
|
src="@/assets/images/task/not_pass.png"
|
|
|
|
|
alt=""
|
|
|
|
|
/>
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mark">
|
|
|
|
|
<SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 0" size="128" name="jia" />
|
|
|
|
@ -460,7 +470,7 @@ function reloadList(param, text) {
|
|
|
|
|
<n-grid x-gap="12" y-gap="10" :cols="12">
|
|
|
|
|
<n-gi span="4" class="gi1">
|
|
|
|
|
<span>
|
|
|
|
|
<img class="icon-status" src="@/assets/images/task/status.png" alt="" />
|
|
|
|
|
<img class="icon-status" src="@/assets/images/task/status.png" alt="">
|
|
|
|
|
</span>
|
|
|
|
|
</n-gi>
|
|
|
|
|
<n-gi span="8" class="gi2">
|
|
|
|
@ -475,7 +485,7 @@ function reloadList(param, text) {
|
|
|
|
|
class="icon-status"
|
|
|
|
|
src="@/assets/images/task/similarity.png"
|
|
|
|
|
alt=""
|
|
|
|
|
/>
|
|
|
|
|
>
|
|
|
|
|
</span>
|
|
|
|
|
</n-gi>
|
|
|
|
|
<n-gi span="8" class="gi2">
|
|
|
|
@ -541,13 +551,13 @@ function reloadList(param, text) {
|
|
|
|
|
class="tag-status"
|
|
|
|
|
src="@/assets/images/task/tag-pass.png"
|
|
|
|
|
alt=""
|
|
|
|
|
/>
|
|
|
|
|
>
|
|
|
|
|
<img
|
|
|
|
|
v-if="item.historyStates === 3"
|
|
|
|
|
class="tag-status"
|
|
|
|
|
src="@/assets/images/task/tag-not-pass.png"
|
|
|
|
|
alt=""
|
|
|
|
|
/>
|
|
|
|
|
>
|
|
|
|
|
<div class="time">
|
|
|
|
|
<div class="time-item">
|
|
|
|
|
<SvgIcon class="svg-time" color="#FFF" size="8" name="camera-time" />
|
|
|
|
|