|
|
|
@ -19,6 +19,7 @@ import { isEmpty } from '@/utils'
|
|
|
|
|
import { formatToDateHMS } from '@/utils/dateUtil'
|
|
|
|
|
import { hideDownload } from '@/utils/image'
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['setAsideItemName'])
|
|
|
|
|
const batch = ref(false)
|
|
|
|
|
const selectItems = ref<any[]>([])
|
|
|
|
|
const message = useMessage()
|
|
|
|
@ -43,11 +44,8 @@ function setBatch(value: boolean) {
|
|
|
|
|
|
|
|
|
|
batch.value = value
|
|
|
|
|
|
|
|
|
|
if (value === false) {
|
|
|
|
|
selectItems.value.forEach(item => (item.checked = false))
|
|
|
|
|
selectItems.value.length = 0
|
|
|
|
|
selectItems.value.length = 0
|
|
|
|
|
}
|
|
|
|
|
if (value === false)
|
|
|
|
|
selectItems.value = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function onCheckChange(checked: any, item: any) {
|
|
|
|
@ -94,6 +92,12 @@ function handleKeydown(event) {
|
|
|
|
|
// 在这里执行右箭头的逻辑
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 从store里面获取任务id
|
|
|
|
|
function currentTaskId() {
|
|
|
|
|
const index = taskStore.getCurrentIndex
|
|
|
|
|
return taskStore.getApprovalList[index]?.id || ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// states:1未提交,2待审批,3通过,4不通过
|
|
|
|
|
function validate(items: any[]) {
|
|
|
|
|
if (items.length === 0)
|
|
|
|
@ -169,36 +173,22 @@ function approvalHandler(items?: any) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function rejectHandler(items?: any) {
|
|
|
|
|
// let cloneItem: any
|
|
|
|
|
// if (batch.value) {
|
|
|
|
|
// processItems = selectItems.value
|
|
|
|
|
// }
|
|
|
|
|
// else if (overTask.value) {
|
|
|
|
|
// cloneItem = clone(overTask.value)
|
|
|
|
|
// processItems = [cloneItem]
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// if (items !== undefined && !(items instanceof PointerEvent))
|
|
|
|
|
// processItems = items
|
|
|
|
|
|
|
|
|
|
// const msg = validate(processItems)
|
|
|
|
|
|
|
|
|
|
// if (msg !== null) {
|
|
|
|
|
// message.error(msg)
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
const modal = unref(notPassModalRef)! as any
|
|
|
|
|
modal.showModal(selectItems.value)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function singleRejectHandler() {
|
|
|
|
|
const modal = unref(notPassModalRef)! as any
|
|
|
|
|
modal.showModal([taskDetailInfo.value])
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function doAudit(param: any) {
|
|
|
|
|
audit(param).then((res) => {
|
|
|
|
|
const { code } = res
|
|
|
|
|
setBatch(false)
|
|
|
|
|
if (code === 'OK') {
|
|
|
|
|
message.success('审核成功')
|
|
|
|
|
reloadList()
|
|
|
|
|
setBatch(false)
|
|
|
|
|
reloadList(param, '通过')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else { message.error(res.message) }
|
|
|
|
@ -273,12 +263,6 @@ async function getImgList() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 从store里面获取任务id
|
|
|
|
|
const currentTaskId = computed(() => {
|
|
|
|
|
const index = taskStore.getCurrentIndex
|
|
|
|
|
return taskStore.getApprovalList[index]?.id || ''
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function overTaskHandle() {
|
|
|
|
|
const item = taskDetailInfo.value
|
|
|
|
|
if (item?.userapprove?.statshis === 2 || item?.userapprove?.statshis == 3) {
|
|
|
|
@ -333,7 +317,14 @@ async function getDetail() {
|
|
|
|
|
getImgList()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function reloadList() {
|
|
|
|
|
function reloadList(param, text) {
|
|
|
|
|
// 修改左侧状态
|
|
|
|
|
const id = currentTaskId()
|
|
|
|
|
const hasCurrentId = param.flowTaskInfoList.find(item => item.formId === id)
|
|
|
|
|
|
|
|
|
|
if (hasCurrentId)
|
|
|
|
|
emit('setAsideItemName', text)
|
|
|
|
|
|
|
|
|
|
getDetail()
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
@ -434,7 +425,7 @@ function reloadList() {
|
|
|
|
|
width="168"
|
|
|
|
|
height="48"
|
|
|
|
|
name="r7"
|
|
|
|
|
@click.stop="rejectHandler"
|
|
|
|
|
@click.stop="singleRejectHandler"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="check">
|
|
|
|
@ -575,7 +566,7 @@ function reloadList() {
|
|
|
|
|
<History :data="taskDetailInfo" />
|
|
|
|
|
</n-tab-pane>
|
|
|
|
|
</n-tabs>
|
|
|
|
|
<NotPassed ref="notPassModalRef" @success="reloadList" />
|
|
|
|
|
<NotPassed ref="notPassModalRef" @success="(param) => reloadList(param, '不通过')" />
|
|
|
|
|
<BatchModal
|
|
|
|
|
ref="batchModalRef"
|
|
|
|
|
@reject="rejectHandler"
|
|
|
|
|