|
|
@ -1,6 +1,6 @@
|
|
|
|
<script lang="ts" setup>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import type { DataTableColumns, DataTableRowKey, PaginationProps } from 'naive-ui'
|
|
|
|
import type { DataTableColumns, DataTableRowKey, PaginationProps } from "naive-ui";
|
|
|
|
import { NButton, NDataTable, useDialog, useMessage } from 'naive-ui'
|
|
|
|
import { NButton, NDataTable, useDialog, useMessage } from "naive-ui";
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
computed,
|
|
|
|
computed,
|
|
|
|
defineEmits,
|
|
|
|
defineEmits,
|
|
|
@ -13,9 +13,9 @@ import {
|
|
|
|
ref,
|
|
|
|
ref,
|
|
|
|
unref,
|
|
|
|
unref,
|
|
|
|
watch,
|
|
|
|
watch,
|
|
|
|
} from 'vue'
|
|
|
|
} from "vue";
|
|
|
|
import { rowPropKeys } from 'naive-ui/es/legacy-grid/src/Row'
|
|
|
|
import { rowPropKeys } from "naive-ui/es/legacy-grid/src/Row";
|
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
import { useRoute, useRouter } from "vue-router";
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
Action,
|
|
|
|
Action,
|
|
|
|
CustomTabelModal,
|
|
|
|
CustomTabelModal,
|
|
|
@ -24,50 +24,50 @@ import {
|
|
|
|
RepeatModal,
|
|
|
|
RepeatModal,
|
|
|
|
RepeatTaskTableModal,
|
|
|
|
RepeatTaskTableModal,
|
|
|
|
StatusItem,
|
|
|
|
StatusItem,
|
|
|
|
} from '../comp'
|
|
|
|
} from "../comp";
|
|
|
|
import { getFinalList } from '@/api/final'
|
|
|
|
import { getFinalList } from "@/api/final";
|
|
|
|
import { audit } from '@/api/task/task'
|
|
|
|
import { audit } from "@/api/task/task";
|
|
|
|
import SvgIcon from '@/components/Icon/SvgIcon.vue'
|
|
|
|
import SvgIcon from "@/components/Icon/SvgIcon.vue";
|
|
|
|
import type { RowData } from '@/config/final'
|
|
|
|
import type { RowData } from "@/config/final";
|
|
|
|
import { findKey, headRules } from '@/config/final'
|
|
|
|
import { findKey, headRules } from "@/config/final";
|
|
|
|
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
|
|
|
|
import { useWindowSizeFn } from "@/hooks/event/useWindowSizeFn";
|
|
|
|
import { useUser } from '@/store/modules/user'
|
|
|
|
import { useUser } from "@/store/modules/user";
|
|
|
|
import { useFinal } from '@/store/modules/final'
|
|
|
|
import { useFinal } from "@/store/modules/final";
|
|
|
|
import { getViewportOffset } from '@/utils/domUtils'
|
|
|
|
import { getViewportOffset } from "@/utils/domUtils";
|
|
|
|
import { isBoolean } from '@/utils/is'
|
|
|
|
import { isBoolean } from "@/utils/is";
|
|
|
|
import { useDictionary } from '@/store/modules/dictonary'
|
|
|
|
import { useDictionary } from "@/store/modules/dictonary";
|
|
|
|
import ConfrimModal from '@/views/task/modal/ConfrimModal.vue'
|
|
|
|
import ConfrimModal from "@/views/task/modal/ConfrimModal.vue";
|
|
|
|
import type { ApprovalParam } from '/#/api'
|
|
|
|
import type { ApprovalParam } from "/#/api";
|
|
|
|
import emitter from '@/utils/mitt'
|
|
|
|
import emitter from "@/utils/mitt";
|
|
|
|
import { formatToDateHMS } from '@/utils/dateUtil'
|
|
|
|
import { formatToDateHMS } from "@/utils/dateUtil";
|
|
|
|
import { getAllfieldList, getfieldList, savefield } from '@/api/home/filter'
|
|
|
|
import { getAllfieldList, getfieldList, savefield } from "@/api/home/filter";
|
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['changeShow'])
|
|
|
|
const emit = defineEmits(["changeShow"]);
|
|
|
|
function changeContent() {
|
|
|
|
function changeContent() {
|
|
|
|
emit('changeShow')
|
|
|
|
emit("changeShow");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const dicStore = useDictionary()
|
|
|
|
const dicStore = useDictionary();
|
|
|
|
const izstatusList = ref([])
|
|
|
|
const izstatusList = ref([]);
|
|
|
|
const router = useRouter()
|
|
|
|
const router = useRouter();
|
|
|
|
const route = useRoute()
|
|
|
|
const route = useRoute();
|
|
|
|
const reviewType = 0
|
|
|
|
const reviewType = 0;
|
|
|
|
const actionsColumns = {
|
|
|
|
const actionsColumns = {
|
|
|
|
title: '操作',
|
|
|
|
title: "操作",
|
|
|
|
key: 'actions',
|
|
|
|
key: "actions",
|
|
|
|
minWidth: 200,
|
|
|
|
minWidth: 200,
|
|
|
|
fixed: 'right',
|
|
|
|
fixed: "right",
|
|
|
|
render(row) {
|
|
|
|
render(row) {
|
|
|
|
return h(ListAction, {
|
|
|
|
return h(ListAction, {
|
|
|
|
id: row.id,
|
|
|
|
id: row.id,
|
|
|
|
status: row.states,
|
|
|
|
status: row.states,
|
|
|
|
trigger: (action) => {
|
|
|
|
trigger: (action) => {
|
|
|
|
actionHandler(action, row)
|
|
|
|
actionHandler(action, row);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
const columnsRef = ref<DataTableColumns<RowData>>([])
|
|
|
|
const columnsRef = ref<DataTableColumns<RowData>>([]);
|
|
|
|
// const columns: DataTableColumns<RowData> = [
|
|
|
|
// const columns: DataTableColumns<RowData> = [
|
|
|
|
// {
|
|
|
|
// {
|
|
|
|
// type: "selection",
|
|
|
|
// type: "selection",
|
|
|
@ -167,213 +167,204 @@ const columnsRef = ref<DataTableColumns<RowData>>([])
|
|
|
|
async function getColumns() {
|
|
|
|
async function getColumns() {
|
|
|
|
columnsRef.value = [
|
|
|
|
columnsRef.value = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
type: 'selection',
|
|
|
|
type: "selection",
|
|
|
|
fixed: 'left',
|
|
|
|
fixed: "left",
|
|
|
|
width: 50,
|
|
|
|
width: 50,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const userStore = useUser()
|
|
|
|
const userStore = useUser();
|
|
|
|
const userInfo = userStore.getUserInfo
|
|
|
|
const userInfo = userStore.getUserInfo;
|
|
|
|
let res
|
|
|
|
let res;
|
|
|
|
res = await getAllfieldList(reviewType) // 所有筛选项目
|
|
|
|
res = await getAllfieldList(reviewType); // 所有筛选项目
|
|
|
|
const allList = res.data
|
|
|
|
const allList = res.data;
|
|
|
|
res = await getfieldList(reviewType, userInfo.id) // 当前用户选择的项目
|
|
|
|
res = await getfieldList(reviewType, userInfo.id); // 当前用户选择的项目
|
|
|
|
const useList = res.data
|
|
|
|
const useList = res.data;
|
|
|
|
const userFieldFixed = useList.userFieldFixed?.split(',')
|
|
|
|
const userFieldFixed = useList.userFieldFixed?.split(",");
|
|
|
|
const userFieldUnFixed = useList.userFieldUnFixed?.split(',')
|
|
|
|
const userFieldUnFixed = useList.userFieldUnFixed?.split(",");
|
|
|
|
console.log(userFieldFixed, userFieldUnFixed, 'userFieldUnFixed')
|
|
|
|
console.log(userFieldFixed, userFieldUnFixed, "userFieldUnFixed");
|
|
|
|
console.log(allList, 'allList')
|
|
|
|
console.log(allList, "allList");
|
|
|
|
allList?.map((v) => {
|
|
|
|
allList?.map((v) => {
|
|
|
|
if (!userFieldFixed?.length && !userFieldUnFixed?.length) {
|
|
|
|
if (!userFieldFixed?.length && !userFieldUnFixed?.length) {
|
|
|
|
if (v.isrequired == 2) {
|
|
|
|
if (v.isrequired == 2) {
|
|
|
|
columnsRef.value.push({
|
|
|
|
columnsRef.value.push({
|
|
|
|
title: v.fieldDesc,
|
|
|
|
title: v.fieldDesc,
|
|
|
|
fixed: 'left',
|
|
|
|
fixed: "left",
|
|
|
|
key: v.name,
|
|
|
|
key: v.name,
|
|
|
|
width: 120,
|
|
|
|
width: 120,
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (userFieldFixed?.find(v2 => v2 == v.name)) {
|
|
|
|
if (userFieldFixed?.find((v2) => v2 == v.name)) {
|
|
|
|
columnsRef.value.push({
|
|
|
|
columnsRef.value.push({
|
|
|
|
title: v.fieldDesc,
|
|
|
|
title: v.fieldDesc,
|
|
|
|
key: v.name,
|
|
|
|
key: v.name,
|
|
|
|
fixed: 'left',
|
|
|
|
fixed: "left",
|
|
|
|
width: 120,
|
|
|
|
width: 120,
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (userFieldUnFixed?.find(v2 => v2 == v.name)) {
|
|
|
|
if (userFieldUnFixed?.find((v2) => v2 == v.name)) {
|
|
|
|
columnsRef.value.push({
|
|
|
|
columnsRef.value.push({
|
|
|
|
title: v.fieldDesc,
|
|
|
|
title: v.fieldDesc,
|
|
|
|
key: v.name,
|
|
|
|
key: v.name,
|
|
|
|
width: 120,
|
|
|
|
width: 120,
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
columnsRef.value.push(actionsColumns as any)
|
|
|
|
columnsRef.value.push(actionsColumns as any);
|
|
|
|
formatColumns()
|
|
|
|
formatColumns();
|
|
|
|
console.log(columnsRef.value, 'columnsRef')
|
|
|
|
console.log(columnsRef.value, "columnsRef");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function formatColumns() {
|
|
|
|
async function formatColumns() {
|
|
|
|
// TODO处理特殊字段
|
|
|
|
// TODO处理特殊字段
|
|
|
|
|
|
|
|
|
|
|
|
let index
|
|
|
|
let index;
|
|
|
|
index = columnsRef.value.findIndex(v => v.title == '任务ID')
|
|
|
|
index = columnsRef.value.findIndex((v) => v.title == "任务ID");
|
|
|
|
if (index > -1) {
|
|
|
|
if (index > -1) {
|
|
|
|
columnsRef.value[index] = {
|
|
|
|
columnsRef.value[index] = {
|
|
|
|
title: '任务ID',
|
|
|
|
title: "任务ID",
|
|
|
|
key: columnsRef.value[index].key, // "id"
|
|
|
|
key: columnsRef.value[index].key, // "id"
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
width: 200,
|
|
|
|
width: 200,
|
|
|
|
render(row) {
|
|
|
|
render(row) {
|
|
|
|
const item: any = izstatusList.value.find(
|
|
|
|
const item: any = izstatusList.value.find(
|
|
|
|
(item: any) => item.value == row.states,
|
|
|
|
(item: any) => item.value == row.states
|
|
|
|
)
|
|
|
|
);
|
|
|
|
return h(
|
|
|
|
return h(
|
|
|
|
NButton,
|
|
|
|
NButton,
|
|
|
|
{
|
|
|
|
{
|
|
|
|
'strong': true,
|
|
|
|
strong: true,
|
|
|
|
'tertiary': true,
|
|
|
|
tertiary: true,
|
|
|
|
'text': true,
|
|
|
|
text: true,
|
|
|
|
'size': 'small',
|
|
|
|
size: "small",
|
|
|
|
'text-color': '#507AFD',
|
|
|
|
"text-color": "#507AFD",
|
|
|
|
'onClick': () => goDetail(row),
|
|
|
|
onClick: () => goDetail(row),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{ default: () => row.id },
|
|
|
|
{ default: () => row.id }
|
|
|
|
)
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
index = columnsRef.value.findIndex(v => v.title == '任务名称')
|
|
|
|
index = columnsRef.value.findIndex((v) => v.title == "任务名称");
|
|
|
|
if (index > -1) {
|
|
|
|
if (index > -1) {
|
|
|
|
columnsRef.value[index] = {
|
|
|
|
columnsRef.value[index] = {
|
|
|
|
title: '任务名称',
|
|
|
|
title: "任务名称",
|
|
|
|
key: columnsRef.value[index].key, // "fromtaskname"
|
|
|
|
key: columnsRef.value[index].key, // "fromtaskname"
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
width: 200,
|
|
|
|
width: 200,
|
|
|
|
ellipsis: {
|
|
|
|
ellipsis: {
|
|
|
|
tooltip: true,
|
|
|
|
tooltip: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
index = columnsRef.value.findIndex(v => v.title == '审批状态')
|
|
|
|
index = columnsRef.value.findIndex((v) => v.title == "审批状态");
|
|
|
|
if (index > -1) {
|
|
|
|
if (index > -1) {
|
|
|
|
columnsRef.value[index] = {
|
|
|
|
columnsRef.value[index] = {
|
|
|
|
title: '审批状态',
|
|
|
|
title: "审批状态",
|
|
|
|
key: columnsRef.value[index].key,
|
|
|
|
key: columnsRef.value[index].key,
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
width: 120,
|
|
|
|
width: 120,
|
|
|
|
sorter: 'default',
|
|
|
|
sorter: "default",
|
|
|
|
renderSorterIcon: ({ order }) => {
|
|
|
|
renderSorterIcon: ({ order }) => {
|
|
|
|
if (order === false)
|
|
|
|
if (order === false) return h(SvgIcon, { name: "sort-2" });
|
|
|
|
return h(SvgIcon, { name: 'sort-2' })
|
|
|
|
if (order === "ascend") return h(SvgIcon, { name: "sort-1" });
|
|
|
|
if (order === 'ascend')
|
|
|
|
if (order === "descend") return h(SvgIcon, { name: "sort-3" });
|
|
|
|
return h(SvgIcon, { name: 'sort-1' })
|
|
|
|
|
|
|
|
if (order === 'descend')
|
|
|
|
|
|
|
|
return h(SvgIcon, { name: 'sort-3' })
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
render(row) {
|
|
|
|
render(row) {
|
|
|
|
const item: any = izstatusList.value.find(
|
|
|
|
const item: any = izstatusList.value.find(
|
|
|
|
(item: any) => item.value == row.states,
|
|
|
|
(item: any) => item.value == row.states
|
|
|
|
)
|
|
|
|
);
|
|
|
|
return h(StatusItem, {
|
|
|
|
return h(StatusItem, {
|
|
|
|
id: row.id,
|
|
|
|
id: row.id,
|
|
|
|
status: row.states,
|
|
|
|
status: row.states,
|
|
|
|
label: item ? item.label : '',
|
|
|
|
label: item ? item.label : "",
|
|
|
|
})
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
index = columnsRef.value.findIndex(v => v.title == '图片相似度')
|
|
|
|
index = columnsRef.value.findIndex((v) => v.title == "图片相似度");
|
|
|
|
if (index > -1) {
|
|
|
|
if (index > -1) {
|
|
|
|
columnsRef.value[index] = {
|
|
|
|
columnsRef.value[index] = {
|
|
|
|
title: '图片相似度',
|
|
|
|
title: "图片相似度",
|
|
|
|
key: columnsRef.value[index].key,
|
|
|
|
key: columnsRef.value[index].key,
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
width: 150,
|
|
|
|
width: 150,
|
|
|
|
sorter: 'default',
|
|
|
|
sorter: "default",
|
|
|
|
renderSorterIcon: ({ order }) => {
|
|
|
|
renderSorterIcon: ({ order }) => {
|
|
|
|
if (order === false)
|
|
|
|
if (order === false) return h(SvgIcon, { name: "sort-2" });
|
|
|
|
return h(SvgIcon, { name: 'sort-2' })
|
|
|
|
if (order === "ascend") return h(SvgIcon, { name: "sort-1" });
|
|
|
|
if (order === 'ascend')
|
|
|
|
if (order === "descend") return h(SvgIcon, { name: "sort-3" });
|
|
|
|
return h(SvgIcon, { name: 'sort-1' })
|
|
|
|
|
|
|
|
if (order === 'descend')
|
|
|
|
|
|
|
|
return h(SvgIcon, { name: 'sort-3' })
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
render(row: any) {
|
|
|
|
render(row: any) {
|
|
|
|
return row.similarityscore ? `${row.similarityscore}%` : ''
|
|
|
|
return row.similarityscore ? `${row.similarityscore}%` : "";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
index = columnsRef.value.findIndex(v => v.title == '提报时间')
|
|
|
|
index = columnsRef.value.findIndex((v) => v.title == "提报时间");
|
|
|
|
if (index > -1) {
|
|
|
|
if (index > -1) {
|
|
|
|
columnsRef.value[index] = {
|
|
|
|
columnsRef.value[index] = {
|
|
|
|
title: '提报时间',
|
|
|
|
title: "提报时间",
|
|
|
|
key: columnsRef.value[index].key,
|
|
|
|
key: columnsRef.value[index].key,
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
width: 200,
|
|
|
|
width: 200,
|
|
|
|
sorter: 'default',
|
|
|
|
sorter: "default",
|
|
|
|
renderSorterIcon: ({ order }) => {
|
|
|
|
renderSorterIcon: ({ order }) => {
|
|
|
|
if (order === false)
|
|
|
|
if (order === false) return h(SvgIcon, { name: "sort-2" });
|
|
|
|
return h(SvgIcon, { name: 'sort-2' })
|
|
|
|
if (order === "ascend") return h(SvgIcon, { name: "sort-1" });
|
|
|
|
if (order === 'ascend')
|
|
|
|
if (order === "descend") return h(SvgIcon, { name: "sort-3" });
|
|
|
|
return h(SvgIcon, { name: 'sort-1' })
|
|
|
|
|
|
|
|
if (order === 'descend')
|
|
|
|
|
|
|
|
return h(SvgIcon, { name: 'sort-3' })
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
render(row: any) {
|
|
|
|
render(row: any) {
|
|
|
|
return formatToDateHMS(row.createdate || 0)
|
|
|
|
return formatToDateHMS(row.createdate || 0);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
index = columnsRef.value.findIndex(v => v.title == '更新时间')
|
|
|
|
index = columnsRef.value.findIndex((v) => v.title == "更新时间");
|
|
|
|
if (index > -1) {
|
|
|
|
if (index > -1) {
|
|
|
|
columnsRef.value[index] = {
|
|
|
|
columnsRef.value[index] = {
|
|
|
|
title: '更新时间',
|
|
|
|
title: "更新时间",
|
|
|
|
key: columnsRef.value[index].key,
|
|
|
|
key: columnsRef.value[index].key,
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
fixed: columnsRef.value[index].fixed || undefined,
|
|
|
|
width: 200,
|
|
|
|
width: 200,
|
|
|
|
render(row: any) {
|
|
|
|
render(row: any) {
|
|
|
|
return row.updatetime ? formatToDateHMS(row.updatetime) : ''
|
|
|
|
return row.updatetime ? formatToDateHMS(row.updatetime) : "";
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const deviceHeight = ref(600)
|
|
|
|
const deviceHeight = ref(600);
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
emitter.on('filter-final', refreshHandler)
|
|
|
|
emitter.on("filter-final", refreshHandler);
|
|
|
|
getColumns()
|
|
|
|
getColumns();
|
|
|
|
|
|
|
|
|
|
|
|
nextTick(() => {
|
|
|
|
nextTick(() => {
|
|
|
|
computeListHeight()
|
|
|
|
computeListHeight();
|
|
|
|
})
|
|
|
|
});
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
onBeforeMount(() => {
|
|
|
|
onBeforeMount(() => {
|
|
|
|
dicStore.fetchizstatusListt()
|
|
|
|
dicStore.fetchizstatusListt();
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
watch(
|
|
|
|
() => dicStore.izstatusList,
|
|
|
|
() => dicStore.izstatusList,
|
|
|
|
(newval) => {
|
|
|
|
(newval) => {
|
|
|
|
izstatusList.value = newval
|
|
|
|
izstatusList.value = newval;
|
|
|
|
},
|
|
|
|
}
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
onUnmounted(() => {
|
|
|
|
emitter.off('filter-final', refreshHandler)
|
|
|
|
emitter.off("filter-final", refreshHandler);
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const tableRef = ref<InstanceType<typeof NDataTable>>()
|
|
|
|
const tableRef = ref<InstanceType<typeof NDataTable>>();
|
|
|
|
const rowKey = (row: RowData) => row.id
|
|
|
|
const rowKey = (row: RowData) => row.id;
|
|
|
|
const loading = ref(true)
|
|
|
|
const loading = ref(true);
|
|
|
|
const total = ref(0);
|
|
|
|
const total = ref(0);
|
|
|
|
const pagination = reactive({
|
|
|
|
const pagination = reactive({
|
|
|
|
page: 1,
|
|
|
|
page: 1,
|
|
|
@ -382,212 +373,204 @@ const pagination = reactive({
|
|
|
|
showSizePicker: true,
|
|
|
|
showSizePicker: true,
|
|
|
|
pageSizes: [
|
|
|
|
pageSizes: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '10 每页',
|
|
|
|
label: "10 每页",
|
|
|
|
value: 10,
|
|
|
|
value: 10,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '15 每页',
|
|
|
|
label: "15 每页",
|
|
|
|
value: 15,
|
|
|
|
value: 15,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '30 每页',
|
|
|
|
label: "30 每页",
|
|
|
|
value: 30,
|
|
|
|
value: 30,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
label: '50 每页',
|
|
|
|
label: "50 每页",
|
|
|
|
value: 50,
|
|
|
|
value: 50,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
showQuickJumper: true,
|
|
|
|
showQuickJumper: true,
|
|
|
|
prefix:()=>`共 ${total.value} 条数据`
|
|
|
|
prefix: () => `共 ${total.value} 条数据`,
|
|
|
|
})
|
|
|
|
});
|
|
|
|
const tableData = ref<Array<RowData>>([])
|
|
|
|
const tableData = ref<Array<RowData>>([]);
|
|
|
|
const selectionIds = ref<DataTableRowKey[]>([])
|
|
|
|
const selectionIds = ref<DataTableRowKey[]>([]);
|
|
|
|
const dialog = useDialog()
|
|
|
|
const dialog = useDialog();
|
|
|
|
const message = useMessage()
|
|
|
|
const message = useMessage();
|
|
|
|
const finalStore = useFinal()
|
|
|
|
const finalStore = useFinal();
|
|
|
|
|
|
|
|
|
|
|
|
async function query(page: number, pageSize: number, filterId?: any) {
|
|
|
|
async function query(page: number, pageSize: number, filterId?: any) {
|
|
|
|
const asideParmas = unref(finalStore.getAsideValue)
|
|
|
|
const asideParmas = unref(finalStore.getAsideValue);
|
|
|
|
// 有过滤配置的时候优先使用过滤配置,不要使用左侧参数
|
|
|
|
// 有过滤配置的时候优先使用过滤配置,不要使用左侧参数
|
|
|
|
const params = filterId ? { userSearchId: filterId } : asideParmas
|
|
|
|
const params = filterId ? { userSearchId: filterId } : asideParmas;
|
|
|
|
const result = await getFinalList({
|
|
|
|
const result = await getFinalList({
|
|
|
|
sortorder: 'asc',
|
|
|
|
sortorder: "asc",
|
|
|
|
pageSize,
|
|
|
|
pageSize,
|
|
|
|
currPage: page,
|
|
|
|
currPage: page,
|
|
|
|
sortname: '',
|
|
|
|
sortname: "",
|
|
|
|
...params,
|
|
|
|
...params,
|
|
|
|
})
|
|
|
|
});
|
|
|
|
const { data, pageCount } = result
|
|
|
|
const { data, pageCount, totalCount } = result;
|
|
|
|
tableData.value = data
|
|
|
|
tableData.value = data;
|
|
|
|
total.value = data.totalCount;
|
|
|
|
total.value = totalCount;
|
|
|
|
pagination.page = page
|
|
|
|
pagination.page = page;
|
|
|
|
pagination.pageCount = pageCount
|
|
|
|
pagination.pageCount = pageCount;
|
|
|
|
loading.value = false
|
|
|
|
loading.value = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function handlePageChange(currentPage) {
|
|
|
|
async function handlePageChange(currentPage) {
|
|
|
|
if (loading.value)
|
|
|
|
if (loading.value) return;
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { pageSize } = pagination
|
|
|
|
const { pageSize } = pagination;
|
|
|
|
await query(currentPage, pageSize)
|
|
|
|
await query(currentPage, pageSize);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
async function handlePageSizeChange(currentPageSize) {
|
|
|
|
async function handlePageSizeChange(currentPageSize) {
|
|
|
|
if (loading.value)
|
|
|
|
if (loading.value) return;
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { page } = pagination
|
|
|
|
const { page } = pagination;
|
|
|
|
pagination.pageSize = currentPageSize
|
|
|
|
pagination.pageSize = currentPageSize;
|
|
|
|
|
|
|
|
|
|
|
|
await query(page, currentPageSize)
|
|
|
|
await query(page, currentPageSize);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function handleCheck(rowKeys: DataTableRowKey[]) {
|
|
|
|
function handleCheck(rowKeys: DataTableRowKey[]) {
|
|
|
|
selectionIds.value = rowKeys
|
|
|
|
selectionIds.value = rowKeys;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function computeListHeight() {
|
|
|
|
async function computeListHeight() {
|
|
|
|
const table = unref(tableRef)
|
|
|
|
const table = unref(tableRef);
|
|
|
|
if (!table)
|
|
|
|
if (!table) return;
|
|
|
|
return
|
|
|
|
const tableEl: any = table?.$el;
|
|
|
|
const tableEl: any = table?.$el
|
|
|
|
const headEl = tableEl.querySelector(".n-data-table-thead ");
|
|
|
|
const headEl = tableEl.querySelector('.n-data-table-thead ')
|
|
|
|
const { bottomIncludeBody } = getViewportOffset(headEl);
|
|
|
|
const { bottomIncludeBody } = getViewportOffset(headEl)
|
|
|
|
const headerH = 64;
|
|
|
|
const headerH = 64
|
|
|
|
let paginationH = 2;
|
|
|
|
let paginationH = 2
|
|
|
|
const marginH = 60;
|
|
|
|
const marginH = 60
|
|
|
|
|
|
|
|
if (!isBoolean(unref(pagination))) {
|
|
|
|
if (!isBoolean(unref(pagination))) {
|
|
|
|
const paginationEl = tableEl.querySelector(
|
|
|
|
const paginationEl = tableEl.querySelector(
|
|
|
|
'.n-data-table__pagination',
|
|
|
|
".n-data-table__pagination"
|
|
|
|
) as HTMLElement
|
|
|
|
) as HTMLElement;
|
|
|
|
if (paginationEl) {
|
|
|
|
if (paginationEl) {
|
|
|
|
const offsetHeight = paginationEl.offsetHeight
|
|
|
|
const offsetHeight = paginationEl.offsetHeight;
|
|
|
|
paginationH += offsetHeight || 0
|
|
|
|
paginationH += offsetHeight || 0;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
paginationH += 28;
|
|
|
|
paginationH += 28
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let height = bottomIncludeBody - (headerH + paginationH + marginH)
|
|
|
|
let height = bottomIncludeBody - (headerH + paginationH + marginH);
|
|
|
|
const maxHeight = 800
|
|
|
|
const maxHeight = 800;
|
|
|
|
height = maxHeight && maxHeight < height ? maxHeight : height
|
|
|
|
height = maxHeight && maxHeight < height ? maxHeight : height;
|
|
|
|
deviceHeight.value = height
|
|
|
|
deviceHeight.value = height;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
useWindowSizeFn(computeListHeight)
|
|
|
|
useWindowSizeFn(computeListHeight);
|
|
|
|
|
|
|
|
|
|
|
|
const maxHeight = computed(() => {
|
|
|
|
const maxHeight = computed(() => {
|
|
|
|
return tableData.value.length ? `${unref(deviceHeight)}px` : 'auto'
|
|
|
|
return tableData.value.length ? `${unref(deviceHeight)}px` : "auto";
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
query(pagination.page, pagination.pageSize)
|
|
|
|
query(pagination.page, pagination.pageSize);
|
|
|
|
|
|
|
|
|
|
|
|
const customTabelRef = ref(null)
|
|
|
|
const customTabelRef = ref(null);
|
|
|
|
const importExcelRef = ref(null)
|
|
|
|
const importExcelRef = ref(null);
|
|
|
|
const rejectModalRef = ref(null)
|
|
|
|
const rejectModalRef = ref(null);
|
|
|
|
const repeatModalRef = ref(null)
|
|
|
|
const repeatModalRef = ref(null);
|
|
|
|
const repeatTaskTableModalRef = ref(null)
|
|
|
|
const repeatTaskTableModalRef = ref(null);
|
|
|
|
|
|
|
|
|
|
|
|
function showModal(modalRef: any) {
|
|
|
|
function showModal(modalRef: any) {
|
|
|
|
const modal = unref(modalRef)! as any
|
|
|
|
const modal = unref(modalRef)! as any;
|
|
|
|
modal.showModal()
|
|
|
|
modal.showModal();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const popover = ref<ComponentRef | null>(null)
|
|
|
|
const popover = ref<ComponentRef | null>(null);
|
|
|
|
|
|
|
|
|
|
|
|
function importHandler() {
|
|
|
|
function importHandler() {
|
|
|
|
(popover.value as any).setShow(false)
|
|
|
|
(popover.value as any).setShow(false);
|
|
|
|
showModal(importExcelRef)
|
|
|
|
showModal(importExcelRef);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function exportHandler() {
|
|
|
|
function exportHandler() {
|
|
|
|
loading.value = true
|
|
|
|
loading.value = true;
|
|
|
|
import('@/utils/exportExcel').then((excel) => {
|
|
|
|
import("@/utils/exportExcel").then((excel) => {
|
|
|
|
const tHeader = [
|
|
|
|
const tHeader = [
|
|
|
|
'任务Id',
|
|
|
|
"任务Id",
|
|
|
|
'任务名称',
|
|
|
|
"任务名称",
|
|
|
|
'审批节点',
|
|
|
|
"审批节点",
|
|
|
|
'审批状态',
|
|
|
|
"审批状态",
|
|
|
|
'图片相似度',
|
|
|
|
"图片相似度",
|
|
|
|
'提报时间',
|
|
|
|
"提报时间",
|
|
|
|
'更新时间',
|
|
|
|
"更新时间",
|
|
|
|
]
|
|
|
|
];
|
|
|
|
const filterVal = [
|
|
|
|
const filterVal = [
|
|
|
|
'id',
|
|
|
|
"id",
|
|
|
|
'name',
|
|
|
|
"name",
|
|
|
|
'approvalnode',
|
|
|
|
"approvalnode",
|
|
|
|
'approvalstatus',
|
|
|
|
"approvalstatus",
|
|
|
|
'similarity',
|
|
|
|
"similarity",
|
|
|
|
'uptime',
|
|
|
|
"uptime",
|
|
|
|
'updatetime',
|
|
|
|
"updatetime",
|
|
|
|
]
|
|
|
|
];
|
|
|
|
const list = tableData.value
|
|
|
|
const list = tableData.value;
|
|
|
|
const data = formatJson(filterVal, list)
|
|
|
|
const data = formatJson(filterVal, list);
|
|
|
|
excel.export_json_to_excel({
|
|
|
|
excel.export_json_to_excel({
|
|
|
|
header: tHeader,
|
|
|
|
header: tHeader,
|
|
|
|
data,
|
|
|
|
data,
|
|
|
|
filename: 'data',
|
|
|
|
filename: "data",
|
|
|
|
autoWidth: true,
|
|
|
|
autoWidth: true,
|
|
|
|
bookType: 'xlsx',
|
|
|
|
bookType: "xlsx",
|
|
|
|
})
|
|
|
|
});
|
|
|
|
loading.value = false
|
|
|
|
loading.value = false;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function formatJson(filterVal, jsonDataList) {
|
|
|
|
function formatJson(filterVal, jsonDataList) {
|
|
|
|
return jsonDataList.map(v =>
|
|
|
|
return jsonDataList.map((v) =>
|
|
|
|
filterVal.map((j) => {
|
|
|
|
filterVal.map((j) => {
|
|
|
|
return v[j]
|
|
|
|
return v[j];
|
|
|
|
}),
|
|
|
|
})
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function sucessHandler(excelData) {
|
|
|
|
function sucessHandler(excelData) {
|
|
|
|
const data = excelData.content.map((item) => {
|
|
|
|
const data = excelData.content.map((item) => {
|
|
|
|
const obj = {}
|
|
|
|
const obj = {};
|
|
|
|
Object.keys(item).forEach((key) => {
|
|
|
|
Object.keys(item).forEach((key) => {
|
|
|
|
const k = findKey(columns, key)
|
|
|
|
const k = findKey(columns, key);
|
|
|
|
obj[k] = item[key]
|
|
|
|
obj[k] = item[key];
|
|
|
|
})
|
|
|
|
});
|
|
|
|
return obj
|
|
|
|
return obj;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
tableData.value = data
|
|
|
|
tableData.value = data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function commitHandler(columns) {
|
|
|
|
function commitHandler(columns) {
|
|
|
|
columnsRef.value = [
|
|
|
|
columnsRef.value = [...columns, actionsColumns];
|
|
|
|
...columns,
|
|
|
|
formatColumns();
|
|
|
|
actionsColumns,
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
formatColumns()
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function actionHandler(action: any, row: any) {
|
|
|
|
function actionHandler(action: any, row: any) {
|
|
|
|
const { key } = action
|
|
|
|
const { key } = action;
|
|
|
|
switch (key) {
|
|
|
|
switch (key) {
|
|
|
|
case 'view':
|
|
|
|
case "view":
|
|
|
|
goDetail(row)
|
|
|
|
goDetail(row);
|
|
|
|
break
|
|
|
|
break;
|
|
|
|
case 'reset':
|
|
|
|
case "reset":
|
|
|
|
resetHandler()
|
|
|
|
resetHandler();
|
|
|
|
break
|
|
|
|
break;
|
|
|
|
case 'approval':
|
|
|
|
case "approval":
|
|
|
|
approvalHandler(row)
|
|
|
|
approvalHandler(row);
|
|
|
|
break
|
|
|
|
break;
|
|
|
|
case 'reject':
|
|
|
|
case "reject":
|
|
|
|
rejectHandler(row)
|
|
|
|
rejectHandler(row);
|
|
|
|
break
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// states:1未提交,2待审批,3通过,4不通过
|
|
|
|
// states:1未提交,2待审批,3通过,4不通过
|
|
|
|
function validate(items: any[]) {
|
|
|
|
function validate(items: any[]) {
|
|
|
|
if (items.length === 0)
|
|
|
|
if (items.length === 0) return "至少选中一个任务";
|
|
|
|
return '至少选中一个任务'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const useInfo = userStore.getUserInfo
|
|
|
|
// const useInfo = userStore.getUserInfo
|
|
|
|
// const username = useInfo.loginname
|
|
|
|
// const username = useInfo.loginname
|
|
|
@ -604,152 +587,151 @@ function validate(items: any[]) {
|
|
|
|
// return '审批人不一致'
|
|
|
|
// return '审批人不一致'
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
return null
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function goDetail(row) {
|
|
|
|
function goDetail(row) {
|
|
|
|
router.push({ name: 'final-detail', query: { id: row.id, packageid: row.packageid } })
|
|
|
|
router.push({ name: "final-detail", query: { id: row.id, packageid: row.packageid } });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function resetHandler() {
|
|
|
|
function resetHandler() {
|
|
|
|
dialog.info({
|
|
|
|
dialog.info({
|
|
|
|
title: '确认提示',
|
|
|
|
title: "确认提示",
|
|
|
|
content: '确认重置当前选中的任务的审批吗?',
|
|
|
|
content: "确认重置当前选中的任务的审批吗?",
|
|
|
|
positiveText: '确定',
|
|
|
|
positiveText: "确定",
|
|
|
|
negativeText: '取消',
|
|
|
|
negativeText: "取消",
|
|
|
|
onPositiveClick: async () => {
|
|
|
|
onPositiveClick: async () => {
|
|
|
|
// TODO:需要支持重置
|
|
|
|
// TODO:需要支持重置
|
|
|
|
// const result = await resetApproval()
|
|
|
|
// const result = await resetApproval()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onNegativeClick: () => {},
|
|
|
|
onNegativeClick: () => {},
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function getSelectItems() {
|
|
|
|
function getSelectItems() {
|
|
|
|
return tableData.value.filter(item => selectionIds.value.includes(item.id))
|
|
|
|
return tableData.value.filter((item) => selectionIds.value.includes(item.id));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function approvalHandler(row) {
|
|
|
|
function approvalHandler(row) {
|
|
|
|
// const items = getSelectItems()
|
|
|
|
// const items = getSelectItems()
|
|
|
|
const items = [row]
|
|
|
|
const items = [row];
|
|
|
|
const msg = validate(items)
|
|
|
|
const msg = validate(items);
|
|
|
|
|
|
|
|
|
|
|
|
if (msg !== null) {
|
|
|
|
if (msg !== null) {
|
|
|
|
message.error(msg)
|
|
|
|
message.error(msg);
|
|
|
|
return
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
dialog.info({
|
|
|
|
dialog.info({
|
|
|
|
title: '确认提示',
|
|
|
|
title: "确认提示",
|
|
|
|
content: '确认给该任务审批为【通过】吗?',
|
|
|
|
content: "确认给该任务审批为【通过】吗?",
|
|
|
|
positiveText: '确定',
|
|
|
|
positiveText: "确定",
|
|
|
|
negativeText: '取消',
|
|
|
|
negativeText: "取消",
|
|
|
|
onPositiveClick: () => {
|
|
|
|
onPositiveClick: () => {
|
|
|
|
approval(items)
|
|
|
|
approval(items);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onNegativeClick: () => {},
|
|
|
|
onNegativeClick: () => {},
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function batchApproval() {
|
|
|
|
function batchApproval() {
|
|
|
|
const items = getSelectItems()
|
|
|
|
const items = getSelectItems();
|
|
|
|
const msg = validate(items)
|
|
|
|
const msg = validate(items);
|
|
|
|
|
|
|
|
|
|
|
|
if (msg !== null) {
|
|
|
|
if (msg !== null) {
|
|
|
|
message.error(msg)
|
|
|
|
message.error(msg);
|
|
|
|
return
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
dialog.info({
|
|
|
|
dialog.info({
|
|
|
|
title: '确认提示',
|
|
|
|
title: "确认提示",
|
|
|
|
content: '确认给该任务审批为【通过】吗?',
|
|
|
|
content: "确认给该任务审批为【通过】吗?",
|
|
|
|
positiveText: '确定',
|
|
|
|
positiveText: "确定",
|
|
|
|
negativeText: '取消',
|
|
|
|
negativeText: "取消",
|
|
|
|
onPositiveClick: () => {
|
|
|
|
onPositiveClick: () => {
|
|
|
|
approval(items)
|
|
|
|
approval(items);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onNegativeClick: () => {},
|
|
|
|
onNegativeClick: () => {},
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function approval(items) {
|
|
|
|
function approval(items) {
|
|
|
|
const formIds: string[] = items.map(item => item.id)
|
|
|
|
const formIds: string[] = items.map((item) => item.id);
|
|
|
|
const taskIds: string[] = items.map(item => item.taskId)
|
|
|
|
const taskIds: string[] = items.map((item) => item.taskId);
|
|
|
|
const tasknames: string[] = items.map(item => item.taskname)
|
|
|
|
const tasknames: string[] = items.map((item) => item.taskname);
|
|
|
|
|
|
|
|
|
|
|
|
const param: ApprovalParam = {
|
|
|
|
const param: ApprovalParam = {
|
|
|
|
formid: formIds,
|
|
|
|
formid: formIds,
|
|
|
|
taskId: taskIds,
|
|
|
|
taskId: taskIds,
|
|
|
|
approvd: true,
|
|
|
|
approvd: true,
|
|
|
|
taskComment: 'approval',
|
|
|
|
taskComment: "approval",
|
|
|
|
taskname: tasknames,
|
|
|
|
taskname: tasknames,
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
doAudit(param)
|
|
|
|
doAudit(param);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function rejectHandler(row) {
|
|
|
|
function rejectHandler(row) {
|
|
|
|
// const items = getSelectItems()
|
|
|
|
// const items = getSelectItems()
|
|
|
|
const items = [row]
|
|
|
|
const items = [row];
|
|
|
|
const msg = validate(items)
|
|
|
|
const msg = validate(items);
|
|
|
|
|
|
|
|
|
|
|
|
if (msg !== null) {
|
|
|
|
if (msg !== null) {
|
|
|
|
message.error(msg)
|
|
|
|
message.error(msg);
|
|
|
|
return
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const modal = unref(rejectModalRef)! as any
|
|
|
|
const modal = unref(rejectModalRef)! as any;
|
|
|
|
modal.showModal()
|
|
|
|
modal.showModal();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function reject(idOrDesc: string, backId: string, isOther: boolean) {
|
|
|
|
function reject(idOrDesc: string, backId: string, isOther: boolean) {
|
|
|
|
const items = getSelectItems()
|
|
|
|
const items = getSelectItems();
|
|
|
|
const formIds: string[] = items.map(item => item.id)
|
|
|
|
const formIds: string[] = items.map((item) => item.id);
|
|
|
|
const taskIds: string[] = items.map(item => item.fromtaskid)
|
|
|
|
const taskIds: string[] = items.map((item) => item.fromtaskid);
|
|
|
|
const tasknames: string[] = items.map(item => item.fromtaskname)
|
|
|
|
const tasknames: string[] = items.map((item) => item.fromtaskname);
|
|
|
|
|
|
|
|
|
|
|
|
const param: ApprovalParam = {
|
|
|
|
const param: ApprovalParam = {
|
|
|
|
formid: formIds,
|
|
|
|
formid: formIds,
|
|
|
|
taskId: taskIds,
|
|
|
|
taskId: taskIds,
|
|
|
|
approvd: false,
|
|
|
|
approvd: false,
|
|
|
|
taskComment: idOrDesc,
|
|
|
|
taskComment: idOrDesc,
|
|
|
|
taskname: isOther ? tasknames : ['其他'],
|
|
|
|
taskname: isOther ? tasknames : ["其他"],
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
doAudit(param)
|
|
|
|
doAudit(param);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function doAudit(param: any) {
|
|
|
|
function doAudit(param: any) {
|
|
|
|
audit(param).then((res) => {
|
|
|
|
audit(param).then((res) => {
|
|
|
|
const { code } = res
|
|
|
|
const { code } = res;
|
|
|
|
if (code === 'OK')
|
|
|
|
if (code === "OK") reload();
|
|
|
|
reload()
|
|
|
|
else message.error(res.message);
|
|
|
|
else message.error(res.message)
|
|
|
|
});
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function reload() {
|
|
|
|
function reload() {
|
|
|
|
const { page, pageSize } = unref(tableRef.value?.pagination) as PaginationProps
|
|
|
|
const { page, pageSize } = unref(tableRef.value?.pagination) as PaginationProps;
|
|
|
|
query(page!, pageSize!)
|
|
|
|
query(page!, pageSize!);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
watch(
|
|
|
|
watch(
|
|
|
|
() => finalStore.asideValue,
|
|
|
|
() => finalStore.asideValue,
|
|
|
|
(newVal, oldVal) => {
|
|
|
|
(newVal, oldVal) => {
|
|
|
|
refreshHandler()
|
|
|
|
refreshHandler();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{ deep: true },
|
|
|
|
{ deep: true }
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
function reset() {
|
|
|
|
function reset() {
|
|
|
|
pagination.page = 1
|
|
|
|
pagination.page = 1;
|
|
|
|
pagination.pageCount = 1
|
|
|
|
pagination.pageCount = 1;
|
|
|
|
pagination.pageSize = 1
|
|
|
|
pagination.pageSize = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function refreshHandler(searchId?: any) {
|
|
|
|
async function refreshHandler(searchId?: any) {
|
|
|
|
reset()
|
|
|
|
reset();
|
|
|
|
query(pagination.page, pagination.pageSize, searchId)
|
|
|
|
query(pagination.page, pagination.pageSize, searchId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
@ -761,9 +743,7 @@ async function refreshHandler(searchId?: any) {
|
|
|
|
<SvgIcon size="32" name="magnifying" @click="changeContent" />
|
|
|
|
<SvgIcon size="32" name="magnifying" @click="changeContent" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<NButton class="xjcc" text @click="showModal(repeatModalRef)">
|
|
|
|
<NButton class="xjcc" text @click="showModal(repeatModalRef)"> 小结查重 </NButton>
|
|
|
|
小结查重
|
|
|
|
|
|
|
|
</NButton>
|
|
|
|
|
|
|
|
<div class="btn" @click="batchApproval">
|
|
|
|
<div class="btn" @click="batchApproval">
|
|
|
|
<SvgIcon style="margin-right: 6px" size="14" name="tf" />
|
|
|
|
<SvgIcon style="margin-right: 6px" size="14" name="tf" />
|
|
|
|
批量审批
|
|
|
|
批量审批
|
|
|
@ -781,13 +761,19 @@ async function refreshHandler(searchId?: any) {
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
<ul class="wrapper-header-action">
|
|
|
|
<ul class="wrapper-header-action">
|
|
|
|
<li @click="importHandler">
|
|
|
|
<li @click="importHandler">
|
|
|
|
<SvgIcon size="20" name="download" /><span style="margin-left: 5px">批量导入数据</span>
|
|
|
|
<SvgIcon size="20" name="download" /><span style="margin-left: 5px"
|
|
|
|
|
|
|
|
>批量导入数据</span
|
|
|
|
|
|
|
|
>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li @click="exportHandler">
|
|
|
|
<li @click="exportHandler">
|
|
|
|
<SvgIcon size="20" name="download" /><span style="margin-left: 5px">导出待审数据</span>
|
|
|
|
<SvgIcon size="20" name="download" /><span style="margin-left: 5px"
|
|
|
|
|
|
|
|
>导出待审数据</span
|
|
|
|
|
|
|
|
>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<li>
|
|
|
|
<SvgIcon size="20" name="download" /><span style="margin-left: 5px">导出全部数据</span>
|
|
|
|
<SvgIcon size="20" name="download" /><span style="margin-left: 5px"
|
|
|
|
|
|
|
|
>导出全部数据</span
|
|
|
|
|
|
|
|
>
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</n-popover>
|
|
|
|
</n-popover>
|
|
|
@ -993,7 +979,7 @@ async function refreshHandler(searchId?: any) {
|
|
|
|
background: #fff;
|
|
|
|
background: #fff;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
:deep(.n-data-table .n-data-table-td.n-data-table-td--fixed-right){
|
|
|
|
:deep(.n-data-table .n-data-table-td.n-data-table-td--fixed-right) {
|
|
|
|
z-index: 100 !important;
|
|
|
|
z-index: 100 !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|