This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
import {Page, useVbenModal, type VbenFormProps} from '@vben/common-ui';
|
||||
import {getVxePopupContainer} from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import {Modal, Popconfirm, Space} from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
@@ -14,14 +14,15 @@ import {
|
||||
import {
|
||||
applicationExport,
|
||||
applicationList,
|
||||
applicationRemove,
|
||||
applicationRemove, applicationUpdate,
|
||||
} from '#/api/property/assetManage/application';
|
||||
import type { ApplicationForm } from '#/api/property/assetManage/application/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
import type {ApplicationForm} from '#/api/property/assetManage/application/model';
|
||||
import {commonDownloadExcel} from '#/utils/file/download';
|
||||
|
||||
import applicationModal from './application-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
import {columns, querySchema} from './data';
|
||||
import {useUserStore} from "@vben/stores";
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
@@ -50,7 +51,7 @@ const gridOptions: VxeGridProps = {
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
query: async ({page}, formValues = {}) => {
|
||||
return await applicationList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
@@ -81,7 +82,7 @@ function handleAdd() {
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<ApplicationForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.setData({id: row.id});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
@@ -90,6 +91,17 @@ async function handleDelete(row: Required<ApplicationForm>) {
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
async function handleAudit(row: Required<ApplicationForm>, status: number) {
|
||||
const info = cloneDeep(row)
|
||||
info.state = status
|
||||
info.acceptanceTime = new Date()
|
||||
info.acceptanceUserId = userStore.userInfo?.userId
|
||||
await applicationUpdate(info)
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<ApplicationForm>) => row.id);
|
||||
@@ -141,12 +153,29 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:application:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
<!-- <ghost-button-->
|
||||
<!-- v-access:code="['property:application:edit']"-->
|
||||
<!-- @click.stop="handleEdit(row)"-->
|
||||
<!-- >-->
|
||||
<!-- {{ $t('pages.common.edit') }}-->
|
||||
<!-- </ghost-button>-->
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="资产领用审核"
|
||||
@confirm="handleAudit(row,1)"
|
||||
cancelText="不通过"
|
||||
okText="通过"
|
||||
@cancel="handleAudit(row,2)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['property:application:edit']"
|
||||
@click.stop=""
|
||||
:disabled="row.state!=0"
|
||||
>
|
||||
审核
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
@@ -164,6 +193,6 @@ function handleDownloadExcel() {
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<ApplicationModal @reload="tableApi.query()" />
|
||||
<ApplicationModal @reload="tableApi.query()"/>
|
||||
</Page>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user