|
|
|
@ -1,8 +1,9 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { computed, onMounted, reactive, ref, unref, watch,defineProps } from 'vue'
|
|
|
|
|
import { computed, defineProps, onMounted, reactive, ref, unref, watch } from 'vue'
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
import { chunk } from 'lodash-es'
|
|
|
|
|
import { chunk, cloneDeep } from 'lodash-es'
|
|
|
|
|
import { useDialog, useMessage } from 'naive-ui'
|
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
import { RepeatModal, RepeatTaskTableModal } from '../comp'
|
|
|
|
|
import testImg from '@/assets/images/test.png'
|
|
|
|
|
import type { RowData } from '@/config/final'
|
|
|
|
@ -10,10 +11,16 @@ import { getFinalList } from '@/api/final'
|
|
|
|
|
import { useFinal } from '@/store/modules/final'
|
|
|
|
|
import { formatToDateHMS } from '@/utils/dateUtil'
|
|
|
|
|
import { audit } from '@/api/task/task'
|
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
import { cloneDeep } from 'lodash-es'
|
|
|
|
|
|
|
|
|
|
import NotPassed from '@/components/Approval/NotPassed.vue'
|
|
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
|
|
|
|
|
taskvalue: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: '',
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
const emit = defineEmits(['changeShow'])
|
|
|
|
|
const dialog = useDialog()
|
|
|
|
|
const message = useMessage()
|
|
|
|
@ -26,13 +33,6 @@ const total = ref(0)
|
|
|
|
|
const scrollContainer = ref(null)
|
|
|
|
|
const tableData = ref<any>([])
|
|
|
|
|
const finalStore = useFinal()
|
|
|
|
|
const props = defineProps({
|
|
|
|
|
|
|
|
|
|
taskvalue: {
|
|
|
|
|
type: String,
|
|
|
|
|
default: ""
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
let num = 1
|
|
|
|
|
const pagination = reactive({
|
|
|
|
|
page: 1,
|
|
|
|
@ -99,27 +99,25 @@ async function initData(
|
|
|
|
|
taskName?: string,
|
|
|
|
|
) {
|
|
|
|
|
const asideParmas = unref(finalStore.getAsideValue)
|
|
|
|
|
if(asideParmas.izyear){
|
|
|
|
|
// console.log(asideParmas.izyear)
|
|
|
|
|
if (asideParmas.izyear) {
|
|
|
|
|
// console.log(asideParmas.izyear)
|
|
|
|
|
// asideParmas.izuptime = cloneDeep(asideParmas.izyear)
|
|
|
|
|
// asideParmas.izuptime = asideParmas.izyear.split(",");
|
|
|
|
|
let ontime = dayjs(asideParmas.izyear[0]).format(
|
|
|
|
|
'YYYY/MM/DD',
|
|
|
|
|
)
|
|
|
|
|
let twotime = dayjs(asideParmas.izyear[1]).format(
|
|
|
|
|
'YYYY/MM/DD',
|
|
|
|
|
)
|
|
|
|
|
asideParmas.izuptime =ontime+"-"+twotime
|
|
|
|
|
// delete asideParmas.izyear
|
|
|
|
|
|
|
|
|
|
const ontime = dayjs(asideParmas.izyear[0]).format(
|
|
|
|
|
'YYYY/MM/DD',
|
|
|
|
|
)
|
|
|
|
|
const twotime = dayjs(asideParmas.izyear[1]).format(
|
|
|
|
|
'YYYY/MM/DD',
|
|
|
|
|
)
|
|
|
|
|
asideParmas.izuptime = `${ontime}-${twotime}`
|
|
|
|
|
// delete asideParmas.izyear
|
|
|
|
|
}
|
|
|
|
|
// 有过滤配置的时候优先使用过滤配置,不要使用左侧参数
|
|
|
|
|
// let params = filterId ? { userSearchId: filterId } : asideParmas
|
|
|
|
|
let params = asideParmas
|
|
|
|
|
if (params?.izshowall == true)
|
|
|
|
|
{
|
|
|
|
|
const params = asideParmas
|
|
|
|
|
if (params?.izshowall == true) {
|
|
|
|
|
params.isFail = true
|
|
|
|
|
delete params.izshowall;
|
|
|
|
|
delete params.izshowall
|
|
|
|
|
}
|
|
|
|
|
const result = await getFinalList({
|
|
|
|
|
sortorder: sortorder.value,
|
|
|
|
@ -131,10 +129,10 @@ async function initData(
|
|
|
|
|
...params,
|
|
|
|
|
})
|
|
|
|
|
const { data, pageCount, totalCount } = result
|
|
|
|
|
//console.log(data, pageCount, totalCount)
|
|
|
|
|
// console.log(data, pageCount, totalCount)
|
|
|
|
|
// tableData.value = tableData.value.concat(data);
|
|
|
|
|
tableData.value = data
|
|
|
|
|
// console.log(tableData.value)
|
|
|
|
|
// console.log(tableData.value)
|
|
|
|
|
total.value = totalCount
|
|
|
|
|
pagination.page = page
|
|
|
|
|
pagination.pageCount = Math.ceil(totalCount / pageSize)
|
|
|
|
@ -158,38 +156,36 @@ async function query(
|
|
|
|
|
const asideParmas = unref(finalStore.getAsideValue)
|
|
|
|
|
// 有过滤配置的时候优先使用过滤配置,不要使用左侧参数
|
|
|
|
|
// let params = filterId ? { userSearchId: filterId } : asideParmas
|
|
|
|
|
if(asideParmas.izyear){
|
|
|
|
|
// console.log(asideParmas.izyear)
|
|
|
|
|
if (asideParmas.izyear) {
|
|
|
|
|
// console.log(asideParmas.izyear)
|
|
|
|
|
// asideParmas.izuptime = cloneDeep(asideParmas.izyear)
|
|
|
|
|
// asideParmas.izuptime = asideParmas.izyear.split(",");
|
|
|
|
|
let ontime = dayjs(asideParmas.izyear[0]).format(
|
|
|
|
|
'YYYY/MM/DD',
|
|
|
|
|
)
|
|
|
|
|
let twotime = dayjs(asideParmas.izyear[1]).format(
|
|
|
|
|
'YYYY/MM/DD',
|
|
|
|
|
)
|
|
|
|
|
asideParmas.izuptime =ontime+"-"+twotime
|
|
|
|
|
// delete asideParmas.izyear
|
|
|
|
|
|
|
|
|
|
const ontime = dayjs(asideParmas.izyear[0]).format(
|
|
|
|
|
'YYYY/MM/DD',
|
|
|
|
|
)
|
|
|
|
|
const twotime = dayjs(asideParmas.izyear[1]).format(
|
|
|
|
|
'YYYY/MM/DD',
|
|
|
|
|
)
|
|
|
|
|
asideParmas.izuptime = `${ontime}-${twotime}`
|
|
|
|
|
// delete asideParmas.izyear
|
|
|
|
|
}
|
|
|
|
|
let params = asideParmas
|
|
|
|
|
if (params?.izshowall == true)
|
|
|
|
|
{
|
|
|
|
|
if (params?.izshowall == true) {
|
|
|
|
|
params.isFail = true
|
|
|
|
|
delete params.izshowall;
|
|
|
|
|
delete params.izshowall
|
|
|
|
|
}
|
|
|
|
|
params = params?.izshowall ? {isFail:true} : params;
|
|
|
|
|
params = params?.izshowall ? { isFail: true } : params
|
|
|
|
|
const result = await getFinalList({
|
|
|
|
|
sortorder: sortorder.value,
|
|
|
|
|
pageSize,
|
|
|
|
|
currPage: page,
|
|
|
|
|
sortname: sortname.value,
|
|
|
|
|
taskName,
|
|
|
|
|
// isFail: true,
|
|
|
|
|
// isFail: true,
|
|
|
|
|
...params,
|
|
|
|
|
})
|
|
|
|
|
const { data, pageCount, totalCount } = result
|
|
|
|
|
console.log(data, pageCount, totalCount);
|
|
|
|
|
console.log(data, pageCount, totalCount)
|
|
|
|
|
const newlist = []
|
|
|
|
|
const oldlist = tableData.value
|
|
|
|
|
if (oldlist.length > 0) {
|
|
|
|
@ -239,7 +235,7 @@ function isValidTimestamp(value) {
|
|
|
|
|
function goDetail(row) {
|
|
|
|
|
router.push({
|
|
|
|
|
name: 'final-detail',
|
|
|
|
|
query: { id: row.id, packageid: row.packageid, taskindex: row.taskNode, type:'card' },
|
|
|
|
|
query: { id: row.id, packageid: row.packageid, taskindex: row.taskNode, type: 'card' },
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 小结批量不通过
|
|
|
|
@ -272,7 +268,7 @@ function showModal(modalRef: any) {
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
initRem()
|
|
|
|
|
|
|
|
|
|
initData(1, 20,{},props.taskvalue)
|
|
|
|
|
initData(1, 20, {}, props.taskvalue)
|
|
|
|
|
})
|
|
|
|
|
const item = {
|
|
|
|
|
img: testImg,
|
|
|
|
@ -313,14 +309,14 @@ function doAudit(param: any, row: any) {
|
|
|
|
|
if (code === 'OK') {
|
|
|
|
|
message.success(res.message)
|
|
|
|
|
// changecardstatus(3, row);
|
|
|
|
|
initData(1, 20,{},props.taskvalue)
|
|
|
|
|
initData(1, 20, {}, props.taskvalue)
|
|
|
|
|
num = 1
|
|
|
|
|
reload()
|
|
|
|
|
selectionIds.value = []
|
|
|
|
|
selectionIds.value = []
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
message.error(res.message)
|
|
|
|
|
selectionIds.value = []
|
|
|
|
|
selectionIds.value = []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
@ -423,7 +419,6 @@ function checkBottom() {
|
|
|
|
|
if (!container)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const { scrollTop, clientHeight, scrollHeight } = container;
|
|
|
|
|
const scrollTop = window.pageYOffset || document.documentElement.scrollTop
|
|
|
|
|
|
|
|
|
@ -435,13 +430,13 @@ function checkBottom() {
|
|
|
|
|
const scrollHeight = document.documentElement.scrollHeight
|
|
|
|
|
|
|
|
|
|
clearTimeout(debounceTimer)
|
|
|
|
|
// console.log(pagination)
|
|
|
|
|
// console.log(pagination)
|
|
|
|
|
debounceTimer = setTimeout(() => {
|
|
|
|
|
if (scrollTop + clientHeight >= scrollHeight -500&&!(pagination.pageCount<num)) {
|
|
|
|
|
if (scrollTop + clientHeight >= scrollHeight - 500 && !(pagination.pageCount < num)) {
|
|
|
|
|
num = num + 1
|
|
|
|
|
console.log(num)
|
|
|
|
|
console.log( pagination.pageCount)
|
|
|
|
|
query(num, 20,{},props.taskvalue)
|
|
|
|
|
console.log(pagination.pageCount)
|
|
|
|
|
query(num, 20, {}, props.taskvalue)
|
|
|
|
|
// fetchData(); // 接近底部时加载更多数据
|
|
|
|
|
}
|
|
|
|
|
}, 500)
|
|
|
|
@ -471,18 +466,18 @@ function changesort(sortnamex) {
|
|
|
|
|
sortorder.value = 'asc'
|
|
|
|
|
sortname.value = 'field1'
|
|
|
|
|
}
|
|
|
|
|
initData(1, 20,{},props.taskvalue)
|
|
|
|
|
initData(1, 20, {}, props.taskvalue)
|
|
|
|
|
num = 1
|
|
|
|
|
}
|
|
|
|
|
function notpass (){
|
|
|
|
|
initData(1, 20,{},props.taskvalue)
|
|
|
|
|
selectionIds.value = []
|
|
|
|
|
function notpass() {
|
|
|
|
|
initData(1, 20, {}, props.taskvalue)
|
|
|
|
|
selectionIds.value = []
|
|
|
|
|
}
|
|
|
|
|
watch(
|
|
|
|
|
() => finalStore.asideValue,
|
|
|
|
|
(newVal, oldVal) => {
|
|
|
|
|
initData(1, 20,{},props.taskvalue)
|
|
|
|
|
num=1
|
|
|
|
|
initData(1, 20, {}, props.taskvalue)
|
|
|
|
|
num = 1
|
|
|
|
|
},
|
|
|
|
|
{ deep: true },
|
|
|
|
|
)
|
|
|
|
@ -594,13 +589,13 @@ defineExpose({
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="width: 3vw">
|
|
|
|
|
<!--<SvgIcon name="magnifying-1" size="18" style="margin-right: 8px" />
|
|
|
|
|
<!-- <SvgIcon name="magnifying-1" size="18" style="margin-right: 8px" />
|
|
|
|
|
<SvgIcon
|
|
|
|
|
style="cursor: pointer"
|
|
|
|
|
size="18"
|
|
|
|
|
name="column"
|
|
|
|
|
@click="showModal(customTabelRef)"
|
|
|
|
|
/>-->
|
|
|
|
|
/> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div ref="scrollContainer" :class="tableData.length > 4 ? 'cotnet_wrapeer' : 'cotnet_wrapeertwo'" @scroll="checkBottom">
|
|
|
|
|