diff --git a/src/assets/icons/task-batch.svg b/src/assets/icons/task-batch.svg new file mode 100644 index 0000000..e967650 --- /dev/null +++ b/src/assets/icons/task-batch.svg @@ -0,0 +1,11 @@ + + + B-复选框 + + + + + + + + \ No newline at end of file diff --git a/src/components/Approval/NotPassed.vue b/src/components/Approval/NotPassed.vue new file mode 100644 index 0000000..baef5f7 --- /dev/null +++ b/src/components/Approval/NotPassed.vue @@ -0,0 +1,217 @@ + + + + + diff --git a/src/enums/index.ts b/src/enums/index.ts index 403b59e..4df77b2 100644 --- a/src/enums/index.ts +++ b/src/enums/index.ts @@ -1,7 +1,6 @@ // 任务审核状态 export const TASK_STATUS_OBJ = { - 1: '未提交', - 2: '待审批', - 3: '通过', - 4: '不通过', + 1: '待审批', + 2: '通过', + 3: '不通过', } as any diff --git a/src/views/task/aside/ListItem.vue b/src/views/task/aside/ListItem.vue index 9c6184f..7dfba1e 100644 --- a/src/views/task/aside/ListItem.vue +++ b/src/views/task/aside/ListItem.vue @@ -18,8 +18,7 @@ const props = defineProps({ default: () => [], }, }) -console.log(props.showFieldList) -console.log(props.listItem) + const svgName = computed(() => { return props.selected ? 'task-select' : 'task' }) diff --git a/src/views/task/content/Content.vue b/src/views/task/content/Content.vue index 73bd0f5..fabd7cb 100644 --- a/src/views/task/content/Content.vue +++ b/src/views/task/content/Content.vue @@ -3,12 +3,12 @@ import { computed, onMounted, onUnmounted, reactive, ref, unref, watch } from 'v import { chunk, clone } from 'lodash-es' import { useDialog, useMessage } from 'naive-ui' import { useRoute } from 'vue-router' +import NotPassed from '@/components/Approval/NotPassed.vue' import BatchModal from '../modal/BatchModal.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 { getTaskDetailPictureList } from '@/api/work/work' import { useTask } from '@/store/modules/task' import { useUser } from '@/store/modules/user' import { isEmpty } from '@/utils' @@ -20,13 +20,13 @@ import CustomSettingModal from '../modal/CustomSettingModal.vue' import PictureTable from './PictureTable.vue' import TaskTable from './TaskTable.vue' import History from './History.vue' -import type { ApprovalParam, PictureSortParam } from '/#/api' +import type { ApprovalParam } from '/#/api' const batch = ref(false) const selectItems = ref([]) const message = useMessage() const dialog = useDialog() -const confrimModalRef = ref(null) +const notPassModalRef = ref(null) const batchModalRef = ref(null) const totalCount = ref(0) const CustomSettingModalRef = ref(null) @@ -58,8 +58,6 @@ function onCheckChange(checked: any, item: any) { if (index === -1 && checked) selectItems.value.push(item) else selectItems.value.splice(index, 1) - - console.log(selectItems.value.map(item => item.id)) } const showActions = computed(() => { @@ -98,19 +96,7 @@ function handleKeydown(event) { async function getDetail(taskId, packageid) { taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid) getTableData() - if (!isEmpty(packageid)) { - const { data, total } = await getTaskDetailPictureList( - packageid, - taskId, - { ...taskpagination, ...sortBy }, - ) - taskDetailPictureList.value = data - totalCount.value = total - } - else { - taskDetailPictureList.value.length = 0 - totalCount.value = 0 - } + getImgList() } // states:1未提交,2待审批,3通过,4不通过 function validate(items: any[]) { @@ -187,7 +173,7 @@ function rejectHandler(items?: any) { return } - const modal = unref(confrimModalRef)! as any + const modal = unref(notPassModalRef)! as any modal.showModal() } @@ -283,54 +269,35 @@ async function getTableData() { taskTableData.value = chunk(listData, 2) } +async function getImgList() { + if (!isEmpty(taskDetailInfo.value.ocrPicture.id)) { + const { data, total } = await getSimilarityList( + { + ...taskpagination, + ...sortBy, + pictureId: taskDetailInfo.value.ocrPicture.id, + }, + ) + taskDetailPictureList.value = data + totalCount.value = total + } + else { + taskDetailPictureList.value.length = 0 + totalCount.value = 0 + } +} + watch( () => [taskStore.activeId], - async (newValue, oldValue) => { + async () => { const packageid = taskStore.getPackageid const taskId = taskStore.getActiveId - console.log(packageid) - console.log(taskId) setBatch(false) - if (isEmpty(taskId)) return taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid) - console.log(taskDetailInfo.value) getTableData() - // TODO mock备份 确认逻辑无误后删除 - // let showFieldData = taskDetailInfo.value.ocrPicture; - // let showFieldKeys = Object.keys(showFieldData); - // for (let i in showFieldKeys) { - // let key = showFieldKeys[i]; - // let hasKey = userFieldList.indexOf(key) > -1; - // if (hasKey) { - // let currentData = fieldList.find((v) => v.name == key); - // if (currentData) { - // console.log(fieldList, key, "currentData"); - // console.log(currentData, "currentData222"); - // let item = { - // label: currentData.fieldDesc, - // value: taskDetailInfo.value.ocrPicture[key], - // key: currentData.name, - // }; - // listData.push(item); - // } - // } - // } - if (!isEmpty(taskDetailInfo.value.ocrPicture.id)) { - const { data, total } = await getSimilarityList( - { pictureId: taskDetailInfo.value.ocrPicture.id, ...taskpagination, ...sortBy }, - ) - console.log(data) - - taskDetailPictureList.value = data - console.log(taskDetailPictureList.value) - totalCount.value = total - } - else { - taskDetailPictureList.value.length = 0 - totalCount.value = 0 - } + getImgList() }, ) @@ -376,16 +343,6 @@ function previewHandler(event: MouseEvent) { if (imageRef.value && (imageRef.value as any).src) (imageRef.value as any).mergedOnClick() } - -function getPercent(pictureid: string) { - const { ocpictureid, pictureresult } = taskDetailInfo.value - const splitId = ocpictureid || '' - const index = splitId.split(',').indexOf(String(pictureid)) - const results = (pictureresult || '').split(',') - const percent = results[index] || '0' - const val = Number.parseFloat(percent) - return `${val}%` -}