|
|
|
|
@ -1,4 +1,8 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import type { DataTableColumns, DataTableRowKey, PaginationProps } from 'naive-ui'
|
|
|
|
|
import { NDataTable, useDialog, useMessage } from 'naive-ui'
|
|
|
|
|
import { computed, h, nextTick, onMounted, onUnmounted, reactive, ref, unref, watch } from 'vue'
|
|
|
|
|
import { Action, CustomTabelModal, ImportExcelModal, RepeatModal, RepeatTaskTableModal } from '../comp'
|
|
|
|
|
import { getFinalList } from '@/api/final'
|
|
|
|
|
import { audit } from '@/api/task/task'
|
|
|
|
|
import SvgIcon from '@/components/Icon/SvgIcon.vue'
|
|
|
|
|
@ -10,11 +14,8 @@ import { useFinal } from '@/store/modules/final'
|
|
|
|
|
import { getViewportOffset } from '@/utils/domUtils'
|
|
|
|
|
import { isBoolean } from '@/utils/is'
|
|
|
|
|
import ConfrimModal from '@/views/task/modal/ConfrimModal.vue'
|
|
|
|
|
import type { DataTableColumns, DataTableRowKey, PaginationProps } from 'naive-ui'
|
|
|
|
|
import { NDataTable, useDialog, useMessage } from 'naive-ui'
|
|
|
|
|
import { computed, h, nextTick, onMounted, reactive, ref, unref, watch } from 'vue'
|
|
|
|
|
import { Action, CustomTabelModal, ImportExcelModal, RepeatModal, RepeatTaskTableModal } from '../comp'
|
|
|
|
|
import type { ApprovalParam } from '/#/api'
|
|
|
|
|
import emitter from '@/utils/mitt'
|
|
|
|
|
|
|
|
|
|
const columns: DataTableColumns<RowData> = [
|
|
|
|
|
{
|
|
|
|
|
@ -107,11 +108,17 @@ const columns: DataTableColumns<RowData> = [
|
|
|
|
|
const deviceHeight = ref(600)
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
emitter.on('filter-final', refreshHandler)
|
|
|
|
|
|
|
|
|
|
nextTick(() => {
|
|
|
|
|
computeListHeight()
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
|
emitter.off('filter-final', refreshHandler)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const columnsRef = ref(columns)
|
|
|
|
|
const tableRef = ref<InstanceType<typeof NDataTable>>()
|
|
|
|
|
const rowKey = (row: RowData) => row.id
|
|
|
|
|
@ -128,9 +135,11 @@ const dialog = useDialog()
|
|
|
|
|
const message = useMessage()
|
|
|
|
|
const finalStore = useFinal()
|
|
|
|
|
|
|
|
|
|
async function query(page: number, pageSize: number) {
|
|
|
|
|
const filterParams = unref(finalStore.getAsideValue)
|
|
|
|
|
const result = await getFinalList({ sortorder: 'asc', pageSize, currPage: page, sortname: '', ...filterParams })
|
|
|
|
|
async function query(page: number, pageSize: number, filterValues?: any) {
|
|
|
|
|
const asideParmas = unref(finalStore.getAsideValue)
|
|
|
|
|
// 有过滤配置的时候优先使用过滤配置,不要使用左侧参数
|
|
|
|
|
const params = filterValues || asideParmas
|
|
|
|
|
const result = await getFinalList({ sortorder: 'asc', pageSize, currPage: page, sortname: '', ...params })
|
|
|
|
|
const { data, pageCount } = result
|
|
|
|
|
tableData.value = data
|
|
|
|
|
pagination.page = page
|
|
|
|
|
@ -268,20 +277,20 @@ function validate(items: any[]) {
|
|
|
|
|
if (items.length === 0)
|
|
|
|
|
return '至少选中一个任务'
|
|
|
|
|
|
|
|
|
|
const useInfo = userStore.getUserInfo
|
|
|
|
|
const username = useInfo.loginname
|
|
|
|
|
// const useInfo = userStore.getUserInfo
|
|
|
|
|
// const username = useInfo.loginname
|
|
|
|
|
|
|
|
|
|
for (const item of items) {
|
|
|
|
|
const { iztrueorfalse, states, assignee } = item
|
|
|
|
|
if (iztrueorfalse === null)
|
|
|
|
|
return '未判别真假'
|
|
|
|
|
// for (const item of items) {
|
|
|
|
|
// const { iztrueorfalse, states, assignee } = item
|
|
|
|
|
// if (iztrueorfalse === null)
|
|
|
|
|
// return '未判别真假'
|
|
|
|
|
|
|
|
|
|
else if (states !== 2)
|
|
|
|
|
return '审批状态不合法'
|
|
|
|
|
// else if (states !== 2)
|
|
|
|
|
// return '审批状态不合法'
|
|
|
|
|
|
|
|
|
|
else if (assignee !== username)
|
|
|
|
|
return '审批人不一致'
|
|
|
|
|
}
|
|
|
|
|
// else if (assignee !== username)
|
|
|
|
|
// return '审批人不一致'
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
@ -395,8 +404,9 @@ function reset() {
|
|
|
|
|
pagination.pageSize = 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function refreshHandler() {
|
|
|
|
|
query(pagination.page, pagination.pageSize)
|
|
|
|
|
async function refreshHandler(filterValues?: any) {
|
|
|
|
|
reset()
|
|
|
|
|
query(pagination.page, pagination.pageSize, filterValues)
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|