elseif 1 year ago
commit 80a7151cbd

@ -32,10 +32,10 @@ const svgName = computed(() => {
<SvgIcon v-show="selected" size="14" name="more-ver" />
</div>
<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>提交时间{{ format(new Date(), 'yyyy-MM-dd HH:mm:ss') }}</li>
<li>提报人{{ listItem.fromuserid }}</li>
<li>提报人{{ listItem.fromUserName }}</li>
</ul>
<div class="list-item-divider" />

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

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

Loading…
Cancel
Save