From 83dcc8400ebd17f881366658d085342edbacb075 Mon Sep 17 00:00:00 2001 From: lizijiee <562949697@qq.com> Date: Fri, 29 Mar 2024 15:39:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E7=9B=B8?= =?UTF-8?q?=E4=BC=BC=E5=9B=BE=E7=89=87=E6=80=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/worksheet/aside/ListItem.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/worksheet/aside/ListItem.vue b/src/views/worksheet/aside/ListItem.vue index b9b4b06..10dac90 100644 --- a/src/views/worksheet/aside/ListItem.vue +++ b/src/views/worksheet/aside/ListItem.vue @@ -46,6 +46,7 @@ onMounted(async () => { {{ listItem.name }} + ({{ listItem.pictureCount }}) From 800d898e87d85c434711ca62a1ec1839fd26f84b Mon Sep 17 00:00:00 2001 From: lizijiee <562949697@qq.com> Date: Fri, 29 Mar 2024 19:03:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E6=B5=81=E7=A8=8B=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/work/work.ts | 4 +- src/views/worksheet/content/Content.vue | 77 ++++++++++--------------- types/workorder.d.ts | 1 + 3 files changed, 34 insertions(+), 48 deletions(-) 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() +} @@ -547,7 +534,6 @@ function approval() { - 任务包图片 @@ -615,6 +601,7 @@ function approval() { + 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 }