diff --git a/src/api/work/work.ts b/src/api/work/work.ts index a9dc373..70e76c3 100644 --- a/src/api/work/work.ts +++ b/src/api/work/work.ts @@ -95,11 +95,10 @@ export async function getTaskDetailPictureList(params: PageParam & PictureSortPa // 精简一下数据 const list = records.map((item,index) => { - return { id: item.id, taskId: item.taskId, - taskname: item.fromtaskname, + taskname: item.fromTaskName, assignee: item.assignee, pictureid: item.pictureid, imgurl: item.serverThumbnailUrl, @@ -113,7 +112,6 @@ export async function getTaskDetailPictureList(params: PageParam & PictureSortPa photoDateTimestamp:item.photoDateTimestamp, } }) - return { pageCount: pages, data: list, diff --git a/src/views/worksheet/content/Content.vue b/src/views/worksheet/content/Content.vue index e467427..14cae00 100644 --- a/src/views/worksheet/content/Content.vue +++ b/src/views/worksheet/content/Content.vue @@ -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(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() +} diff --git a/types/workorder.d.ts b/types/workorder.d.ts index 36781d1..e0fd016 100644 --- a/types/workorder.d.ts +++ b/types/workorder.d.ts @@ -16,6 +16,7 @@ export interface OrderState { activeId: string currentIndex: number packageList: PackageListItem[] + approvalList: any[] immersion: boolean }