elseif 1 year ago
commit 80a7151cbd

@ -32,10 +32,10 @@ const svgName = computed(() => {
<SvgIcon v-show="selected" size="14" name="more-ver" /> <SvgIcon v-show="selected" size="14" name="more-ver" />
</div> </div>
<ul class="list-item-detail"> <ul class="list-item-detail">
<li>审批状态<span class="list-item-status">{{ listItem.statshis }}</span></li> <li>审批状态<span class="list-item-status">{{ listItem.statshisText }}</span></li>
<li>审批节点{{ listItem.tasknamehis }}</li> <li>审批节点{{ listItem.tasknamehis }}</li>
<li>提交时间{{ format(new Date(), 'yyyy-MM-dd HH:mm:ss') }}</li> <li>提交时间{{ format(new Date(), 'yyyy-MM-dd HH:mm:ss') }}</li>
<li>提报人{{ listItem.fromuserid }}</li> <li>提报人{{ listItem.fromUserName }}</li>
</ul> </ul>
<div class="list-item-divider" /> <div class="list-item-divider" />

@ -1,21 +1,24 @@
<script lang="ts" setup> <script lang="ts" setup>
import { clone } from 'lodash-es' import { getAllfieldList } from "@/api/home/filter"
import { useDialog, useMessage } from 'naive-ui'
import { computed, onUnmounted, reactive, ref, unref, watch } from 'vue'
import { isEmpty } from '@/utils'
import BatchModal from '../modal/BatchModal.vue'
import { audit } from '@/api/task/task' import { audit } from '@/api/task/task'
import { getTaskDetailInfo, getTaskDetailPictureList } from '@/api/work/work' import { getTaskDetailInfo, getTaskDetailPictureList } from '@/api/work/work'
import { useTask } from '@/store/modules/task' import { useTask } from '@/store/modules/task'
import { useUser } from '@/store/modules/user' import { useUser } from '@/store/modules/user'
import { isEmpty } from '@/utils'
import { hideDownload } from '@/utils/image' import { hideDownload } from '@/utils/image'
import emitter from '@/utils/mitt' import emitter from '@/utils/mitt'
import _ from 'lodash'
import { clone } from 'lodash-es'
import { useDialog, useMessage } from 'naive-ui'
import { computed, onUnmounted, reactive, ref, unref, watch } from 'vue'
import BatchModal from '../modal/BatchModal.vue'
import ConfrimModal from '../modal/ConfrimModal.vue' import ConfrimModal from '../modal/ConfrimModal.vue'
import CustomSettingModal from '../modal/CustomSettingModal.vue' import CustomSettingModal from '../modal/CustomSettingModal.vue'
import PictureTable from './PictureTable.vue' import PictureTable from './PictureTable.vue'
import TaskTable from './TaskTable.vue' import TaskTable from './TaskTable.vue'
import type { ApprovalParam, PictureSortParam } from '/#/api' import type { ApprovalParam, PictureSortParam } from '/#/api'
const batch = ref(false) const batch = ref(false)
const selectItems = ref<any[]>([]) const selectItems = ref<any[]>([])
const message = useMessage() const message = useMessage()
@ -24,6 +27,7 @@ const confrimModalRef = ref(null)
const batchModalRef = ref(null) const batchModalRef = ref(null)
const totalCount = ref(0) const totalCount = ref(0)
const CustomSettingModalRef = ref(null) const CustomSettingModalRef = ref(null)
const taskTableData = ref<any[]>([])
const sortBy: PictureSortParam = { const sortBy: PictureSortParam = {
orderbyname: 'asc', orderbyname: 'asc',
@ -196,25 +200,50 @@ function backHandler() {
taskStore.back() taskStore.back()
} }
watch(() => [taskStore.activeId], async (newValue, oldValue) => { watch(
const packageid = taskStore.getPackageid () => [taskStore.activeId],
const taskId = taskStore.getActiveId async (newValue, oldValue) => {
const packageid = taskStore.getPackageid;
if (isEmpty(taskId)) const taskId = taskStore.getActiveId;
return
if (isEmpty(taskId)) return;
taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid)
let listData = [];
if (!isEmpty(packageid)) { taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid);
const { data, total } = await getTaskDetailPictureList(packageid, taskId, { ...taskpagination, ...sortBy }) const reviewType = 3; //
taskDetailPictureList.value = data let res = await getAllfieldList(reviewType);
totalCount.value = total let fieldList = (res as any)?.data;
} console.log(taskDetailInfo.value, "taskDetailInfo");
else { console.log(fieldList, "fieldList");
taskDetailPictureList.value.length = 0 let showFieldData = taskDetailInfo.value.ocrPicture;
totalCount.value = 0 let showFieldKeys = Object.keys(showFieldData);
for (let i in showFieldKeys) {
let key = showFieldKeys[i];
let currentData = fieldList.find((v) => v.name == key);
if (currentData) {
let item = {
label: currentData.fieldDesc,
value: taskDetailInfo.value.ocrPicture[key],
key: currentData.name,
};
listData.push(item);
}
}
taskTableData.value = _.chunk(listData,2);
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;
}
} }
}) )
const currentTaskId = computed(() => { const currentTaskId = computed(() => {
const index = taskStore.getCurrentIndex const index = taskStore.getCurrentIndex
@ -402,7 +431,7 @@ function getPercent(pictureid: string) {
</div> </div>
<n-tabs type="line" animated> <n-tabs type="line" animated>
<n-tab-pane name="task-info" tab="任务信息"> <n-tab-pane name="task-info" tab="任务信息">
<TaskTable :data="taskDetailInfo" /> <TaskTable :data="taskDetailInfo" :taskTableData="taskTableData"/>
</n-tab-pane> </n-tab-pane>
<n-tab-pane name="picture-info" tab="图片信息"> <n-tab-pane name="picture-info" tab="图片信息">
<PictureTable :data="taskDetailInfo" /> <PictureTable :data="taskDetailInfo" />

@ -1,5 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
defineProps({ import { onMounted } from "vue";
const props = defineProps({
data: { data: {
type: Object as PropType<any>, type: Object as PropType<any>,
required: true, required: true,
@ -9,15 +11,18 @@ defineProps({
default: () => [[]], default: () => [[]],
}, },
}); });
onMounted(()=>{
console.log(props.taskTableData,'taskTableData')
})
</script> </script>
<template> <template>
<table class="description"> <table class="description">
<tr v-for="(item, index) in taskTableData" :key="index"> <tr v-for="(item, index) in taskTableData" :key="index">
<th>{{ item[0]["label"] }}</th> <th v-if="item&&item[0]">{{ item[0]["label"] }}</th>
<td>{{ item[0]["value"] }}</td> <td v-if="item&&item[0]">{{ item[0]["value"] }}</td>
<th v-if="item.length>1">{{ item[1]["label"] }}</th> <th v-if="item&&item.length>1">{{ item[1]["label"] }}</th>
<td v-if="item.length>1">{{ item[1]["value"] }}</td> <td v-if="item&&item.length>1">{{ item[1]["value"] }}</td>
</tr> </tr>
</table> </table>
</template> </template>

Loading…
Cancel
Save