This commit is contained in:
@@ -2,7 +2,14 @@
|
||||
import type {ContingenPlanVO} from '#/api/property/customerService/contingenPlan/model';
|
||||
import {shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem, Rate} from 'ant-design-vue';
|
||||
import {
|
||||
Descriptions,
|
||||
DescriptionsItem,
|
||||
Divider,
|
||||
Rate,
|
||||
Timeline,
|
||||
TimelineItem
|
||||
} from 'ant-design-vue';
|
||||
import {contingenPlanInfo} from '#/api/property/customerService/contingenPlan';
|
||||
import {renderDict} from "#/utils/render";
|
||||
|
||||
@@ -14,7 +21,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
});
|
||||
|
||||
const contingenPlanIDetail = shallowRef<null | ContingenPlanVO>(null);
|
||||
|
||||
const handleRecords = shallowRef<null | ContingenPlanVO>(null);
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
@@ -23,6 +30,12 @@ async function handleOpenChange(open: boolean) {
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const response = await contingenPlanInfo(id);
|
||||
contingenPlanIDetail.value = response;
|
||||
handleRecords.value = response.contingenPlanRecordVos.map(item => ({
|
||||
status: item.status,
|
||||
createTime: item.createTime,
|
||||
handlerName: item.dutyPersionName
|
||||
}));
|
||||
console.log(handleRecords.value)
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
@@ -65,5 +78,19 @@ async function handleOpenChange(open: boolean) {
|
||||
<Rate :value="contingenPlanIDetail.grade" disabled />
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
|
||||
<Divider orientation="left" orientation-margin="0px">
|
||||
处理记录
|
||||
</Divider>
|
||||
<Timeline>
|
||||
<TimelineItem v-for="(item,index) in handleRecords" :key="index">
|
||||
<p style="display: flex;">类型:
|
||||
<component
|
||||
:is="renderDict(item.status,'pro_exercise_status')"
|
||||
/></p>
|
||||
<p>时间:{{item.createTime}}</p>
|
||||
<p>处理人:{{item.handlerName}}</p>
|
||||
</TimelineItem>
|
||||
</Timeline>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@@ -15,7 +15,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
label: '预案类型',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'dutyPersion',
|
||||
label: '责任人',
|
||||
},
|
||||
@@ -92,7 +92,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
width: 240,
|
||||
},
|
||||
];
|
||||
|
||||
|
@@ -7,11 +7,12 @@ import {
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {onMounted} from "vue";
|
||||
import {
|
||||
contingenPlanExport,
|
||||
contingenPlanList,
|
||||
contingenPlanRemove,
|
||||
contingenPlanUpdate
|
||||
} from '#/api/property/customerService/contingenPlan';
|
||||
import type { ContingenPlanForm } from '#/api/property/customerService/contingenPlan/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
@@ -19,6 +20,8 @@ import { commonDownloadExcel } from '#/utils/file/download';
|
||||
import contingenPlanModal from './contingenPlan-modal.vue';
|
||||
import contingenPlanDetail from './contingenPlan-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import {personList} from "#/api/property/resident/person";
|
||||
import {renderDictValue} from "#/utils/render";
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -93,6 +96,12 @@ async function handleDelete(row: Required<ContingenPlanForm>) {
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
async function handleExamine(row: Required<ContingenPlanForm>) {
|
||||
row.status = '1'
|
||||
await contingenPlanUpdate(row);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<ContingenPlanForm>) => row.id);
|
||||
@@ -112,6 +121,36 @@ function handleDownloadExcel() {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
}
|
||||
|
||||
async function queryPersonData() {
|
||||
let params = {
|
||||
pageSize: 1000,
|
||||
pageNum: 1,
|
||||
}
|
||||
const res = await personList(params);
|
||||
const options = res.rows.map((user) => ({
|
||||
label: user.userName + '-' + renderDictValue(user.gender, 'sys_user_sex') + '-' + user.phone,
|
||||
value: user.id,
|
||||
}));
|
||||
tableApi.formApi.updateSchema([
|
||||
{
|
||||
componentProps: () => ({
|
||||
options: options,
|
||||
showSearch:true,
|
||||
filterOption: filterOption
|
||||
}),
|
||||
fieldName: 'dutyPersion',
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await queryPersonData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -144,12 +183,26 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<Popconfirm
|
||||
v-if="row.status === '0'"
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认审核?"
|
||||
@confirm="handleExamine(row)"
|
||||
>
|
||||
<ghost-button
|
||||
@click.stop=""
|
||||
>
|
||||
{{ '审核' }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
<ghost-button
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-if="row.status === '0'"
|
||||
v-access:code="['system:contingenPlan:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
|
Reference in New Issue
Block a user