Merge pull request 'jie' (#8) from jie into test

Reviewed-on: #8
pull/10/head
yaoshuli 1 year ago
commit 8d48cd92b4

@ -95,11 +95,10 @@ export async function getTaskDetailPictureList(params: PageParam & PictureSortPa
// 精简一下数据 // 精简一下数据
const list = records.map((item,index) => { const list = records.map((item,index) => {
return { return {
id: item.id, id: item.id,
taskId: item.taskId, taskId: item.taskId,
taskname: item.fromtaskname, taskname: item.fromTaskName,
assignee: item.assignee, assignee: item.assignee,
pictureid: item.pictureid, pictureid: item.pictureid,
imgurl: item.serverThumbnailUrl, imgurl: item.serverThumbnailUrl,
@ -113,7 +112,6 @@ export async function getTaskDetailPictureList(params: PageParam & PictureSortPa
photoDateTimestamp:item.photoDateTimestamp, photoDateTimestamp:item.photoDateTimestamp,
} }
}) })
return { return {
pageCount: pages, pageCount: pages,
data: list, data: list,

@ -46,6 +46,7 @@ onMounted(async () => {
<SvgIcon :name="svgName" size="28" /> <SvgIcon :name="svgName" size="28" />
<span class="list-item-header-name" :class="{ 'list-item-header-selected': selected }"> <span class="list-item-header-name" :class="{ 'list-item-header-selected': selected }">
{{ listItem.name }} {{ listItem.name }}
<span class="list-item-header-selected">({{ listItem.pictureCount }})</span>
</span> </span>
</div> </div>
</div> </div>

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

@ -16,6 +16,7 @@ export interface OrderState {
activeId: string activeId: string
currentIndex: number currentIndex: number
packageList: PackageListItem[] packageList: PackageListItem[]
approvalList: any[]
immersion: boolean immersion: boolean
} }

Loading…
Cancel
Save