|
|
|
@ -4,6 +4,7 @@ import {
|
|
|
|
|
getTaskDetailInfo,
|
|
|
|
|
getTaskDetailPictureList
|
|
|
|
|
} from "@/api/work/work";
|
|
|
|
|
import NotPassed from '@/components/Approval/NotPassed.vue';
|
|
|
|
|
import { fieldMap } from "@/config/workorder";
|
|
|
|
|
import { TASK_STATUS_OBJ } from '@/enums/index';
|
|
|
|
|
import { useWorkOrder } from "@/store/modules/workOrder";
|
|
|
|
@ -47,10 +48,6 @@ const showActions = computed(() => {
|
|
|
|
|
return selectItems.value.length > 0 && batch;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const packagepagination = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
});
|
|
|
|
|
const taskpagination = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
@ -70,6 +67,7 @@ const loading = ref(false);
|
|
|
|
|
const el = ref<HTMLDivElement | null>(null);
|
|
|
|
|
const selectedSortName = ref('');
|
|
|
|
|
const isFullScreen = ref(false);
|
|
|
|
|
const notPassModalRef = ref(null)
|
|
|
|
|
|
|
|
|
|
let canloadMore = true;
|
|
|
|
|
|
|
|
|
@ -134,7 +132,7 @@ async function featchList() {
|
|
|
|
|
try {
|
|
|
|
|
taskpagination.pageNo += 1;
|
|
|
|
|
const { data, total, pageCount } = await getTaskDetailPictureList(
|
|
|
|
|
{ ...taskpagination, ...sortBy, checkDuplicateId: workStore.activeId, pictureId: taskDetailInfo.value.pictureid}
|
|
|
|
|
{ ...taskpagination, ...sortBy, checkDuplicateId: workStore.activeId, pictureId: taskDetailInfo.value.pictureid }
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
totalCount.value = total;
|
|
|
|
@ -188,6 +186,7 @@ watch(
|
|
|
|
|
async (newValue, oldValue) => {
|
|
|
|
|
const packageid = workStore.getActiveId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isEmpty(packageid)) {
|
|
|
|
|
listData.value.length = 0;
|
|
|
|
|
totalCount.value = 0;
|
|
|
|
@ -229,7 +228,7 @@ async function handleSelect(item: any) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
refreshHandler();
|
|
|
|
|
// refreshHandler();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function sortHandler(orderby: "similarityScore" | "createdate") {
|
|
|
|
@ -247,7 +246,7 @@ const propertys = computed(() => {
|
|
|
|
|
return v;
|
|
|
|
|
});
|
|
|
|
|
function overTaskHandelr(item: any) {
|
|
|
|
|
if (item?.userapprove?.statshis === 2 || item?.userapprove?.statshis == 3) {
|
|
|
|
|
if (item?.historyStates === 2 || item?.historyStates == 3) {
|
|
|
|
|
overTask.value = null;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -285,28 +284,9 @@ function previewHandler(event: MouseEvent) {
|
|
|
|
|
if (imageRef.value && (imageRef.value as any).src)
|
|
|
|
|
(imageRef.value as any).mergedOnClick();
|
|
|
|
|
}
|
|
|
|
|
function rejectHandler(items?: any) {
|
|
|
|
|
let cloneItem: any
|
|
|
|
|
if (batch.value) {
|
|
|
|
|
processItems = selectItems.value
|
|
|
|
|
}
|
|
|
|
|
else if (overTask.value) {
|
|
|
|
|
cloneItem = clone(overTask.value)
|
|
|
|
|
processItems = [cloneItem]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (items !== undefined && !(items instanceof PointerEvent))
|
|
|
|
|
processItems = items
|
|
|
|
|
|
|
|
|
|
const msg = validate(processItems)
|
|
|
|
|
|
|
|
|
|
if (msg !== null) {
|
|
|
|
|
message.error(msg)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const modal = unref(confrimModalRef)! as any
|
|
|
|
|
modal.showModal()
|
|
|
|
|
function rejectHandler() {
|
|
|
|
|
const modal = unref(notPassModalRef)! as any
|
|
|
|
|
modal.showModal(selectItems.value)
|
|
|
|
|
}
|
|
|
|
|
function reject(idOrDesc: string, backId: string, isOther: boolean) {
|
|
|
|
|
const formIds: string[] = processItems.map(item => item.id)
|
|
|
|
@ -323,30 +303,23 @@ function reject(idOrDesc: string, backId: string, isOther: boolean) {
|
|
|
|
|
|
|
|
|
|
doAudit(param)
|
|
|
|
|
}
|
|
|
|
|
function doAudit(param: any) {
|
|
|
|
|
audit(param).then((res) => {
|
|
|
|
|
const { code } = res
|
|
|
|
|
setBatch(false)
|
|
|
|
|
if (code === 'OK') {
|
|
|
|
|
emitter.emit('refresh')
|
|
|
|
|
refreshHandler()
|
|
|
|
|
}
|
|
|
|
|
else message.error(res.message)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function approvalHandler(items?: any) {
|
|
|
|
|
let cloneItem: any
|
|
|
|
|
if (batch.value) {
|
|
|
|
|
processItems = selectItems.value
|
|
|
|
|
}
|
|
|
|
|
else if (overTask.value) {
|
|
|
|
|
// 主图点击 => 点击 => 通过/不通过按钮
|
|
|
|
|
cloneItem = clone(overTask.value)
|
|
|
|
|
// 接口问题,暂时先这样处理
|
|
|
|
|
// if (!cloneItem.taskId) {
|
|
|
|
|
// cloneItem.taskId = "taskIdtaskIdtaskIdtaskIdtaskId"
|
|
|
|
|
// }
|
|
|
|
|
processItems = [cloneItem]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 任务包图片 => 点击 => 通过/不通过按钮
|
|
|
|
|
if (items !== undefined && !(items instanceof PointerEvent))
|
|
|
|
|
processItems = items
|
|
|
|
|
processItems = [items]
|
|
|
|
|
|
|
|
|
|
const msg = validate(processItems)
|
|
|
|
|
|
|
|
|
@ -370,7 +343,6 @@ 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,
|
|
|
|
@ -381,6 +353,21 @@ function approval() {
|
|
|
|
|
|
|
|
|
|
doAudit(param)
|
|
|
|
|
}
|
|
|
|
|
function doAudit(param: any) {
|
|
|
|
|
audit(param).then((res) => {
|
|
|
|
|
const { code } = res
|
|
|
|
|
setBatch(false)
|
|
|
|
|
if (code === 'OK') {
|
|
|
|
|
emitter.emit('refresh')
|
|
|
|
|
refreshHandler()
|
|
|
|
|
}
|
|
|
|
|
else message.error(res.message)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function reloadList() {
|
|
|
|
|
loadMore()
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
@ -547,7 +534,6 @@ function approval() {
|
|
|
|
|
</div>
|
|
|
|
|
<div style="display: flex; justify-content: space-between; padding: 12px 0px 3px 0">
|
|
|
|
|
<div>
|
|
|
|
|
<!-- <span style="font-size: 21px; font-weight: bold">任务包图片</span><span>({{ totalCount }})</span> -->
|
|
|
|
|
<span
|
|
|
|
|
style="font-size: 18px; font-weight: Medium;color: #333333;font-family: PingFang SC, PingFang SC-Medium;">任务包图片</span>
|
|
|
|
|
</div>
|
|
|
|
@ -615,6 +601,7 @@ function approval() {
|
|
|
|
|
</div>
|
|
|
|
|
</n-spin>
|
|
|
|
|
<ConfrimModal ref="confrimModalRef" @commit="reject" />
|
|
|
|
|
<NotPassed ref="notPassModalRef" @success="reloadList" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|