Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
@@ -12,7 +12,7 @@ import { requestClient } from '#/api/request';
|
||||
* @returns 意见反馈列表
|
||||
*/
|
||||
export function feedbacksList(params?: FeedbacksQuery) {
|
||||
return requestClient.get<PageResult<FeedbacksVO>>('/system/feedbacks/list', { params });
|
||||
return requestClient.get<PageResult<FeedbacksVO>>('/property/feedbacks/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -21,7 +21,7 @@ export function feedbacksList(params?: FeedbacksQuery) {
|
||||
* @returns 意见反馈列表
|
||||
*/
|
||||
export function feedbacksExport(params?: FeedbacksQuery) {
|
||||
return commonExport('/system/feedbacks/export', params ?? {});
|
||||
return commonExport('/property/feedbacks/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -30,7 +30,7 @@ export function feedbacksExport(params?: FeedbacksQuery) {
|
||||
* @returns 意见反馈详情
|
||||
*/
|
||||
export function feedbacksInfo(id: ID) {
|
||||
return requestClient.get<FeedbacksVO>(`/system/feedbacks/${id}`);
|
||||
return requestClient.get<FeedbacksVO>(`/property/feedbacks/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,7 +39,7 @@ export function feedbacksInfo(id: ID) {
|
||||
* @returns void
|
||||
*/
|
||||
export function feedbacksAdd(data: FeedbacksForm) {
|
||||
return requestClient.postWithMsg<void>('/system/feedbacks', data);
|
||||
return requestClient.postWithMsg<void>('/property/feedbacks', data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ export function feedbacksAdd(data: FeedbacksForm) {
|
||||
* @returns void
|
||||
*/
|
||||
export function feedbacksUpdate(data: FeedbacksForm) {
|
||||
return requestClient.putWithMsg<void>('/system/feedbacks', data);
|
||||
return requestClient.putWithMsg<void>('/property/feedbacks', data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,5 +57,5 @@ export function feedbacksUpdate(data: FeedbacksForm) {
|
||||
* @returns void
|
||||
*/
|
||||
export function feedbacksRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/system/feedbacks/${id}`);
|
||||
return requestClient.deleteWithMsg<void>(`/property/feedbacks/${id}`);
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
import type {PageQuery, BaseEntity} from '#/api/common';
|
||||
|
||||
export interface FeedbacksVO {
|
||||
/**
|
||||
@@ -104,6 +104,11 @@ export interface FeedbacksForm extends BaseEntity {
|
||||
*/
|
||||
serviceName?: string;
|
||||
|
||||
/**
|
||||
* 工单id
|
||||
*/
|
||||
orderId?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface FeedbacksQuery extends PageQuery {
|
||||
|
@@ -0,0 +1,61 @@
|
||||
import type { NoticesVO, NoticesForm, NoticesQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询客户服务-通知公告列表
|
||||
* @param params
|
||||
* @returns 客户服务-通知公告列表
|
||||
*/
|
||||
export function noticesList(params?: NoticesQuery) {
|
||||
return requestClient.get<PageResult<NoticesVO>>('/property/notices/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出客户服务-通知公告列表
|
||||
* @param params
|
||||
* @returns 客户服务-通知公告列表
|
||||
*/
|
||||
export function noticesExport(params?: NoticesQuery) {
|
||||
return commonExport('/property/notices/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户服务-通知公告详情
|
||||
* @param id id
|
||||
* @returns 客户服务-通知公告详情
|
||||
*/
|
||||
export function noticesInfo(id: ID) {
|
||||
return requestClient.get<NoticesVO>(`/property/notices/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户服务-通知公告
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function noticesAdd(data: NoticesForm) {
|
||||
return requestClient.postWithMsg<void>('/property/notices', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新客户服务-通知公告
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function noticesUpdate(data: NoticesForm) {
|
||||
return requestClient.putWithMsg<void>('/property/notices', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除客户服务-通知公告
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function noticesRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/notices/${id}`);
|
||||
}
|
139
apps/web-antd/src/api/property/customerService/notices/model.d.ts
vendored
Normal file
139
apps/web-antd/src/api/property/customerService/notices/model.d.ts
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface NoticesVO {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
title: string;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
type: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 是否全小区公告
|
||||
*/
|
||||
isAll: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime: string;
|
||||
|
||||
/**
|
||||
* 公告内容
|
||||
*/
|
||||
afficheContent: string;
|
||||
|
||||
/**
|
||||
* 发布人
|
||||
*/
|
||||
issuers: number;
|
||||
|
||||
}
|
||||
|
||||
export interface NoticesForm extends BaseEntity {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 是否全小区公告
|
||||
*/
|
||||
isAll?: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 公告内容
|
||||
*/
|
||||
afficheContent?: string;
|
||||
|
||||
/**
|
||||
* 发布人
|
||||
*/
|
||||
issuers?: number;
|
||||
|
||||
}
|
||||
|
||||
export interface NoticesQuery extends PageQuery {
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
type?: string;
|
||||
|
||||
/**
|
||||
* 是否全小区公告
|
||||
*/
|
||||
isAll?: string;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 公告内容
|
||||
*/
|
||||
afficheContent?: string;
|
||||
|
||||
/**
|
||||
* 发布人
|
||||
*/
|
||||
issuers?: number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@@ -207,13 +207,13 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '计费单价',
|
||||
fieldName: 'unitPrice',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '附加费',
|
||||
fieldName: 'surcharge',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
},
|
||||
];
|
||||
|
@@ -3,7 +3,9 @@ import { EditOutlined } from '@ant-design/icons-vue';
|
||||
import {EchartsUI, type EchartsUIType, useEcharts} from "@vben/plugins/echarts";
|
||||
import {onMounted, ref} from "vue";
|
||||
import {countsList} from '#/api/property/customerService/centerConsole'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
const board = ref ({})
|
||||
const getBoard = async () => {
|
||||
board.value = await countsList();
|
||||
@@ -15,19 +17,21 @@ const seriesData = ref<any[]>([]);
|
||||
const workOrderCount = ref<EchartsUIType>();
|
||||
const { renderEcharts: renderWorkOrderCount } = useEcharts(workOrderCount);
|
||||
async function fetchWorkOrderCount() {
|
||||
xAxisData.value = board.value.recentWeekWorkOrders
|
||||
const result = xAxisData.value.map(item => {
|
||||
xAxisData.value = board.value.recentWeekWorkOrders.map(item => {
|
||||
const [year, month, day] = item.date.split('-');
|
||||
const monthDay = `${month}-${day}`;
|
||||
return `${monthDay}${item.dayOfWeek}`;
|
||||
});
|
||||
console.log(result)
|
||||
seriesData.value = board.value.recentWeekWorkOrders.map(item => {
|
||||
return `${item.count}`;
|
||||
});
|
||||
console.log(xAxisData.value,seriesData.value)
|
||||
renderWorkOrderCount({
|
||||
tooltip: { trigger: 'axis' },
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: ['06-17周二', '06-17周二', '06-17周二', '06-17周二', '06-17周二', '06-17周二', '06-17周二']
|
||||
data: xAxisData.value
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
@@ -35,7 +39,7 @@ async function fetchWorkOrderCount() {
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: [6, 2, 0, 1, 0, 0, 1],
|
||||
data: seriesData.value,
|
||||
type: 'line',
|
||||
areaStyle: {},
|
||||
smooth: true,
|
||||
@@ -48,16 +52,19 @@ async function fetchWorkOrderCount() {
|
||||
const satisfactionLevel = ref<EchartsUIType>();
|
||||
const { renderEcharts: renderSatisfactionLevel } = useEcharts(satisfactionLevel);
|
||||
async function fetchSatisfactionLevel() {
|
||||
seriesData.value = board.value.satisfactionRateList.map(item => {
|
||||
return `${item.value}`;
|
||||
})
|
||||
renderSatisfactionLevel({
|
||||
title: {text: '满意度指数',left: '18px'},
|
||||
tooltip: { trigger: 'item'},
|
||||
radar: {
|
||||
indicator: [
|
||||
{name: '1星', max: 1000},
|
||||
{name: '2星', max: 1000},
|
||||
{name: '3星', max: 1000},
|
||||
{name: '4星', max: 1000},
|
||||
{name: '5星', max: 1000},
|
||||
{name: '1星'},
|
||||
{name: '2星'},
|
||||
{name: '3星'},
|
||||
{name: '4星'},
|
||||
{name: '5星'},
|
||||
]
|
||||
},
|
||||
series: [
|
||||
@@ -66,7 +73,7 @@ async function fetchSatisfactionLevel() {
|
||||
name: '满意度指数',
|
||||
data: [
|
||||
{
|
||||
value: [500, 400, 800, 600, 400],
|
||||
value: seriesData.value,
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -153,6 +160,14 @@ async function fetchOrderTyper() {
|
||||
})
|
||||
}
|
||||
|
||||
const goOrderPool = () => {
|
||||
router.push('/property/business/workOrders')
|
||||
}
|
||||
|
||||
const goToDo = () => {
|
||||
router.push('/property/business/workOrderPending')
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getBoard()
|
||||
await fetchWorkOrderCount()
|
||||
@@ -172,7 +187,7 @@ onMounted(async () => {
|
||||
<div>
|
||||
<div>工单总数:</div>
|
||||
<div>{{ board.workOrdersTotal }}</div>
|
||||
<div style="color: #1890FF">点击前往工单池</div>
|
||||
<div style="color: #1890FF;cursor: pointer" @click="goOrderPool()">点击前往工单池</div>
|
||||
</div>
|
||||
<div class="icon-edit"><EditOutlined /></div>
|
||||
</div>
|
||||
@@ -180,7 +195,7 @@ onMounted(async () => {
|
||||
<div>
|
||||
<div>待派工单数:</div>
|
||||
<div>{{ board.notWorkOrdersTotal }}</div>
|
||||
<div style="color: #1890FF">点击前往工单待办</div>
|
||||
<div style="color: #1890FF;cursor: pointer" @click="goToDo()">点击前往工单待办</div>
|
||||
</div>
|
||||
<div class="icon-edit"><EditOutlined /></div>
|
||||
</div>
|
||||
@@ -218,8 +233,8 @@ onMounted(async () => {
|
||||
<div style="margin-left: 20px;line-height: 30px">
|
||||
<div>累计处理工单数</div>
|
||||
<div>12</div>
|
||||
<div>累计回复数</div>
|
||||
<div>2</div>
|
||||
<!-- <div>累计回复数</div>-->
|
||||
<!-- <div>2</div>-->
|
||||
</div>
|
||||
</div>
|
||||
<EchartsUI
|
||||
|
@@ -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)"
|
||||
>
|
||||
|
@@ -5,14 +5,6 @@ import {renderDict} from "#/utils/render";
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options:getDictOptions('wy_yjfklx')
|
||||
},
|
||||
fieldName: 'feedbackType',
|
||||
label: '反馈类型',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
@@ -26,34 +18,30 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '反馈类型',
|
||||
field: 'feedbackType',
|
||||
slots:{
|
||||
default: ({row})=>{
|
||||
return renderDict(row.feedbackType,'wy_yjfklx')
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '反馈人',
|
||||
field: 'feedbackPersion',
|
||||
},
|
||||
{
|
||||
title: '反馈人电话',
|
||||
field: 'feedbackPersionPhone',
|
||||
},
|
||||
// {
|
||||
// title: '反馈类型',
|
||||
// field: 'feedbackType',
|
||||
// width:120
|
||||
// },
|
||||
// {
|
||||
// title: '反馈人',
|
||||
// field: 'feedbackPersion',
|
||||
// width:120
|
||||
// },
|
||||
// {
|
||||
// title: '反馈人电话',
|
||||
// field: 'feedbackPersionPhone',
|
||||
// width:120
|
||||
// },
|
||||
{
|
||||
title: '反馈内容',
|
||||
field: 'feedbackContent',
|
||||
minWidth:180
|
||||
},
|
||||
{
|
||||
title: '反馈位置',
|
||||
field: 'feedbackLocation',
|
||||
},
|
||||
{
|
||||
title: '反馈图片',
|
||||
field: 'feedbackImg',
|
||||
width:120
|
||||
},
|
||||
{
|
||||
title: '是否转至工单',
|
||||
@@ -62,7 +50,8 @@ export const columns: VxeGridProps['columns'] = [
|
||||
default: ({row})=>{
|
||||
return renderDict(row.isWorkOrder,'wy_sf')
|
||||
}
|
||||
}
|
||||
},
|
||||
width:120
|
||||
},
|
||||
{
|
||||
title: '处理状态',
|
||||
@@ -71,18 +60,20 @@ export const columns: VxeGridProps['columns'] = [
|
||||
default: ({row})=>{
|
||||
return renderDict(row.status,'wy_yjclzt')
|
||||
}
|
||||
}
|
||||
},
|
||||
width:120
|
||||
},
|
||||
{
|
||||
title: '客服电话',
|
||||
field: 'serviceName',
|
||||
width:120
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
width: 200,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -100,22 +91,41 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '反馈类型',
|
||||
fieldName: 'feedbackType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options:getDictOptions('wy_yjfklx')
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '反馈人',
|
||||
fieldName: 'person',
|
||||
component: 'Input',
|
||||
slots:{
|
||||
default:'person'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '反馈人',
|
||||
fieldName: 'feedbackPersion',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '反馈人电话',
|
||||
fieldName: 'feedbackPersionPhone',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '客服电话',
|
||||
fieldName: 'serviceName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '反馈内容',
|
||||
@@ -139,19 +149,8 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
// accept: 'image/*', // 可选拓展名或者mime类型 ,拼接
|
||||
// maxCount: 1, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型
|
||||
},
|
||||
rules: 'required',
|
||||
formItemClass:'col-span-2'
|
||||
},
|
||||
{
|
||||
label: '转至工单',
|
||||
fieldName: 'isWorkOrder',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
buttonStyle: 'solid',
|
||||
options: getDictOptions('wy_sf'),
|
||||
},
|
||||
defaultValue:'0'
|
||||
},
|
||||
{
|
||||
label: '处理状态',
|
||||
fieldName: 'status',
|
||||
@@ -159,10 +158,19 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_yjclzt')
|
||||
},
|
||||
rules:'selectRequired'
|
||||
},
|
||||
|
||||
{
|
||||
label: '客服电话',
|
||||
fieldName: 'serviceName',
|
||||
component: 'Input',
|
||||
label: '转至工单',//转至工单
|
||||
fieldName: 'isWorkOrder',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
buttonStyle: 'solid',
|
||||
options: getDictOptions('wy_sf'),
|
||||
optionType: 'button',
|
||||
},
|
||||
defaultValue:'0',
|
||||
rules:'selectRequired'
|
||||
},
|
||||
];
|
||||
|
@@ -0,0 +1,69 @@
|
||||
<script setup lang="ts">
|
||||
import {shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {renderDict} from "#/utils/render";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
import {feedbacksInfo} from "#/api/property/customerService/feedbacks";
|
||||
import type {FeedbacksVO} from "#/api/property/customerService/feedbacks/model";
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
onClosed() {
|
||||
feedbacksDetail.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const feedbacksDetail = shallowRef<null | FeedbacksVO>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
feedbacksDetail.value = await feedbacksInfo(id);
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="意见反馈详情" class="w-[70%]">
|
||||
<Descriptions v-if="feedbacksDetail" size="small" :column="2" bordered
|
||||
:labelStyle="{width:'120px'}">
|
||||
<DescriptionsItem label="反馈类型">
|
||||
{{ feedbacksDetail.feedbackType }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="反馈人">
|
||||
{{ feedbacksDetail.feedbackPersion+'-'+feedbacksDetail.feedbackPersionPhone }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="反馈内容" :span="2">
|
||||
{{ feedbacksDetail.feedbackContent }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="反馈位置" :span="2">
|
||||
{{ feedbacksDetail.feedbackLocation }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="反馈图片" :span="2">
|
||||
{{feedbacksDetail.feedbackImg}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="转至工单">
|
||||
<component
|
||||
:is="renderDict(feedbacksDetail.isWorkOrder,'wy_sf')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="处理状态">
|
||||
<component
|
||||
:is="renderDict(feedbacksDetail.status,'wy_yjclzt')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="客服电话">
|
||||
{{ feedbacksDetail.serviceName }}
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
@@ -1,15 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import {computed, ref} from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {$t} from '@vben/locales';
|
||||
import {cloneDeep} from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { feedbacksAdd, feedbacksInfo, feedbacksUpdate } from '#/api/property/customerService/feedbacks';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
import {useVbenForm} from '#/adapter/form';
|
||||
import {
|
||||
feedbacksAdd,
|
||||
feedbacksInfo,
|
||||
feedbacksUpdate
|
||||
} from '#/api/property/customerService/feedbacks';
|
||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
import {modalSchema} from './data';
|
||||
import type {FeedbacksVO} from "#/api/property/customerService/feedbacks/model";
|
||||
import {workOrdersTypeList} from "#/api/property/businessManagement/workOrdersType";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@@ -34,13 +40,14 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
},
|
||||
);
|
||||
|
||||
const detail = ref<FeedbacksVO>()
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[70%]',
|
||||
@@ -54,11 +61,12 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
const {id} = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
await initWorkOrderTypeOption()
|
||||
if (isUpdate.value && id) {
|
||||
const record = await feedbacksInfo(id);
|
||||
detail.value = record
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@@ -70,7 +78,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
const {valid} = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
@@ -91,11 +99,32 @@ async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
|
||||
async function initWorkOrderTypeOption() {
|
||||
let params = {
|
||||
pageSize: 1000,
|
||||
pageNum: 1
|
||||
}
|
||||
const res = await workOrdersTypeList(params)
|
||||
formApi.updateSchema([{
|
||||
componentProps: () => ({
|
||||
options: res.rows,
|
||||
showSearch: true,
|
||||
optionFilterProp: 'orderTypeName',
|
||||
fieldNames: {label: 'orderTypeName', value: 'id'},
|
||||
}),
|
||||
fieldName: 'feedbackType',
|
||||
}])
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
<BasicForm>
|
||||
<template #person>
|
||||
<span v-if="detail">{{ detail.feedbackPersion + '-' + detail.feedbackPersionPhone }}</span>
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
|
@@ -1,25 +1,23 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import { Space } from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
feedbacksExport,
|
||||
feedbacksList,
|
||||
feedbacksRemove,
|
||||
} from '#/api/property/customerService/feedbacks';
|
||||
import type { FeedbacksForm } from '#/api/property/customerService/feedbacks/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import feedbacksModal from './feedbacks-modal.vue';
|
||||
import feedbacksDetail from './feedbacks-detail.vue';
|
||||
import workOrdersDetail from '../../businessManagement/workOrders/work-orders-detail.vue'
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
@@ -42,8 +40,6 @@ const gridOptions: VxeGridProps = {
|
||||
// 点击行选中
|
||||
// trigger: 'row',
|
||||
},
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// columns: columns(),
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
@@ -63,7 +59,7 @@ const gridOptions: VxeGridProps = {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'system-feedbacks-index'
|
||||
id: 'property-feedbacks-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
@@ -75,35 +71,34 @@ const [FeedbacksModal, modalApi] = useVbenModal({
|
||||
connectedComponent: feedbacksModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
const [WorkOrdersDetail, orderDetailApi] = useVbenModal({
|
||||
connectedComponent: workOrdersDetail,
|
||||
});
|
||||
|
||||
const [FeedbacksDetail, detailApi] = useVbenModal({
|
||||
connectedComponent: feedbacksDetail,
|
||||
});
|
||||
|
||||
|
||||
|
||||
async function handleEdit(row: Required<FeedbacksForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<FeedbacksForm>) {
|
||||
await feedbacksRemove(row.id);
|
||||
await tableApi.query();
|
||||
async function handleInfo(row: Required<FeedbacksForm>) {
|
||||
detailApi.setData({ id: row.id });
|
||||
detailApi.open();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<FeedbacksForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await feedbacksRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
async function handleOrderInfo(row: Required<FeedbacksForm>) {
|
||||
orderDetailApi.setData({ id: row.orderId });
|
||||
orderDetailApi.open();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(feedbacksExport, '意见反馈数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
@@ -122,48 +117,34 @@ function handleDownloadExcel() {
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['system:feedbacks:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['system:feedbacks:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['system:feedbacks:info']"
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['system:feedbacks:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['system:feedbacks:remove']"
|
||||
@click.stop=""
|
||||
v-access:code="['system:feedbacks:info']"
|
||||
@click.stop="handleOrderInfo(row)"
|
||||
:disabled="row.isWorkOrder=='1'"
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
工单详情
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<FeedbacksModal @reload="tableApi.query()" />
|
||||
<FeedbacksDetail></FeedbacksDetail>
|
||||
<WorkOrdersDetail></WorkOrdersDetail>
|
||||
</Page>
|
||||
</template>
|
||||
|
144
apps/web-antd/src/views/property/customerService/notices/data.ts
Normal file
144
apps/web-antd/src/views/property/customerService/notices/data.ts
Normal file
@@ -0,0 +1,144 @@
|
||||
import {type FormSchemaGetter, z} from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import {renderDict} from "#/utils/render";
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'title',
|
||||
label: '标题',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_information_type'),
|
||||
},
|
||||
fieldName: 'type',
|
||||
label: '信息类型',
|
||||
},
|
||||
];
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '信息ID',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '标题',
|
||||
field: 'title',
|
||||
},
|
||||
{
|
||||
title: '信息类型',
|
||||
field: 'type',
|
||||
slots:{
|
||||
default: ({row})=>{
|
||||
return renderDict(row.type,'pro_information_type')
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
field: 'startTime',
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
field: 'endTime',
|
||||
},
|
||||
{
|
||||
title: '发布人',
|
||||
field: 'issuers',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width:'180'
|
||||
},
|
||||
];
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '主键',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '标题',
|
||||
fieldName: 'title',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '公告类型',
|
||||
fieldName: 'type',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_information_type'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '全小区公告',
|
||||
fieldName: 'isAll',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_sf'),
|
||||
},
|
||||
rules: 'required',
|
||||
formItemClass: 'col-span-2',
|
||||
},
|
||||
{
|
||||
label: '通知人',
|
||||
fieldName: 'noticePersion',
|
||||
component: 'ApiSelect',
|
||||
componentProps:{
|
||||
mode: 'multiple',
|
||||
},
|
||||
rules: z.array(z.string()).min(1, { message: '请选择巡检人员' }),
|
||||
formItemClass: 'col-span-2',
|
||||
dependencies: {
|
||||
show: (formValue) =>formValue.isAll==1 ,
|
||||
triggerFields: ['isAll'],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '开始时间',
|
||||
fieldName: 'startTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '结束时间',
|
||||
fieldName: 'endTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '公告内容',
|
||||
fieldName: 'afficheContent',
|
||||
component: 'RichTextarea',
|
||||
componentProps: {
|
||||
// disabled: false, // 是否只读
|
||||
// height: 400 // 高度 默认400
|
||||
},
|
||||
rules: 'required',
|
||||
formItemClass: 'col-span-2'
|
||||
},
|
||||
];
|
@@ -0,0 +1,170 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
noticesList,
|
||||
noticesRemove,
|
||||
} from '#/api/property/customerService/notices';
|
||||
import type { NoticesForm } from '#/api/property/customerService/notices/model';
|
||||
import noticesDetail from './notices-detail.vue';
|
||||
import noticesModal from './notices-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
// 高亮
|
||||
highlight: true,
|
||||
// 翻页时保留选中状态
|
||||
reserve: true,
|
||||
// 点击行选中
|
||||
// trigger: 'row',
|
||||
},
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// columns: columns(),
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await noticesList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-notices-index'
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [NoticesModal, modalApi] = useVbenModal({
|
||||
connectedComponent: noticesModal,
|
||||
});
|
||||
|
||||
const [noticesDetailModal, noticesDetailApi] = useVbenModal({
|
||||
connectedComponent: noticesDetail,
|
||||
});
|
||||
|
||||
async function handleInfo(row: Required<NoticesForm>) {
|
||||
noticesDetailApi.setData({ id: row.id });
|
||||
noticesDetailApi.open();
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<NoticesForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<NoticesForm>) {
|
||||
await noticesRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<NoticesForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await noticesRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="通知公告列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['domain:notices:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['domain:notices:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['domain:notices:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['domain:notices:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<NoticesModal @reload="tableApi.query()" />
|
||||
<noticesDetailModal/>
|
||||
</Page>
|
||||
</template>
|
@@ -0,0 +1,60 @@
|
||||
<script setup lang="ts">
|
||||
import {shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {noticesInfo} from "#/api/property/customerService/notices";
|
||||
import type {NoticesVO} from "#/api/property/customerService/notices/model";
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
onClosed() {
|
||||
noticesDetail.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const noticesDetail = shallowRef<null | NoticesVO>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
noticesDetail.value = await noticesInfo(id);
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="意见反馈详情" class="w-[70%]">
|
||||
<Descriptions v-if="noticesDetail" size="small" :column="2" bordered
|
||||
:labelStyle="{width:'120px'}">
|
||||
<DescriptionsItem label="标题">
|
||||
{{ noticesDetail.title }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="公告类型">
|
||||
<component
|
||||
:is="renderDict(noticesDetail.type,'pro_information_type')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="全小区公告">
|
||||
<component
|
||||
:is="renderDict(noticesDetail.isAll,'wy_sf')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="通知人">
|
||||
{{ noticesDetail.noticePersion }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="开始时间">
|
||||
{{ noticesDetail.startTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="结束时间">
|
||||
{{ noticesDetail.endTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="公告内容">
|
||||
<div v-html="noticesDetail.afficheContent"></div>
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
@@ -0,0 +1,133 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { noticesAdd, noticesInfo, noticesUpdate } from '#/api/property/customerService/notices';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
import {personList} from "#/api/property/resident/person";
|
||||
import {renderDictValue} from "#/utils/render";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||
});
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-1',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
}
|
||||
},
|
||||
schema: modalSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
},
|
||||
);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[60%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
onConfirm: handleConfirm,
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
await queryPersonData()
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await noticesInfo(id);
|
||||
if(record.isAll === '0'){
|
||||
record.noticePersion = null
|
||||
}
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
data.noticePersion = data.noticePersion?.join(',')
|
||||
await (isUpdate.value ? noticesUpdate(data) : noticesAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
|
||||
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 + '-' + user.unitName,
|
||||
value: user.id,
|
||||
}));
|
||||
formApi.updateSchema([{
|
||||
componentProps: () => ({
|
||||
options: options,
|
||||
showSearch: true,
|
||||
filterOption: filterOption,
|
||||
mode: 'multiple',
|
||||
}),
|
||||
fieldName: 'noticePersion',
|
||||
}])
|
||||
}
|
||||
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@@ -20,7 +20,7 @@
|
||||
<a-form-item class="form-button">
|
||||
<a-button @click="handleClean">重置</a-button>
|
||||
<a-button type="primary" class="primary-button"
|
||||
:disabled="!formState.appointmentTime||!formState.openHours||!formState.personNumber"
|
||||
:disabled="!formState.appointmentTime||!(formState.openHours&&formState.openHours.length)||!formState.personNumber"
|
||||
@click="handleSearch">搜索</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
|
@@ -37,9 +37,14 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'name',
|
||||
minWidth:100,
|
||||
},
|
||||
// {
|
||||
// title: '会议室地址',
|
||||
// field: 'locationName',
|
||||
// width:210,
|
||||
// },
|
||||
{
|
||||
title: '会议室地址',
|
||||
field: 'locationName',
|
||||
title: '配套设备',
|
||||
field: 'baseService',
|
||||
width:210,
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user