You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
1.7 KiB
84 lines
1.7 KiB
import type { FinalParam, ResetParam } from '/#/api'
|
|
import { http } from '@/utils/http/axios'
|
|
import { notEmpty } from '@/utils'
|
|
import { pickBy } from 'lodash-es'
|
|
import { formatToDate2 } from '@/utils/dateUtil'
|
|
|
|
/**
|
|
* 获取审核列表
|
|
* @returns
|
|
*/
|
|
export async function getFinalList(params: FinalParam) {
|
|
const notEmptyParams = pickBy(params, notEmpty)
|
|
|
|
Object.keys(notEmptyParams).forEach((key) => {
|
|
const val = notEmptyParams[key]
|
|
|
|
if (key === 'izuptime') {
|
|
const start = formatToDate2(val[0])
|
|
const end = formatToDate2(val[1])
|
|
notEmptyParams[key] = `${start}-${end}`
|
|
}
|
|
|
|
if (Array.isArray(notEmptyParams[key]))
|
|
notEmptyParams[key] = val.join(',')
|
|
})
|
|
|
|
const res = await http.request({
|
|
url: `/flow/task/listfinal`,
|
|
method: 'get',
|
|
params: notEmptyParams,
|
|
})
|
|
|
|
const { data: { list, totalPage, totalCount } } = res
|
|
return {
|
|
pageCount: totalPage,
|
|
data: list,
|
|
totalCount,
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 重置审批
|
|
* @param params
|
|
* @returns
|
|
*/
|
|
export async function resetApproval(params: ResetParam) {
|
|
return http.request({
|
|
url: `/flow/task/removeTask`,
|
|
method: 'get',
|
|
params,
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 小结查重
|
|
* @param params
|
|
* @returns
|
|
*/
|
|
export async function repetitionTask() {
|
|
return http.request({
|
|
url: `/flow/task/repetitionTask`,
|
|
method: 'get',
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取审核列表
|
|
* @returns
|
|
*/
|
|
export async function getRepeatList(params: FinalParam) {
|
|
const res = await http.request({
|
|
url: `/flow/task/repetitionTaskList`,
|
|
method: 'get',
|
|
params,
|
|
})
|
|
|
|
const { data: { records, totalPage, totalCount } } = res
|
|
return {
|
|
pageCount: totalPage,
|
|
data: records,
|
|
totalCount,
|
|
}
|
|
}
|