2024-05-28 08:48:47 +08:00

99 lines
4.0 KiB
Vue

<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" class="flex-1">
<el-option label="全部" value="0" />
<el-option label="待我审核" value="1" />
<el-option label="我已审批" value="2" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="开票抬头" prop="invoice_title" show-overflow-tooltip />
<el-table-column label="开票金额(元)" prop="amount" show-overflow-tooltip />
<el-table-column label="开票类型" prop="invoice_type_text" show-overflow-tooltip />
<el-table-column label="发票状态" prop="check_status_text" show-overflow-tooltip />
<el-table-column label="申请人" prop="user_name" show-overflow-tooltip />
<el-table-column label="所属部门" prop="dept_name" show-overflow-tooltip />
<el-table-column label="申请时间" prop="create_time" show-overflow-tooltip />
<el-table-column label="当前审核人" prop="check_admin_users" show-overflow-tooltip />
<el-table-column label="开票人" prop="open_admin_name" show-overflow-tooltip />
<el-table-column label="开票时间" prop="open_time" show-overflow-tooltip />
<el-table-column label="发票号码" prop="code" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button type="primary" link @click="handDetail(row.id)">
详情
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<detailPopup v-if="showDetail" ref="detailRef" @success="showDetail = false, getLists()"
@close="showDetail = false, getLists()" />
</div>
</template>
<script lang="ts" setup name="oaSealCateLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import detailPopup from './detail.vue'
import { apiInvlicedealwith, apiInvliceDetail } from '@/api/oa_financial'
const detailRef = ref(null)
// 是否显示编辑框
const showDetail = ref(false)
// 查询条件
const queryParams = reactive({
title: '',
status: ''
})
// 选中数据
const selectData = ref<any[]>([])
// 表格选择后回调事件
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
// 获取字典数据
const { dictData } = useDictData('')
// 分页相关
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiInvlicedealwith,
params: queryParams
})
const handDetail = async (id: any) => {
let res = await apiInvliceDetail({ id })
showDetail.value = true
await nextTick()
detailRef.value?.open()
detailRef.value?.setFormData(res)
}
getLists()
</script>