删除不相关业务页面
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VITE_APP_TITLE=智慧物业后台管理系统
|
VITE_APP_TITLE=太阳城水电表管理平台
|
||||||
|
|
||||||
VITE_APP_LOGO_TITLE=智慧物业后台管理系统
|
VITE_APP_LOGO_TITLE=太阳城水电表管理平台
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
VITE_APP_ENV='development'
|
VITE_APP_ENV='development'
|
||||||
@@ -9,7 +9,7 @@ VITE_APP_ENV='development'
|
|||||||
# 开发环境
|
# 开发环境
|
||||||
VITE_APP_BASE_API='/dev-api'
|
VITE_APP_BASE_API='/dev-api'
|
||||||
# # 开发环境 接口代理地址
|
# # 开发环境 接口代理地址
|
||||||
VITE_APP_PROXY_API='http://192.168.0.222:8080'
|
VITE_APP_PROXY_API='http://192.168.0.199:8080'
|
||||||
# 开发环境 接口代理地址
|
# 开发环境 接口代理地址
|
||||||
#VITE_APP_PROXY_API='http://192.168.0.199:8080'
|
#VITE_APP_PROXY_API='http://192.168.0.199:8080'
|
||||||
# 图片基础地址
|
# 图片基础地址
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { ActivityVO, ActivityForm, ActivityQuery } from '@/api/system/Activity/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询活动管理列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listActivity = (query?: ActivityQuery): AxiosPromise<ActivityVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/activity/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询活动管理详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getActivity = (id: string | number): AxiosPromise<ActivityVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/activity/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增活动管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addActivity = (data: ActivityForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/activity',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改活动管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateActivity = (data: ActivityForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/activity',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除活动管理
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delActivity = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/activity/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
export interface ActivityVO {
|
|
||||||
'id': string;
|
|
||||||
'villageId': string;
|
|
||||||
'title': string;
|
|
||||||
'author': string;
|
|
||||||
'content': string;
|
|
||||||
'status': string;
|
|
||||||
'pageViews': number;
|
|
||||||
'createName': string;
|
|
||||||
'coverImage': string;
|
|
||||||
'startTime': string;
|
|
||||||
'endTime': string;
|
|
||||||
'applyDeadline': string;
|
|
||||||
'signinStartTime': string;
|
|
||||||
'signinEndTime': string;
|
|
||||||
'address': string;
|
|
||||||
'quota': number;
|
|
||||||
'appliedCount': number;
|
|
||||||
'organizer': string;
|
|
||||||
'contactName': string;
|
|
||||||
'contactPhone': string;
|
|
||||||
'pointsReward': number;
|
|
||||||
'requirements': string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ActivityForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 活动管理表id
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 标题
|
|
||||||
*/
|
|
||||||
title?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者
|
|
||||||
*/
|
|
||||||
author?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 内容
|
|
||||||
*/
|
|
||||||
content?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布状态 0未发布 1已发布
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 浏览量
|
|
||||||
*/
|
|
||||||
pageViews?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者姓名
|
|
||||||
*/
|
|
||||||
createName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ActivityQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 标题
|
|
||||||
*/
|
|
||||||
title?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者
|
|
||||||
*/
|
|
||||||
author?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 内容
|
|
||||||
*/
|
|
||||||
content?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布状态 0未发布 1已发布
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 浏览量
|
|
||||||
*/
|
|
||||||
pageViews?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者姓名
|
|
||||||
*/
|
|
||||||
createName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { BannerVO, BannerForm, BannerQuery } from './type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询Banner图管理列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listBanner = (query?: BannerQuery): AxiosPromise<BannerVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/banner/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询Banner图管理详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getBanner = (id: string | number): AxiosPromise<BannerVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/banner/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增Banner图管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addBanner = (data: BannerForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/banner',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改Banner图管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateBanner = (data: BannerForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/banner',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除Banner图管理
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delBanner = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/banner/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 改变Banner图管理 状态
|
|
||||||
* @param id
|
|
||||||
* @param status
|
|
||||||
*/
|
|
||||||
export const switchBanner = (id: string, status: string) => {
|
|
||||||
return request({
|
|
||||||
url: '/banner/changeStatus',
|
|
||||||
method: 'GET',
|
|
||||||
params: {
|
|
||||||
id,
|
|
||||||
status
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
export interface BannerVO {
|
|
||||||
/**
|
|
||||||
* Banner图管理表id
|
|
||||||
*/
|
|
||||||
id: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 名称
|
|
||||||
*/
|
|
||||||
name: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态 0启用 1停用
|
|
||||||
*/
|
|
||||||
status: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序
|
|
||||||
*/
|
|
||||||
url: string;
|
|
||||||
byOrder: number;
|
|
||||||
link: string;
|
|
||||||
/**
|
|
||||||
* 小区id
|
|
||||||
*/
|
|
||||||
villageId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BannerForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* Banner图管理表id
|
|
||||||
*/
|
|
||||||
id?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 名称
|
|
||||||
*/
|
|
||||||
name?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态 0启用 1停用
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序
|
|
||||||
*/
|
|
||||||
byOrder?: number;
|
|
||||||
link: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BannerQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 名称
|
|
||||||
*/
|
|
||||||
name?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态 0启用 1停用
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序
|
|
||||||
*/
|
|
||||||
byOrder: number;
|
|
||||||
link: string;
|
|
||||||
/**
|
|
||||||
* 小区id
|
|
||||||
*/
|
|
||||||
villageId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { ComplaintTypeVO, ComplaintTypeForm, ComplaintTypeQuery } from '@/api/system/ComplainType/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询投诉类型管理列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listComplaintType = (query?: ComplaintTypeQuery): AxiosPromise<ComplaintTypeVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/complaintType/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询投诉类型管理详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getComplaintType = (id: string | number): AxiosPromise<ComplaintTypeVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/complaintType/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增投诉类型管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addComplaintType = (data: ComplaintTypeForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/complaintType',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改投诉类型管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateComplaintType = (data: ComplaintTypeForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/complaintType',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除投诉类型管理
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delComplaintType = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/complaintType/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
export interface ComplaintTypeVO {
|
|
||||||
/**
|
|
||||||
* 投诉类型管理表id
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 投诉类型名称
|
|
||||||
*/
|
|
||||||
name: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态 0 启用 1停用
|
|
||||||
*/
|
|
||||||
status: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ComplaintTypeForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 投诉类型管理表id
|
|
||||||
*/
|
|
||||||
id?: string;
|
|
||||||
/**
|
|
||||||
* 状态 0 启用 1停用
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
/**
|
|
||||||
* 投诉类型名称
|
|
||||||
*/
|
|
||||||
name?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ComplaintTypeQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 投诉类型名称
|
|
||||||
*/
|
|
||||||
name?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态 0 启用 1停用
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { ComplaintVO, ComplaintForm, ComplaintQuery } from '@/api/system/Complaint/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询投诉管理列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listComplaint = (query?: ComplaintQuery): AxiosPromise<ComplaintVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/complaint/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询投诉管理详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getComplaint = (id: string): AxiosPromise<ComplaintVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/complaint/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增投诉管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addComplaint = (data: ComplaintForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/complaint',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改投诉管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateComplaint = (data: ComplaintForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/complaint',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除投诉管理
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delComplaint = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/complaint/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
export interface ComplaintVO {
|
|
||||||
/**
|
|
||||||
* 投诉管理表id
|
|
||||||
*/
|
|
||||||
id: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 投诉类型id
|
|
||||||
*/
|
|
||||||
typeId: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问题描述
|
|
||||||
*/
|
|
||||||
problemDes: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 投诉人姓名
|
|
||||||
*/
|
|
||||||
complaintName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号
|
|
||||||
*/
|
|
||||||
phone: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问题照片url
|
|
||||||
*/
|
|
||||||
problemIamgeUrl: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 投诉状态 0 待处理 1 已处理
|
|
||||||
*/
|
|
||||||
status: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理人员id
|
|
||||||
*/
|
|
||||||
handleId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理人员姓名
|
|
||||||
*/
|
|
||||||
handleName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理描述
|
|
||||||
*/
|
|
||||||
handleContent: string;
|
|
||||||
|
|
||||||
problemImageUrl: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ComplaintForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 投诉管理表id
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 投诉类型id
|
|
||||||
*/
|
|
||||||
typeId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问题描述
|
|
||||||
*/
|
|
||||||
problemDes?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 投诉人姓名
|
|
||||||
*/
|
|
||||||
complaintName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号
|
|
||||||
*/
|
|
||||||
phone?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问题照片url
|
|
||||||
*/
|
|
||||||
problemImageUrl?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 投诉状态 0待处理 1处理中 2已处理
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理人员id
|
|
||||||
*/
|
|
||||||
handleId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理人员姓名
|
|
||||||
*/
|
|
||||||
handleName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理描述
|
|
||||||
*/
|
|
||||||
handleContent?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ComplaintQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 投诉类型id
|
|
||||||
*/
|
|
||||||
typeId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问题描述
|
|
||||||
*/
|
|
||||||
problemDes?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 投诉人姓名
|
|
||||||
*/
|
|
||||||
complaintName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号
|
|
||||||
*/
|
|
||||||
phone?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问题照片url
|
|
||||||
*/
|
|
||||||
problemImageUrl?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 投诉状态 0待处理 1处理中 2已处理
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理人员id
|
|
||||||
*/
|
|
||||||
handleId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理人员姓名
|
|
||||||
*/
|
|
||||||
handleName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理描述
|
|
||||||
*/
|
|
||||||
handleContent?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { DecorationVO, DecorationForm, DecorationQuery } from '@/api/system/Decoration/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询装修管理列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listDecoration = (query?: DecorationQuery): AxiosPromise<DecorationVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/decoration/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询装修管理详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getDecoration = (id: string | number): AxiosPromise<DecorationVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/decoration/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增装修管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addDecoration = (data: DecorationForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/decoration',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改装修管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateDecoration = (data: DecorationForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/decoration',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除装修管理
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delDecoration = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/decoration/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
export interface DecorationVO {
|
|
||||||
/**
|
|
||||||
* 装修管理表id
|
|
||||||
*/
|
|
||||||
id: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属小区id
|
|
||||||
*/
|
|
||||||
villageId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属房屋id
|
|
||||||
*/
|
|
||||||
houseId: string | number;
|
|
||||||
buildingId: string;
|
|
||||||
unitNoId: string;
|
|
||||||
/**
|
|
||||||
* 申请人姓名
|
|
||||||
*/
|
|
||||||
applyName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装修公司
|
|
||||||
*/
|
|
||||||
decorationCompany: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装修内容
|
|
||||||
*/
|
|
||||||
decorationContent: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装修押金
|
|
||||||
*/
|
|
||||||
decorationDeposit: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装修验收结果 0通过 1未通过
|
|
||||||
*/
|
|
||||||
inspectionResult: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 验收人
|
|
||||||
*/
|
|
||||||
inspectionName: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DecorationForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 装修管理表id
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属小区id
|
|
||||||
*/
|
|
||||||
villageId?: string;
|
|
||||||
villageName?: string;
|
|
||||||
/**
|
|
||||||
* 所属房屋id
|
|
||||||
*/
|
|
||||||
houseId?: string | number;
|
|
||||||
houseName?: string;
|
|
||||||
/**
|
|
||||||
* 申请人姓名
|
|
||||||
*/
|
|
||||||
applyName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装修公司
|
|
||||||
*/
|
|
||||||
decorationCompany?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装修内容
|
|
||||||
*/
|
|
||||||
decorationContent?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装修押金
|
|
||||||
*/
|
|
||||||
decorationDeposit?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装修验收结果 0通过 1未通过
|
|
||||||
*/
|
|
||||||
inspectionResult?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 验收人
|
|
||||||
*/
|
|
||||||
inspectionName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DecorationQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 所属小区id
|
|
||||||
*/
|
|
||||||
villageId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属房屋id
|
|
||||||
*/
|
|
||||||
houseId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请人姓名
|
|
||||||
*/
|
|
||||||
applyName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装修公司
|
|
||||||
*/
|
|
||||||
decorationCompany?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装修内容
|
|
||||||
*/
|
|
||||||
decorationContent?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装修押金
|
|
||||||
*/
|
|
||||||
decorationDeposit?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 装修验收结果 0通过 1未通过
|
|
||||||
*/
|
|
||||||
inspectionResult?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 验收人
|
|
||||||
*/
|
|
||||||
inspectionName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询巡检数据 概况
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listItem = (query?: Request): AxiosPromise<any[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/data/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
export const overview = (query?: Request): AxiosPromise<any[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/data/generate/overview',
|
|
||||||
method: 'POST',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
export interface Request {
|
|
||||||
/**
|
|
||||||
* 进行中的任务数
|
|
||||||
*/
|
|
||||||
activeTask?: string;
|
|
||||||
/**
|
|
||||||
* 按时完成任务数
|
|
||||||
*/
|
|
||||||
completedTask?: string;
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
createTime?: string;
|
|
||||||
/**
|
|
||||||
* 详细数据
|
|
||||||
*/
|
|
||||||
dataContent?: string;
|
|
||||||
/**
|
|
||||||
* 数据类型:0-概况/1-日报/2-周报/3-月报/4-统计
|
|
||||||
*/
|
|
||||||
dataType?: string;
|
|
||||||
/**
|
|
||||||
* 巡检人员id
|
|
||||||
*/
|
|
||||||
inspectorId?: string;
|
|
||||||
/**
|
|
||||||
* 完成率
|
|
||||||
*/
|
|
||||||
onTimeRate?: string;
|
|
||||||
/**
|
|
||||||
* 超时完成数
|
|
||||||
*/
|
|
||||||
outCompletedTasks?: string;
|
|
||||||
/**
|
|
||||||
* 超时未完成数
|
|
||||||
*/
|
|
||||||
outUncompletedTasks?: string;
|
|
||||||
/**
|
|
||||||
* 未开始的任务数
|
|
||||||
*/
|
|
||||||
pendingTask?: string;
|
|
||||||
statDate?: string;
|
|
||||||
/**
|
|
||||||
* 总任务数
|
|
||||||
*/
|
|
||||||
totalTasks?: string;
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
updateTime?: string;
|
|
||||||
[property: string]: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询 巡检业务统计
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const list_statapi = (query?: { queryDateBegin: string; queryDateEnd: string }): AxiosPromise<any[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/data/role/stat',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export type exportPageApiQuery = {
|
|
||||||
/**
|
|
||||||
* 数据类型:1-日报 / 2-周报 / 3-月报
|
|
||||||
*/
|
|
||||||
dataType?: string;
|
|
||||||
/**
|
|
||||||
* 页码
|
|
||||||
*/
|
|
||||||
pageNum: number;
|
|
||||||
/**
|
|
||||||
* 每页条数
|
|
||||||
*/
|
|
||||||
pageSize: number;
|
|
||||||
/**
|
|
||||||
* 查询开始日期
|
|
||||||
*/
|
|
||||||
queryDateBegin?: string;
|
|
||||||
/**
|
|
||||||
* 查询结束日期
|
|
||||||
*/
|
|
||||||
queryDateEnd?: string;
|
|
||||||
/**
|
|
||||||
* 日期
|
|
||||||
*/
|
|
||||||
statDate?: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type exportAllApiQuery = Omit<exportPageApiQuery, 'pageSize' | 'pageNum'>;
|
|
||||||
/** 导出当前页 数据api */
|
|
||||||
export const exportPageApi = (data: exportPageApiQuery): AxiosPromise<any[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/data/export/page',
|
|
||||||
method: 'POST',
|
|
||||||
data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 导出 所有 数据api */
|
|
||||||
export const exportAllApi = (data: exportAllApiQuery): AxiosPromise<any[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/data/export',
|
|
||||||
method: 'POST',
|
|
||||||
data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { ItemVO, ItemForm, ItemQuery } from './type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询巡检项目列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listItem = (query?: ItemQuery): AxiosPromise<ItemVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/item/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询巡检项目详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getItem = (id: string | number): AxiosPromise<ItemVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/item/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增巡检项目
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addItem = (data: ItemForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/item',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改巡检项目
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateItem = (data: ItemForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/item/updateItem',
|
|
||||||
method: 'PUT',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改巡检项目 状态
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateItemStatus = (data: { id: string; status: string }) => {
|
|
||||||
return request({
|
|
||||||
url: `/inspection/item/changeStatus?id=${data.id}&status=${data.status}`,
|
|
||||||
method: 'PUT'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除巡检项目
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delItem = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/item/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
export interface ItemVO {
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
id: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目名称
|
|
||||||
*/
|
|
||||||
itemName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目编号
|
|
||||||
*/
|
|
||||||
itemCode: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检标准
|
|
||||||
*/
|
|
||||||
inspectionStandard: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目类别
|
|
||||||
*/
|
|
||||||
category: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目描述
|
|
||||||
*/
|
|
||||||
description: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认值
|
|
||||||
*/
|
|
||||||
defaultValue: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 输入类型:text/select/radio/checkbox
|
|
||||||
*/
|
|
||||||
inputType: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 选项,多个用逗号分隔
|
|
||||||
*/
|
|
||||||
options: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否必填:0-否,1-是
|
|
||||||
*/
|
|
||||||
isRequired: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-开启,1-关闭
|
|
||||||
*/
|
|
||||||
status: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ItemForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目名称
|
|
||||||
*/
|
|
||||||
itemName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目编号
|
|
||||||
*/
|
|
||||||
itemCode?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检标准
|
|
||||||
*/
|
|
||||||
inspectionStandard?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目类别
|
|
||||||
*/
|
|
||||||
category?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目描述
|
|
||||||
*/
|
|
||||||
description?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认值
|
|
||||||
*/
|
|
||||||
defaultValue?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 输入类型:text/select/radio/checkbox
|
|
||||||
*/
|
|
||||||
inputType?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 选项,多个用逗号分隔
|
|
||||||
*/
|
|
||||||
options?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否必填:0-否,1-是
|
|
||||||
*/
|
|
||||||
isRequired?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-开启,1-关闭
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ItemQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 项目名称
|
|
||||||
*/
|
|
||||||
itemName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目编号
|
|
||||||
*/
|
|
||||||
itemCode?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检标准
|
|
||||||
*/
|
|
||||||
inspectionStandard?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目类别
|
|
||||||
*/
|
|
||||||
category?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目描述
|
|
||||||
*/
|
|
||||||
description?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认值
|
|
||||||
*/
|
|
||||||
defaultValue?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 输入类型:text/select/radio/checkbox
|
|
||||||
*/
|
|
||||||
inputType?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 选项,多个用逗号分隔
|
|
||||||
*/
|
|
||||||
options?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否必填:0-否,1-是
|
|
||||||
*/
|
|
||||||
isRequired?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-开启,1-关闭
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { PlanVO, PlanForm, PlanQuery } from '@/api/system/InspectionPlan/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询巡检计划列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listPlan = (query: PlanQuery | {} = {}): AxiosPromise<PlanVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/plan/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询巡检计划详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getPlan = (id: string | number): AxiosPromise<PlanVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/plan/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增巡检计划
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addPlan = (data: PlanForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/plan',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改巡检计划
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updatePlan = (data: PlanForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/plan',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除巡检计划
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delPlan = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/plan/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 改变巡检计划状态
|
|
||||||
* @param id
|
|
||||||
* @param status
|
|
||||||
*/
|
|
||||||
export const changePlanStatus = (id: string, status: string) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/plan/changeStatus',
|
|
||||||
method: 'put',
|
|
||||||
params: { id, status }
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,186 +0,0 @@
|
|||||||
export interface PlanVO {
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
id: string | number;
|
|
||||||
inspectorIds: string;
|
|
||||||
/**
|
|
||||||
* 巡检计划名称
|
|
||||||
*/
|
|
||||||
planName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行周期,如:开始日期-结束日期
|
|
||||||
*/
|
|
||||||
executeCycle: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务时间
|
|
||||||
*/
|
|
||||||
taskTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提醒时间
|
|
||||||
*/
|
|
||||||
remindTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检设置:0-必须拍照,1-可以跳检
|
|
||||||
*/
|
|
||||||
inspectSetting: number;
|
|
||||||
inspectSettingDict: {
|
|
||||||
dictLabel: string;
|
|
||||||
dictValue: string;
|
|
||||||
listClass: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 计划路线,多个用逗号分隔
|
|
||||||
*/
|
|
||||||
routeIds: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-关闭,1-开启
|
|
||||||
*/
|
|
||||||
status: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行周期具体日期
|
|
||||||
*/
|
|
||||||
executeDay: string;
|
|
||||||
executeDayList: {
|
|
||||||
dictLabel: string;
|
|
||||||
dictValue: string;
|
|
||||||
listClass: string;
|
|
||||||
}[];
|
|
||||||
/** 巡检人员信息 */
|
|
||||||
inspectorList: {
|
|
||||||
'userId': string;
|
|
||||||
'userName': string;
|
|
||||||
'nickName': string;
|
|
||||||
'phonenumber': number;
|
|
||||||
}[];
|
|
||||||
/** 巡检路线 */
|
|
||||||
routeList: {
|
|
||||||
'id': string;
|
|
||||||
'routeName': string;
|
|
||||||
'description': string;
|
|
||||||
'totalPoints': string;
|
|
||||||
'estimatedTime': number;
|
|
||||||
'routeStatus': string;
|
|
||||||
}[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PlanForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检计划名称
|
|
||||||
*/
|
|
||||||
planName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检人员ID,多个用逗号分隔
|
|
||||||
*/
|
|
||||||
inspectorIds?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行周期,如:开始日期-结束日期
|
|
||||||
*/
|
|
||||||
executeCycle?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务时间
|
|
||||||
*/
|
|
||||||
taskTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提醒时间
|
|
||||||
*/
|
|
||||||
remindTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检设置:0-必须拍照,1-可以跳检
|
|
||||||
*/
|
|
||||||
inspectSetting?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 计划路线,多个用逗号分隔
|
|
||||||
*/
|
|
||||||
routeIds?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-关闭,1-开启
|
|
||||||
*/
|
|
||||||
status?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行周期具体日期
|
|
||||||
*/
|
|
||||||
executeDay?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PlanQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 巡检计划名称
|
|
||||||
*/
|
|
||||||
planName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检人员ID,多个用逗号分隔
|
|
||||||
*/
|
|
||||||
inspectorIds?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行周期,如:开始日期-结束日期
|
|
||||||
*/
|
|
||||||
executeCycle?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务时间
|
|
||||||
*/
|
|
||||||
taskTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提醒时间
|
|
||||||
*/
|
|
||||||
remindTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检设置:0-必须拍照,1-可以跳检
|
|
||||||
*/
|
|
||||||
inspectSetting?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 计划路线,多个用逗号分隔
|
|
||||||
*/
|
|
||||||
routeIds?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-关闭,1-开启
|
|
||||||
*/
|
|
||||||
status?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行周期具体日期
|
|
||||||
*/
|
|
||||||
executeDay?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { PointVO, PointForm, PointQuery } from '@/api/system/InspectionPoint/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询巡检点列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listPoint = (query?: PointQuery | {}): AxiosPromise<PointVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/point/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询巡检点详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getPoint = (id: string | number): AxiosPromise<PointVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/point/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增巡检点
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addPoint = (data: PointForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/point',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改巡检点
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updatePoint = (data: PointForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/point',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除巡检点
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delPoint = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/point/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 修改巡检点状态
|
|
||||||
* @param id
|
|
||||||
* @param status
|
|
||||||
*/
|
|
||||||
export const changePointStatus = (id: string, status: string) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/point/changeStatus?id=' + id + '&status=' + status,
|
|
||||||
method: 'PUT'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,150 +0,0 @@
|
|||||||
export interface PointVO {
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检点名称
|
|
||||||
*/
|
|
||||||
pointName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检项目id
|
|
||||||
*/
|
|
||||||
itemId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属路线ID
|
|
||||||
*/
|
|
||||||
routeId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检点位置(经纬度),格式:经度,纬度
|
|
||||||
*/
|
|
||||||
location: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打卡方式:9999定位打卡、9998蓝牙打卡、9997NFC打卡
|
|
||||||
*/
|
|
||||||
checkMode: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-开启,1-关闭
|
|
||||||
*/
|
|
||||||
status: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点位编号
|
|
||||||
*/
|
|
||||||
pointCode: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否打卡 0:已打卡 1:未打卡
|
|
||||||
*/
|
|
||||||
isCheck: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PointForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检点名称
|
|
||||||
*/
|
|
||||||
pointName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检项目id
|
|
||||||
*/
|
|
||||||
itemId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属路线ID
|
|
||||||
*/
|
|
||||||
routeId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检点位置(经纬度),格式:经度,纬度
|
|
||||||
*/
|
|
||||||
location?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打卡方式:9999定位打卡、9998蓝牙打卡、9997NFC打卡
|
|
||||||
*/
|
|
||||||
checkMode?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-开启,1-关闭
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点位编号
|
|
||||||
*/
|
|
||||||
pointCode?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否打卡 0:已打卡 1:未打卡
|
|
||||||
*/
|
|
||||||
isCheck?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PointQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 巡检点名称
|
|
||||||
*/
|
|
||||||
pointName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检项目id
|
|
||||||
*/
|
|
||||||
itemId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属路线ID
|
|
||||||
*/
|
|
||||||
routeId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检点位置(经纬度),格式:经度,纬度
|
|
||||||
*/
|
|
||||||
location?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打卡方式:9999定位打卡、9998蓝牙打卡、9997NFC打卡
|
|
||||||
*/
|
|
||||||
checkMode?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-开启,1-关闭
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点位编号
|
|
||||||
*/
|
|
||||||
pointCode?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否打卡 0:已打卡 1:未打卡
|
|
||||||
*/
|
|
||||||
isCheck?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { RecordVO, RecordForm, RecordQuery } from '@/api/system/InspectionRecord/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询巡检记录主列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listRecord = (query?: RecordQuery): AxiosPromise<RecordVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/record/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询巡检记录主详细
|
|
||||||
* @param id
|
|
||||||
* @param date
|
|
||||||
*/
|
|
||||||
export const getRecord = (id: string, date?: string): AxiosPromise<RecordVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/record/' + id,
|
|
||||||
method: 'get',
|
|
||||||
params: {
|
|
||||||
date
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增巡检记录主
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addRecord = (data: RecordForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/record',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改巡检记录主
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateRecord = (data: RecordForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/record',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除巡检记录主
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delRecord = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/record/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
export interface RecordVO {
|
|
||||||
actualEndTime?: string;
|
|
||||||
actualStartTime?: string;
|
|
||||||
createByName?: string;
|
|
||||||
createTime?: string;
|
|
||||||
details?: DetailsVo[];
|
|
||||||
id?: string;
|
|
||||||
inspectorId?: number;
|
|
||||||
inspectorName?: string;
|
|
||||||
planId?: string;
|
|
||||||
planName?: string;
|
|
||||||
remark?: string;
|
|
||||||
routeId?: string;
|
|
||||||
routeName?: string;
|
|
||||||
status?: string;
|
|
||||||
statusLabel?: null;
|
|
||||||
taskName?: string;
|
|
||||||
taskTime?: string;
|
|
||||||
updateTime?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RecordForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联巡检任务ID
|
|
||||||
*/
|
|
||||||
taskId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联巡检计划ID
|
|
||||||
*/
|
|
||||||
planId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检人员ID
|
|
||||||
*/
|
|
||||||
inspectorId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检路线ID
|
|
||||||
*/
|
|
||||||
routeId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务开始时间
|
|
||||||
*/
|
|
||||||
startTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务结束时间
|
|
||||||
*/
|
|
||||||
endTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行状态(字典:inspection_exec_status 0-按时完成 1-超时完成 2-未完成)
|
|
||||||
*/
|
|
||||||
execStatus?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RecordQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 执行状态(字典:inspection_exec_status 0-按时完成 1-超时完成 2-未完成)
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
taskTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 任务名称
|
|
||||||
*/
|
|
||||||
taskName?: string;
|
|
||||||
|
|
||||||
taskTimeBegin?: string;
|
|
||||||
taskTimeEnd?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DetailsVo {
|
|
||||||
'id': string;
|
|
||||||
'taskId': string;
|
|
||||||
'pointId': string;
|
|
||||||
'pointName': string;
|
|
||||||
'location': string;
|
|
||||||
'checkTime': string;
|
|
||||||
'checkResult': string;
|
|
||||||
'photos': string;
|
|
||||||
'sortNo': string;
|
|
||||||
'remark': string;
|
|
||||||
'imgUrl': string;
|
|
||||||
'status': string;
|
|
||||||
photoslist?: string[];
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { RouteVO, RouteForm, RouteQuery } from './type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询巡检路线列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listRoute = (query: RouteQuery | {} = {}): AxiosPromise<RouteVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/route/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询巡检路线详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getRoute = (id: string): AxiosPromise<RouteVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/route/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增巡检路线
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addRoute = (data: RouteForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/route',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改巡检路线
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateRoute = (data: RouteForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/route',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除巡检路线
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delRoute = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/route/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const changeStatusRoute = (id: string, status: string) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/route/changeStatus',
|
|
||||||
method: 'put',
|
|
||||||
params: { id, status }
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
import { PointVO } from '../InspectionPoint/type';
|
|
||||||
|
|
||||||
export interface RouteVO {
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检路线名称
|
|
||||||
*/
|
|
||||||
routeName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线描述
|
|
||||||
*/
|
|
||||||
description: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检点
|
|
||||||
*/
|
|
||||||
totalPoints: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预计巡检时长(分钟)
|
|
||||||
*/
|
|
||||||
estimatedTime: number;
|
|
||||||
|
|
||||||
items: { itemName: string }[];
|
|
||||||
PointsName: string;
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检路线状态 0开启 1关闭
|
|
||||||
|
|
||||||
*/
|
|
||||||
routeStatus: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 起点经度
|
|
||||||
*/
|
|
||||||
startLng: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 起点纬度
|
|
||||||
*/
|
|
||||||
startLat: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 终点经度
|
|
||||||
*/
|
|
||||||
endLng: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 终点纬度
|
|
||||||
*/
|
|
||||||
endLat: string;
|
|
||||||
/** 路线经纬度 二维数组 */
|
|
||||||
pathPoints: string;
|
|
||||||
/** 巡检点 数组 */
|
|
||||||
points?: PointVO[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RouteForm extends BaseEntity {
|
|
||||||
/** 路线经纬度 二维数组 */
|
|
||||||
pathPoints: string;
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
id?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检路线名称
|
|
||||||
*/
|
|
||||||
routeName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线描述
|
|
||||||
*/
|
|
||||||
description?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检点
|
|
||||||
*/
|
|
||||||
totalPoints?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预计巡检时长(分钟)
|
|
||||||
*/
|
|
||||||
estimatedTime?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检路线状态 0开启 1关闭
|
|
||||||
|
|
||||||
*/
|
|
||||||
routeStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 起点经度
|
|
||||||
*/
|
|
||||||
startLng?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 起点纬度
|
|
||||||
*/
|
|
||||||
startLat?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 终点经度
|
|
||||||
*/
|
|
||||||
endLng?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 终点纬度
|
|
||||||
*/
|
|
||||||
endLat?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RouteQuery extends PageQuery {
|
|
||||||
/** 路线经纬度 二维数组 */
|
|
||||||
pathPoints: string;
|
|
||||||
/**
|
|
||||||
* 巡检路线名称
|
|
||||||
*/
|
|
||||||
routeName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线描述
|
|
||||||
*/
|
|
||||||
description?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检点
|
|
||||||
*/
|
|
||||||
totalPoints?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预计巡检时长(分钟)
|
|
||||||
*/
|
|
||||||
estimatedTime?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检路线状态 0开启 1关闭
|
|
||||||
|
|
||||||
*/
|
|
||||||
routeStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 起点经度
|
|
||||||
*/
|
|
||||||
startLng?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 起点纬度
|
|
||||||
*/
|
|
||||||
startLat?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 终点经度
|
|
||||||
*/
|
|
||||||
endLng?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 终点纬度
|
|
||||||
*/
|
|
||||||
endLat?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { TaskVO, TaskForm, TaskQuery } from './type';
|
|
||||||
/**
|
|
||||||
* 查询巡检任务列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listTask = (query?: TaskQuery): AxiosPromise<TaskVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/task/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询巡检任务详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getTask = (id: string | number): AxiosPromise<TaskVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/task/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增巡检任务
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addTask = (data: TaskForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/task',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改巡检任务
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateTask = (data: TaskForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/task',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除巡检任务
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delTask = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/inspection/task/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
export interface TaskVO {
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
id: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检任务名称
|
|
||||||
*/
|
|
||||||
taskName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联巡检计划ID
|
|
||||||
*/
|
|
||||||
planId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检人员ID
|
|
||||||
*/
|
|
||||||
inspectorId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检路线ID
|
|
||||||
*/
|
|
||||||
routeId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 起止日期
|
|
||||||
*/
|
|
||||||
taskTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-待执行,1-执行中,2-已完成,3-已超时
|
|
||||||
*/
|
|
||||||
status: string;
|
|
||||||
|
|
||||||
/** 巡检人员信息 */
|
|
||||||
inspectorInfo: {
|
|
||||||
'userId': string;
|
|
||||||
'userName': string;
|
|
||||||
'nickName': string;
|
|
||||||
'phonenumber': '';
|
|
||||||
'avatar': string;
|
|
||||||
}[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提醒时间
|
|
||||||
*/
|
|
||||||
remindTime: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface TaskForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检任务名称
|
|
||||||
*/
|
|
||||||
taskName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联巡检计划ID
|
|
||||||
*/
|
|
||||||
planId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检人员ID
|
|
||||||
*/
|
|
||||||
inspectorId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检路线ID
|
|
||||||
*/
|
|
||||||
routeId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 起止日期
|
|
||||||
*/
|
|
||||||
taskTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-待执行,1-执行中,2-已完成,3-已超时
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提醒时间
|
|
||||||
*/
|
|
||||||
remindTime?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface TaskQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 巡检任务名称
|
|
||||||
*/
|
|
||||||
taskName?: string;
|
|
||||||
taskTimeBegin?: string;
|
|
||||||
taskTimeEnd?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联巡检计划ID
|
|
||||||
*/
|
|
||||||
planId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检人员ID
|
|
||||||
*/
|
|
||||||
inspectorId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 巡检路线ID
|
|
||||||
*/
|
|
||||||
routeId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 起止日期
|
|
||||||
*/
|
|
||||||
taskTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 费用单位
|
|
||||||
*/
|
|
||||||
costUnit?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-待执行,1-执行中,2-已完成,3-已超时
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提醒时间
|
|
||||||
*/
|
|
||||||
remindTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { MonthCardVO, MonthCardForm, MonthCardQuery } from '@/api/system/MonthCard/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询月卡管理列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listMonthCard = (query?: MonthCardQuery): AxiosPromise<MonthCardVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/monthCard/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询月卡管理详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getMonthCard = (id: string | number): AxiosPromise<MonthCardVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/monthCard/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增月卡管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addMonthCard = (data: MonthCardForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/monthCard',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改月卡管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateMonthCard = (data: MonthCardForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/monthCard',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除月卡管理
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delMonthCard = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/monthCard/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
export interface MonthCardVO {
|
|
||||||
/**
|
|
||||||
* 月卡管理表id
|
|
||||||
*/
|
|
||||||
id: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 办理时间
|
|
||||||
*/
|
|
||||||
handleTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 持卡人姓名
|
|
||||||
*/
|
|
||||||
cardName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号码
|
|
||||||
*/
|
|
||||||
phone: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 绑定车牌号
|
|
||||||
*/
|
|
||||||
carNum: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 办理人姓名
|
|
||||||
*/
|
|
||||||
handleName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 月卡编号
|
|
||||||
*/
|
|
||||||
cardCode: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 费用/元
|
|
||||||
*/
|
|
||||||
cost: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支付方式 0微信 1支付宝 2线下缴费
|
|
||||||
*/
|
|
||||||
payMethod: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始日期
|
|
||||||
*/
|
|
||||||
startTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结束日期
|
|
||||||
*/
|
|
||||||
endTime: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MonthCardForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 月卡管理表id
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 办理时间
|
|
||||||
*/
|
|
||||||
handleTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 持卡人姓名
|
|
||||||
*/
|
|
||||||
cardName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号码
|
|
||||||
*/
|
|
||||||
phone?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 绑定车牌号
|
|
||||||
*/
|
|
||||||
carNum?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 办理人姓名
|
|
||||||
*/
|
|
||||||
handleName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 月卡编号
|
|
||||||
*/
|
|
||||||
cardCode?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 费用/元
|
|
||||||
*/
|
|
||||||
cost?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支付方式 0微信 1支付宝 2线下缴费
|
|
||||||
*/
|
|
||||||
payMethod?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始日期
|
|
||||||
*/
|
|
||||||
startTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结束日期
|
|
||||||
*/
|
|
||||||
endTime?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MonthCardQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 办理时间
|
|
||||||
*/
|
|
||||||
handleTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 持卡人姓名
|
|
||||||
*/
|
|
||||||
cardName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号码
|
|
||||||
*/
|
|
||||||
phone?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 绑定车牌号
|
|
||||||
*/
|
|
||||||
carNum?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 办理人姓名
|
|
||||||
*/
|
|
||||||
handleName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 月卡编号
|
|
||||||
*/
|
|
||||||
cardCode?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 费用/元
|
|
||||||
*/
|
|
||||||
cost?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支付方式 0微信 1支付宝 2线下缴费
|
|
||||||
*/
|
|
||||||
payMethod?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始日期
|
|
||||||
*/
|
|
||||||
startTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结束日期
|
|
||||||
*/
|
|
||||||
endTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { NoticeVO, NoticeForm, NoticeQuery } from '@/api/system/NoticePc/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询公告信息列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listNotice = (query?: NoticeQuery): AxiosPromise<NoticeVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/notice/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询公告信息详细
|
|
||||||
* @param noticeId
|
|
||||||
*/
|
|
||||||
export const getNotice = (noticeId: string | number): AxiosPromise<NoticeVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/notice/' + noticeId,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增公告信息
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addNotice = (data: NoticeForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/notice',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改公告信息
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateNotice = (data: NoticeForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/notice',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除公告信息
|
|
||||||
* @param noticeId
|
|
||||||
*/
|
|
||||||
export const delNotice = (noticeId: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/notice/' + noticeId,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
export interface NoticeVO {
|
|
||||||
/**
|
|
||||||
* 公告ID
|
|
||||||
*/
|
|
||||||
noticeId: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公告标题
|
|
||||||
*/
|
|
||||||
noticeTitle: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公告内容
|
|
||||||
*/
|
|
||||||
noticeContent: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者
|
|
||||||
*/
|
|
||||||
author: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 紧急程度 0=普通 1=紧急 2=非常紧急
|
|
||||||
*/
|
|
||||||
urgencyLevel: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布状态 0=草稿 1=已发布
|
|
||||||
*/
|
|
||||||
publishStatus: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布人
|
|
||||||
*/
|
|
||||||
publishBy: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布日期
|
|
||||||
*/
|
|
||||||
publishTime: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface NoticeForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 公告ID
|
|
||||||
*/
|
|
||||||
noticeId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公告标题
|
|
||||||
*/
|
|
||||||
noticeTitle?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公告内容
|
|
||||||
*/
|
|
||||||
noticeContent?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者
|
|
||||||
*/
|
|
||||||
author?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 紧急程度 0=普通 1=紧急 2=非常紧急
|
|
||||||
*/
|
|
||||||
urgencyLevel?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布状态 0=草稿 1=已发布
|
|
||||||
*/
|
|
||||||
publishStatus?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布人
|
|
||||||
*/
|
|
||||||
publishBy?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布日期
|
|
||||||
*/
|
|
||||||
publishTime?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface NoticeQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 公告标题
|
|
||||||
*/
|
|
||||||
noticeTitle?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公告内容
|
|
||||||
*/
|
|
||||||
noticeContent?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者
|
|
||||||
*/
|
|
||||||
author?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 紧急程度 0=普通 1=紧急 2=非常紧急
|
|
||||||
*/
|
|
||||||
urgencyLevel?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布状态 0=草稿 1=已发布
|
|
||||||
*/
|
|
||||||
publishStatus?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布人
|
|
||||||
*/
|
|
||||||
publishBy?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布日期
|
|
||||||
*/
|
|
||||||
publishTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
|
|
||||||
export interface NotificationVo {
|
|
||||||
'id': 'string';
|
|
||||||
'title': 'string';
|
|
||||||
'item': 'string';
|
|
||||||
'content': 'string';
|
|
||||||
'manageIsCheck': 'string';
|
|
||||||
'repairIsCheck': 'string';
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 查询消息通知列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const getNotificationList = (query): AxiosPromise<NotificationVo[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/notification/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 消息通知 已读
|
|
||||||
* @returns {*}
|
|
||||||
* @param ids
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const ReadNotificationByID = (ids: string[]) => {
|
|
||||||
return request({
|
|
||||||
url: '/notification/read',
|
|
||||||
method: 'POST',
|
|
||||||
data: {
|
|
||||||
id: ids
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { ParkingCostVO, ParkingCostForm, ParkingCostQuery } from './type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询停车缴费管理列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listParkingCost = (query?: ParkingCostQuery): AxiosPromise<ParkingCostVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/parkingCost/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询停车缴费管理详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getParkingCost = (id: string | number): AxiosPromise<ParkingCostVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/parkingCost/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增停车缴费管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addParkingCost = (data: ParkingCostForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/parkingCost',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改停车缴费管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateParkingCost = (data: ParkingCostForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/parkingCost',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除停车缴费管理
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delParkingCost = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/parkingCost/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export type Request = {
|
|
||||||
/**
|
|
||||||
* 区域id
|
|
||||||
*/
|
|
||||||
areaId?: string;
|
|
||||||
/**
|
|
||||||
* 0 审核中 1 审核通过 2 审核不通过
|
|
||||||
*/
|
|
||||||
checkStatus?: string;
|
|
||||||
/**
|
|
||||||
* 添加者姓名,sys_user nickname
|
|
||||||
*/
|
|
||||||
createName?: string;
|
|
||||||
/**
|
|
||||||
* id车位管理表
|
|
||||||
*/
|
|
||||||
id?: string;
|
|
||||||
/**
|
|
||||||
* 车位面积(单位㎡)
|
|
||||||
*/
|
|
||||||
parkingArea?: number;
|
|
||||||
/**
|
|
||||||
* 车位编号
|
|
||||||
*/
|
|
||||||
parkingCode?: string;
|
|
||||||
/**
|
|
||||||
* 车位楼层
|
|
||||||
*/
|
|
||||||
parkingFloor?: string;
|
|
||||||
/**
|
|
||||||
* 车位状态 0 闲置 1自用 2出租
|
|
||||||
*/
|
|
||||||
parkingStatus?: string;
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
/**
|
|
||||||
* 住户id
|
|
||||||
*/
|
|
||||||
residentId?: string;
|
|
||||||
/**
|
|
||||||
* 所属小区id
|
|
||||||
*/
|
|
||||||
villageId?: string;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 查询停车缴费 车位列表
|
|
||||||
* @param {Request} queryParams
|
|
||||||
*/
|
|
||||||
export const getParkingCostCarAreaApi = (queryParams: Request) => {
|
|
||||||
return request({
|
|
||||||
url: '/parkingCost/parkingList',
|
|
||||||
method: 'get',
|
|
||||||
params: queryParams
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,195 +0,0 @@
|
|||||||
export interface ParkingCostVO {
|
|
||||||
/**
|
|
||||||
* 停车缴费表id
|
|
||||||
*/
|
|
||||||
id: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 区域id
|
|
||||||
*/
|
|
||||||
areaId: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车位id
|
|
||||||
*/
|
|
||||||
parkingId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收费项目 0临时停车
|
|
||||||
*/
|
|
||||||
chargeItem: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 缴纳人姓名
|
|
||||||
*/
|
|
||||||
payerName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车牌号
|
|
||||||
*/
|
|
||||||
carNum: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始时间
|
|
||||||
*/
|
|
||||||
startTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结束时间
|
|
||||||
*/
|
|
||||||
endTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 费用/元
|
|
||||||
*/
|
|
||||||
cost: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 缴纳状态 0待缴纳 1已缴纳
|
|
||||||
*/
|
|
||||||
payerStatus: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支付方式 0微信 1支付宝 2线下缴费
|
|
||||||
*/
|
|
||||||
payMethod: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属小区id
|
|
||||||
*/
|
|
||||||
villageId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ParkingCostForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 停车缴费表id
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 区域id
|
|
||||||
*/
|
|
||||||
areaId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车位id
|
|
||||||
*/
|
|
||||||
parkingId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收费项目 0临时停车
|
|
||||||
*/
|
|
||||||
chargeItem?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 缴纳人姓名
|
|
||||||
*/
|
|
||||||
payerName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车牌号
|
|
||||||
*/
|
|
||||||
carNum?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始时间
|
|
||||||
*/
|
|
||||||
startTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结束时间
|
|
||||||
*/
|
|
||||||
endTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 费用/元
|
|
||||||
*/
|
|
||||||
cost?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 缴纳状态 0待缴纳 1已缴纳
|
|
||||||
*/
|
|
||||||
payerStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支付方式 0微信 1支付宝 2线下缴费
|
|
||||||
*/
|
|
||||||
payMethod?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属小区id
|
|
||||||
*/
|
|
||||||
villageId?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ParkingCostQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 区域id
|
|
||||||
*/
|
|
||||||
areaId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车位id
|
|
||||||
*/
|
|
||||||
parkingId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 收费项目 0临时停车
|
|
||||||
*/
|
|
||||||
chargeItem?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 缴纳人姓名
|
|
||||||
*/
|
|
||||||
payerName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车牌号
|
|
||||||
*/
|
|
||||||
carNum?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始时间
|
|
||||||
*/
|
|
||||||
startTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结束时间
|
|
||||||
*/
|
|
||||||
endTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 费用/元
|
|
||||||
*/
|
|
||||||
cost?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 缴纳状态 0待缴纳 1已缴纳
|
|
||||||
*/
|
|
||||||
payerStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支付方式 0微信 1支付宝 2线下缴费
|
|
||||||
*/
|
|
||||||
payMethod?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属小区id
|
|
||||||
*/
|
|
||||||
villageId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,159 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取缴费方式,种类占比
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
export type IncomeStatsResponse = {
|
|
||||||
'totalDue': string;
|
|
||||||
'totalPaid': string;
|
|
||||||
'totalUnpaid': string;
|
|
||||||
'paidPercentage': string;
|
|
||||||
'payWx': number;
|
|
||||||
'payZfb': number;
|
|
||||||
'payOffline': number;
|
|
||||||
'totalPay': number;
|
|
||||||
'feeTypeStats': feeTypeStats[];
|
|
||||||
'dailyStats': {
|
|
||||||
'statDate': string;
|
|
||||||
'totalDue': string;
|
|
||||||
'totalPaid': string;
|
|
||||||
'totalUnpaid': string;
|
|
||||||
}[];
|
|
||||||
};
|
|
||||||
export type feeTypeStats = {
|
|
||||||
'feeType': number;
|
|
||||||
'feeName': string;
|
|
||||||
'totalDue': string;
|
|
||||||
'totalPaid': string;
|
|
||||||
'totalUnpaid': string;
|
|
||||||
'paidPercentage': string;
|
|
||||||
};
|
|
||||||
export const income_statsApi = (datetime?: string): AxiosPromise<IncomeStatsResponse> => {
|
|
||||||
return request({
|
|
||||||
url: '/api/analysis/income/stats',
|
|
||||||
method: 'get',
|
|
||||||
params: {
|
|
||||||
startDate: datetime
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface sourceType {
|
|
||||||
'totalPayable': string;
|
|
||||||
'totalReceived': string;
|
|
||||||
'totalPending': string;
|
|
||||||
'parkingFee': string;
|
|
||||||
'parkingFeePercent': string;
|
|
||||||
'propertyFee': string;
|
|
||||||
'propertyFeePercent': string;
|
|
||||||
'utilityFee': string;
|
|
||||||
'utilityFeePercent': string;
|
|
||||||
'shopRent': string;
|
|
||||||
'shopRentPercent': string;
|
|
||||||
'repairFee': string;
|
|
||||||
'repairFeePercent': string;
|
|
||||||
'garbageFee': string;
|
|
||||||
'garbageFeePercent': string;
|
|
||||||
}
|
|
||||||
// 收入来源
|
|
||||||
export const income_scourcApi = (datetime?: string): AxiosPromise<sourceType> => {
|
|
||||||
return request({
|
|
||||||
url: '/api/analysis/income/source',
|
|
||||||
method: 'get',
|
|
||||||
params: {
|
|
||||||
date: datetime
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface PayMentMethod {
|
|
||||||
'wechatAmount': string;
|
|
||||||
'wechatPercent': string;
|
|
||||||
'alipayAmount': string;
|
|
||||||
'alipayPercent': string;
|
|
||||||
'yidangAmount': string;
|
|
||||||
'yidangPercent': string;
|
|
||||||
'cashAmount': string;
|
|
||||||
'cashPercent': string;
|
|
||||||
'unionPayAmount': string;
|
|
||||||
'unionPayPercent': string;
|
|
||||||
'transferAmount': string;
|
|
||||||
'transferPercent': string;
|
|
||||||
'depositOffsetAmount': string;
|
|
||||||
'depositOffsetAmountPercent': string;
|
|
||||||
'propertyOffsetAmount': string;
|
|
||||||
'propertyOffsetAmountPercent': string;
|
|
||||||
}
|
|
||||||
// 缴费方式
|
|
||||||
export const payment_methodApi = (datetime?: string): AxiosPromise<PayMentMethod> => {
|
|
||||||
return request({
|
|
||||||
url: '/api/analysis/income/payment_method',
|
|
||||||
method: 'get',
|
|
||||||
params: {
|
|
||||||
date: datetime
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface Arrears_distrubution {
|
|
||||||
month: number;
|
|
||||||
amount: string;
|
|
||||||
}
|
|
||||||
// 欠费分布
|
|
||||||
export const arrears_distributionApi = (
|
|
||||||
datetime?: string
|
|
||||||
): AxiosPromise<{
|
|
||||||
items: Arrears_distrubution[];
|
|
||||||
}> => {
|
|
||||||
return request({
|
|
||||||
url: '/api/analysis/income/arrears_distribution',
|
|
||||||
method: 'get',
|
|
||||||
params: {
|
|
||||||
date: datetime
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
export interface payment_sourceType {
|
|
||||||
'miniProgramAmount': string;
|
|
||||||
'miniProgramPercent': string;
|
|
||||||
'mobileAppAmount': string;
|
|
||||||
'mobileAppPercent': string;
|
|
||||||
'offlineAmount': string;
|
|
||||||
'offlinePercent': string;
|
|
||||||
}
|
|
||||||
// 缴费来源分析
|
|
||||||
export const payment_sourceApi = (datetime?: string): AxiosPromise<payment_sourceType> => {
|
|
||||||
return request({
|
|
||||||
url: '/api/analysis/income/payment_source',
|
|
||||||
method: 'get',
|
|
||||||
params: {
|
|
||||||
date: datetime
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface payment_trendType {
|
|
||||||
'date': string;
|
|
||||||
'paidAmount': string;
|
|
||||||
'unpaidAmount': string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 缴费走势分析
|
|
||||||
export const payment_trendApi = (
|
|
||||||
startDate?: string,
|
|
||||||
endDate?: string
|
|
||||||
): AxiosPromise<{
|
|
||||||
items: payment_trendType[];
|
|
||||||
}> => {
|
|
||||||
return request({
|
|
||||||
url: '/api/analysis/income/payment_trend',
|
|
||||||
method: 'get',
|
|
||||||
params: {
|
|
||||||
startDate,
|
|
||||||
endDate
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询入住情况
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const user_movein_list = (query?: {
|
|
||||||
dateTime: string;
|
|
||||||
}): AxiosPromise<{
|
|
||||||
'villageId': string;
|
|
||||||
'villageName': string;
|
|
||||||
'totalHouse': number;
|
|
||||||
'occupiedHouse': number;
|
|
||||||
'occupancyRate': string;
|
|
||||||
'occupancyCount': number;
|
|
||||||
}> => {
|
|
||||||
return request({
|
|
||||||
url: '/api/analysis/occupancy/stats',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询居住人类型列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const get_movein_user_type = (query?: {
|
|
||||||
dateTime: string;
|
|
||||||
}): Promise<{
|
|
||||||
'owner': string;
|
|
||||||
'ownerRate': string;
|
|
||||||
'tenant': string;
|
|
||||||
'tenantRate': string;
|
|
||||||
'relatives': string;
|
|
||||||
'relativeRate': string;
|
|
||||||
'otherType': string;
|
|
||||||
'otherRate': string;
|
|
||||||
'totalResident': string;
|
|
||||||
}> => {
|
|
||||||
return request({
|
|
||||||
url: '/residentType/selectTotal',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 查询住户性别比例
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const get_movein_user_sex = (query?: {
|
|
||||||
dateTime: string;
|
|
||||||
}): Promise<{
|
|
||||||
'man': number;
|
|
||||||
'woman': number;
|
|
||||||
'total': number;
|
|
||||||
'manRate': string;
|
|
||||||
'womanRate': string;
|
|
||||||
}> => {
|
|
||||||
return request({
|
|
||||||
url: '/gender/overview',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 获取迁入迁出趋势图
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const get_movein_moveout_list = (query?: {
|
|
||||||
date: string;
|
|
||||||
}): AxiosPromise<
|
|
||||||
{
|
|
||||||
'date': string;
|
|
||||||
'moveInCount': number;
|
|
||||||
'moveOutCount': number;
|
|
||||||
'totalCount': number;
|
|
||||||
}[]
|
|
||||||
> => {
|
|
||||||
return request({
|
|
||||||
url: '/api/analysis/resident/moveInOutStats',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const get_person_age = (query?: {
|
|
||||||
dateTime: string;
|
|
||||||
}): AxiosPromise<
|
|
||||||
{
|
|
||||||
'date': string;
|
|
||||||
'moveInCount': number;
|
|
||||||
'moveOutCount': number;
|
|
||||||
'totalCount': number;
|
|
||||||
}[]
|
|
||||||
> => {
|
|
||||||
return request({
|
|
||||||
url: '/gender/personAge',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { QuestionnaireVO, QuestionnaireForm, QuestionnaireQuery } from '@/api/system/Questionnaire/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询问卷调查列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listQuestionnaire = (query?: QuestionnaireQuery): AxiosPromise<QuestionnaireVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/questionnaire/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询问卷调查详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getQuestionnaire = (id: string | number): AxiosPromise<QuestionnaireVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/questionnaire/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增问卷调查
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addQuestionnaire = (data: QuestionnaireForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/questionnaire',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改问卷调查
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateQuestionnaire = (data: QuestionnaireForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/questionnaire',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除问卷调查
|
|
||||||
* @param ids
|
|
||||||
* @param vailid
|
|
||||||
* @param ids
|
|
||||||
* @param vailid
|
|
||||||
*/
|
|
||||||
export const delQuestionnaire = (ids: string | string[], vailid: boolean = true) => {
|
|
||||||
return request({
|
|
||||||
url: '/questionnaire/' + ids + '?isValid=' + vailid,
|
|
||||||
method: 'delete',
|
|
||||||
headers: {
|
|
||||||
silentError: 'true'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 查询问卷调查回答列表
|
|
||||||
*/
|
|
||||||
export const getQuestionnaireAnswer = (
|
|
||||||
{
|
|
||||||
pageSize,
|
|
||||||
pageNum,
|
|
||||||
questionnaireId
|
|
||||||
}
|
|
||||||
) => {
|
|
||||||
return request({
|
|
||||||
url: '/questionnaireAnswer/list',
|
|
||||||
method: 'GET',
|
|
||||||
params: {
|
|
||||||
pageSize,
|
|
||||||
pageNum,
|
|
||||||
questionnaireId,
|
|
||||||
answerStatus: '1'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 查询问卷调查回答详情
|
|
||||||
*/
|
|
||||||
export const getQuestionnaireAnswerMain = (id: string) => {
|
|
||||||
return request({
|
|
||||||
url: '/questionnaireAnswer/' + id,
|
|
||||||
method: 'GET'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,165 +0,0 @@
|
|||||||
export interface QuestionnaireVO {
|
|
||||||
/**
|
|
||||||
* 问卷ID
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属小区id
|
|
||||||
*/
|
|
||||||
villageId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问卷标题
|
|
||||||
*/
|
|
||||||
title: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问卷描述
|
|
||||||
*/
|
|
||||||
description: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问卷题目结构(JSON数组)
|
|
||||||
*/
|
|
||||||
content: string | QuestionComponentItem[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-草稿 1-已发布 2-已结束
|
|
||||||
*/
|
|
||||||
status: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参与范围 0全体业主 1部分业主
|
|
||||||
*/
|
|
||||||
scope: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 部分业主串 ”,“号隔开
|
|
||||||
*/
|
|
||||||
residents: string;
|
|
||||||
startTime: string;
|
|
||||||
endTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface QuestionnaireForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 问卷ID
|
|
||||||
*/
|
|
||||||
id?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属小区id
|
|
||||||
*/
|
|
||||||
villageId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问卷标题
|
|
||||||
*/
|
|
||||||
title?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问卷描述
|
|
||||||
*/
|
|
||||||
description?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问卷题目结构(JSON数组)
|
|
||||||
*/
|
|
||||||
content?: string | QuestionComponentItem[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-草稿 1-已发布 2-已结束
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参与范围 0全体业主 1部分业主
|
|
||||||
*/
|
|
||||||
scope?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 部分业主串 ”,“号隔开
|
|
||||||
*/
|
|
||||||
residents?: string;
|
|
||||||
|
|
||||||
startTime: string;
|
|
||||||
endTime: string;
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface QuestionnaireQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 所属小区id
|
|
||||||
*/
|
|
||||||
villageId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问卷标题
|
|
||||||
*/
|
|
||||||
title?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问卷描述
|
|
||||||
*/
|
|
||||||
description?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问卷题目结构(JSON数组)
|
|
||||||
*/
|
|
||||||
content?: string | QuestionComponentItem[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态:0-草稿 1-已发布 2-已结束
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 参与范围 0全体业主 1部分业主
|
|
||||||
*/
|
|
||||||
scope?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 部分业主串 ”,“号隔开
|
|
||||||
*/
|
|
||||||
residents?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ==================== 调卷 类型定义 ====================
|
|
||||||
export interface ComponentItem {
|
|
||||||
type: string;
|
|
||||||
label: string;
|
|
||||||
icon: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface QuestionComponentOption {
|
|
||||||
label: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface QuestionComponentItem {
|
|
||||||
cid: number;
|
|
||||||
type: string;
|
|
||||||
title: string;
|
|
||||||
required: boolean;
|
|
||||||
options: QuestionComponentOption[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface QuestionComponentnaireForm {
|
|
||||||
id?: string;
|
|
||||||
title: string;
|
|
||||||
description?: string;
|
|
||||||
content: QuestionComponentItem[];
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { RepairVO, RepairForm, RepairQuery } from '@/api/system/Repair/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询报修管理列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listRepair = (query?: RepairQuery): AxiosPromise<RepairVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/repair/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询报修管理详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getRepair = (id: string | number): AxiosPromise<RepairVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/repair/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增报修管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addRepair = (data: RepairForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/repair',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改报修管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateRepair = (data: RepairForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/repair',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除报修管理
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delRepair = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/repair/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 上传报修图片
|
|
||||||
* @param { formdata } formdata
|
|
||||||
*/
|
|
||||||
export const uploadRepairImages = (formdata: FormData) => {
|
|
||||||
return request({
|
|
||||||
url: '/repair/uploadImages',
|
|
||||||
method: 'POST',
|
|
||||||
data: formdata
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,174 +0,0 @@
|
|||||||
export interface RepairVO {
|
|
||||||
'id': string;
|
|
||||||
'houseId': string;
|
|
||||||
'maintenanceItemId': number;
|
|
||||||
'maintenanceItemName': number;
|
|
||||||
'problem': string;
|
|
||||||
'residentId': string;
|
|
||||||
'residentName': string;
|
|
||||||
'phone': string;
|
|
||||||
'orderDate': string;
|
|
||||||
'problemImageUrl': string;
|
|
||||||
'problemStatus': string;
|
|
||||||
'repairDes': string;
|
|
||||||
'repairImageUrl': string;
|
|
||||||
'repairId': string;
|
|
||||||
'repairName': string;
|
|
||||||
'houseName': string;
|
|
||||||
'item': string;
|
|
||||||
'projectType': number;
|
|
||||||
'updateTime': string;
|
|
||||||
'projectTypeStr': string;
|
|
||||||
'repairIsCheck': string;
|
|
||||||
'manageIsCheck': string;
|
|
||||||
'isCheckStr': number;
|
|
||||||
'repairPhone': number;
|
|
||||||
'repairRoleName': number;
|
|
||||||
'repairStatus': string;
|
|
||||||
repairUserId: string;
|
|
||||||
'createTime': string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RepairForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 报修管理表id
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联房屋id
|
|
||||||
*/
|
|
||||||
houseId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修项目id
|
|
||||||
*/
|
|
||||||
maintenanceItemId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问题描述
|
|
||||||
*/
|
|
||||||
problem?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报修人id(住户表id)
|
|
||||||
*/
|
|
||||||
residentId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号码
|
|
||||||
*/
|
|
||||||
phone?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预约日期
|
|
||||||
*/
|
|
||||||
orderDate?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问题图片地址
|
|
||||||
*/
|
|
||||||
problemImageUrl?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
createBy?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
createTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
updateBy?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
updateTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 0 已提交 1已分配 2维修中 3维修完成
|
|
||||||
*/
|
|
||||||
problemStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修描述
|
|
||||||
*/
|
|
||||||
repairDes?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修图片url
|
|
||||||
*/
|
|
||||||
repairImageUrl?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修人员id
|
|
||||||
*/
|
|
||||||
repairId?: string | number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RepairQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 关联房屋id
|
|
||||||
*/
|
|
||||||
houseId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修项目id
|
|
||||||
*/
|
|
||||||
maintenanceItemId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问题描述
|
|
||||||
*/
|
|
||||||
problem?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报修人id(住户表id)
|
|
||||||
*/
|
|
||||||
residentId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号码
|
|
||||||
*/
|
|
||||||
phone?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预约日期
|
|
||||||
*/
|
|
||||||
orderDate?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 问题图片地址
|
|
||||||
*/
|
|
||||||
problemImageUrl?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 0 已提交 1已分配 2维修中 3维修完成
|
|
||||||
*/
|
|
||||||
problemStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修描述
|
|
||||||
*/
|
|
||||||
repairDes?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修图片url
|
|
||||||
*/
|
|
||||||
repairImageUrl?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修人员id
|
|
||||||
*/
|
|
||||||
repairId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { RepairProjectVO, RepairProjectForm, RepairProjectQuery, RepairProjectQueryNoPage } from './type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询报修维修项目管理列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listRepairProject = (query?: RepairProjectQuery): AxiosPromise<RepairProjectVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/repairProject/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询报修维修项目管理详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getRepairProject = (id: string | number): AxiosPromise<RepairProjectVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/repairProject/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增报修维修项目管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addRepairProject = (data: RepairProjectForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/repairProject',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改报修维修项目管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateRepairProject = (data: RepairProjectForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/repairProject',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除报修维修项目管理
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delRepairProject = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/repairProject/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* 查询报修维修项目tree管理列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const gettreelistRepairProject = (query?: RepairProjectQueryNoPage): AxiosPromise<RepairProjectVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/repairProject/treeList',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
export interface RepairProjectVO {
|
|
||||||
/**
|
|
||||||
* 维修项目表id
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修项目名
|
|
||||||
*/
|
|
||||||
projectName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 父级项目id
|
|
||||||
*/
|
|
||||||
parentId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目类型 0公共报修 1个人报修
|
|
||||||
*/
|
|
||||||
projectType: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目层级 0,1
|
|
||||||
*/
|
|
||||||
projectLevel: number;
|
|
||||||
children?: RepairProjectVO[];
|
|
||||||
/**
|
|
||||||
* 排序 (数越小越靠前)
|
|
||||||
*/
|
|
||||||
sortOrder: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态 0启用 1停用
|
|
||||||
*/
|
|
||||||
status: string;
|
|
||||||
|
|
||||||
disabled?: boolean;
|
|
||||||
// children?: RepairProjectVO[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RepairProjectForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 维修项目表id
|
|
||||||
*/
|
|
||||||
id?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修项目名
|
|
||||||
*/
|
|
||||||
projectName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 父级项目id
|
|
||||||
*/
|
|
||||||
parentId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目类型 0公共报修 1个人报修
|
|
||||||
*/
|
|
||||||
projectType?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目层级 0,1
|
|
||||||
*/
|
|
||||||
projectLevel?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序 (数越小越靠前)
|
|
||||||
*/
|
|
||||||
sortOrder?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态 0启用 1停用
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RepairProjectQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 维修项目名
|
|
||||||
*/
|
|
||||||
projectName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 父级项目id
|
|
||||||
*/
|
|
||||||
parentId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目类型 0公共报修 1个人报修
|
|
||||||
*/
|
|
||||||
projectType?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目层级 0,1
|
|
||||||
*/
|
|
||||||
projectLevel?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序 (数越小越靠前)
|
|
||||||
*/
|
|
||||||
sortOrder?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态 0启用 1停用
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
}
|
|
||||||
export interface RepairProjectQueryNoPage {
|
|
||||||
/**
|
|
||||||
* 维修项目名
|
|
||||||
*/
|
|
||||||
projectName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 父级项目id
|
|
||||||
*/
|
|
||||||
parentId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目类型 0公共报修 1个人报修
|
|
||||||
*/
|
|
||||||
projectType?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目层级 0,1
|
|
||||||
*/
|
|
||||||
projectLevel?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序 (数越小越靠前)
|
|
||||||
*/
|
|
||||||
sortOrder?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态 0启用 1停用
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { StockInVO, StockInForm, StockInQuery } from './type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询入库主列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listStockIn = (query?: StockInQuery): AxiosPromise<StockInVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/stockIn/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询入库主详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getStockIn = (id: string | number): AxiosPromise<StockInVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/stockIn/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增入库主
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addStockIn = (data: StockInForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/stockIn',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改入库主
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateStockIn = (data: StockInForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/stockIn',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除入库主
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delStockIn = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/stockIn/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,128 +0,0 @@
|
|||||||
import { MaterialVO } from '../Tmaterial/type';
|
|
||||||
|
|
||||||
export interface StockInVO {
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
id: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 入库单号*
|
|
||||||
*/
|
|
||||||
inNo: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 入库日期*
|
|
||||||
*/
|
|
||||||
inDate: string;
|
|
||||||
totalAmount: string;
|
|
||||||
/**
|
|
||||||
* 供应商id*
|
|
||||||
*/
|
|
||||||
supplierId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 入库仓库id*
|
|
||||||
*/
|
|
||||||
warehouseId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 操作状态 入库/未入库
|
|
||||||
*/
|
|
||||||
operateStatus: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 负责人
|
|
||||||
*/
|
|
||||||
leader: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
|
|
||||||
items: MaterialVO[];
|
|
||||||
|
|
||||||
warehouseName: string;
|
|
||||||
supplierName: string;
|
|
||||||
createTime: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StockInForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 入库单号*
|
|
||||||
*/
|
|
||||||
inNo?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 入库日期*
|
|
||||||
*/
|
|
||||||
inDate?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 供应商id*
|
|
||||||
*/
|
|
||||||
supplierId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 入库仓库id*
|
|
||||||
*/
|
|
||||||
warehouseId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 操作状态 入库/未入库
|
|
||||||
*/
|
|
||||||
operateStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 负责人
|
|
||||||
*/
|
|
||||||
leader?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StockInQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 入库单号*
|
|
||||||
*/
|
|
||||||
inNo?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 入库日期*
|
|
||||||
*/
|
|
||||||
inDate?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 供应商id*
|
|
||||||
*/
|
|
||||||
supplierId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 入库仓库id*
|
|
||||||
*/
|
|
||||||
warehouseId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 操作状态 入库/未入库
|
|
||||||
*/
|
|
||||||
operateStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 负责人
|
|
||||||
*/
|
|
||||||
leader?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { StockOutVO, StockOutForm, StockOutQuery } from './type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询出库主列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listStockOut = (query?: StockOutQuery): AxiosPromise<StockOutVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/stockOut/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询出库主详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getStockOut = (id: string | number): AxiosPromise<StockOutVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/stockOut/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增出库主
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addStockOut = (data: StockOutForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/stockOut',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改出库主
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateStockOut = (data: StockOutForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/stockOut',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除出库主
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delStockOut = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/stockOut/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
import { MaterialVO } from '../Tmaterial/type';
|
|
||||||
|
|
||||||
export interface StockOutVO {
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 出库单号*
|
|
||||||
*/
|
|
||||||
outNo: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 出库日期*
|
|
||||||
*/
|
|
||||||
outDate: string;
|
|
||||||
totalAmount: string;
|
|
||||||
/**
|
|
||||||
* 领用人(供应商id)*
|
|
||||||
*/
|
|
||||||
supplierId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 出库仓库id*
|
|
||||||
*/
|
|
||||||
warehouseId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 操作状态 未出库/出库
|
|
||||||
*/
|
|
||||||
operateStatus: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 负责人
|
|
||||||
*/
|
|
||||||
leader: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
items: MaterialVO[];
|
|
||||||
|
|
||||||
warehouseName: string;
|
|
||||||
supplierName: string;
|
|
||||||
createTime: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StockOutForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
id?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 出库单号*
|
|
||||||
*/
|
|
||||||
outNo?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 出库日期*
|
|
||||||
*/
|
|
||||||
outDate?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 领用人(供应商id)*
|
|
||||||
*/
|
|
||||||
supplierId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 出库仓库id*
|
|
||||||
*/
|
|
||||||
warehouseId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 操作状态 未出库/出库
|
|
||||||
*/
|
|
||||||
operateStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 负责人
|
|
||||||
*/
|
|
||||||
leader?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface StockOutQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 出库单号*
|
|
||||||
*/
|
|
||||||
outNo?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 出库日期*
|
|
||||||
*/
|
|
||||||
outDate?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 领用人(供应商id)*
|
|
||||||
*/
|
|
||||||
supplierId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 出库仓库id*
|
|
||||||
*/
|
|
||||||
warehouseId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 操作状态 未出库/出库
|
|
||||||
*/
|
|
||||||
operateStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 负责人
|
|
||||||
*/
|
|
||||||
leader?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { MaterialVO, MaterialForm, MaterialQuery } from './type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询物料列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listMaterial = (query?: MaterialQuery): AxiosPromise<MaterialVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse/material/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询物料详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getMaterial = (id: string | number): AxiosPromise<MaterialVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse/material/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增物料
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addMaterial = (data: MaterialForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse/material',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改物料
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateMaterial = (data: MaterialForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse/material',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除物料
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delMaterial = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse/material/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
export interface MaterialVO {
|
|
||||||
/**
|
|
||||||
* 物料ID
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 物料名称*
|
|
||||||
*/
|
|
||||||
materialName: string;
|
|
||||||
materialId: string;
|
|
||||||
/**
|
|
||||||
* 品牌*
|
|
||||||
*/
|
|
||||||
brand: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 规格型号*
|
|
||||||
*/
|
|
||||||
model: string;
|
|
||||||
villageId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 计量单位
|
|
||||||
*/
|
|
||||||
unit: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MaterialForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 物料ID
|
|
||||||
*/
|
|
||||||
id?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 物料名称*
|
|
||||||
*/
|
|
||||||
materialName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 品牌*
|
|
||||||
*/
|
|
||||||
brand?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 规格型号*
|
|
||||||
*/
|
|
||||||
model?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 计量单位
|
|
||||||
*/
|
|
||||||
unit?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MaterialQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 物料名称*
|
|
||||||
*/
|
|
||||||
materialName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 品牌*
|
|
||||||
*/
|
|
||||||
brand?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 规格型号*
|
|
||||||
*/
|
|
||||||
model?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 计量单位
|
|
||||||
*/
|
|
||||||
unit?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询 库存查询列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listStock = (query?: any): AxiosPromise<any[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/stock/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询 库存查询 详情
|
|
||||||
* @returns {*}
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listStockMain = (id?: string): AxiosPromise<any[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/stock/detail/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export type StockUpdate = {
|
|
||||||
materialId: string; // 物料id
|
|
||||||
materialName: string; // 物料名称
|
|
||||||
brand: string; // 型号
|
|
||||||
model: string; // 品牌
|
|
||||||
unit: string; // 单位
|
|
||||||
costPrice: string; // 成本价
|
|
||||||
stockNum: string; // 库存数量
|
|
||||||
};
|
|
||||||
type StockUpdateForm = {
|
|
||||||
materialId: string; // 物料id
|
|
||||||
costPrice: string; // 成本价
|
|
||||||
stockNum: string; // 库存数量
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新库存信息
|
|
||||||
* @param data - 库存更新表单数据,可选参数
|
|
||||||
* @returns 返回一个 Axios Promise,解析为任意类型的数组
|
|
||||||
*/
|
|
||||||
export const listStockUpdate = (data?: StockUpdateForm): AxiosPromise<any[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/stock/update?materialId=' + data?.materialId + '&stockNum=' + data?.stockNum,
|
|
||||||
method: 'PUT'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { SupplierVO, SupplierForm, SupplierQuery } from './type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询供应商列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listSupplier = (query: SupplierQuery | {} = {}): AxiosPromise<SupplierVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse/supplier/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询供应商详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getSupplier = (id: string | number): AxiosPromise<SupplierVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse/supplier/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增供应商
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addSupplier = (data: SupplierForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse/supplier',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改供应商
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateSupplier = (data: SupplierForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse/supplier',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除供应商
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delSupplier = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse/supplier/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
export interface SupplierVO {
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
id: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 供应商名称*
|
|
||||||
*/
|
|
||||||
supplierName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系人*
|
|
||||||
*/
|
|
||||||
contactPerson: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系电话*
|
|
||||||
*/
|
|
||||||
contactPhone: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 邮箱
|
|
||||||
*/
|
|
||||||
email: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 地址
|
|
||||||
*/
|
|
||||||
address: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
villageId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SupplierForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 主键ID
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 供应商名称*
|
|
||||||
*/
|
|
||||||
supplierName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系人*
|
|
||||||
*/
|
|
||||||
contactPerson?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系电话*
|
|
||||||
*/
|
|
||||||
contactPhone?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 邮箱
|
|
||||||
*/
|
|
||||||
email?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 地址
|
|
||||||
*/
|
|
||||||
address?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SupplierQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 供应商名称*
|
|
||||||
*/
|
|
||||||
supplierName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系人*
|
|
||||||
*/
|
|
||||||
contactPerson?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系电话*
|
|
||||||
*/
|
|
||||||
contactPhone?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 邮箱
|
|
||||||
*/
|
|
||||||
email?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 地址
|
|
||||||
*/
|
|
||||||
address?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { WarehouseVO, WarehouseForm, WarehouseQuery } from './type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询仓库列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listWarehouse = (query?: WarehouseQuery): AxiosPromise<WarehouseVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询仓库详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getWarehouse = (id: string | number): AxiosPromise<WarehouseVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增仓库
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addWarehouse = (data: WarehouseForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改仓库
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateWarehouse = (data: WarehouseForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除仓库
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delWarehouse = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/warehouse/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
export interface WarehouseVO {
|
|
||||||
/**
|
|
||||||
* 仓库ID
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 仓库名称*
|
|
||||||
*/
|
|
||||||
warehouseName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 仓库归属id*(关联com_village)
|
|
||||||
*/
|
|
||||||
villageId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系人*
|
|
||||||
*/
|
|
||||||
contactPerson: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系电话*
|
|
||||||
*/
|
|
||||||
contactPhone: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 地址
|
|
||||||
*/
|
|
||||||
address: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态 0-启用 1-禁用
|
|
||||||
*/
|
|
||||||
status: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface WarehouseForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 仓库ID
|
|
||||||
*/
|
|
||||||
id?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 仓库名称*
|
|
||||||
*/
|
|
||||||
warehouseName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 仓库归属id*(关联com_village)
|
|
||||||
*/
|
|
||||||
villageId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系人*
|
|
||||||
*/
|
|
||||||
contactPerson?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系电话*
|
|
||||||
*/
|
|
||||||
contactPhone?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 地址
|
|
||||||
*/
|
|
||||||
address?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态 0-启用 1-禁用
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface WarehouseQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 仓库名称*
|
|
||||||
*/
|
|
||||||
warehouseName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系人*
|
|
||||||
*/
|
|
||||||
contactPerson?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系电话*
|
|
||||||
*/
|
|
||||||
contactPhone?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 地址
|
|
||||||
*/
|
|
||||||
address?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态 0-启用 1-禁用
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { VisitorVO, VisitorForm, VisitorQuery } from '@/api/system/Visitor/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询访客管理列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listVisitor = (query?: VisitorQuery): AxiosPromise<VisitorVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/visitor/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询访客管理详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getVisitor = (id: string | number): AxiosPromise<VisitorVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/visitor/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增访客管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addVisitor = (data: VisitorForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/visitor',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改访客管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateVisitor = (data: VisitorForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/visitor',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除访客管理
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delVisitor = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/visitor/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
export interface VisitorVO {
|
|
||||||
/**
|
|
||||||
* 访客管理表id
|
|
||||||
*/
|
|
||||||
id: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访问房屋id
|
|
||||||
*/
|
|
||||||
houseId: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访客姓名
|
|
||||||
*/
|
|
||||||
visitorName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访客性别 0男 1女 3未知
|
|
||||||
*/
|
|
||||||
visitorGender: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访客联系方式
|
|
||||||
*/
|
|
||||||
visitorPhone: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车牌号
|
|
||||||
*/
|
|
||||||
carNum: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 随行人数
|
|
||||||
*/
|
|
||||||
visitorNum: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 来访时间
|
|
||||||
*/
|
|
||||||
startTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 离开时间
|
|
||||||
*/
|
|
||||||
endTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 来访方式 0车辆来访 1人员来访
|
|
||||||
*/
|
|
||||||
type: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访客状态 0等待来访 1已到访
|
|
||||||
*/
|
|
||||||
status: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface VisitorForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 访客管理表id
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访问房屋id
|
|
||||||
*/
|
|
||||||
houseId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访客姓名
|
|
||||||
*/
|
|
||||||
visitorName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访客性别 0男 1女 3未知
|
|
||||||
*/
|
|
||||||
visitorGender?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访客联系方式
|
|
||||||
*/
|
|
||||||
visitorPhone?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车牌号
|
|
||||||
*/
|
|
||||||
carNum?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 随行人数
|
|
||||||
*/
|
|
||||||
visitorNum?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 来访时间
|
|
||||||
*/
|
|
||||||
startTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 离开时间
|
|
||||||
*/
|
|
||||||
endTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 来访方式 0车辆来访 1人员来访
|
|
||||||
*/
|
|
||||||
type?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访客状态 0等待来访 1已到访
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
createTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者(住户id)
|
|
||||||
*/
|
|
||||||
createId?: string | number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface VisitorQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 访问房屋id
|
|
||||||
*/
|
|
||||||
houseId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访客姓名
|
|
||||||
*/
|
|
||||||
visitorName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访客性别 0男 1女 3未知
|
|
||||||
*/
|
|
||||||
visitorGender?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访客联系方式
|
|
||||||
*/
|
|
||||||
visitorPhone?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车牌号
|
|
||||||
*/
|
|
||||||
carNum?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 随行人数
|
|
||||||
*/
|
|
||||||
visitorNum?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 来访时间
|
|
||||||
*/
|
|
||||||
startTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 离开时间
|
|
||||||
*/
|
|
||||||
endTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 来访方式 0车辆来访 1人员来访
|
|
||||||
*/
|
|
||||||
type?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 访客状态 0等待来访 1已到访
|
|
||||||
*/
|
|
||||||
status?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { AreaVO, AreaForm, AreaQuery } from '@/api/system/carArea/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询车位区域管理列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listArea = (query: AreaQuery | {} = {}): AxiosPromise<AreaVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/area/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询车位区域管理详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getArea = (id: string | number): AxiosPromise<AreaVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/area/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增车位区域管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addArea = (data: AreaForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/area',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改车位区域管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateArea = (data: AreaForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/area',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除车位区域管理
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delArea = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/area/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
export interface AreaVO {
|
|
||||||
/**
|
|
||||||
* 区域管理表id
|
|
||||||
*/
|
|
||||||
id: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 区域名称
|
|
||||||
*/
|
|
||||||
areaName: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 区域编号
|
|
||||||
*/
|
|
||||||
areaCode: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 面积(单位㎡)
|
|
||||||
*/
|
|
||||||
area: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车位数量
|
|
||||||
*/
|
|
||||||
parkingCount: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AreaForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 区域管理表id
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 区域名称
|
|
||||||
*/
|
|
||||||
areaName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 区域编号
|
|
||||||
*/
|
|
||||||
areaCode?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 面积(单位㎡)
|
|
||||||
*/
|
|
||||||
area?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车位数量
|
|
||||||
*/
|
|
||||||
parkingCount?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
createBy?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
createTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改者
|
|
||||||
*/
|
|
||||||
updateBy?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改时间
|
|
||||||
*/
|
|
||||||
updateTime?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AreaQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 区域名称
|
|
||||||
*/
|
|
||||||
areaName?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 区域编号
|
|
||||||
*/
|
|
||||||
areaCode?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 面积(单位㎡)
|
|
||||||
*/
|
|
||||||
area?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车位数量
|
|
||||||
*/
|
|
||||||
parkingCount?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { CarVO, CarForm, CarQuery } from '@/api/system/cars/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询车辆管理列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listCar = (query?: CarQuery): AxiosPromise<CarVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/car/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询车辆管理详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getCar = (id: string | number): AxiosPromise<CarVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/car/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增车辆管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addCar = (data: CarForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/car',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改车辆管理
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateCar = (data: CarForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/car',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除车辆管理
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delCar = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/car/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除车辆图片
|
|
||||||
* @param format
|
|
||||||
*/
|
|
||||||
export const uploadCar = (format: FormData) => {
|
|
||||||
return request({
|
|
||||||
url: '/car/uploadImage',
|
|
||||||
method: 'POST',
|
|
||||||
data: format
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface AppUserList {
|
|
||||||
'user_id': string;
|
|
||||||
'user_name': string;
|
|
||||||
'user_phone': string;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 获取用户端app-用户
|
|
||||||
* */
|
|
||||||
export const getAppUser = (data): AxiosPromise<AppUserList[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/car/getAppUserList',
|
|
||||||
method: 'GET',
|
|
||||||
params: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,170 +0,0 @@
|
|||||||
export interface CarVO {
|
|
||||||
/**
|
|
||||||
* 车辆管理表id
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 区域id
|
|
||||||
*/
|
|
||||||
areaId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车位id
|
|
||||||
*/
|
|
||||||
parkingId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 持有人id(住户表id)
|
|
||||||
*/
|
|
||||||
residentId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车牌号
|
|
||||||
*/
|
|
||||||
carNum: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆品牌
|
|
||||||
*/
|
|
||||||
carBrand: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆型号
|
|
||||||
*/
|
|
||||||
carModel: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车身颜色
|
|
||||||
*/
|
|
||||||
carColor: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆图片url
|
|
||||||
*/
|
|
||||||
carImageUrl: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CarForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 车辆管理表id
|
|
||||||
*/
|
|
||||||
id?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 区域id
|
|
||||||
*/
|
|
||||||
areaId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车位id
|
|
||||||
*/
|
|
||||||
parkingId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 持有人id(住户表id)
|
|
||||||
*/
|
|
||||||
residentId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车牌号
|
|
||||||
*/
|
|
||||||
carNum?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆品牌
|
|
||||||
*/
|
|
||||||
carBrand?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆型号
|
|
||||||
*/
|
|
||||||
carModel?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车身颜色
|
|
||||||
*/
|
|
||||||
carColor?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
remark?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆图片url
|
|
||||||
*/
|
|
||||||
carImageUrl?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
createBy?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
createTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改者
|
|
||||||
*/
|
|
||||||
updateBy?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改时间
|
|
||||||
*/
|
|
||||||
updateTime?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface CarQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 区域id
|
|
||||||
*/
|
|
||||||
areaId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车位id
|
|
||||||
*/
|
|
||||||
parkingId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 持有人id(住户表id)
|
|
||||||
*/
|
|
||||||
residentId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车牌号
|
|
||||||
*/
|
|
||||||
carNum?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆品牌
|
|
||||||
*/
|
|
||||||
carBrand?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆型号
|
|
||||||
*/
|
|
||||||
carModel?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车身颜色
|
|
||||||
*/
|
|
||||||
carColor?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆图片url
|
|
||||||
*/
|
|
||||||
carImageUrl?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -16,53 +16,3 @@ export function getVillageByIdAPI(id: string): AxiosPromise<communitylist_rows_t
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** 删除小区 */
|
|
||||||
export function deleteVillageByIdAPI(id: string): AxiosPromise<null> {
|
|
||||||
return request({
|
|
||||||
url: `/village/${id}`,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
type uploadResponseType = {
|
|
||||||
'success': {
|
|
||||||
'url': string;
|
|
||||||
'fileName': string;
|
|
||||||
'ossId': string;
|
|
||||||
}[];
|
|
||||||
'error': string[];
|
|
||||||
};
|
|
||||||
/** 上传小区图片 */
|
|
||||||
export function uploadVillageImageAPI(formdata: FormData): AxiosPromise<uploadResponseType> {
|
|
||||||
return request({
|
|
||||||
url: `/village/uploadImages`,
|
|
||||||
method: 'post',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'multipart/form-data'
|
|
||||||
},
|
|
||||||
data: formdata
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/** 添加小区 */
|
|
||||||
export function addVillageAPI<T>(data: T) {
|
|
||||||
return request({
|
|
||||||
url: `/village`,
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/** 添加小区 */
|
|
||||||
export function editVillageAPI<T>(data: T) {
|
|
||||||
return request({
|
|
||||||
url: `/village`,
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**切换小区 */
|
|
||||||
export function switchVillageAPI(villageId: string) {
|
|
||||||
return request({
|
|
||||||
url: `/village/switchVillage/${villageId}`,
|
|
||||||
method: 'POST'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { NoticeForm, NoticeQuery, NoticeVO } from './types';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
// 查询公告列表
|
|
||||||
export function listNotice(query: NoticeQuery): AxiosPromise<NoticeVO[]> {
|
|
||||||
return request({
|
|
||||||
url: '/system/notice/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询公告详细
|
|
||||||
export function getNotice(noticeId: string | number): AxiosPromise<NoticeVO> {
|
|
||||||
return request({
|
|
||||||
url: '/system/notice/' + noticeId,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增公告
|
|
||||||
export function addNotice(data: NoticeForm) {
|
|
||||||
return request({
|
|
||||||
url: '/system/notice',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改公告
|
|
||||||
export function updateNotice(data: NoticeForm) {
|
|
||||||
return request({
|
|
||||||
url: '/system/notice',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除公告
|
|
||||||
export function delNotice(noticeId: string | number | Array<string | number>) {
|
|
||||||
return request({
|
|
||||||
url: '/system/notice/' + noticeId,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
export interface NoticeVO extends BaseEntity {
|
|
||||||
noticeId: number;
|
|
||||||
noticeTitle: string;
|
|
||||||
noticeType: string;
|
|
||||||
noticeContent: string;
|
|
||||||
status: string;
|
|
||||||
remark: string;
|
|
||||||
createByName: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface NoticeQuery extends PageQuery {
|
|
||||||
noticeTitle: string;
|
|
||||||
createByName: string;
|
|
||||||
status: string;
|
|
||||||
noticeType: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface NoticeForm {
|
|
||||||
noticeId: number | string | undefined;
|
|
||||||
noticeTitle: string;
|
|
||||||
noticeType: string;
|
|
||||||
noticeContent: string;
|
|
||||||
status: string;
|
|
||||||
remark: string;
|
|
||||||
createByName: string;
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { RepairProcessVO, RepairProcessForm, RepairProcessQuery } from '@/api/system/repairProcess/type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询报修维修流程列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listRepairProcess = (query?: RepairProcessQuery): AxiosPromise<RepairProcessVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/repairProcess/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询报修维修流程详细
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const getRepairProcess = (id: string | number): AxiosPromise<RepairProcessVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/repairProcess/' + id,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增报修维修流程
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addRepairProcess = (data: RepairProcessForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/repairProcess',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改报修维修流程
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateRepairProcess = (data: RepairProcessForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/repairProcess',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除报修维修流程
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
export const delRepairProcess = (id: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/repairProcess/' + id,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
export interface RepairProcessVO {
|
|
||||||
/**
|
|
||||||
* 维修流程表id
|
|
||||||
*/
|
|
||||||
id: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属报修id
|
|
||||||
*/
|
|
||||||
repairId: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提交时间
|
|
||||||
*/
|
|
||||||
submitTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提交状态 0未提交 1已提交
|
|
||||||
*/
|
|
||||||
submitStatus: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分配时间
|
|
||||||
*/
|
|
||||||
allocateTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分配状态 0 待分配 1已分配
|
|
||||||
*/
|
|
||||||
allocateStatus: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 完成时间
|
|
||||||
*/
|
|
||||||
completeTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 完成状态 0进行中 1已完成
|
|
||||||
*/
|
|
||||||
completeStatus: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RepairProcessForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 维修流程表id
|
|
||||||
*/
|
|
||||||
id?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属报修id
|
|
||||||
*/
|
|
||||||
repairId?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提交时间
|
|
||||||
*/
|
|
||||||
submitTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提交状态 0未提交 1已提交
|
|
||||||
*/
|
|
||||||
submitStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分配时间
|
|
||||||
*/
|
|
||||||
allocateTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分配状态 0 待分配 1已分配
|
|
||||||
*/
|
|
||||||
allocateStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 完成时间
|
|
||||||
*/
|
|
||||||
completeTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 完成状态 0进行中 1已完成
|
|
||||||
*/
|
|
||||||
completeStatus?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RepairProcessQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 所属报修id
|
|
||||||
*/
|
|
||||||
repairId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提交时间
|
|
||||||
*/
|
|
||||||
submitTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提交状态 0未提交 1已提交
|
|
||||||
*/
|
|
||||||
submitStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分配时间
|
|
||||||
*/
|
|
||||||
allocateTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分配状态 0 待分配 1已分配
|
|
||||||
*/
|
|
||||||
allocateStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 完成时间
|
|
||||||
*/
|
|
||||||
completeTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 完成状态 0进行中 1已完成
|
|
||||||
*/
|
|
||||||
completeStatus?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
import { AxiosPromise } from 'axios';
|
|
||||||
import { RevenueNoticeVO, RevenueNoticeForm, RevenueNoticeQuery } from './type';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询公区收益通知列表
|
|
||||||
* @param query
|
|
||||||
* @returns {*}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const listRevenueNotice = (query?: RevenueNoticeQuery): AxiosPromise<RevenueNoticeVO[]> => {
|
|
||||||
return request({
|
|
||||||
url: '/revenueNotice/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询公区收益通知详细
|
|
||||||
* @param noticeId
|
|
||||||
*/
|
|
||||||
export const getRevenueNotice = (noticeId: string | number): AxiosPromise<RevenueNoticeVO> => {
|
|
||||||
return request({
|
|
||||||
url: '/revenueNotice/' + noticeId,
|
|
||||||
method: 'get'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增公区收益通知
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const addRevenueNotice = (data: RevenueNoticeForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/revenueNotice',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改公区收益通知
|
|
||||||
* @param data
|
|
||||||
*/
|
|
||||||
export const updateRevenueNotice = (data: RevenueNoticeForm) => {
|
|
||||||
return request({
|
|
||||||
url: '/revenueNotice',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除公区收益通知
|
|
||||||
* @param noticeId
|
|
||||||
*/
|
|
||||||
export const delRevenueNotice = (noticeId: string | number | Array<string | number>) => {
|
|
||||||
return request({
|
|
||||||
url: '/revenueNotice/' + noticeId,
|
|
||||||
method: 'delete'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
@@ -1,140 +0,0 @@
|
|||||||
export interface RevenueNoticeVO {
|
|
||||||
/**
|
|
||||||
* 公告ID
|
|
||||||
*/
|
|
||||||
noticeId: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公告标题
|
|
||||||
*/
|
|
||||||
noticeTitle: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公告内容
|
|
||||||
*/
|
|
||||||
noticeContent: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者
|
|
||||||
*/
|
|
||||||
author: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 紧急程度 0=普通 1=紧急 2=非常紧急
|
|
||||||
*/
|
|
||||||
urgencyLevel: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布状态 0=草稿 1=已发布
|
|
||||||
*/
|
|
||||||
publishStatus: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布人
|
|
||||||
*/
|
|
||||||
publishBy: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布日期
|
|
||||||
*/
|
|
||||||
publishTime: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属小区id
|
|
||||||
*/
|
|
||||||
villageId: string | number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RevenueNoticeForm extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 公告ID
|
|
||||||
*/
|
|
||||||
noticeId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公告标题
|
|
||||||
*/
|
|
||||||
noticeTitle?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公告内容
|
|
||||||
*/
|
|
||||||
noticeContent?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者
|
|
||||||
*/
|
|
||||||
author?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 紧急程度 0=普通 1=紧急 2=非常紧急
|
|
||||||
*/
|
|
||||||
urgencyLevel?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布状态 0=草稿 1=已发布
|
|
||||||
*/
|
|
||||||
publishStatus?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布人
|
|
||||||
*/
|
|
||||||
publishBy?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布日期
|
|
||||||
*/
|
|
||||||
publishTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属小区id
|
|
||||||
*/
|
|
||||||
villageId?: string | number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RevenueNoticeQuery extends PageQuery {
|
|
||||||
/**
|
|
||||||
* 公告标题
|
|
||||||
*/
|
|
||||||
noticeTitle?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 公告内容
|
|
||||||
*/
|
|
||||||
noticeContent?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 作者
|
|
||||||
*/
|
|
||||||
author?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 紧急程度 0=普通 1=紧急 2=非常紧急
|
|
||||||
*/
|
|
||||||
urgencyLevel?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布状态 0=草稿 1=已发布
|
|
||||||
*/
|
|
||||||
publishStatus?: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布人
|
|
||||||
*/
|
|
||||||
publishBy?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布日期
|
|
||||||
*/
|
|
||||||
publishTime?: string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属小区id
|
|
||||||
*/
|
|
||||||
villageId?: string | number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日期范围参数
|
|
||||||
*/
|
|
||||||
params?: any;
|
|
||||||
}
|
|
||||||
@@ -32,6 +32,8 @@ export interface LoginData {
|
|||||||
*/
|
*/
|
||||||
export interface LoginResult {
|
export interface LoginResult {
|
||||||
access_token: string;
|
access_token: string;
|
||||||
|
/** 后端返回的当前小区(默认小区)id */
|
||||||
|
villageId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,272 +0,0 @@
|
|||||||
<template>
|
|
||||||
<slot name="default" />
|
|
||||||
<el-dialog v-model="dialog.dialogVisible" :title="dialog.dialogTitle" append-to-body width="1050">
|
|
||||||
<nav class="flex flex-items-center mb-8 justify-between">
|
|
||||||
<div class="flex flex-items-center">
|
|
||||||
<div class="flex flex-items-center mr-20px">
|
|
||||||
<div style="width: 80px; text-align: right; padding-right: 10px">业主账号</div>
|
|
||||||
<div class="flex-1">
|
|
||||||
<el-input v-model="queryParams.userName" clearable placeholder="请输入业主账号" style="width: 200px" @clear="handleClear"></el-input>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-items-center mr-20px">
|
|
||||||
<div style="width: 60px; text-align: right; padding-right: 10px">手机号</div>
|
|
||||||
<div class="flex-1">
|
|
||||||
<el-input v-model="queryParams.userPhone" clearable placeholder="请输入手机号" style="width: 200px" @clear="handleClear"></el-input>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-button type="primary" @click="getList">查询</el-button>
|
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
<el-table ref="multipleTableRef" v-loading="loading" :data="tableData" border @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column align="center" type="selection" width="55" />
|
|
||||||
<el-table-column align="center" label="业主">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ scope.row.user_name ? scope.row.user_name : '---' }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="手机号" prop="user_phone" />
|
|
||||||
</el-table>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer flex flex-items-center flex-justify-between">
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
v-model:limit="queryParams.pageSize"
|
|
||||||
v-model:page="queryParams.pageNum"
|
|
||||||
:total="total"
|
|
||||||
style="margin-top: 0"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
<el-button @click="conBack">退出</el-button>
|
|
||||||
<el-button type="primary" @click="confirm"> 确定 </el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import pagination from '@/components/Pagination/index.vue';
|
|
||||||
import { ref, nextTick, toRefs } from 'vue';
|
|
||||||
import { AppUserList, getAppUser } from '@/api/system/cars';
|
|
||||||
|
|
||||||
type ReturnValueType = keyof AppUserList | '*';
|
|
||||||
|
|
||||||
const props = withDefaults(
|
|
||||||
defineProps<{
|
|
||||||
returnable: ReturnValueType;
|
|
||||||
titleName?: string;
|
|
||||||
isMultiple?: boolean;
|
|
||||||
}>(),
|
|
||||||
{
|
|
||||||
returnable: '*',
|
|
||||||
titleName: '选择业主',
|
|
||||||
isMultiple: false
|
|
||||||
}
|
|
||||||
);
|
|
||||||
const { titleName, returnable } = toRefs(props);
|
|
||||||
|
|
||||||
const userid = ref([]);
|
|
||||||
// ✅ 手动设置默认值(替代 withDefaults)
|
|
||||||
const emit = defineEmits<{
|
|
||||||
change: [value: AppUserList[keyof AppUserList] | AppUserList | AppUserList[]]; // 支持返回数组
|
|
||||||
}>();
|
|
||||||
|
|
||||||
const dialog = ref({
|
|
||||||
dialogVisible: false,
|
|
||||||
dialogTitle: titleName.value
|
|
||||||
});
|
|
||||||
|
|
||||||
const queryParams = ref({
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
userPhone: '',
|
|
||||||
userName: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const multipleTableRef = ref();
|
|
||||||
const tableData = ref<AppUserList[]>([]);
|
|
||||||
const total = ref(0);
|
|
||||||
const loading = ref(false);
|
|
||||||
const isFetching = ref(false);
|
|
||||||
// 存储选中项
|
|
||||||
const multipleSelection = ref<AppUserList[]>([]);
|
|
||||||
|
|
||||||
const isMultiple = computed(() => props.isMultiple ?? false);
|
|
||||||
|
|
||||||
// 优化 handleUserSelection,避免重复查找
|
|
||||||
const handleUserSelection = () => {
|
|
||||||
isFetching.value = true;
|
|
||||||
if (!multipleTableRef.value || !tableData.value.length) {
|
|
||||||
isFetching.value = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const rowsToSelect = tableData.value.filter((row) => {
|
|
||||||
return multipleSelection.value.some((selected) => selected.user_id === row.user_id);
|
|
||||||
});
|
|
||||||
multipleTableRef.value.clearSelection();
|
|
||||||
if (rowsToSelect.length > 0) {
|
|
||||||
nextTick(() => {
|
|
||||||
rowsToSelect.forEach((row) => {
|
|
||||||
multipleTableRef.value?.toggleRowSelection(row, true);
|
|
||||||
});
|
|
||||||
isFetching.value = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
isFetching.value = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// ====================== 方法 ======================
|
|
||||||
function handleClear() {
|
|
||||||
queryParams.value.userName = '';
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
// 获取列表
|
|
||||||
function getList() {
|
|
||||||
isFetching.value = true; // 加锁
|
|
||||||
loading.value = true;
|
|
||||||
getAppUser(queryParams.value)
|
|
||||||
.then((res) => {
|
|
||||||
tableData.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
handleUserSelection();
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error('获取用户列表失败:', error);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
isFetching.value = false; // 加锁
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// ==============================================
|
|
||||||
// ✅ 新增:处理 selection-change(多选专用)
|
|
||||||
// ==============================================
|
|
||||||
function handleSelectionChange(selection: AppUserList[]) {
|
|
||||||
if (isFetching.value) return;
|
|
||||||
if (isMultiple.value) {
|
|
||||||
const currentSelectedIds = new Set(selection.map((item) => item.user_id));
|
|
||||||
const otherPageSelections = multipleSelection.value.filter((item) => {
|
|
||||||
const isCurrentPageItem = tableData.value.some((row) => row.user_id === item.user_id);
|
|
||||||
if (isCurrentPageItem) {
|
|
||||||
return currentSelectedIds.has(item.user_id);
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 3. 合并:其他页保留的 + 当前页新选中的
|
|
||||||
const finalSelection = [...otherPageSelections, ...selection];
|
|
||||||
// 4. 去重(以防万一)
|
|
||||||
const uniqueMap = new Map();
|
|
||||||
finalSelection.forEach((item) => uniqueMap.set(item.user_id, item));
|
|
||||||
multipleSelection.value = Array.from(uniqueMap.values());
|
|
||||||
} else {
|
|
||||||
// --- 单选逻辑 ---
|
|
||||||
if (selection.length > 0) {
|
|
||||||
const lastSelected = selection[selection.length - 1];
|
|
||||||
multipleSelection.value = [lastSelected];
|
|
||||||
nextTick(() => {
|
|
||||||
if (selection.length > 1) {
|
|
||||||
multipleTableRef.value?.clearSelection();
|
|
||||||
multipleTableRef.value?.toggleRowSelection(lastSelected, true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
multipleSelection.value = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 重置查询
|
|
||||||
function resetQuery() {
|
|
||||||
queryParams.value = {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
userPhone: '',
|
|
||||||
userName: ''
|
|
||||||
};
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 退出
|
|
||||||
function conBack() {
|
|
||||||
dialog.value.dialogVisible = false;
|
|
||||||
resetQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ==============================================
|
|
||||||
// ✅ 核心修改:根据 returnable 返回对应的值
|
|
||||||
// ==============================================
|
|
||||||
function confirm() {
|
|
||||||
dialog.value.dialogVisible = false;
|
|
||||||
if (isMultiple.value) {
|
|
||||||
// 多选
|
|
||||||
if (returnable.value === '*') {
|
|
||||||
// ✅ 返回整个对象数组
|
|
||||||
emit('change', multipleSelection.value);
|
|
||||||
} else {
|
|
||||||
// 返回指定字段数组
|
|
||||||
emit(
|
|
||||||
'change',
|
|
||||||
multipleSelection.value.map((item) => item[returnable.value])
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 单选
|
|
||||||
if (returnable.value === '*') {
|
|
||||||
// ✅ 返回整个对象
|
|
||||||
emit('change', multipleSelection.value[multipleSelection.value.length - 1]);
|
|
||||||
} else {
|
|
||||||
// 返回指定字段
|
|
||||||
emit('change', multipleSelection.value[multipleSelection.value.length - 1][returnable.value]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
multipleSelection.value = [];
|
|
||||||
multipleTableRef.value.clearSelection();
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
open: (arr: string[] = []) => {
|
|
||||||
userid.value = arr;
|
|
||||||
if (arr && arr.length > 0) {
|
|
||||||
multipleSelection.value = arr.map(
|
|
||||||
(id) =>
|
|
||||||
({
|
|
||||||
user_id: id
|
|
||||||
}) as AppUserList
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
multipleSelection.value = [];
|
|
||||||
}
|
|
||||||
getList();
|
|
||||||
dialog.value.dialogVisible = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.residentBox {
|
|
||||||
width: 385px;
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 0 10px;
|
|
||||||
.defaultBox {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
cursor: pointer;
|
|
||||||
&:hover {
|
|
||||||
background-color: #f4f8ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,316 +0,0 @@
|
|||||||
<template>
|
|
||||||
<slot v-if="$slots.default" />
|
|
||||||
|
|
||||||
<div v-else class="residentBox" @click="choiceResidentFun">
|
|
||||||
<div v-if="multipleSelection.length === 0 && props.username === null" class="defaultBox">
|
|
||||||
<span>请选择</span>
|
|
||||||
<el-icon><Search /></el-icon>
|
|
||||||
</div>
|
|
||||||
<div v-else class="overflow-auto overflow-hidden w-full text-ellipsis text-nowrap">
|
|
||||||
<span>姓名:{{ multipleSelection[0]?.nickName ?? props.username }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<el-dialog v-model="dialog.dialogVisible" :title="dialog.dialogTitle" append-to-body width="1050">
|
|
||||||
<nav class="flex flex-items-center mb-8">
|
|
||||||
<div class="flex flex-items-center">
|
|
||||||
<div style="width: 70px; text-align: right; padding-right: 10px">员工姓名</div>
|
|
||||||
<div class="mr-5 flex-1">
|
|
||||||
<el-input v-model="queryParams.nickName" clearable placeholder="请输入员工姓名" style="width: 170px" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-items-center">
|
|
||||||
<div style="width: 70px; text-align: right; padding-right: 10px">手机号</div>
|
|
||||||
<div class="mr-5 flex-1">
|
|
||||||
<el-input v-model="queryParams.phonenumber" clearable placeholder="请输入手机号" style="width: 170px" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-button type="primary" @click="getList">查询</el-button>
|
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
<el-table ref="multipleTableRef" :data="tableData" border @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column align="center" type="selection" width="55" />
|
|
||||||
<el-table-column align="center" label="序号" type="index" width="55" />
|
|
||||||
<el-table-column align="center" label="姓名" prop="nickName" />
|
|
||||||
<el-table-column align="center" label="性别" prop="sex" width="85">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<dict-tag :options="sys_user_sex" :value="row.sex" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="角色" prop="roleName" />
|
|
||||||
<el-table-column v-if="props.userType == 'repair'" align="center" label="当前任务数量" prop="taskCount" />
|
|
||||||
<el-table-column align="center" label="手机号码" prop="phonenumber" />
|
|
||||||
<el-table-column align="center" label="状态" prop="status">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-tag :type="row.status === '0' ? 'success' : 'danger'">{{ row.status === '0' ? '正常' : '停用' }}</el-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer flex flex-items-center flex-justify-between">
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
v-model:limit="queryParams.pageSize"
|
|
||||||
v-model:page="queryParams.pageNum"
|
|
||||||
:total="total"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
style="margin-top: 0"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
<el-button @click="conBack">退出</el-button>
|
|
||||||
<el-button type="primary" @click="confirm"> 确定 </el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { ResidentVO } from '@/api/system/residentReviewProcess/resident/type';
|
|
||||||
import { getUserByRoleKey } from '@/api/system/user';
|
|
||||||
import { ref, watch, nextTick, getCurrentInstance, ComponentInternalInstance, toRefs } from 'vue';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { sys_user_sex } = toRefs<any>(proxy?.useDict('sys_user_sex'));
|
|
||||||
|
|
||||||
interface tableType extends ResidentVO {
|
|
||||||
housePath?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
userid: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
username: {
|
|
||||||
type: String,
|
|
||||||
default: null
|
|
||||||
},
|
|
||||||
returnvalue: {
|
|
||||||
type: String,
|
|
||||||
default: 'userId'
|
|
||||||
},
|
|
||||||
titleName: {
|
|
||||||
type: String,
|
|
||||||
default: '选择投诉处理人员'
|
|
||||||
},
|
|
||||||
userType: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
isMultiple: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { userid, titleName, userType, returnvalue } = toRefs(props);
|
|
||||||
|
|
||||||
// ✅ 手动设置默认值(替代 withDefaults)
|
|
||||||
const emit = defineEmits<{
|
|
||||||
change: [value: string | number | (string | number)[] | tableType | tableType[]]; // 支持返回数组
|
|
||||||
}>();
|
|
||||||
|
|
||||||
const dialog = ref({
|
|
||||||
dialogVisible: false,
|
|
||||||
dialogTitle: titleName.value
|
|
||||||
});
|
|
||||||
|
|
||||||
const queryParams = ref({
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
nickName: null,
|
|
||||||
phonenumber: null
|
|
||||||
});
|
|
||||||
|
|
||||||
const multipleTableRef = ref();
|
|
||||||
const tableData = ref<tableType[]>([]);
|
|
||||||
const total = ref(0);
|
|
||||||
const loading = ref(false);
|
|
||||||
const isFetching = ref(false); // 加锁,防止重复触发 selection-change
|
|
||||||
|
|
||||||
// 存储选中项
|
|
||||||
const multipleSelection = ref<tableType[]>([]);
|
|
||||||
|
|
||||||
const isMultiple = computed(() => props.isMultiple ?? false);
|
|
||||||
|
|
||||||
// 优化 handleUserSelection,避免重复查找
|
|
||||||
const handleUserSelection = () => {
|
|
||||||
isFetching.value = true;
|
|
||||||
if (tableData.value.length <= 0 || !multipleTableRef.value) {
|
|
||||||
isFetching.value = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const rowsToSelect = tableData.value.filter((row) => {
|
|
||||||
return multipleSelection.value.some((selected) => selected.userId === row.userId);
|
|
||||||
});
|
|
||||||
multipleTableRef.value.clearSelection();
|
|
||||||
if (rowsToSelect.length > 0) {
|
|
||||||
nextTick(() => {
|
|
||||||
rowsToSelect.forEach((row) => {
|
|
||||||
multipleTableRef.value?.toggleRowSelection(row, true);
|
|
||||||
});
|
|
||||||
isFetching.value = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
isFetching.value = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 监听
|
|
||||||
// 监听优化:只在 userid 变化时触发
|
|
||||||
watch(userid, handleUserSelection, { immediate: true });
|
|
||||||
|
|
||||||
// ====================== 方法 ======================
|
|
||||||
// 打开选择框
|
|
||||||
function choiceResidentFun() {
|
|
||||||
dialog.value.dialogVisible = true;
|
|
||||||
multipleSelection.value = []; // 打开时清空之前的选择
|
|
||||||
if (typeof props.userid === 'string' && props.userid.trim() !== '') {
|
|
||||||
multipleSelection.value = [
|
|
||||||
{
|
|
||||||
userId: props.userid
|
|
||||||
} as ResidentVO
|
|
||||||
];
|
|
||||||
} else if (Array.isArray(props.userid)) {
|
|
||||||
multipleSelection.value = props.userid.map((id) => ({ userId: id })) as tableType[];
|
|
||||||
}
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取列表
|
|
||||||
function getList() {
|
|
||||||
loading.value = true;
|
|
||||||
getUserByRoleKey({
|
|
||||||
...queryParams.value,
|
|
||||||
roleKey: userType.value
|
|
||||||
})
|
|
||||||
.then((res) => {
|
|
||||||
tableData.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
handleUserSelection();
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error('获取用户列表失败:', error);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// ==============================================
|
|
||||||
// ✅ 新增:处理 selection-change(多选专用)
|
|
||||||
// ==============================================
|
|
||||||
function handleSelectionChange(selection: tableType[]) {
|
|
||||||
if (isFetching.value) return;
|
|
||||||
if (isMultiple.value) {
|
|
||||||
const currentSelectedIds = new Set(selection.map((item) => item.id));
|
|
||||||
const otherPageSelections = multipleSelection.value.filter((item) => {
|
|
||||||
const isCurrentPageItem = tableData.value.some((row) => row.id === item.id);
|
|
||||||
if (isCurrentPageItem) {
|
|
||||||
return currentSelectedIds.has(item.id);
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 3. 合并:其他页保留的 + 当前页新选中的
|
|
||||||
const finalSelection = [...otherPageSelections, ...selection];
|
|
||||||
// 4. 去重(以防万一)
|
|
||||||
const uniqueMap = new Map();
|
|
||||||
finalSelection.forEach((item) => uniqueMap.set(item.id, item));
|
|
||||||
multipleSelection.value = Array.from(uniqueMap.values());
|
|
||||||
} else {
|
|
||||||
// --- 单选逻辑 ---
|
|
||||||
if (selection.length > 0) {
|
|
||||||
const lastSelected = selection[selection.length - 1];
|
|
||||||
multipleSelection.value = [lastSelected];
|
|
||||||
nextTick(() => {
|
|
||||||
if (selection.length > 1) {
|
|
||||||
multipleTableRef.value?.clearSelection();
|
|
||||||
multipleTableRef.value?.toggleRowSelection(lastSelected, true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
multipleSelection.value = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 重置查询
|
|
||||||
function resetQuery() {
|
|
||||||
queryParams.value = {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
nickName: null,
|
|
||||||
phonenumber: null
|
|
||||||
};
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 退出
|
|
||||||
function conBack() {
|
|
||||||
dialog.value.dialogVisible = false;
|
|
||||||
resetQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ==============================================
|
|
||||||
// ✅ 核心修改:根据 returnvalue 返回对应的值
|
|
||||||
// ==============================================
|
|
||||||
function confirm() {
|
|
||||||
dialog.value.dialogVisible = false;
|
|
||||||
if (isMultiple.value) {
|
|
||||||
// 多选
|
|
||||||
if (returnvalue.value === '*') {
|
|
||||||
// ✅ 返回整个对象数组
|
|
||||||
emit('change', multipleSelection.value);
|
|
||||||
} else {
|
|
||||||
// 返回指定字段数组
|
|
||||||
emit(
|
|
||||||
'change',
|
|
||||||
multipleSelection.value.map((item) => item[returnvalue.value as keyof tableType])
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 单选
|
|
||||||
if (returnvalue.value === '*') {
|
|
||||||
// ✅ 返回整个对象
|
|
||||||
emit('change', multipleSelection.value[multipleSelection.value.length - 1]);
|
|
||||||
} else {
|
|
||||||
// 返回指定字段
|
|
||||||
emit('change', multipleSelection.value[multipleSelection.value.length - 1][returnvalue.value as keyof tableType]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onMounted(() => {
|
|
||||||
// 初始化
|
|
||||||
});
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
open: () => {
|
|
||||||
dialog.value.dialogVisible = true;
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.residentBox {
|
|
||||||
width: 385px;
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 0 10px;
|
|
||||||
.defaultBox {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
cursor: pointer;
|
|
||||||
&:hover {
|
|
||||||
background-color: #f4f8ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,335 +0,0 @@
|
|||||||
<template>
|
|
||||||
<slot name="default" />
|
|
||||||
<el-dialog v-model="dialog.dialogVisible" :title="dialog.dialogTitle" append-to-body width="1050">
|
|
||||||
<nav class="flex flex-items-center mb-8">
|
|
||||||
<div class="flex flex-items-center">
|
|
||||||
<div style="width: 70px; text-align: right; padding-right: 10px">物料名称</div>
|
|
||||||
<div class="mr-5 flex-1">
|
|
||||||
<el-input v-model="queryParams.materialName" clearable placeholder="请输入物料名称" style="width: 170px" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-items-center">
|
|
||||||
<div style="width: 70px; text-align: right; padding-right: 10px">品牌</div>
|
|
||||||
<div class="mr-5 flex-1">
|
|
||||||
<el-input v-model="queryParams.brand" clearable placeholder="请输入品牌" style="width: 170px" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<el-button type="primary" @click="getlist">查询</el-button>
|
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
<el-table ref="multipleTableRef" :data="tableData" border>
|
|
||||||
<el-table-column align="center" width="55">
|
|
||||||
<template #header>
|
|
||||||
<el-checkbox v-model="isSelectAll" :disabled="!isMultiple" :indeterminate="isIndeterminate" @change="handleSelectAllChange" />
|
|
||||||
</template>
|
|
||||||
<template #default="scope">
|
|
||||||
<el-checkbox :model-value="isRowSelected(scope.row)" @change="(val: boolean) => handleRowCheckChange(scope.row, val)" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="物料名称" prop="materialName" />
|
|
||||||
<el-table-column align="center" label="品牌" prop="brand" />
|
|
||||||
<el-table-column align="center" label="规格型号" prop="model" />
|
|
||||||
<el-table-column align="center" label="单位" prop="unit" />
|
|
||||||
<el-table-column v-if="!isHidden" align="center" label="数量" prop="stockNum" />
|
|
||||||
<el-table-column align="center" label="所属小区" prop="villageName" />
|
|
||||||
<el-table-column align="center" label="备注" prop="remark" />
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer flex flex-items-center flex-justify-between">
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
v-model:limit="queryParams.pageSize"
|
|
||||||
v-model:page="queryParams.pageNum"
|
|
||||||
:total="total"
|
|
||||||
style="margin-top: 0"
|
|
||||||
@pagination="getlist"
|
|
||||||
/>
|
|
||||||
<div>
|
|
||||||
<el-button @click="conback">退出</el-button>
|
|
||||||
<el-button :loading="loading" type="primary" @click="confirm"> 确定 </el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { listMaterial } from '@/api/system/Tmaterial';
|
|
||||||
import { MaterialVO } from '@/api/system/Tmaterial/type';
|
|
||||||
import { ComponentInternalInstance, getCurrentInstance, ref, toRefs } from 'vue';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
userid: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
returnvalue: {
|
|
||||||
type: String,
|
|
||||||
default: 'id'
|
|
||||||
},
|
|
||||||
titleName: {
|
|
||||||
type: String,
|
|
||||||
default: '选择物料'
|
|
||||||
},
|
|
||||||
isMultiple: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
isHidden: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { userid, titleName, returnvalue } = toRefs(props);
|
|
||||||
|
|
||||||
// ✅ 手动设置默认值(替代 withDefaults)
|
|
||||||
const emit = defineEmits<{
|
|
||||||
change: [value: string | number | (string | number)[] | MaterialVO | MaterialVO[]]; // 支持返回数组
|
|
||||||
}>();
|
|
||||||
|
|
||||||
const dialog = ref({
|
|
||||||
dialogVisible: false,
|
|
||||||
dialogTitle: titleName.value
|
|
||||||
});
|
|
||||||
|
|
||||||
const queryParams = ref({
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
brand: '',
|
|
||||||
materialName: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const multipleTableRef = ref();
|
|
||||||
const tableData = ref<MaterialVO[]>([]);
|
|
||||||
const total = ref(0);
|
|
||||||
const loading = ref(false);
|
|
||||||
|
|
||||||
/** 存储所有选中项(跨页累计,非全选模式使用) */
|
|
||||||
const multipleSelection = ref<MaterialVO[]>([]);
|
|
||||||
/** 是否已跨页全选(标记模式,不实际持有全部数据) */
|
|
||||||
const isSelectAll = ref(false);
|
|
||||||
/** 表头复选框半选状态(部分选中时为 true) */
|
|
||||||
const isIndeterminate = ref(false);
|
|
||||||
/** 全选模式下被手动取消勾选的 id 列表 */
|
|
||||||
const deselectedIds = ref<string[]>([]);
|
|
||||||
|
|
||||||
const isMultiple = computed(() => props.isMultiple ?? false);
|
|
||||||
|
|
||||||
/** 判断某行是否已选中 */
|
|
||||||
function isRowSelected(row: MaterialVO): boolean {
|
|
||||||
if (isSelectAll.value) {
|
|
||||||
// 全选模式:只要不在取消列表中就算选中
|
|
||||||
return !deselectedIds.value.includes(row.id);
|
|
||||||
}
|
|
||||||
return multipleSelection.value.some((item) => item.id === row.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 更新表头复选框状态:全选 / 半选 / 空 */
|
|
||||||
function updateIndeterminate() {
|
|
||||||
if (isSelectAll.value) {
|
|
||||||
// 全选模式下:有取消勾选的行 → 半选,否则 → 全选
|
|
||||||
isIndeterminate.value = deselectedIds.value.length > 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 非全选模式:只要有已勾选的行即为半选。
|
|
||||||
// 注意:不能用 selectedCount >= total 去做“自动升级为全选”,
|
|
||||||
// 否则搜索/筛选后 total 变小,会把之前积累的 multipleSelection 误判并清空,覆盖已选数据。
|
|
||||||
isIndeterminate.value = multipleSelection.value.length > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 跨页全选 / 取消全选(仅设标记,不拉取数据) */
|
|
||||||
function handleSelectAllChange(val: boolean) {
|
|
||||||
isSelectAll.value = val;
|
|
||||||
deselectedIds.value = [];
|
|
||||||
multipleSelection.value = [];
|
|
||||||
updateIndeterminate();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 单行勾选 / 取消勾选 */
|
|
||||||
function handleRowCheckChange(row: MaterialVO, checked: boolean) {
|
|
||||||
if (!isMultiple.value) {
|
|
||||||
// 单选模式:仅保留当前行
|
|
||||||
if (checked) {
|
|
||||||
multipleSelection.value = [row];
|
|
||||||
} else {
|
|
||||||
multipleSelection.value = [];
|
|
||||||
}
|
|
||||||
isSelectAll.value = false;
|
|
||||||
deselectedIds.value = [];
|
|
||||||
updateIndeterminate();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isSelectAll.value) {
|
|
||||||
// 全选模式:维护取消列表
|
|
||||||
if (checked) {
|
|
||||||
deselectedIds.value = deselectedIds.value.filter((id) => id !== row.id);
|
|
||||||
} else {
|
|
||||||
if (!deselectedIds.value.includes(row.id)) {
|
|
||||||
deselectedIds.value.push(row.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 非全选模式:维护选中列表
|
|
||||||
if (checked) {
|
|
||||||
if (!isRowSelected(row)) {
|
|
||||||
multipleSelection.value.push(row);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
multipleSelection.value = multipleSelection.value.filter((item) => item.id !== row.id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
updateIndeterminate();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ====================== 方法 ======================
|
|
||||||
|
|
||||||
// 获取列表
|
|
||||||
function getlist() {
|
|
||||||
loading.value = true;
|
|
||||||
listMaterial(queryParams.value)
|
|
||||||
.then((res) => {
|
|
||||||
tableData.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
updateIndeterminate();
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error('获取物料列表失败:', error);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 重置查询
|
|
||||||
function resetQuery() {
|
|
||||||
queryParams.value = {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
brand: '',
|
|
||||||
materialName: ''
|
|
||||||
};
|
|
||||||
resetSelection();
|
|
||||||
getlist();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 退出
|
|
||||||
function conback() {
|
|
||||||
dialog.value.dialogVisible = false;
|
|
||||||
resetQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 重置所有选中状态 */
|
|
||||||
function resetSelection() {
|
|
||||||
multipleSelection.value = [];
|
|
||||||
isSelectAll.value = false;
|
|
||||||
isIndeterminate.value = false;
|
|
||||||
deselectedIds.value = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 根据 returnvalue 发射选中结果 */
|
|
||||||
function emitResult(data: MaterialVO[]) {
|
|
||||||
if (isMultiple.value) {
|
|
||||||
if (returnvalue.value === '*') {
|
|
||||||
emit('change', data);
|
|
||||||
} else {
|
|
||||||
emit(
|
|
||||||
'change',
|
|
||||||
data.map((item) => item[returnvalue.value as keyof MaterialVO])
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (returnvalue.value === '*') {
|
|
||||||
emit('change', data[0]);
|
|
||||||
} else {
|
|
||||||
emit('change', data[0]?.[returnvalue.value as keyof MaterialVO]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 确定:全选模式下按需拉取全部数据,非全选模式直接使用已选列表 */
|
|
||||||
async function confirm() {
|
|
||||||
if (isMultiple.value && isSelectAll.value && total.value > 0) {
|
|
||||||
// 全选模式:此时才真正拉取全部数据,排除已取消勾选的行
|
|
||||||
loading.value = true;
|
|
||||||
try {
|
|
||||||
const res = await listMaterial({
|
|
||||||
...queryParams.value,
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: total.value
|
|
||||||
});
|
|
||||||
const allData: MaterialVO[] = res.rows || [];
|
|
||||||
const filteredData = allData.filter((item) => !deselectedIds.value.includes(item.id));
|
|
||||||
dialog.value.dialogVisible = false;
|
|
||||||
emitResult(filteredData);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('获取全部物料数据失败:', error);
|
|
||||||
} finally {
|
|
||||||
loading.value = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 非全选模式:直接使用已收集的选中列表
|
|
||||||
dialog.value.dialogVisible = false;
|
|
||||||
emitResult(multipleSelection.value);
|
|
||||||
}
|
|
||||||
|
|
||||||
resetSelection();
|
|
||||||
}
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
open: () => {
|
|
||||||
// 重置查询条件,避免残留上次的筛选条件
|
|
||||||
queryParams.value = {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
brand: '',
|
|
||||||
materialName: ''
|
|
||||||
};
|
|
||||||
// 立即清空旧列表数据,避免闪烁
|
|
||||||
tableData.value = [];
|
|
||||||
total.value = 0;
|
|
||||||
// 重置全选标记
|
|
||||||
isSelectAll.value = false;
|
|
||||||
deselectedIds.value = [];
|
|
||||||
// 根据 userid(逗号分隔)初始化选中状态
|
|
||||||
const arr = userid.value ? userid.value.split(',').filter((id) => id) : [];
|
|
||||||
if (arr.length > 0) {
|
|
||||||
multipleSelection.value = arr.map((id) => ({ id }) as MaterialVO);
|
|
||||||
isIndeterminate.value = true;
|
|
||||||
} else {
|
|
||||||
multipleSelection.value = [];
|
|
||||||
isIndeterminate.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
getlist();
|
|
||||||
dialog.value.dialogVisible = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.residentBox {
|
|
||||||
width: 385px;
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 5px;
|
|
||||||
padding: 0 10px;
|
|
||||||
.defaultbox {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
cursor: pointer;
|
|
||||||
&:hover {
|
|
||||||
background-color: #f4f8ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,369 +0,0 @@
|
|||||||
<script lang="ts" setup>
|
|
||||||
import AMapLoader from '@amap/amap-jsapi-loader';
|
|
||||||
import { getVillageByIdAPI } from '@/api/system/community';
|
|
||||||
import { onUnmounted, ref, watch, onMounted, nextTick } from 'vue';
|
|
||||||
import { LngLat } from '@/components/Map/type';
|
|
||||||
|
|
||||||
// 密钥配置
|
|
||||||
const autoloader = import.meta.env.VITE_GCJ02_KEY_GD;
|
|
||||||
const VITE_GCJ02_JS_CODE_GD = import.meta.env.VITE_GCJ02_JS_CODE_GD;
|
|
||||||
window._AMapSecurityConfig = { securityJsCode: VITE_GCJ02_JS_CODE_GD };
|
|
||||||
|
|
||||||
// 全局实例
|
|
||||||
const AMAP = ref<any>(null);
|
|
||||||
const map = ref<any>(null);
|
|
||||||
const mapReady = ref(false);
|
|
||||||
const mapLoading = ref(false);
|
|
||||||
const markers = ref<any[]>([]);
|
|
||||||
const mouseTool = ref<any>(null);
|
|
||||||
const AddMarkered = new Map<string, any>();
|
|
||||||
let drawnPolylines: any[] = [];
|
|
||||||
|
|
||||||
// Props & Emits
|
|
||||||
const props = defineProps({
|
|
||||||
disabled: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
clickOrDraw: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
smallScroll: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const emits = defineEmits<{
|
|
||||||
clickPoint: [value: LngLat];
|
|
||||||
}>();
|
|
||||||
|
|
||||||
// 对外暴露方法
|
|
||||||
defineExpose({
|
|
||||||
addMarker_only,
|
|
||||||
clearLocation,
|
|
||||||
addMarker_more,
|
|
||||||
clearAll,
|
|
||||||
getAllDrawLines,
|
|
||||||
renderSavedPath,
|
|
||||||
clearMapMarker
|
|
||||||
});
|
|
||||||
|
|
||||||
const village = localStorage.getItem('villageid');
|
|
||||||
|
|
||||||
// ===================== 工具函数 =====================
|
|
||||||
/** 地图完整可用校验 */
|
|
||||||
function isMapAvailable() {
|
|
||||||
return mapReady.value && map.value && AMAP.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 统一适配视野,无动画 + 留白 + 最大缩放限制 */
|
|
||||||
function fitMapView(overlays: any[]) {
|
|
||||||
if (!isMapAvailable() || overlays.length === 0) return;
|
|
||||||
// 第二个参数true关闭动画,留白80px,最大缩放18级
|
|
||||||
map.value.setFitView(overlays, props.smallScroll);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===================== 渲染等待队列(响应式) =====================
|
|
||||||
type WaitMarkerItem = { angular: number[]; pointName: string };
|
|
||||||
type WaitMoreMarkerItem = { angular: number[]; pointName: string; pointId: string };
|
|
||||||
const waitQueue = ref<{
|
|
||||||
onlyPoints: WaitMarkerItem[];
|
|
||||||
point: WaitMoreMarkerItem[];
|
|
||||||
routes: string[];
|
|
||||||
clear: boolean;
|
|
||||||
}>({
|
|
||||||
onlyPoints: [],
|
|
||||||
point: [],
|
|
||||||
routes: [],
|
|
||||||
clear: false
|
|
||||||
});
|
|
||||||
|
|
||||||
// 地图就绪后批量执行队列任务
|
|
||||||
watch(mapReady, async (ready) => {
|
|
||||||
if (!ready || !isMapAvailable()) return;
|
|
||||||
await nextTick();
|
|
||||||
|
|
||||||
// 先执行清空
|
|
||||||
if (waitQueue.value.clear) {
|
|
||||||
map.value.clearMap();
|
|
||||||
AddMarkered.clear();
|
|
||||||
markers.value = [];
|
|
||||||
drawnPolylines = [];
|
|
||||||
waitQueue.value.clear = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 批量多点标记
|
|
||||||
waitQueue.value.point.forEach((item) => addMarker_more(item.angular, item.pointName, item.pointId));
|
|
||||||
waitQueue.value.point = [];
|
|
||||||
|
|
||||||
// 单点标记
|
|
||||||
waitQueue.value.onlyPoints.forEach((item) => addMarker_only(item.angular, item.pointName));
|
|
||||||
waitQueue.value.onlyPoints = [];
|
|
||||||
|
|
||||||
// 路线回显
|
|
||||||
waitQueue.value.routes.forEach((pathStr) => renderSavedPath(pathStr));
|
|
||||||
waitQueue.value.routes = [];
|
|
||||||
});
|
|
||||||
|
|
||||||
// ===================== 单点标记 =====================
|
|
||||||
function addMarker_only(angular: number[], pointName: string) {
|
|
||||||
if (!isMapAvailable()) {
|
|
||||||
waitQueue.value.onlyPoints.push({ angular, pointName });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
clearLocation();
|
|
||||||
const marker = new AMAP.value.Marker({
|
|
||||||
position: angular,
|
|
||||||
map: map.value,
|
|
||||||
title: pointName || '巡检点',
|
|
||||||
content: `
|
|
||||||
<div style="display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:rgba(26,117,255,0.3);">
|
|
||||||
<div style="width:20px;height:20px;border-radius:50%;line-height:20px;background:#1a75ff;color:#fff;font-size:20px;text-align:center;">1</div>
|
|
||||||
</div>`
|
|
||||||
});
|
|
||||||
markers.value = [marker];
|
|
||||||
fitMapView(markers.value);
|
|
||||||
return marker;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 清空单点标记 */
|
|
||||||
function clearLocation() {
|
|
||||||
if (!isMapAvailable() || markers.value.length === 0) return;
|
|
||||||
markers.value.forEach((item) => map.value.remove(item));
|
|
||||||
markers.value = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
let lastFitTime = 0;
|
|
||||||
let fitTimer: ReturnType<typeof setTimeout> | null = null;
|
|
||||||
const FIT_THROTTLE_MS = 100; // 节流间隔(ms)
|
|
||||||
// === 新增函数 ===
|
|
||||||
function throttledFitView() {
|
|
||||||
const now = Date.now();
|
|
||||||
if (now - lastFitTime >= FIT_THROTTLE_MS) {
|
|
||||||
// 距离上次调用已超过阈值,立即执行
|
|
||||||
if (fitTimer) {
|
|
||||||
clearTimeout(fitTimer);
|
|
||||||
fitTimer = null;
|
|
||||||
}
|
|
||||||
fitMapView(Array.from(AddMarkered.values()));
|
|
||||||
lastFitTime = now;
|
|
||||||
} else if (!fitTimer) {
|
|
||||||
// 未超过阈值,延迟到阈值时再执行
|
|
||||||
fitTimer = setTimeout(() => {
|
|
||||||
fitMapView(Array.from(AddMarkered.values()));
|
|
||||||
lastFitTime = Date.now();
|
|
||||||
fitTimer = null;
|
|
||||||
}, FIT_THROTTLE_MS);
|
|
||||||
}
|
|
||||||
// 如果已经有定时器在等,不重复创建
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===================== 多点标记(可增删) =====================
|
|
||||||
function addMarker_more(angular: number[], pointName: string, pointId: string) {
|
|
||||||
if (!isMapAvailable()) {
|
|
||||||
waitQueue.value.point.push({ angular, pointName, pointId });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 存在则删除
|
|
||||||
if (AddMarkered.has(pointId)) {
|
|
||||||
map.value.remove(AddMarkered.get(pointId));
|
|
||||||
AddMarkered.delete(pointId);
|
|
||||||
// 删除后重新适配视野
|
|
||||||
// fitMapView(Array.from(AddMarkered.values()));
|
|
||||||
throttledFitView();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const index = AddMarkered.size + 1;
|
|
||||||
const marker = new AMAP.value.Marker({
|
|
||||||
position: angular,
|
|
||||||
map: map.value,
|
|
||||||
title: pointName || '巡检点',
|
|
||||||
content: `
|
|
||||||
<div style="display:flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:50%;background:rgba(26,117,255,0.3);">
|
|
||||||
<div style="width:20px;height:20px;border-radius:50%;line-height:20px;background:#1a75ff;color:#fff;font-size:20px;text-align:center;">${index}</div>
|
|
||||||
</div>`
|
|
||||||
});
|
|
||||||
AddMarkered.set(pointId, marker);
|
|
||||||
markers.value.push(marker);
|
|
||||||
// fitMapView(Array.from(AddMarkered.values()));
|
|
||||||
throttledFitView();
|
|
||||||
return marker;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===================== 绘制路线 =====================
|
|
||||||
function MapDrawLine() {
|
|
||||||
if (!isMapAvailable()) return;
|
|
||||||
mouseTool.value = new AMAP.value.MouseTool(map.value);
|
|
||||||
mouseTool.value.on('draw', (e: any) => {
|
|
||||||
if (!e.obj) return;
|
|
||||||
// 只保留一条线
|
|
||||||
if (drawnPolylines.length > 0) map.value.remove(drawnPolylines[0]);
|
|
||||||
drawnPolylines = [e.obj];
|
|
||||||
initDrawTool();
|
|
||||||
});
|
|
||||||
initDrawTool();
|
|
||||||
}
|
|
||||||
|
|
||||||
function initDrawTool() {
|
|
||||||
if (!mouseTool.value || !isMapAvailable()) return;
|
|
||||||
mouseTool.value.close(false);
|
|
||||||
mouseTool.value.polyline({
|
|
||||||
strokeColor: '#3366FF',
|
|
||||||
strokeOpacity: 1,
|
|
||||||
strokeWeight: 3,
|
|
||||||
strokeStyle: 'solid'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 获取路线坐标数组 */
|
|
||||||
function getAllDrawLines(): LngLat[] | [] {
|
|
||||||
if (!isMapAvailable() || drawnPolylines.length === 0) return [];
|
|
||||||
const path = drawnPolylines[0].getPath();
|
|
||||||
return path.map((p: any) => [p.lng, p.lat]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 回显历史路线 */
|
|
||||||
function renderSavedPath(pathStr: string) {
|
|
||||||
if (!isMapAvailable()) {
|
|
||||||
waitQueue.value.routes.push(pathStr);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const path = JSON.parse(pathStr);
|
|
||||||
if (!Array.isArray(path) || path.length === 0) return;
|
|
||||||
// 清空旧线
|
|
||||||
drawnPolylines.forEach((line) => map.value.remove(line));
|
|
||||||
drawnPolylines = [];
|
|
||||||
|
|
||||||
const polyline = new AMAP.value.Polyline({
|
|
||||||
path,
|
|
||||||
strokeColor: '#3366FF',
|
|
||||||
strokeOpacity: 1,
|
|
||||||
strokeWeight: 3,
|
|
||||||
strokeStyle: 'solid',
|
|
||||||
map: map.value
|
|
||||||
});
|
|
||||||
drawnPolylines.push(polyline);
|
|
||||||
fitMapView([polyline]);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('路线解析失败', err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 清空绘图工具+路线 */
|
|
||||||
function clearAll() {
|
|
||||||
if (!isMapAvailable() || !mouseTool.value) return;
|
|
||||||
mouseTool.value.close(true);
|
|
||||||
drawnPolylines.forEach((line) => map.value.removeOverlay(line));
|
|
||||||
drawnPolylines = [];
|
|
||||||
initDrawTool();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 清空地图所有覆盖物(标记+路线) */
|
|
||||||
function clearMapMarker() {
|
|
||||||
if (isMapAvailable()) {
|
|
||||||
map.value.clearMap();
|
|
||||||
AddMarkered.clear();
|
|
||||||
markers.value = [];
|
|
||||||
drawnPolylines = [];
|
|
||||||
} else {
|
|
||||||
waitQueue.value.clear = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 地图点击拾取坐标 */
|
|
||||||
function handleMap() {
|
|
||||||
if (!isMapAvailable()) return;
|
|
||||||
map.value.on('click', (e: any) => {
|
|
||||||
const { lng, lat } = e.lnglat;
|
|
||||||
emits('clickPoint', [lng, lat]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===================== 地图初始化 =====================
|
|
||||||
onMounted(async () => {
|
|
||||||
mapLoading.value = true;
|
|
||||||
try {
|
|
||||||
const AMap = await AMapLoader.load({
|
|
||||||
key: autoloader,
|
|
||||||
version: '2.0',
|
|
||||||
plugins: ['AMap.Scale', 'AMap.Marker', 'AMap.Geocoder', 'AMap.MouseTool']
|
|
||||||
});
|
|
||||||
AMAP.value = AMap;
|
|
||||||
|
|
||||||
// 创建地图,全局关闭动画,解决移动缓慢
|
|
||||||
map.value = new AMap.Map('GD-Map', {
|
|
||||||
viewMode: '3D',
|
|
||||||
zoom: 11,
|
|
||||||
center: [116.397428, 39.90923]
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
|
||||||
// 获取村庄城市定位
|
|
||||||
const villageInfo = await getVillageByIdAPI(village);
|
|
||||||
const city = villageInfo.data.city.replaceAll('/', '');
|
|
||||||
// 城市地理编码定位
|
|
||||||
const geocoder = new AMap.Geocoder({ city });
|
|
||||||
geocoder.getLocation(city, (status: string, result: any) => {
|
|
||||||
if (status === 'complete' && result.info === 'OK') {
|
|
||||||
map.value.setCenter(result.geocodes[0].location.toArray());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
map.value.setCenter([116.397428, 39.90923]);
|
|
||||||
}
|
|
||||||
|
|
||||||
mapReady.value = true;
|
|
||||||
|
|
||||||
// 禁用状态不开启绘制/点击
|
|
||||||
if (!props.disabled) {
|
|
||||||
props.clickOrDraw ? handleMap() : MapDrawLine();
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error('高德地图加载失败', err);
|
|
||||||
} finally {
|
|
||||||
mapLoading.value = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// ===================== 销毁清理 =====================
|
|
||||||
onUnmounted(() => {
|
|
||||||
// 销毁地图实例
|
|
||||||
map.value?.destroy();
|
|
||||||
// 清空所有缓存队列
|
|
||||||
waitQueue.value.onlyPoints = [];
|
|
||||||
waitQueue.value.point = [];
|
|
||||||
waitQueue.value.routes = [];
|
|
||||||
waitQueue.value.clear = false;
|
|
||||||
// 清空覆盖物缓存
|
|
||||||
markers.value = [];
|
|
||||||
drawnPolylines = [];
|
|
||||||
AddMarkered.clear();
|
|
||||||
mouseTool.value = null;
|
|
||||||
AMAP.value = null;
|
|
||||||
map.value = null;
|
|
||||||
mapReady.value = false;
|
|
||||||
if (fitTimer) {
|
|
||||||
clearTimeout(fitTimer);
|
|
||||||
fitTimer = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div id="GD-Map" v-loading="mapLoading" class="map"></div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.map {
|
|
||||||
width: 100%;
|
|
||||||
min-height: 450px;
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 4px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,330 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import { ref, watch, onMounted, onUnmounted, nextTick } from 'vue';
|
|
||||||
import { LngLat } from '@/components/Map/type';
|
|
||||||
|
|
||||||
// ========== 配置项,替换成你自己的天地图密钥 ==========
|
|
||||||
const TDT_TOKEN = import.meta.env.VITE_TIANDITU_KEY;
|
|
||||||
const TDT_CDN_URL = 'https://api.tianditu.gov.cn/api?v=4.0';
|
|
||||||
|
|
||||||
const mapLoading = ref(false);
|
|
||||||
|
|
||||||
let T: any = null;
|
|
||||||
let map = null;
|
|
||||||
const mapReady = ref(false);
|
|
||||||
|
|
||||||
// Props
|
|
||||||
const props = defineProps({
|
|
||||||
disabled: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
clickOrDraw: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const emits = defineEmits<{
|
|
||||||
clickPoint: [lnglat: LngLat];
|
|
||||||
}>();
|
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
addMarker_only,
|
|
||||||
clearLocation,
|
|
||||||
|
|
||||||
getAllDrawLines,
|
|
||||||
clearAll,
|
|
||||||
renderSavedPath,
|
|
||||||
|
|
||||||
clearMapMarker,
|
|
||||||
addMarker_more
|
|
||||||
});
|
|
||||||
const PointMap = new Map();
|
|
||||||
let handler = null; // 绘制工具
|
|
||||||
let lines = []; // 存储线
|
|
||||||
type WaitMarkerItem = { angular: LngLat; pointName: string };
|
|
||||||
type WaitMoreMarkerItem = { angular: LngLat; pointName: string; pointId: string };
|
|
||||||
const waitQueue = ref<{
|
|
||||||
onlyPoints: WaitMarkerItem[];
|
|
||||||
point: WaitMoreMarkerItem[];
|
|
||||||
routes: string[];
|
|
||||||
clear: boolean;
|
|
||||||
}>({
|
|
||||||
onlyPoints: [],
|
|
||||||
point: [],
|
|
||||||
routes: [],
|
|
||||||
clear: false
|
|
||||||
});
|
|
||||||
// 地图就绪后批量执行队列任务
|
|
||||||
watch(mapReady, async (ready) => {
|
|
||||||
if (!ready || !isMapAvailable()) return;
|
|
||||||
await nextTick();
|
|
||||||
|
|
||||||
// 先执行清空
|
|
||||||
if (waitQueue.value.clear) {
|
|
||||||
map.clearMap();
|
|
||||||
PointMap.clear();
|
|
||||||
markers = [];
|
|
||||||
lines = [];
|
|
||||||
waitQueue.value.clear = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 批量多点标记
|
|
||||||
waitQueue.value.point.forEach((item) => addMarker_more(item.angular, item.pointName, item.pointId));
|
|
||||||
waitQueue.value.point = [];
|
|
||||||
|
|
||||||
// 单点标记
|
|
||||||
waitQueue.value.onlyPoints.forEach((item) => addMarker_only(item.angular, item.pointName));
|
|
||||||
waitQueue.value.onlyPoints = [];
|
|
||||||
|
|
||||||
// 路线回显
|
|
||||||
waitQueue.value.routes.forEach((pathStr) => renderSavedPath(pathStr));
|
|
||||||
waitQueue.value.routes = [];
|
|
||||||
});
|
|
||||||
let markers = [];
|
|
||||||
|
|
||||||
// ==================== 动态加载天地图JS + 初始化地图 ====================
|
|
||||||
function loadTDT(): Promise<any> {
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
if ((window as any).T) return resolve((window as any).T);
|
|
||||||
const script = document.createElement('script');
|
|
||||||
script.src = `${TDT_CDN_URL}&tk=${TDT_TOKEN}`;
|
|
||||||
script.onload = () => resolve((window as any).T);
|
|
||||||
document.body.appendChild(script);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
let lastFitTime = 0;
|
|
||||||
let fitTimer: ReturnType<typeof setTimeout> | null = null;
|
|
||||||
const FIT_THROTTLE_MS = 100; // 节流间隔(ms)
|
|
||||||
function throttledFitView(data: any[]) {
|
|
||||||
const now = Date.now();
|
|
||||||
if (now - lastFitTime >= FIT_THROTTLE_MS) {
|
|
||||||
if (fitTimer) {
|
|
||||||
clearTimeout(fitTimer);
|
|
||||||
fitTimer = null;
|
|
||||||
}
|
|
||||||
const points = data.map((m: any) => m.getLngLat());
|
|
||||||
fitMapView(points);
|
|
||||||
lastFitTime = now;
|
|
||||||
} else if (!fitTimer) {
|
|
||||||
fitTimer = setTimeout(() => {
|
|
||||||
const points = data.map((m: any) => m.getLngLat());
|
|
||||||
fitMapView(points);
|
|
||||||
lastFitTime = Date.now();
|
|
||||||
fitTimer = null;
|
|
||||||
}, FIT_THROTTLE_MS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 根据提供的 坐标点数组 设置地图视野,调整后的视野会保证包含提供的坐标点。 */
|
|
||||||
function fitMapView(overlays: any[] = []) {
|
|
||||||
if (!isMapAvailable()) return;
|
|
||||||
map.setViewport(overlays);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 判断 地图是否加载完成
|
|
||||||
function isMapAvailable() {
|
|
||||||
return mapReady.value && map && T;
|
|
||||||
}
|
|
||||||
/** 点击事件 */
|
|
||||||
function bindMapClick() {
|
|
||||||
if (!isMapAvailable()) return;
|
|
||||||
map.addEventListener('click', (e: { lnglat: { lng: any; lat: any } }) => {
|
|
||||||
const { lng, lat } = e.lnglat;
|
|
||||||
emits('clickPoint', [lng, lat]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/** 添加标注点 */
|
|
||||||
function addMarker_only(LngLat: LngLat, pointName: string = '巡检点') {
|
|
||||||
if (!isMapAvailable()) {
|
|
||||||
waitQueue.value.onlyPoints.push({ angular: LngLat, pointName });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 清空地图覆盖物
|
|
||||||
clearLocation();
|
|
||||||
const marker = new T.Marker(new T.LngLat(LngLat[0], LngLat[1]), {
|
|
||||||
title: pointName
|
|
||||||
});
|
|
||||||
//向地图上添加标注
|
|
||||||
markers = [marker];
|
|
||||||
map.addOverLay(marker);
|
|
||||||
throttledFitView(markers);
|
|
||||||
return marker;
|
|
||||||
}
|
|
||||||
/** 清空单点标记 */
|
|
||||||
function clearLocation() {
|
|
||||||
if (!isMapAvailable() || markers.length === 0) return;
|
|
||||||
map.clearOverLays();
|
|
||||||
markers = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 添加 路线中的巡检点 */
|
|
||||||
function addMarker_more(LngLat: LngLat, pointName: string, pointId: string) {
|
|
||||||
if (!isMapAvailable()) {
|
|
||||||
waitQueue.value.point.push({ angular: LngLat, pointName, pointId });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (PointMap.has(pointId)) {
|
|
||||||
map.removeOverLay(PointMap.get(pointId));
|
|
||||||
PointMap.delete(pointId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const marker = new T.Marker(new T.LngLat(LngLat[0], LngLat[1]), {
|
|
||||||
title: pointName
|
|
||||||
});
|
|
||||||
PointMap.set(pointId, marker);
|
|
||||||
map.addOverLay(marker);
|
|
||||||
throttledFitView([marker]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// !===================================================================
|
|
||||||
|
|
||||||
/** 初始化 划线 */
|
|
||||||
function initDrawTool() {
|
|
||||||
if (handler) handler.close();
|
|
||||||
handler = new T.PolylineTool(map);
|
|
||||||
handler.open();
|
|
||||||
handler.off('draw');
|
|
||||||
handler.on('draw', lineDraw);
|
|
||||||
}
|
|
||||||
// 监听 绘画完成事件
|
|
||||||
function lineDraw(data: { currentPolyline: any }) {
|
|
||||||
if (lines.length > 0) {
|
|
||||||
lines.forEach((item) => {
|
|
||||||
map.removeOverLay(item);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
lines = [data.currentPolyline];
|
|
||||||
initDrawTool();
|
|
||||||
}
|
|
||||||
/** 清空绘制工具 + 所有路线 */
|
|
||||||
function clearAll() {
|
|
||||||
if (!isMapAvailable()) return;
|
|
||||||
// 关闭绘图工具
|
|
||||||
handler.close();
|
|
||||||
// 删除所有折线
|
|
||||||
lines.forEach((line) => map.removeOverLay(line));
|
|
||||||
lines = [];
|
|
||||||
// 重新初始化绘图,可再次绘制
|
|
||||||
initDrawTool();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 获取当前路线坐标数组,对外统一格式 [[lng,lat],...] */
|
|
||||||
function getAllDrawLines(): LngLat[] | [] {
|
|
||||||
if (lines.length === 0) return [];
|
|
||||||
const path = lines.at(0).getLngLats();
|
|
||||||
return path.map((p: { lng: number; lat: number }) => [p.lng, p.lat]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 回显历史路线 */
|
|
||||||
function renderSavedPath(pathStr: string) {
|
|
||||||
if (!isMapAvailable()) {
|
|
||||||
waitQueue.value.routes.push(pathStr);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
const path = JSON.parse(pathStr);
|
|
||||||
if (!Array.isArray(path) || path.length === 0) return;
|
|
||||||
// 清空旧线
|
|
||||||
lines.forEach((line) => map.removeOverLay(line));
|
|
||||||
lines = [];
|
|
||||||
const paths = path.map((item) => {
|
|
||||||
return new T.LngLat(item[0], item[1]);
|
|
||||||
});
|
|
||||||
const polyline = new T.Polyline(paths);
|
|
||||||
lines.push(polyline);
|
|
||||||
map.addOverLay(polyline);
|
|
||||||
fitMapView(paths);
|
|
||||||
} catch (err) {
|
|
||||||
console.error('路线解析失败', err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 清空地图所有覆盖物(标记+路线) */
|
|
||||||
function clearMapMarker() {
|
|
||||||
if (isMapAvailable()) {
|
|
||||||
map.clearOverLays();
|
|
||||||
markers = [];
|
|
||||||
lines = [];
|
|
||||||
} else {
|
|
||||||
waitQueue.value.clear = true;
|
|
||||||
}
|
|
||||||
if (fitTimer) {
|
|
||||||
clearTimeout(fitTimer);
|
|
||||||
fitTimer = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
mapLoading.value = true;
|
|
||||||
try {
|
|
||||||
T = await loadTDT();
|
|
||||||
map = new T.Map('TDT-Map', {
|
|
||||||
zoom: 11,
|
|
||||||
center: new T.LngLat(119.54, 35.42),
|
|
||||||
animateEnable: true
|
|
||||||
});
|
|
||||||
mapReady.value = true;
|
|
||||||
if (!props.disabled) {
|
|
||||||
props.clickOrDraw ? bindMapClick() : initDrawTool();
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
mapLoading.value = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// ===================== 销毁清理 =====================
|
|
||||||
onUnmounted(() => {
|
|
||||||
map.clearOverLays();
|
|
||||||
map.clearLayers();
|
|
||||||
|
|
||||||
// 清空所有缓存队列
|
|
||||||
waitQueue.value.onlyPoints = [];
|
|
||||||
waitQueue.value.point = [];
|
|
||||||
waitQueue.value.routes = [];
|
|
||||||
waitQueue.value.clear = false;
|
|
||||||
|
|
||||||
// 清空覆盖物缓存
|
|
||||||
markers = [];
|
|
||||||
lines = [];
|
|
||||||
|
|
||||||
PointMap.clear();
|
|
||||||
|
|
||||||
if (handler) {
|
|
||||||
handler.close();
|
|
||||||
handler.off('draw');
|
|
||||||
handler = null;
|
|
||||||
}
|
|
||||||
mapReady.value = false;
|
|
||||||
|
|
||||||
// 销毁地图实例
|
|
||||||
map = null;
|
|
||||||
|
|
||||||
if (fitTimer) {
|
|
||||||
clearTimeout(fitTimer);
|
|
||||||
fitTimer = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div v-loading="mapLoading" class="map" id="TDT-Map"></div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.map {
|
|
||||||
width: 450px;
|
|
||||||
height: 450px;
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 4px;
|
|
||||||
margin-top: 10px;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
/* 穿透天地图内部图层,强制限制在容器内 */
|
|
||||||
:deep(.tdt-map-container) {
|
|
||||||
width: 100% !important;
|
|
||||||
height: 100% !important;
|
|
||||||
overflow: hidden !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<script setup lang="ts">
|
|
||||||
import { ref, computed } from 'vue';
|
|
||||||
import type { IMapInstance, MapBaseProps, MapEmits } from './type';
|
|
||||||
import GDMap from './GD.vue';
|
|
||||||
import TdtMap from './TDT.vue';
|
|
||||||
|
|
||||||
const emits = defineEmits<MapEmits>();
|
|
||||||
const props = defineProps<MapBaseProps>();
|
|
||||||
|
|
||||||
const GDorTDT = import.meta.env.VITE_APP_MAP_TYPE === 'GCJ02';
|
|
||||||
|
|
||||||
// 实例绑定
|
|
||||||
const GDRef = ref<InstanceType<typeof GDMap>>();
|
|
||||||
const tdtRef = ref<InstanceType<typeof TdtMap>>();
|
|
||||||
|
|
||||||
// 获取当前激活地图实例
|
|
||||||
const currentMap = computed(() => {
|
|
||||||
return GDorTDT ? GDRef.value : tdtRef.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
// 统一代理所有地图方法,对外抹平差异
|
|
||||||
defineExpose<IMapInstance>({
|
|
||||||
addMarker_only: (...args: Parameters<IMapInstance['addMarker_only']>) => currentMap.value?.addMarker_only(...args),
|
|
||||||
clearLocation: () => currentMap.value?.clearLocation(),
|
|
||||||
addMarker_more: (...args: Parameters<IMapInstance['addMarker_more']>) => currentMap.value?.addMarker_more(...args),
|
|
||||||
getAllDrawLines: () => currentMap.value?.getAllDrawLines() ?? [],
|
|
||||||
renderSavedPath: (str: string) => currentMap.value?.renderSavedPath(str),
|
|
||||||
clearAll: () => currentMap.value?.clearAll(),
|
|
||||||
clearMapMarker: () => currentMap.value?.clearMapMarker()
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<GDMap v-if="GDorTDT" v-bind="props" ref="GDRef" @click-point="(...args) => emits('clickPoint', ...args)" />
|
|
||||||
<TdtMap v-else ref="tdtRef" v-bind="props" @click-point="(...args) => emits('clickPoint', ...args)" />
|
|
||||||
</template>
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
// src/types/map.ts
|
|
||||||
export type LngLat = [number, number];
|
|
||||||
|
|
||||||
// 统一对外暴露的地图方法类型
|
|
||||||
export interface IMapInstance {
|
|
||||||
// 单点标记
|
|
||||||
addMarker_only(lnglat: LngLat, pointName: string): void;
|
|
||||||
clearLocation(): void;
|
|
||||||
// 多点可删除标记
|
|
||||||
addMarker_more(lnglat: LngLat, pointName: string, pointId: string): void;
|
|
||||||
// 绘制路线
|
|
||||||
getAllDrawLines(): LngLat[] | [];
|
|
||||||
renderSavedPath(pathStr: string): void;
|
|
||||||
clearAll(): void;
|
|
||||||
// 全局清空覆盖物
|
|
||||||
clearMapMarker(): void;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 统一Props
|
|
||||||
export interface MapBaseProps {
|
|
||||||
/** 禁用功能,只做展示 */
|
|
||||||
disabled?: boolean;
|
|
||||||
/** true 标注点 false 路线*/
|
|
||||||
clickOrDraw?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 统一事件
|
|
||||||
export type MapEmits = {
|
|
||||||
clickPoint: [lnglat: LngLat];
|
|
||||||
};
|
|
||||||
@@ -80,7 +80,6 @@ export default {
|
|||||||
selectTenant: 'Select Tenant',
|
selectTenant: 'Select Tenant',
|
||||||
layoutSetting: 'Layout Setting',
|
layoutSetting: 'Layout Setting',
|
||||||
personalCenter: 'Personal Center',
|
personalCenter: 'Personal Center',
|
||||||
logout: 'Logout',
|
logout: 'Logout'
|
||||||
community: 'Switching communities'
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ export default {
|
|||||||
selectTenant: '选择租户',
|
selectTenant: '选择租户',
|
||||||
layoutSetting: '布局设置',
|
layoutSetting: '布局设置',
|
||||||
personalCenter: '个人中心',
|
personalCenter: '个人中心',
|
||||||
logout: '退出登录',
|
logout: '退出登录'
|
||||||
community: '切换小区'
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,13 +35,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item v-if="isShow" command="changecommunity" divided>
|
<router-link v-has-permi="['system:user:profile']" to="/system/user/profile">
|
||||||
<span>{{ proxy.$t('navbar.community') }}</span>
|
|
||||||
</el-dropdown-item>
|
|
||||||
<router-link v-if="isShow" v-has-permi="['system:user:profile']" to="/system/user/profile">
|
|
||||||
<el-dropdown-item>{{ proxy.$t('navbar.personalCenter') }}</el-dropdown-item>
|
<el-dropdown-item>{{ proxy.$t('navbar.personalCenter') }}</el-dropdown-item>
|
||||||
</router-link>
|
</router-link>
|
||||||
<el-dropdown-item :divided="isShow" command="logout">
|
<el-dropdown-item divided command="logout">
|
||||||
<span>{{ proxy.$t('navbar.logout') }}</span>
|
<span>{{ proxy.$t('navbar.logout') }}</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
@@ -99,29 +96,12 @@ const logout = async () => {
|
|||||||
closeWebSocket();
|
closeWebSocket();
|
||||||
closeSSE();
|
closeSSE();
|
||||||
router.replace({
|
router.replace({
|
||||||
path: '/login',
|
path: '/login'
|
||||||
query: {
|
|
||||||
redirect: encodeURIComponent(router.currentRoute.value.fullPath || '/')
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
proxy?.$tab.closeAllPage();
|
proxy?.$tab.closeAllPage();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const routerPush = useRouter();
|
|
||||||
const changecommunity = () => {
|
|
||||||
routerPush.push({
|
|
||||||
path: '/community'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const route = useRoute();
|
|
||||||
const isShow = ref(true);
|
|
||||||
const hiddenAction = ['communitylist'];
|
|
||||||
onMounted(() => {
|
|
||||||
if (hiddenAction.includes(typeof route.name === 'string' ? route.name : '')) {
|
|
||||||
isShow.value = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const emits = defineEmits(['setLayout']);
|
const emits = defineEmits(['setLayout']);
|
||||||
const setLayout = () => {
|
const setLayout = () => {
|
||||||
emits('setLayout');
|
emits('setLayout');
|
||||||
@@ -129,8 +109,7 @@ const setLayout = () => {
|
|||||||
// 定义Command方法对象 通过key直接调用方法
|
// 定义Command方法对象 通过key直接调用方法
|
||||||
const commandMap: { [key: string]: any } = {
|
const commandMap: { [key: string]: any } = {
|
||||||
setLayout,
|
setLayout,
|
||||||
logout,
|
logout
|
||||||
changecommunity
|
|
||||||
};
|
};
|
||||||
const handleCommand = (command: string) => {
|
const handleCommand = (command: string) => {
|
||||||
// 判断是否存在该方法
|
// 判断是否存在该方法
|
||||||
|
|||||||
@@ -100,13 +100,10 @@ router.beforeEach(async (to, from) => {
|
|||||||
});
|
});
|
||||||
isDynamicRoutesAdded = true;
|
isDynamicRoutesAdded = true;
|
||||||
|
|
||||||
// 登录页跳转进来,直接跳首页;其他情况重新触发导航加载动态路由
|
// 动态路由已构建完成,重新触发本次导航
|
||||||
if (from.path === '/login') {
|
// 登录后不再强制进入小区选择页,直接进入目标页(默认走 '/' 的 redirect → 工作台 /index)
|
||||||
return '/community/communitylist';
|
// 这里replace仅在首次加载路由时执行;后续菜单切换不会走到这里
|
||||||
} else {
|
return { ...to, replace: true };
|
||||||
// 这里replace仅在首次加载路由时执行;后续菜单切换不会走到这里
|
|
||||||
return { ...to, replace: true };
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ 已经有角色、动态路由已经构建完成:直接放行菜单切换,不会再走上面的动态路由构建逻辑
|
// ✅ 已经有角色、动态路由已经构建完成:直接放行菜单切换,不会再走上面的动态路由构建逻辑
|
||||||
|
|||||||
@@ -47,31 +47,6 @@ export const constantRoutes: RouteRecordRaw[] = [
|
|||||||
component: () => import('@/views/login.vue'),
|
component: () => import('@/views/login.vue'),
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/community',
|
|
||||||
redirect: '/community/communitylist',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'communitylist',
|
|
||||||
name: 'communitylist',
|
|
||||||
// system:village:list
|
|
||||||
hidden: true,
|
|
||||||
meta: {
|
|
||||||
title: '小区列表'
|
|
||||||
},
|
|
||||||
component: () => import('@/views/community/index.vue')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'AddCommunity',
|
|
||||||
name: 'AddCommunity',
|
|
||||||
hidden: true,
|
|
||||||
meta: {
|
|
||||||
title: '小区管理'
|
|
||||||
},
|
|
||||||
component: () => import('@/views/community/AddCommunity.vue')
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/register',
|
path: '/register',
|
||||||
component: () => import('@/views/register.vue'),
|
component: () => import('@/views/register.vue'),
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ export const useUserStore = defineStore('user', () => {
|
|||||||
const data = res.data;
|
const data = res.data;
|
||||||
setToken(data.access_token);
|
setToken(data.access_token);
|
||||||
token.value = data.access_token;
|
token.value = data.access_token;
|
||||||
|
// 登录接口返回当前小区(后端默认小区),写入本地供请求头和业务页面使用
|
||||||
|
if (data.villageId) {
|
||||||
|
localStorage.setItem('villageid', data.villageId);
|
||||||
|
}
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
|
|||||||
@@ -88,8 +88,12 @@ service.interceptors.request.use(
|
|||||||
(config: InternalAxiosRequestConfig) => {
|
(config: InternalAxiosRequestConfig) => {
|
||||||
// 对应国际化资源文件后缀
|
// 对应国际化资源文件后缀
|
||||||
const villageid = localStorage.getItem('villageid');
|
const villageid = localStorage.getItem('villageid');
|
||||||
|
// 本地没有选择过小区(首次登录)时不携带 villageId,由后端使用默认小区
|
||||||
|
const hasVillage = !!villageid && villageid !== 'null';
|
||||||
config.headers['Content-Language'] = getLanguage();
|
config.headers['Content-Language'] = getLanguage();
|
||||||
config.headers['villageId'] = villageid;
|
if (hasVillage) {
|
||||||
|
config.headers['villageId'] = villageid;
|
||||||
|
}
|
||||||
// const disableAutoVillage = config.headers?.autoVillage === false;
|
// const disableAutoVillage = config.headers?.autoVillage === false;
|
||||||
|
|
||||||
const isToken = config.headers?.isToken === false;
|
const isToken = config.headers?.isToken === false;
|
||||||
@@ -104,7 +108,7 @@ service.interceptors.request.use(
|
|||||||
// get请求映射params参数
|
// get请求映射params参数
|
||||||
if (config.method === 'get' && config.params) {
|
if (config.method === 'get' && config.params) {
|
||||||
let url = '';
|
let url = '';
|
||||||
if (villageid != 'null' && needVillageId(config.url)) {
|
if (hasVillage && needVillageId(config.url)) {
|
||||||
url =
|
url =
|
||||||
config.url +
|
config.url +
|
||||||
'?' +
|
'?' +
|
||||||
@@ -122,7 +126,7 @@ service.interceptors.request.use(
|
|||||||
|
|
||||||
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
|
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
|
||||||
let obj = null;
|
let obj = null;
|
||||||
if (villageid != 'null' && needVillageId(config.url)) {
|
if (hasVillage && needVillageId(config.url)) {
|
||||||
obj = {
|
obj = {
|
||||||
villageId: villageid,
|
villageId: villageid,
|
||||||
...config.data
|
...config.data
|
||||||
|
|||||||
@@ -1,539 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="box">
|
|
||||||
<div class="header">
|
|
||||||
<span>智慧物业后台管理系统</span>
|
|
||||||
<navbar ref="navbarRef" :Showhamburger="false" />
|
|
||||||
</div>
|
|
||||||
<div class="container AddBuildingBox">
|
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" class="formBody" inline label-width="100px">
|
|
||||||
<div class="AddBuildingBody">
|
|
||||||
<div class="title">基本信息</div>
|
|
||||||
<div class="addBuildingFormBody">
|
|
||||||
<el-form-item label="小区名称" prop="villageName">
|
|
||||||
<el-input v-model.trim="form.villageName" maxlength="25" placeholder="请输入小区名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="小区编号" prop="villageCode">
|
|
||||||
<el-input v-model.trim="form.villageCode" maxlength="20" placeholder="请输入小区编号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="所在城市" prop="city">
|
|
||||||
<el-cascader v-model="city" :options="pcaTextArrList" @change="cityChange"> </el-cascader>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="完整详细地址" prop="buildingArea">
|
|
||||||
<el-input v-model.trim="form.address" :row="3" maxlength="100" placeholder="请输入完整详细地址" show-word-limit type="textarea" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="建成时间" prop="buildingArea">
|
|
||||||
<el-date-picker v-model="builtTime" placeholder="选择建成时间" type="date" value-format="YYYY-MM-DD" @change="changeBuiltTime" />
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="房屋用途" prop="houseUse">-->
|
|
||||||
<!-- <el-select v-model="form.houseUse" placeholder="请选择房屋用途" style="width: 240px">-->
|
|
||||||
<!-- <el-option v-for="item in houseUserList" :key="item.id" :label="item.name" :value="item.id" />-->
|
|
||||||
<!-- </el-select>-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<el-form-item label="小区面积" prop="villageArea">
|
|
||||||
<el-input v-model.trim="form.villageArea" maxlength="8" placeholder="请输入小区面积"><template #append>㎡</template> </el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="小区图片" style="width: 100%">
|
|
||||||
<el-upload
|
|
||||||
ref="uploadRef"
|
|
||||||
:action="uploadFileUrl"
|
|
||||||
:auto-upload="false"
|
|
||||||
:file-list="villageImg"
|
|
||||||
:headers="headerToken()"
|
|
||||||
:limit="9"
|
|
||||||
:on-exceed="handleExceed"
|
|
||||||
accept=".jpg, .png"
|
|
||||||
list-type="picture-card"
|
|
||||||
@change="handleUploadChange"
|
|
||||||
@before-upload="handleBeforeUpload"
|
|
||||||
>
|
|
||||||
<el-icon><Plus /></el-icon>
|
|
||||||
<template #file="{ file }">
|
|
||||||
<div>
|
|
||||||
<img :src="file.url" alt="" class="el-upload-list__item-thumbnail" />
|
|
||||||
<span class="el-upload-list__item-actions">
|
|
||||||
<span class="el-upload-list__item-delete" @click="handleRemove(file)">
|
|
||||||
<el-icon><Delete /></el-icon>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template #tip>
|
|
||||||
<div class="el-upload__tip">支持jpg, png等格式文件上传,文件大小不超过10MB</div>
|
|
||||||
</template>
|
|
||||||
</el-upload>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="小区简介" style="width: 100%">
|
|
||||||
<el-input v-model.trim="form.remark" :rows="5" maxlength="200" placeholder="小区简介" show-word-limit type="textarea" />
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="AddBuildingBody">
|
|
||||||
<div class="title">负责人信息</div>
|
|
||||||
<div class="addBuildingFormBody addBuildingForm_User_Body">
|
|
||||||
<el-form-item label="姓名">
|
|
||||||
<el-input v-model.trim="form.manageName" maxlength="20" placeholder="请输入姓名" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="电话" prop="managePhone">
|
|
||||||
<el-input v-model.trim="form.managePhone" placeholder="请输入电话" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="微信" prop="manageVx">
|
|
||||||
<el-input v-model.trim="form.manageVx" maxlength="20" placeholder="请输入微信"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="QQ" prop="manageQq">
|
|
||||||
<el-input v-model.trim="form.manageQq" maxlength="20" placeholder="请输入QQ"> </el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="邮箱" prop="manageEmail">
|
|
||||||
<el-input v-model.trim="form.manageEmail" maxlength="30" placeholder="请输入邮箱"> </el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<div class="pl-100px">
|
|
||||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
|
||||||
<el-button @click="cancelForm">取消</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import Navbar from '@/layout/components/Navbar.vue';
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import { pcaTextArr } from 'element-china-area-data';
|
|
||||||
import type { DataItem } from 'element-china-area-data';
|
|
||||||
import { useUserStore } from '@/store/modules/user';
|
|
||||||
import { CascaderValue } from 'element-plus';
|
|
||||||
import { addVillageAPI, editVillageAPI, getVillageByIdAPI, uploadVillageImageAPI } from '@/api/system/community';
|
|
||||||
import { communitylist_rows_type } from '@/api/system/community/type';
|
|
||||||
import { Delete, Plus } from '@element-plus/icons-vue';
|
|
||||||
import { listHouseUseType_add_house } from '@/api/system/houseUse';
|
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const router = useRouter();
|
|
||||||
const editId = ref(route.query.id as string);
|
|
||||||
const isEdit = computed(() => Boolean(editId.value));
|
|
||||||
const apiPrefix = import.meta.env.VITE_APP_BASE_API;
|
|
||||||
const uploadFileUrl = `${apiPrefix}/village/uploadImages`;
|
|
||||||
// 获取省 市 区╬╬╬╬╬╬╬
|
|
||||||
const pcaTextArrList = ref<DataItem[]>(pcaTextArr);
|
|
||||||
// 获取小区用途
|
|
||||||
const houseUserList = ref([]);
|
|
||||||
const formRef = ref();
|
|
||||||
const uploadRef = ref();
|
|
||||||
|
|
||||||
const form = ref<communitylist_rows_type>({
|
|
||||||
villageId: null,
|
|
||||||
villageName: '',
|
|
||||||
villageCode: '',
|
|
||||||
address: '',
|
|
||||||
houseUse: null,
|
|
||||||
villageArea: '',
|
|
||||||
remark: '',
|
|
||||||
parkingSpaceCount: '',
|
|
||||||
villageImageUrl: '',
|
|
||||||
city: '',
|
|
||||||
status: '0',
|
|
||||||
choiceStatus: 1, // 0 选择 1未选择
|
|
||||||
manageName: '',
|
|
||||||
managePhone: '',
|
|
||||||
manageVx: '',
|
|
||||||
manageEmail: '',
|
|
||||||
manageQq: '',
|
|
||||||
completDate: ''
|
|
||||||
});
|
|
||||||
const builtTime = ref(null);
|
|
||||||
const city = ref<string[]>([]);
|
|
||||||
const villageImg = ref([]);
|
|
||||||
|
|
||||||
// 表单验证
|
|
||||||
const rules = ref({
|
|
||||||
villageName: [{ required: true, message: '请输入小区名称', trigger: 'blur' }],
|
|
||||||
villageArea: [
|
|
||||||
{ required: false, message: '请输入小区面积', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (rule, value, callback) => {
|
|
||||||
const num = Number(value);
|
|
||||||
if (value === '' || value === null) {
|
|
||||||
return callback();
|
|
||||||
}
|
|
||||||
if (Number.isNaN(num)) {
|
|
||||||
return callback(new Error('请输入正确的小区面积'));
|
|
||||||
}
|
|
||||||
if (num < 0) {
|
|
||||||
return callback(new Error('小区面积不能小于0'));
|
|
||||||
}
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
parkingSpaceCount: [
|
|
||||||
{ required: false, message: '请输入车位数量', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (rule, value, callback) => {
|
|
||||||
const num = Number(value);
|
|
||||||
if (value === '' || value === null) {
|
|
||||||
return callback();
|
|
||||||
}
|
|
||||||
if (Number.isNaN(num)) {
|
|
||||||
return callback(new Error('请输入正确的车位数量'));
|
|
||||||
}
|
|
||||||
if (num < 0) {
|
|
||||||
return callback(new Error('车位数量不能小于0'));
|
|
||||||
}
|
|
||||||
if (num % 1 !== 0) {
|
|
||||||
return callback(new Error('请输入正确的整数车位数量'));
|
|
||||||
}
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
villageCode: [
|
|
||||||
{ required: true, message: '请输入小区编号', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_, value, callback) => {
|
|
||||||
if (value === '' || value === null) {
|
|
||||||
return callback(new Error('请输入小区编号'));
|
|
||||||
}
|
|
||||||
if (!/^[a-zA-Z0-9_-]{1,20}$/.test(value)) {
|
|
||||||
callback(new Error('请输入正确的小区编号,只能包含字母、数字、_和-'));
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
city: [{ required: true, message: '请选择城市', trigger: 'blur' }],
|
|
||||||
managePhone: [
|
|
||||||
{ required: false, message: '请输入电话', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_, value, callback) => {
|
|
||||||
// 值为空直接放行(非必填)
|
|
||||||
if (value === '' || value === null) {
|
|
||||||
return callback();
|
|
||||||
}
|
|
||||||
if (!/^1[3456789]\d{9}$/.test(value)) {
|
|
||||||
callback(new Error('请输入正确的手机号'));
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
manageEmail: [
|
|
||||||
{ required: false, message: '请输入邮箱', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_, value, callback) => {
|
|
||||||
if (value === '' || value === null) {
|
|
||||||
return callback();
|
|
||||||
}
|
|
||||||
// 邮箱总长度不超过254个字符,用户名不超过64个字符
|
|
||||||
if (value.length > 254 || value.split('@')[0].length > 64) {
|
|
||||||
callback(new Error('邮箱地址过长'));
|
|
||||||
} else if (!/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/.test(value)) {
|
|
||||||
callback(new Error('请输入正确的邮箱'));
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
manageVx: [
|
|
||||||
{ required: false, message: '请输入微信', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_, value, callback) => {
|
|
||||||
// 值为空直接放行(非必填)
|
|
||||||
if (value === '' || value === null) {
|
|
||||||
return callback();
|
|
||||||
}
|
|
||||||
if (!/^[a-zA-Z0-9_]{4,20}$/.test(value)) {
|
|
||||||
callback(new Error('请输入正确的微信'));
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
manageQq: [
|
|
||||||
{ required: false, message: '请输入QQ', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_, value, callback) => {
|
|
||||||
// 值为空直接放行(非必填)
|
|
||||||
if (value === '' || value === null) {
|
|
||||||
return callback();
|
|
||||||
}
|
|
||||||
if (!/^[1-9]\d{4,10}$/.test(value)) {
|
|
||||||
callback(new Error('请输入正确的QQ'));
|
|
||||||
} else {
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
/** 获取编辑小区的信息 */
|
|
||||||
function getCommunityInfo() {
|
|
||||||
const id = editId.value;
|
|
||||||
getVillageByIdAPI(id).then((res) => {
|
|
||||||
city.value = res.data.city ? res.data.city.split('/') : [];
|
|
||||||
if (res.data.villageImageUrl) {
|
|
||||||
villageImg.value = res.data.villageImageUrl
|
|
||||||
.split(',')
|
|
||||||
.filter((item) => item !== '')
|
|
||||||
.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.split('/').pop(),
|
|
||||||
url: item
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (res.data.completDate) {
|
|
||||||
builtTime.value = res.data.completDate.split(' ')[0];
|
|
||||||
}
|
|
||||||
form.value = {
|
|
||||||
...res.data,
|
|
||||||
completDate: builtTime.value
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isEdit.value) {
|
|
||||||
getCommunityInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 请求头
|
|
||||||
function headerToken() {
|
|
||||||
const useStore = useUserStore();
|
|
||||||
return {
|
|
||||||
Authorization: 'Bearer ' + useStore.token
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const allowImgSuffix = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'heic'];
|
|
||||||
/** 检测文件大小和格式 */
|
|
||||||
function handleBeforeUpload(file: UploadFile): Promise<boolean | { file: UploadFile; type: string }> {
|
|
||||||
const type = file.raw.type.split('/').pop();
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
const isLt10M = file.size / 1024 / 1024 < 10;
|
|
||||||
if (!isLt10M) {
|
|
||||||
reject({
|
|
||||||
type: '文件大小错误',
|
|
||||||
file: file
|
|
||||||
});
|
|
||||||
ElMessage.warning('图片大小超过10M,请重新上传');
|
|
||||||
} else if (!allowImgSuffix.includes(type)) {
|
|
||||||
reject({
|
|
||||||
type: '文件类型错误',
|
|
||||||
file: file
|
|
||||||
});
|
|
||||||
ElMessage.warning('图片格式不是 png/jpg/jpeg 格式, 请重新上传');
|
|
||||||
} else {
|
|
||||||
resolve(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/** 上传狗子 */
|
|
||||||
async function handleUploadChange(file: UploadFile) {
|
|
||||||
const isUpload = await handleBeforeUpload(file);
|
|
||||||
if (typeof isUpload === 'object') {
|
|
||||||
ElMessage.error(isUpload.type);
|
|
||||||
return;
|
|
||||||
} else if (typeof isUpload === 'boolean' && isUpload === true) {
|
|
||||||
villageImg.value.push(file.raw);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleExceed() {
|
|
||||||
ElMessage.error('最多上传9张图片');
|
|
||||||
}
|
|
||||||
/** 移除钩子 */
|
|
||||||
const handleRemove = (file: UploadFile) => {
|
|
||||||
const fileToRemoveIndex = villageImg.value.findIndex((item) => item.uid === file.uid);
|
|
||||||
if (fileToRemoveIndex === -1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
uploadRef.value.handleRemove(villageImg.value[fileToRemoveIndex]);
|
|
||||||
villageImg.value.splice(fileToRemoveIndex, 1);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 改变时间
|
|
||||||
const changeBuiltTime = (value: string) => {
|
|
||||||
form.value.completDate = value;
|
|
||||||
};
|
|
||||||
|
|
||||||
const cityChange = (value: CascaderValue[]) => {
|
|
||||||
form.value.city = value.join('/');
|
|
||||||
};
|
|
||||||
|
|
||||||
const reg = {
|
|
||||||
phone: /^1[3-9]\d{9}$/,
|
|
||||||
email: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
|
|
||||||
qq: /^[1-9]\d{4,11}$/,
|
|
||||||
wechat: /^[a-zA-Z][a-zA-Z0-9_-]{5,19}$/
|
|
||||||
};
|
|
||||||
// 上传图片
|
|
||||||
const submitForm = () => {
|
|
||||||
formRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
// 1) 将图片拆分为“新上传文件”和“已有图片URL”
|
|
||||||
const newFiles: File[] = [];
|
|
||||||
const existingUrls: string[] = [];
|
|
||||||
villageImg.value.forEach((item: any) => {
|
|
||||||
// 新增图片:handleUploadChange push 进来的是 File
|
|
||||||
if (item instanceof File) {
|
|
||||||
newFiles.push(item);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 编辑态已有图片:通常是 { name, url } 结构
|
|
||||||
if (item && typeof item === 'object' && typeof item.url === 'string') {
|
|
||||||
existingUrls.push(item.url);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 兜底:如果有字符串URL也兼容
|
|
||||||
if (typeof item === 'string') {
|
|
||||||
existingUrls.push(item);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 2) 没有新文件:不调用上传接口,直接用已有URL提交
|
|
||||||
if (newFiles.length === 0) {
|
|
||||||
form.value.villageImageUrl = existingUrls.join(',');
|
|
||||||
submitFormInfo();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3) 有新文件:先上传新文件,再与已有URL合并
|
|
||||||
const formdata = new FormData();
|
|
||||||
newFiles.forEach((file) => formdata.append('files', file));
|
|
||||||
uploadVillageImageAPI(formdata).then((res) => {
|
|
||||||
const uploadedUrls = res.data.success.map((x) => x.url).filter(Boolean);
|
|
||||||
// 4) 最终图片 = 已有图片 + 新上传图片(避免覆盖)
|
|
||||||
form.value.villageImageUrl = [...existingUrls, ...uploadedUrls].join(',');
|
|
||||||
submitFormInfo();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
function submitFormInfo() {
|
|
||||||
if (form.value.managePhone && form.value.managePhone.trim()) {
|
|
||||||
if (!reg.phone.test(form.value.managePhone)) {
|
|
||||||
ElMessage.error('请输入正确的手机号码');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (form.value.manageVx && form.value.manageVx.trim()) {
|
|
||||||
if (!reg.wechat.test(form.value.manageVx)) {
|
|
||||||
ElMessage.error('请输入正确的微信号');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (form.value.manageQq && form.value.manageQq.trim()) {
|
|
||||||
if (!reg.qq.test(form.value.manageQq)) {
|
|
||||||
ElMessage.error('请输入正确的QQ号码');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (form.value.manageEmail && form.value.manageEmail.trim()) {
|
|
||||||
if (!reg.email.test(form.value.manageEmail)) {
|
|
||||||
ElMessage.error('请输入正确的邮箱号码');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isEdit.value) {
|
|
||||||
editVillageAPI<communitylist_rows_type>(form.value).then(() => {
|
|
||||||
ElMessage.success('编辑成功');
|
|
||||||
cancelForm();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addVillageAPI<communitylist_rows_type>(form.value).then(() => {
|
|
||||||
ElMessage.success('添加成功');
|
|
||||||
cancelForm();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 返回
|
|
||||||
const cancelForm = () => {
|
|
||||||
router.back();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 获取房屋用途
|
|
||||||
const getHouseUserList = () => {
|
|
||||||
listHouseUseType_add_house().then((res) => {
|
|
||||||
houseUserList.value = res.data;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
getHouseUserList();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.box {
|
|
||||||
background: #deedff;
|
|
||||||
height: 100%;
|
|
||||||
overflow: auto;
|
|
||||||
.header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
height: 50px;
|
|
||||||
line-height: 50px;
|
|
||||||
background: transparent;
|
|
||||||
& > div {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
& > span {
|
|
||||||
padding-left: 20px;
|
|
||||||
font-size: 20px;
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.AddBuildingBox {
|
|
||||||
padding: 15px;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.AddBuildingBody {
|
|
||||||
margin-top: 20px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
background-color: white;
|
|
||||||
padding: 15px;
|
|
||||||
.title {
|
|
||||||
height: 40px;
|
|
||||||
line-height: 40px;
|
|
||||||
padding-left: 20px;
|
|
||||||
background-color: rgba(255, 255, 255, 1);
|
|
||||||
color: rgba(16, 16, 16, 1);
|
|
||||||
border-bottom: 1px solid #bbbbbb;
|
|
||||||
margin-bottom: 50px;
|
|
||||||
}
|
|
||||||
.addBuildingFormBody {
|
|
||||||
width: 900px;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding-bottom: 40px;
|
|
||||||
.el-form-item {
|
|
||||||
width: 46%;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
&:deep(.el-input, .el-date-editor.el-input) {
|
|
||||||
width: 300px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.el-button {
|
|
||||||
width: 80px;
|
|
||||||
height: 35px;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.addBuildingForm_User_Body {
|
|
||||||
width: 900px;
|
|
||||||
margin: 0 auto;
|
|
||||||
.el-button {
|
|
||||||
width: 80px;
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,287 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="h-full box">
|
|
||||||
<div class="header">
|
|
||||||
<span class="">智慧物业后台管理系统</span>
|
|
||||||
<navbar :Showhamburger="false" ref="navbarRef" />
|
|
||||||
</div>
|
|
||||||
<div class="containerbox">
|
|
||||||
<div class="community_nav_box">
|
|
||||||
<div class="currentbox">当前小区:{{ currentViliageInfo && currentViliageInfo.villageName }}</div>
|
|
||||||
<div class="subtitle flex align-center">
|
|
||||||
<div class="changecommunity">切换小区</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="communityBody">
|
|
||||||
<div class="coummunity_card" v-for="(item, index) in list" :key="index">
|
|
||||||
<el-image
|
|
||||||
:zoom-rate="1.2"
|
|
||||||
:max-scale="7"
|
|
||||||
:min-scale="0.2"
|
|
||||||
:preview-src-list="item.villageImageUrl ? item.villageImageUrl.split(',') : [defaultVilageinfoImage]"
|
|
||||||
show-progress
|
|
||||||
:initial-index="0"
|
|
||||||
fit="cover"
|
|
||||||
:src="item.villageImageUrl ? item.villageImageUrl.split(',')[0] : defaultVilageinfoImage"
|
|
||||||
>
|
|
||||||
<template #error>
|
|
||||||
<div class="image-viewer-slot image-slot">
|
|
||||||
<el-icon><Picture /></el-icon>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-image>
|
|
||||||
<div class="coummunityaction_box">
|
|
||||||
<div class="coummunityname">{{ item.villageName }}</div>
|
|
||||||
<div class="counmmunityaddress">{{ item.address }}</div>
|
|
||||||
</div>
|
|
||||||
<div class="actions flex">
|
|
||||||
<div @click="handleclick(item)">管理</div>
|
|
||||||
<div @click="handleEdit(item)" v-has-permi="['system:village:edit']">编辑</div>
|
|
||||||
<div @click="handleDelete(item)" v-has-permi="['system:village:remove']">删除</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-has-permi="['system:village:add']" @click="handleAdd" class="coummunity_card addActions flex flex-items-center justify-center">
|
|
||||||
<div class="addCoummunity">
|
|
||||||
<el-icon>
|
|
||||||
<AddLocation></AddLocation>
|
|
||||||
</el-icon>
|
|
||||||
<div>添加小区</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<i class="bgcolor"></i>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import defaultVilageinfoImage from '@/assets/images/villageimage.png';
|
|
||||||
import Navbar from '@/layout/components/Navbar.vue';
|
|
||||||
import { deleteVillageByIdAPI, getCommunitylistAPI, switchVillageAPI } from '@/api/system/community';
|
|
||||||
import type { communitylist_rows_type } from '@/api/system/community/type';
|
|
||||||
import { AddLocation, Picture } from '@element-plus/icons-vue';
|
|
||||||
import { useHouseStore } from '@/store/modules/house';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
|
|
||||||
const houseStore = useHouseStore();
|
|
||||||
const router = useRouter();
|
|
||||||
const list = ref<communitylist_rows_type[]>([]);
|
|
||||||
const currentViliageInfo = ref<communitylist_rows_type>();
|
|
||||||
/** 获取小区列表 */
|
|
||||||
function getlist() {
|
|
||||||
getCommunitylistAPI().then((res) => {
|
|
||||||
list.value = res.rows;
|
|
||||||
const villageid = localStorage.getItem('villageid');
|
|
||||||
const find = list.value.find((item) => item.villageId === villageid);
|
|
||||||
if (find) {
|
|
||||||
currentViliageInfo.value = find;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
getlist();
|
|
||||||
/** 新增小区 */
|
|
||||||
function handleAdd() {
|
|
||||||
router.push({
|
|
||||||
path: '/community/AddCommunity'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 删除小区 */
|
|
||||||
function handleDelete(item: communitylist_rows_type) {
|
|
||||||
proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').then(() => {
|
|
||||||
deleteVillageByIdAPI(item.villageId).then(() => {
|
|
||||||
list.value = list.value.filter((listitem) => listitem.villageId !== item.villageId);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 编辑小区 */
|
|
||||||
function handleEdit(item: communitylist_rows_type) {
|
|
||||||
router.push({
|
|
||||||
path: '/community/AddCommunity',
|
|
||||||
query: {
|
|
||||||
id: item.villageId
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 管理小区 */
|
|
||||||
function handleclick(item: communitylist_rows_type) {
|
|
||||||
switchVillageAPI(item.villageId).then(() => {
|
|
||||||
localStorage.setItem('villageInfo', JSON.stringify(item));
|
|
||||||
localStorage.setItem('villageid', item.villageId);
|
|
||||||
houseStore.getviliageinfo(item.villageId);
|
|
||||||
router.push({
|
|
||||||
path: '/'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.box {
|
|
||||||
background: linear-gradient(180deg, #deedff 0%, #f8f9fe 50%);
|
|
||||||
position: relative;
|
|
||||||
.header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
height: 50px;
|
|
||||||
line-height: 50px;
|
|
||||||
background: transparent;
|
|
||||||
position: relative;
|
|
||||||
z-index: 100;
|
|
||||||
& > div {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
& > span {
|
|
||||||
padding-left: 20px;
|
|
||||||
font-size: 20px;
|
|
||||||
color: #000;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.bgcolor {
|
|
||||||
width: 571px;
|
|
||||||
height: 571px;
|
|
||||||
background: #fdf1ee;
|
|
||||||
filter: blur(200px);
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
z-index: 90;
|
|
||||||
top: -210px;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.image-slot {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
font-size: 30px;
|
|
||||||
height: 200px;
|
|
||||||
background: #fff;
|
|
||||||
}
|
|
||||||
.containerbox {
|
|
||||||
position: relative;
|
|
||||||
z-index: 100;
|
|
||||||
width: 85%;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 20px;
|
|
||||||
background: transparent;
|
|
||||||
.community_nav_box {
|
|
||||||
height: 98px;
|
|
||||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, #ffffff 70%);
|
|
||||||
border-radius: 16px 16px 16px 16px;
|
|
||||||
padding: 20px;
|
|
||||||
.currentbox {
|
|
||||||
height: 20px;
|
|
||||||
line-height: 20px;
|
|
||||||
color: rgba(102, 102, 102, 1);
|
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
.subtitle {
|
|
||||||
.line {
|
|
||||||
margin-top: 4px;
|
|
||||||
width: 5px;
|
|
||||||
height: 19px;
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: rgba(26, 117, 255, 1);
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
.changecommunity {
|
|
||||||
height: 25px;
|
|
||||||
line-height: 25px;
|
|
||||||
color: rgba(51, 51, 51, 1);
|
|
||||||
font-size: 18px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.communityBody {
|
|
||||||
padding: 20px;
|
|
||||||
color: #000;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(5, 1fr);
|
|
||||||
@media (max-width: 2350px) {
|
|
||||||
grid-template-columns: repeat(4, 1fr);
|
|
||||||
}
|
|
||||||
@media (max-width: 1900px) {
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
}
|
|
||||||
@media (max-width: 1450px) {
|
|
||||||
grid-template-columns: repeat(2, 1fr);
|
|
||||||
}
|
|
||||||
.coummunity_card {
|
|
||||||
min-width: 369px;
|
|
||||||
max-width: 369px;
|
|
||||||
min-height: 358px;
|
|
||||||
border: 2px solid #ffffff;
|
|
||||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, #ffffff 70%);
|
|
||||||
box-shadow: 0 4px 8px 0 rgba(0, 104, 255, 0.06);
|
|
||||||
border-radius: 16px 16px 16px 16px;
|
|
||||||
margin-right: 20px;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
|
|
||||||
overflow: hidden;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
.el-image {
|
|
||||||
height: 179px;
|
|
||||||
width: 100%;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
.coummunityaction_box {
|
|
||||||
flex: 1;
|
|
||||||
padding: 30px;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 20px;
|
|
||||||
color: #303133;
|
|
||||||
line-height: 25px;
|
|
||||||
.counmmunityaddress {
|
|
||||||
margin-top: 10px;
|
|
||||||
font-weight: 400;
|
|
||||||
font-size: 16px;
|
|
||||||
color: #666666;
|
|
||||||
line-height: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.actions {
|
|
||||||
height: 60px;
|
|
||||||
div {
|
|
||||||
border-top: 1px solid #ccc;
|
|
||||||
border-right: 1px solid #ccc;
|
|
||||||
flex: 1;
|
|
||||||
text-align: center;
|
|
||||||
cursor: pointer;
|
|
||||||
line-height: 60px;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 18px;
|
|
||||||
color: #036aff;
|
|
||||||
&:hover {
|
|
||||||
background-color: #f5f7fb;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
& > div:last-child {
|
|
||||||
color: red;
|
|
||||||
border-right: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.addCoummunity {
|
|
||||||
height: 40px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.addActions {
|
|
||||||
cursor: pointer;
|
|
||||||
&:hover {
|
|
||||||
background-color: #f5f7fb;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="line"></div>
|
<div class="line"></div>
|
||||||
<div class="subtitle">
|
<div class="subtitle">
|
||||||
<div>WELCOME</div>
|
<div>WELCOME</div>
|
||||||
<div>智慧物业后台管理系统</div>
|
<div>太阳城水电表管理平台</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
@@ -91,19 +91,10 @@ const captchaEnabled = ref(true);
|
|||||||
const tenantEnabled = ref(true);
|
const tenantEnabled = ref(true);
|
||||||
|
|
||||||
// 注册开关
|
// 注册开关
|
||||||
const redirect = ref('/');
|
|
||||||
const loginRef = ref<ElFormInstance>();
|
const loginRef = ref<ElFormInstance>();
|
||||||
// 租户列表
|
// 租户列表
|
||||||
const tenantList = ref<TenantVO[]>([]);
|
const tenantList = ref<TenantVO[]>([]);
|
||||||
|
|
||||||
watch(
|
|
||||||
() => router.currentRoute.value,
|
|
||||||
(newRoute: any) => {
|
|
||||||
redirect.value = newRoute.query && newRoute.query.redirect && decodeURIComponent(newRoute.query.redirect);
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleLogin = () => {
|
const handleLogin = () => {
|
||||||
loginRef.value?.validate(async (valid: boolean) => {
|
loginRef.value?.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
@@ -121,8 +112,8 @@ const handleLogin = () => {
|
|||||||
// 调用action的登录方法
|
// 调用action的登录方法
|
||||||
const [err] = await to(userStore.login(loginForm.value));
|
const [err] = await to(userStore.login(loginForm.value));
|
||||||
if (!err) {
|
if (!err) {
|
||||||
const redirectUrl = redirect.value || '/';
|
// 登录后固定进入工作台(小区由后端默认,无需选择)
|
||||||
await router.push(redirectUrl);
|
await router.push(import.meta.env.VITE_LOGIN_BACK_URL || '/');
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
} else {
|
} else {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|||||||
@@ -1,689 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="ResidentMainBox p-2 w-full">
|
|
||||||
<PageHeader></PageHeader>
|
|
||||||
<div class="ResidentMainBody">
|
|
||||||
<el-card>
|
|
||||||
<template #header>
|
|
||||||
<div class="title">基本信息</div>
|
|
||||||
</template>
|
|
||||||
<div class="addBuildingFormBody">
|
|
||||||
<div class="formbox">
|
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="150px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="13">
|
|
||||||
<el-form-item label="活动标题" prop="title">
|
|
||||||
<el-input v-model.trim="form.title" maxlength="30" placeholder="请输入活动标题" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<!-- <el-col :span="11">-->
|
|
||||||
<!-- <el-form-item label="活动作者" prop="author">-->
|
|
||||||
<!-- <el-input maxlength="20" v-model.trim="form.author" placeholder="请输入活动作者" />-->
|
|
||||||
<!-- </el-form-item>-->
|
|
||||||
<!-- </el-col>-->
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="活动时间" prop="startTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="activityTime"
|
|
||||||
:disabled-date="disabledDate"
|
|
||||||
end-placeholder="结束活动"
|
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
range-separator="至"
|
|
||||||
start-placeholder="开始活动"
|
|
||||||
type="datetimerange"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
@change="
|
|
||||||
(data: string[] | null) => {
|
|
||||||
if (data) {
|
|
||||||
form.startTime = data[0];
|
|
||||||
form.endTime = data[1];
|
|
||||||
} else {
|
|
||||||
form.startTime = '';
|
|
||||||
form.endTime = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="13">
|
|
||||||
<el-form-item label="报名截止日期" prop="applyDeadline">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="deadline"
|
|
||||||
:disabled="!Boolean(form.startTime)"
|
|
||||||
:disabled-date="disabledDateDeadline"
|
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
placeholder="请选择报名截止日期"
|
|
||||||
style="width: 100%"
|
|
||||||
type="datetime"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
@update:model-value="
|
|
||||||
(data) => {
|
|
||||||
if (data) {
|
|
||||||
form.applyDeadline = data;
|
|
||||||
} else {
|
|
||||||
form.applyDeadline = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="活动地点" prop="address">
|
|
||||||
<el-input v-model.trim="form.address" maxlength="50" placeholder="请输入活动地点" show-word-limit type="textarea" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="13">
|
|
||||||
<el-form-item label="签到时间" prop="signinStartTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="SignInTime"
|
|
||||||
:disabled="!Boolean(form.endTime)"
|
|
||||||
:disabled-date="disabledSignInDate"
|
|
||||||
end-placeholder="结束签到"
|
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
range-separator="至"
|
|
||||||
start-placeholder="开始签到"
|
|
||||||
type="datetimerange"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
@change="
|
|
||||||
(data: string[] | null) => {
|
|
||||||
if (data) {
|
|
||||||
form.signinStartTime = data[0];
|
|
||||||
form.signinEndTime = data[1];
|
|
||||||
} else {
|
|
||||||
form.signinStartTime = '';
|
|
||||||
form.signinEndTime = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="主办方" prop="organizer">
|
|
||||||
<el-input v-model.trim="form.organizer" maxlength="20" placeholder="请输入主办方" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="13">
|
|
||||||
<el-form-item label="联系人" prop="contactName">
|
|
||||||
<el-input v-model.trim="form.contactName" maxlength="20" placeholder="请输入联系人" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="联系方式" prop="contactPhone">
|
|
||||||
<el-input v-model.trim="form.contactPhone" maxlength="11" placeholder="请输入联系方式" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="活动名额" prop="quota">
|
|
||||||
<div class="flex items-center">
|
|
||||||
<el-input-number v-model.trim.number="form.quota" :max="99999" :min="0" placeholder="0代表无限" />
|
|
||||||
<span class="ml-2 text-gray-500 text-sm" style="font-size: 12px">(填 <strong>0</strong> 代表 <u>不限制名额</u> )</span>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="活动封面" prop="title">
|
|
||||||
<el-upload
|
|
||||||
ref="upload"
|
|
||||||
:action="uploadUrl"
|
|
||||||
:before-upload="handleBeforeUpload"
|
|
||||||
:limit="1"
|
|
||||||
:on-error="handleError"
|
|
||||||
:on-exceed="handleExceed"
|
|
||||||
:on-success="handleAvatarSuccess"
|
|
||||||
:show-file-list="false"
|
|
||||||
accept=".png,.jpg,.jpeg,.bmp"
|
|
||||||
class="avatar-uploader"
|
|
||||||
>
|
|
||||||
<img v-if="form.coverImage" :src="form.coverImage" alt="活动封面" class="avatar" />
|
|
||||||
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
|
|
||||||
</el-upload>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col>
|
|
||||||
<el-form-item label="招募要求" prop="requirements">
|
|
||||||
<!-- <editor v-model="form.requirements" :file-size="5" :height="200" :min-height="200" :read-only="false" :type="'url'" /> -->
|
|
||||||
<el-input v-model="form.requirements" :rows="5" maxlength="400" show-word-limit type="textarea"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col>
|
|
||||||
<el-form-item label="活动详情" prop="content">
|
|
||||||
<editor v-model="form.content" :file-size="5" :height="300" :min-height="300" :read-only="false" :type="'url'" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<!-- <el-row>
|
|
||||||
<el-col>
|
|
||||||
<el-form-item label="活动签到">
|
|
||||||
<el-switch
|
|
||||||
@change="
|
|
||||||
(val) => {
|
|
||||||
if (val) {
|
|
||||||
initSignMap();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"
|
|
||||||
v-model="isSignin"
|
|
||||||
active-text="签到"
|
|
||||||
inactive-text="不签到"
|
|
||||||
:active-value="true"
|
|
||||||
:inactive-value="false"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="13">
|
|
||||||
<el-form-item label="签到时间" prop="signinStartTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="SignInTime"
|
|
||||||
type="datetimerange"
|
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
range-separator="至"
|
|
||||||
@update:model-value="
|
|
||||||
(data) => {
|
|
||||||
if (data && data.length > 0) {
|
|
||||||
form.signinStartTime = data[0];
|
|
||||||
form.signinEndTime = data[1];
|
|
||||||
} else {
|
|
||||||
form.signinStartTime = '';
|
|
||||||
form.signinEndTime = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
"
|
|
||||||
start-placeholder="开始签到"
|
|
||||||
end-placeholder="结束签到"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row v-if="isSignin">
|
|
||||||
<el-col>
|
|
||||||
<el-form-item label="签到设置">
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<el-button type="primary" v-if="isDraw === 0" @click="startDrawCircle">开始设置签到范围</el-button>
|
|
||||||
<el-button type="success" v-if="isDraw === 1" @click="editCircle">编辑签到范围</el-button>
|
|
||||||
<el-button type="warning" v-if="isDraw === 2" @click="stopDrawCircle">结束设置签到范围</el-button>
|
|
||||||
<el-button type="danger" @click="clearCircle">清空签到范围</el-button>
|
|
||||||
</div>
|
|
||||||
<div v-loading="mapReady" class="SignMapbox">
|
|
||||||
<div id="SignMap" style="height: 100%; width: 100%"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row> -->
|
|
||||||
<el-form-item>
|
|
||||||
<!-- <el-button type="warning" @click="submitForm('0')">保存为草稿</el-button>-->
|
|
||||||
<el-button type="primary" @click="submitForm('1')">发布</el-button>
|
|
||||||
<el-button @click="handleBack">返回</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import editor from '@/components/Editor/index.vue';
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
|
||||||
import { addActivity, getActivity, updateActivity } from '@/api/system/Activity';
|
|
||||||
import { genFileId, UploadInstance, UploadProps, UploadRawFile } from 'element-plus';
|
|
||||||
import AMapLoader from '@amap/amap-jsapi-loader';
|
|
||||||
import { Plus } from '@element-plus/icons-vue';
|
|
||||||
import { validator } from '@/utils/Reg';
|
|
||||||
|
|
||||||
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/activity/uploadImage';
|
|
||||||
|
|
||||||
const aloaderkey = import.meta.env.VITE_GCJ02_KEY_GD;
|
|
||||||
const VITE_GCJ02_JS_CODE_GD = import.meta.env.VITE_GCJ02_JS_CODE_GD;
|
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const router = useRouter();
|
|
||||||
const formRef = ref();
|
|
||||||
const form = ref({
|
|
||||||
'id': null,
|
|
||||||
// 标题
|
|
||||||
'title': '',
|
|
||||||
// 作者
|
|
||||||
'author': '',
|
|
||||||
// 内容
|
|
||||||
'content': '',
|
|
||||||
// 发布状态 0未发布 1己发布
|
|
||||||
'status': '0',
|
|
||||||
// 报名截止日期
|
|
||||||
'applyDeadline': '',
|
|
||||||
// 活动时间
|
|
||||||
'startTime': '',
|
|
||||||
'endTime': '',
|
|
||||||
// 活动地点
|
|
||||||
'address': '',
|
|
||||||
// 主办方
|
|
||||||
'organizer': '',
|
|
||||||
// 联系人
|
|
||||||
'contactName': '',
|
|
||||||
// 联系方式
|
|
||||||
'contactPhone': '',
|
|
||||||
// 开始签到时间
|
|
||||||
'signinStartTime': '',
|
|
||||||
// 结束签到时间
|
|
||||||
'signinEndTime': '',
|
|
||||||
// 活动名额
|
|
||||||
'quota': 0,
|
|
||||||
// 积分奖励
|
|
||||||
'pointsReward': 0,
|
|
||||||
// 活动封面
|
|
||||||
'coverImage': '',
|
|
||||||
// 招募要求
|
|
||||||
'requirements': ''
|
|
||||||
|
|
||||||
// 'SignInfo': {
|
|
||||||
// lng: null, // 经度
|
|
||||||
// lat: null, // 纬度
|
|
||||||
// radius: null // 半径 m
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
const rules = {
|
|
||||||
title: [{ required: true, message: '请输入活动标题', trigger: 'blur' }],
|
|
||||||
author: [
|
|
||||||
{ required: true, message: '请输入作者', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number) => validator(value, 'Character'),
|
|
||||||
message: '请输入中文,字母,数字,-,_等字符',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
applyDeadline: [{ required: true, message: '请输入报名截止日期', trigger: 'blur' }],
|
|
||||||
startTime: [{ required: true, message: '请选择开始日期', trigger: 'blur' }],
|
|
||||||
endTime: [{ required: true, message: '请选择结束日期', trigger: 'blur' }],
|
|
||||||
signinStartTime: [{ required: true, message: '请选择开始签到时间', trigger: 'blur' }],
|
|
||||||
signinEndTime: [{ required: true, message: '请选择结束签到时间', trigger: 'blur' }],
|
|
||||||
address: [{ required: true, message: '请输入活动地点', trigger: 'blur' }],
|
|
||||||
organizer: [
|
|
||||||
{ required: true, message: '请输入主办方', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number) => validator(value, 'Character'),
|
|
||||||
message: '请输入中文,字母,数字,-,_等字符',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
contactName: [
|
|
||||||
{ required: true, message: '请输入联系人', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number) => validator(value, 'Character'),
|
|
||||||
message: '请输入中文,字母,数字,-,_等字符',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
contactPhone: [
|
|
||||||
{ required: true, message: '请输入联系方式', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number) => validator(value, 'phone'),
|
|
||||||
message: '请输入联系方式',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
coverImage: [{ required: true, message: '请上传活动封面', trigger: 'blur' }],
|
|
||||||
content: [{ required: true, message: '请输入内容', trigger: 'blur' }]
|
|
||||||
};
|
|
||||||
|
|
||||||
const disabledDate = (time: string) => {
|
|
||||||
const today = new Date();
|
|
||||||
today.setHours(0, 0, 0, 0);
|
|
||||||
const selectDate = new Date(time);
|
|
||||||
return selectDate.getTime() < today.getTime();
|
|
||||||
};
|
|
||||||
const disabledDateDeadline = (time: string) => {
|
|
||||||
const today = new Date(form.value.endTime);
|
|
||||||
const selectDate = new Date(time);
|
|
||||||
return selectDate.getTime() > today.getTime();
|
|
||||||
};
|
|
||||||
function disabledSignInDate(time: string) {
|
|
||||||
const selectDate = new Date(time);
|
|
||||||
const today = new Date(form.value.endTime);
|
|
||||||
return selectDate.getTime() > today.getTime() || selectDate.getTime() < new Date(new Date().toLocaleDateString()).getTime();
|
|
||||||
}
|
|
||||||
const userid = ref();
|
|
||||||
// 报名截止日期
|
|
||||||
const deadline = ref([]);
|
|
||||||
// 有效签到时间
|
|
||||||
const SignInTime = ref([]);
|
|
||||||
// 活动时间
|
|
||||||
const activityTime = ref([]);
|
|
||||||
|
|
||||||
// 上传文件
|
|
||||||
const upload = ref<UploadInstance>();
|
|
||||||
// 上传成功
|
|
||||||
const handleAvatarSuccess: UploadProps['onSuccess'] = (response) => {
|
|
||||||
if (response.data && response.data.url) {
|
|
||||||
form.value.coverImage = response.data.url;
|
|
||||||
} else {
|
|
||||||
ElMessage.warning(response.msg);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 超出文件限制
|
|
||||||
const handleExceed: UploadProps['onExceed'] = (files) => {
|
|
||||||
upload.value!.clearFiles();
|
|
||||||
const file = files[0] as UploadRawFile;
|
|
||||||
file.uid = genFileId();
|
|
||||||
upload.value!.handleStart(file);
|
|
||||||
upload.value?.submit();
|
|
||||||
};
|
|
||||||
// 上传失败
|
|
||||||
const handleError: UploadProps['onError'] = (error: Error) => {
|
|
||||||
console.log(error);
|
|
||||||
};
|
|
||||||
const allowImgSuffix = ['jpg', 'jpeg', 'png', 'gif', 'bmp'];
|
|
||||||
/** 检测文件大小和格式 */
|
|
||||||
const handleBeforeUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) => {
|
|
||||||
if (!allowImgSuffix.includes(rawFile.name.split('.')[1])) {
|
|
||||||
ElMessage.error('文件类型错误,请重新上传');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
// ! 投诉 ====================================================================================================
|
|
||||||
|
|
||||||
// ! 签到 =======================================
|
|
||||||
// const isSignin = ref(false);
|
|
||||||
let AMapLi = null;
|
|
||||||
let map: any = null;
|
|
||||||
let circle: any = null;
|
|
||||||
let circleEditor: any = null;
|
|
||||||
|
|
||||||
let geocoder: any = null;
|
|
||||||
const mapReady = ref(false);
|
|
||||||
let mouseTool = null;
|
|
||||||
|
|
||||||
// 0 开始 1 编辑 2结束
|
|
||||||
const isDraw = ref(0);
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (route.query.id) {
|
|
||||||
userid.value = route.query.id;
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
async function initSignMap() {
|
|
||||||
try {
|
|
||||||
mapReady.value = true;
|
|
||||||
window._AMapSecurityConfig = { securityJsCode: VITE_GCJ02_JS_CODE_GD };
|
|
||||||
const AMap = await AMapLoader.load({
|
|
||||||
key: aloaderkey,
|
|
||||||
version: '2.0',
|
|
||||||
plugins: ['AMap.MouseTool', 'AMap.CircleEditor', 'AMap.Geolocation', 'AMap.Geocoder']
|
|
||||||
});
|
|
||||||
mapReady.value = false;
|
|
||||||
console.log('AMapLoader.load 执行完毕');
|
|
||||||
AMapLi = AMap;
|
|
||||||
map = new AMap.Map('SignMap', {
|
|
||||||
viewMode: '3D',
|
|
||||||
zoom: 11,
|
|
||||||
center: [116.397428, 39.90923]
|
|
||||||
});
|
|
||||||
|
|
||||||
// 解析本地存储的城市信息
|
|
||||||
const villageInfoStr = localStorage.getItem('villageInfo') || '{}';
|
|
||||||
let city = '';
|
|
||||||
try {
|
|
||||||
const villageInfo = JSON.parse(villageInfoStr);
|
|
||||||
city = (villageInfo?.city || '').trim();
|
|
||||||
} catch (err) {
|
|
||||||
console.warn('解析 villageInfo 失败', err);
|
|
||||||
}
|
|
||||||
// 初始化地理编码工具
|
|
||||||
if (city.trim() !== '') {
|
|
||||||
geocoder = new AMap.Geocoder({
|
|
||||||
city: city.trim(),
|
|
||||||
radius: 1000
|
|
||||||
});
|
|
||||||
getGeoCode(city.trim(), map);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 鼠标绘制工具
|
|
||||||
mouseTool = new AMap.MouseTool(map);
|
|
||||||
mouseTool.on('draw', (e: any) => {
|
|
||||||
// 移除旧围栏
|
|
||||||
if (circle) {
|
|
||||||
map.remove(circle);
|
|
||||||
}
|
|
||||||
circle = e.obj;
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.error('高德地图初始化失败:', error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 获取 城市经纬度并定位中心
|
|
||||||
const getGeoCode = (address, map) => {
|
|
||||||
geocoder.getLocation(address, (status: string, result: any) => {
|
|
||||||
if (status === 'complete' && result.geocodes.length > 0) {
|
|
||||||
const geo = result.geocodes[0];
|
|
||||||
const lng = geo.location.lng;
|
|
||||||
const lat = geo.location.lat;
|
|
||||||
map.setCenter([lng, lat]);
|
|
||||||
map.setZoom(15);
|
|
||||||
} else {
|
|
||||||
console.log('未找到该地址');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
// 开始绘制圆形
|
|
||||||
const startDrawCircle = () => {
|
|
||||||
resetCircle();
|
|
||||||
if (!mouseTool) return;
|
|
||||||
isDraw.value = 1; // 编辑
|
|
||||||
mouseTool.circle({
|
|
||||||
strokeColor: '#1890ff',
|
|
||||||
strokeWeight: 3,
|
|
||||||
fillColor: 'rgba(24, 144, 255, 0.2)',
|
|
||||||
fillOpacity: 0.4
|
|
||||||
});
|
|
||||||
};
|
|
||||||
// 停止绘制圆形
|
|
||||||
const stopDrawCircle = () => {
|
|
||||||
if (!mouseTool) return;
|
|
||||||
if (mouseTool) {
|
|
||||||
mouseTool.close(false);
|
|
||||||
}
|
|
||||||
if (circleEditor) {
|
|
||||||
circleEditor.close();
|
|
||||||
circleEditor = null;
|
|
||||||
}
|
|
||||||
isDraw.value = 0; // 开始
|
|
||||||
mouseTool.close(false);
|
|
||||||
if (circle) {
|
|
||||||
const center = circle.getCenter();
|
|
||||||
const radius = circle.getRadius();
|
|
||||||
// form.value.SignInfo.lat = center.lat;
|
|
||||||
// form.value.SignInfo.lng = center.lng;
|
|
||||||
// form.value.SignInfo.radius = center.radius;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 编辑 圆形
|
|
||||||
const editCircle = () => {
|
|
||||||
if (!circle) return;
|
|
||||||
if (mouseTool) {
|
|
||||||
mouseTool.close(false);
|
|
||||||
}
|
|
||||||
isDraw.value = 2; // 结束
|
|
||||||
circleEditor = new AMapLi.CircleEditor(map, circle);
|
|
||||||
circleEditor.open();
|
|
||||||
};
|
|
||||||
|
|
||||||
// 删除圆形
|
|
||||||
const clearCircle = () => {
|
|
||||||
// resetCircle();
|
|
||||||
isDraw.value = 0; // 开始
|
|
||||||
ElMessage.success('全部清除');
|
|
||||||
};
|
|
||||||
// 重置
|
|
||||||
const resetCircle = () => {
|
|
||||||
// 不能绘画
|
|
||||||
if (mouseTool) {
|
|
||||||
mouseTool.close(false);
|
|
||||||
}
|
|
||||||
// 清除圆形
|
|
||||||
if (circle) {
|
|
||||||
map.remove(circle);
|
|
||||||
circle = null;
|
|
||||||
}
|
|
||||||
// 不能编辑
|
|
||||||
if (circleEditor) {
|
|
||||||
circleEditor.close();
|
|
||||||
circleEditor = null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
getActivity(userid.value).then((res) => {
|
|
||||||
form.value = {
|
|
||||||
...form.value,
|
|
||||||
...res.data
|
|
||||||
};
|
|
||||||
activityTime.value = [res.data.startTime, res.data.endTime];
|
|
||||||
SignInTime.value = [res.data.signinStartTime, res.data.signinEndTime];
|
|
||||||
deadline.value = [res.data.applyDeadline];
|
|
||||||
|
|
||||||
// if (res.data?.SignInfo !== null) {
|
|
||||||
// isSignin.value = true;
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提交
|
|
||||||
const submitForm = (status: string) => {
|
|
||||||
form.value.status = status;
|
|
||||||
|
|
||||||
// if (!isSignin.value) {
|
|
||||||
// form.value.SignInfo = null;
|
|
||||||
// }
|
|
||||||
formRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
if (userid.value) {
|
|
||||||
updateActivity(form.value).then(() => {
|
|
||||||
ElMessage.success('编辑成功');
|
|
||||||
handleBack();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addActivity(form.value).then(() => {
|
|
||||||
ElMessage.success('添加成功');
|
|
||||||
handleBack();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 返回
|
|
||||||
function handleBack() {
|
|
||||||
router.push({
|
|
||||||
path: '/repair/Activity'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 销毁地图及所有工具实例(防内存泄漏、重复初始化)
|
|
||||||
*/
|
|
||||||
// function destroyMapInstance() {
|
|
||||||
// if (map) {
|
|
||||||
// map.destroy();
|
|
||||||
// map = null;
|
|
||||||
// }
|
|
||||||
// mouseTool = null;
|
|
||||||
// geocoder = null;
|
|
||||||
// circle = null;
|
|
||||||
// AMapLi = null;
|
|
||||||
// mapReady.value = false;
|
|
||||||
// }
|
|
||||||
onUnmounted(() => {
|
|
||||||
// destroyMapInstance();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.SignMapbox {
|
|
||||||
height: 500px;
|
|
||||||
width: 500px;
|
|
||||||
margin-top: 10px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ResidentMainBox {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
.avatar-uploader {
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
border-radius: 6px;
|
|
||||||
}
|
|
||||||
.el-icon.avatar-uploader-icon {
|
|
||||||
font-size: 28px;
|
|
||||||
color: #8c939d;
|
|
||||||
width: 158px;
|
|
||||||
height: 158px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.avatar-uploader .avatar {
|
|
||||||
width: 158px;
|
|
||||||
height: 158px;
|
|
||||||
display: block;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
.avatar-uploader .el-upload {
|
|
||||||
border: 1px dashed var(--el-border-color);
|
|
||||||
border-radius: 6px;
|
|
||||||
cursor: pointer;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
transition: var(--el-transition-duration-fast);
|
|
||||||
}
|
|
||||||
|
|
||||||
.ResidentMainBody {
|
|
||||||
margin-top: 20px;
|
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
.formbox {
|
|
||||||
width: 1000px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
&:deep(div.el-step__head.is-process) {
|
|
||||||
& > div.el-step__line {
|
|
||||||
width: 0;
|
|
||||||
border: 1px dashed gray;
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:deep(.el-step.is-vertical .el-step__line) {
|
|
||||||
top: 20px;
|
|
||||||
}
|
|
||||||
&:deep(div.el-step__head.is-finish) {
|
|
||||||
& > div.el-step__line {
|
|
||||||
width: 0;
|
|
||||||
border: 1px solid var(--el-color-primary);
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,265 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="flex flex-col h-full p-2">
|
|
||||||
<Pageheader></Pageheader>
|
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
|
||||||
<el-card shadow="hover">
|
|
||||||
<el-form ref="queryFormRef" :inline="true" :model="queryParams" @submit.prevent="handleQuery">
|
|
||||||
<el-form-item label="标题" prop="title">
|
|
||||||
<el-input v-model="queryParams.title" clearable placeholder="请输入标题" @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
|
|
||||||
<el-card class="flex-1" shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<el-row :gutter="10" class="mb10">
|
|
||||||
<right-toolbar
|
|
||||||
:disable-delete="multiple"
|
|
||||||
:disable-edit="single"
|
|
||||||
:show-add="checkPermi(['activity:activity:add'])"
|
|
||||||
:show-delete="checkPermi(['activity:activity:remove'])"
|
|
||||||
:show-edit="checkPermi(['activity:activity:edit'])"
|
|
||||||
@update:add="handleAdd"
|
|
||||||
@update:edit="handleUpdate()"
|
|
||||||
@update:delete="handleDelete()"
|
|
||||||
></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="activityList" border @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column align="center" type="selection" width="55" />
|
|
||||||
<el-table-column align="center" label="封面" min-width="130px">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-image
|
|
||||||
v-if="scope.row.coverImage"
|
|
||||||
:preview-src-list="[scope.row.coverImage]"
|
|
||||||
:src="scope.row.coverImage"
|
|
||||||
fit="cover"
|
|
||||||
lazy
|
|
||||||
preview-teleported
|
|
||||||
style="width: 100px; height: 100px"
|
|
||||||
></el-image>
|
|
||||||
<span v-else style="color: grey">暂无</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="标题" prop="title" />
|
|
||||||
<el-table-column align="center" label="主办方" prop="organizer" />
|
|
||||||
<el-table-column align="center" label="签到时间" prop="signInTime" width="120">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ scope.row.signinStartTime }}-{{ scope.row.signinEndTime }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="发布状态" prop="status" width="100">
|
|
||||||
<template #default="scope">
|
|
||||||
<DictTag :options="com_publish_status" :value="scope.row.status"></DictTag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="活动时间">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ scope.row.startTime }}</span>
|
|
||||||
<span> -- </span>
|
|
||||||
<span>{{ scope.row.endTime }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="活动地点" prop="address" />
|
|
||||||
<el-table-column align="center" label="联系人" prop="contactName" width="120" />
|
|
||||||
<el-table-column align="center" label="联系电话" prop="contactPhone" width="120" />
|
|
||||||
|
|
||||||
<el-table-column align="center" label="活动名额" prop="contactPhone" width="80">
|
|
||||||
<template #default="scope">
|
|
||||||
<span v-if="scope.row.quota === 0">无限制</span>
|
|
||||||
<span v-else>{{ scope.row.quota }}人</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" fixed="right" label="操作" width="200px">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button v-if="scope.row.status === '0'" link type="primary" @click="handleSend(scope.row)">发布</el-button>
|
|
||||||
<el-button v-has-permi="['activity:activity:edit']" link type="primary" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
||||||
<el-button v-has-permi="['activity:activity:remove']" link type="primary" @click="handleDelete(scope.row)">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<pagination v-show="total > 0" v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNum" :total="total" @pagination="getList" />
|
|
||||||
</el-card>
|
|
||||||
<el-dialog v-model="dialog.visible" :title="dialog.title" append-to-body width="500px">
|
|
||||||
<el-form ref="activityFormRef" :model="form" :rules="rules" label-width="120px">
|
|
||||||
<el-form-item label="发布人姓名" prop="createName">
|
|
||||||
<el-input v-model.trim="form.createName" maxlength="20" placeholder="请输入发布人姓名" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="发布后状态" prop="status">
|
|
||||||
<el-radio-group v-model="form.status">
|
|
||||||
<el-radio v-for="item in com_publish_status" :key="item.value" :label="item.label" :value="item.value"></el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="Activity" setup>
|
|
||||||
import { listActivity, delActivity, updateActivity } from '@/api/system/Activity';
|
|
||||||
import { ActivityVO, ActivityQuery, ActivityForm } from '@/api/system/Activity/type';
|
|
||||||
import { checkPermi } from '@/utils/permission';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { com_publish_status } = toRefs<any>(proxy?.useDict('com_publish_status'));
|
|
||||||
|
|
||||||
const activityList = ref<ActivityVO[]>([]);
|
|
||||||
const buttonLoading = ref(false);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const ids = ref<Array<string | number>>([]);
|
|
||||||
const single = ref(true);
|
|
||||||
const multiple = ref(true);
|
|
||||||
const total = ref(0);
|
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
|
||||||
const activityFormRef = ref<ElFormInstance>();
|
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
|
||||||
visible: false,
|
|
||||||
title: '发布活动'
|
|
||||||
});
|
|
||||||
|
|
||||||
const initFormData: ActivityForm = {
|
|
||||||
id: undefined,
|
|
||||||
title: undefined,
|
|
||||||
author: undefined,
|
|
||||||
content: undefined,
|
|
||||||
status: undefined,
|
|
||||||
pageViews: undefined,
|
|
||||||
createName: undefined
|
|
||||||
};
|
|
||||||
const data = reactive<PageData<ActivityForm, ActivityQuery>>({
|
|
||||||
form: { ...initFormData },
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
title: undefined,
|
|
||||||
author: undefined,
|
|
||||||
content: undefined,
|
|
||||||
status: undefined,
|
|
||||||
pageViews: undefined,
|
|
||||||
createName: undefined,
|
|
||||||
params: {}
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
createName: [{ required: true, message: '发布人姓名不能为空', trigger: 'blur' }]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
|
||||||
|
|
||||||
/** 查询活动管理列表 */
|
|
||||||
const getList = async () => {
|
|
||||||
loading.value = true;
|
|
||||||
listActivity(queryParams.value)
|
|
||||||
.then((res) => {
|
|
||||||
activityList.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/** 发布按钮 */
|
|
||||||
const handleSend = (row: ActivityVO) => {
|
|
||||||
form.value = {
|
|
||||||
...form.value,
|
|
||||||
...row
|
|
||||||
};
|
|
||||||
dialog.visible = true;
|
|
||||||
};
|
|
||||||
/** 取消按钮 */
|
|
||||||
const cancel = () => {
|
|
||||||
reset();
|
|
||||||
dialog.visible = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 表单重置 */
|
|
||||||
const reset = () => {
|
|
||||||
form.value = { ...initFormData };
|
|
||||||
activityFormRef.value?.resetFields();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
const handleQuery = () => {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryFormRef.value?.resetFields();
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
|
||||||
const handleSelectionChange = (selection: ActivityVO[]) => {
|
|
||||||
ids.value = selection.map((item) => item.id);
|
|
||||||
single.value = selection.length != 1;
|
|
||||||
multiple.value = !selection.length;
|
|
||||||
};
|
|
||||||
const router = useRouter();
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
const handleAdd = () => {
|
|
||||||
router.push({
|
|
||||||
path: '/repair/addActivity'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
const handleUpdate = (row?: ActivityVO) => {
|
|
||||||
const _id = row?.id || ids.value[0];
|
|
||||||
router.push({
|
|
||||||
path: '/repair/editActivity',
|
|
||||||
query: {
|
|
||||||
id: _id
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
const submitForm = () => {
|
|
||||||
activityFormRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
buttonLoading.value = true;
|
|
||||||
await updateActivity(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
|
||||||
dialog.visible = false;
|
|
||||||
await getList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
const handleDelete = async (row?: ActivityVO) => {
|
|
||||||
const _ids = row?.id || ids.value;
|
|
||||||
await proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').finally(() => (loading.value = false));
|
|
||||||
await delActivity(_ids);
|
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
|
||||||
await getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.el-table {
|
|
||||||
height: calc(100% - 80px);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,239 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="AddBuildingBox">
|
|
||||||
<PageHeader></PageHeader>
|
|
||||||
<div class="AddBuildingBody">
|
|
||||||
<div class="title">基本信息</div>
|
|
||||||
<div class="addBuildingFormBody">
|
|
||||||
<el-form class="formBody" label-position="right" ref="formRef" :model="form" :rules="rules" label-width="130px">
|
|
||||||
<el-form-item label="Banner名称" prop="name">
|
|
||||||
<el-input maxlength="20" show-word-limit v-model.trim="form.name" placeholder="请输入" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="Banner图" prop="url">
|
|
||||||
<el-upload
|
|
||||||
class="avatar-uploader"
|
|
||||||
ref="uploadRef"
|
|
||||||
accept=".png, .jpg"
|
|
||||||
:action="uploadUrl"
|
|
||||||
name="file"
|
|
||||||
:limit="1"
|
|
||||||
:headers="headerToken()"
|
|
||||||
:show-file-list="false"
|
|
||||||
:on-success="handleAvatarSuccess"
|
|
||||||
v-on:error="handleAvatarError"
|
|
||||||
:before-upload="beforeAvatarUpload"
|
|
||||||
>
|
|
||||||
<img v-if="form.url" :src="form.url" class="avatar" alt="" />
|
|
||||||
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
|
|
||||||
<template #tip>
|
|
||||||
<div class="el-upload__tip">支持jpg, png等格式文件上传,文件大小不超过10MB.</div>
|
|
||||||
</template>
|
|
||||||
</el-upload>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="跳转链接" prop="link">
|
|
||||||
<el-input v-model.trim="form.link" placeholder="请输入跳转链接" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="排序号" prop="byOrder">
|
|
||||||
<el-input-number :min="0" :max="9999" v-model.trim="form.byOrder" placeholder="请输入" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item style="margin-top: 30px">
|
|
||||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
|
||||||
<el-button @click="cancelForm">返回</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
|
||||||
import { addBanner, getBanner, updateBanner } from '@/api/system/Banner';
|
|
||||||
import { useUserStore } from '@/store/modules/user';
|
|
||||||
import { UploadProps, UploadRawFile } from 'element-plus';
|
|
||||||
import { Plus } from '@element-plus/icons-vue';
|
|
||||||
|
|
||||||
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/car/uploadImage';
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
function headerToken() {
|
|
||||||
const useStore = useUserStore();
|
|
||||||
return {
|
|
||||||
Authorization: 'Bearer ' + useStore.token
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const allowImgSuffix = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'heic'];
|
|
||||||
const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) => {
|
|
||||||
const type = rawFile.type.split('/').pop();
|
|
||||||
if (allowImgSuffix.includes(type)) {
|
|
||||||
if (rawFile.size / 1024 / 1024 <= 10) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
ElMessage.warning('图片大小超过10M,请重新上传');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ElMessage.warning('图片格式不是 png/jpg 格式, 请重新上传');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const handleAvatarSuccess: UploadProps['onSuccess'] = (response: any) => {
|
|
||||||
if (response.code === 500) {
|
|
||||||
form.value.url = '';
|
|
||||||
} else if (response.code === 200) {
|
|
||||||
form.value.url = response.data.url;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleAvatarError: UploadProps['onError'] = () => {};
|
|
||||||
|
|
||||||
const formRef = ref();
|
|
||||||
const form = ref({
|
|
||||||
id: null,
|
|
||||||
name: '', // 分类id、
|
|
||||||
url: '', // 设备名称
|
|
||||||
link: '', // 编号
|
|
||||||
status: '1',
|
|
||||||
byOrder: 1 // 区域
|
|
||||||
});
|
|
||||||
const rules = ref({
|
|
||||||
name: [{ required: true, message: '请输入Banner图名称', trigger: 'blur' }],
|
|
||||||
url: [{ required: true, message: '请上传图片', trigger: 'blur' }]
|
|
||||||
});
|
|
||||||
const userid = ref(null);
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
if (route.query.id) {
|
|
||||||
userid.value = route.query.id;
|
|
||||||
getBanner(userid.value).then((res) => {
|
|
||||||
form.value = {
|
|
||||||
id: res.data.id,
|
|
||||||
name: res.data.name, // 分类id、
|
|
||||||
url: res.data.url, // 设备名称
|
|
||||||
status: res.data.status ?? '0',
|
|
||||||
link: res.data.link, // 编号
|
|
||||||
byOrder: res.data.byOrder // 区域
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
init();
|
|
||||||
|
|
||||||
// !== 提交 =============================================================================
|
|
||||||
// 提交
|
|
||||||
const submitForm = () => {
|
|
||||||
formRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
if (userid.value) {
|
|
||||||
updateBanner(form.value).then(() => {
|
|
||||||
ElMessage.success('编辑成功');
|
|
||||||
cancelForm();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addBanner(form.value).then(() => {
|
|
||||||
ElMessage.success('添加成功');
|
|
||||||
cancelForm();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
// 推出
|
|
||||||
const cancelForm = () => {
|
|
||||||
router.back();
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.avatar-uploader .avatar {
|
|
||||||
width: 178px;
|
|
||||||
height: 178px;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
:deep(.avatar-uploader .el-upload) {
|
|
||||||
border: 1px dashed var(--el-border-color);
|
|
||||||
border-radius: 6px;
|
|
||||||
cursor: pointer;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
transition: var(--el-transition-duration-fast);
|
|
||||||
}
|
|
||||||
:deep(.avatar-uploader .el-upload:hover) {
|
|
||||||
border-color: var(--el-color-primary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.avatar-uploader-icon {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
color: #8c939d;
|
|
||||||
width: 178px;
|
|
||||||
height: 178px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.AddBuildingBox {
|
|
||||||
padding: 15px;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.AddBuildingBody {
|
|
||||||
margin-top: 20px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
background-color: white;
|
|
||||||
padding: 15px;
|
|
||||||
.title {
|
|
||||||
height: 40px;
|
|
||||||
line-height: 40px;
|
|
||||||
padding-left: 20px;
|
|
||||||
background-color: rgba(255, 255, 255, 1);
|
|
||||||
color: rgba(16, 16, 16, 1);
|
|
||||||
border-bottom: 1px solid #bbbbbb;
|
|
||||||
margin-bottom: 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formBody {
|
|
||||||
width: 650px;
|
|
||||||
margin: 0 auto;
|
|
||||||
|
|
||||||
.checkoutuserbox {
|
|
||||||
margin: 5px;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
padding: 5px 10px;
|
|
||||||
border-radius: 5px;
|
|
||||||
&.add {
|
|
||||||
cursor: pointer;
|
|
||||||
border-style: dashed;
|
|
||||||
&:hover {
|
|
||||||
color: #409eff;
|
|
||||||
border-color: #409eff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
& > div {
|
|
||||||
cursor: pointer;
|
|
||||||
margin-left: 10px;
|
|
||||||
&:hover {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:deep(.el-form-item__content, .el-select, .el-input) {
|
|
||||||
width: 350px !important;
|
|
||||||
margin-right: 10px;
|
|
||||||
.el-cascader {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.el-form-item {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.el-button {
|
|
||||||
width: 80px;
|
|
||||||
height: 35px;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,192 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="p-2 h-full flex flex-col">
|
|
||||||
<pageheader></pageheader>
|
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
|
||||||
<el-card shadow="hover">
|
|
||||||
<el-form ref="queryFormRef" :inline="true" :model="queryParams" @submit.prevent="handleQuery">
|
|
||||||
<el-form-item label="名称" prop="name">
|
|
||||||
<el-input v-model="queryParams.name" clearable maxlength="20" placeholder="请输入名称" @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
|
|
||||||
<el-card class="flex-1" shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<right-toolbar
|
|
||||||
:disable-delete="multiple"
|
|
||||||
:disable-edit="single"
|
|
||||||
:show-add="checkPermi(['banner:banner:add'])"
|
|
||||||
:show-delete="checkPermi(['banner:banner:remove'])"
|
|
||||||
:show-edit="checkPermi(['banner:banner:edit'])"
|
|
||||||
@update:add="handleAdd"
|
|
||||||
@update:edit="handleUpdate()"
|
|
||||||
@update:delete="handleDelete()"
|
|
||||||
></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="bannerList" border @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column align="center" type="selection" width="55" />
|
|
||||||
<el-table-column align="center" label="Banner缩略图" prop="id">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-image
|
|
||||||
v-if="scope.row.url && scope.row.url.includes('http')"
|
|
||||||
:preview-src-list="[scope.row.url]"
|
|
||||||
:src="scope.row.url"
|
|
||||||
fit="cover"
|
|
||||||
preview-teleported
|
|
||||||
style="width: 40px; height: 40px; border-radius: 4px; margin-right: 5px"
|
|
||||||
/>
|
|
||||||
<span v-else>暂时没有</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="名称" prop="name" />
|
|
||||||
<el-table-column align="center" label="状态" prop="status">
|
|
||||||
<template #default="scope">
|
|
||||||
<!-- 0启用 1停用 -->
|
|
||||||
<el-switch
|
|
||||||
v-model="scope.row.status"
|
|
||||||
active-value="0"
|
|
||||||
inactive-value="1"
|
|
||||||
@change="(val: string) => handleSwitch(scope.row.id, val)"
|
|
||||||
></el-switch>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="排序" prop="byOrder" />
|
|
||||||
<el-table-column align="center" label="添加时间" prop="createTime" />
|
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button v-has-permi="['banner:banner:edit']" link type="primary" @click="handleUpdate(scope.row)">修改</el-button>
|
|
||||||
<el-button v-has-permi="['banner:banner:remove']" link type="primary" @click="handleDelete(scope.row)">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination v-show="total > 0" v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNum" :total="total" @pagination="getList" />
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="Banner" setup>
|
|
||||||
import { listBanner, delBanner, switchBanner } from '@/api/system/Banner';
|
|
||||||
import { BannerVO, BannerQuery, BannerForm } from '@/api/system/Banner/type';
|
|
||||||
import { checkPermi } from '@/utils/permission';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
|
|
||||||
const bannerList = ref<BannerVO[]>([]);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const ids = ref<Array<string | number>>([]);
|
|
||||||
const single = ref(true);
|
|
||||||
const multiple = ref(true);
|
|
||||||
const total = ref(0);
|
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
|
||||||
|
|
||||||
const initFormData: BannerForm = {
|
|
||||||
id: undefined,
|
|
||||||
name: undefined,
|
|
||||||
status: undefined,
|
|
||||||
byOrder: undefined,
|
|
||||||
link: undefined
|
|
||||||
};
|
|
||||||
const data = reactive<PageData<BannerForm, BannerQuery>>({
|
|
||||||
form: { ...initFormData },
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
name: undefined,
|
|
||||||
status: undefined,
|
|
||||||
byOrder: undefined,
|
|
||||||
link: undefined
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams } = toRefs(data);
|
|
||||||
|
|
||||||
/** 查询Banner图管理列表 */
|
|
||||||
const getList = async () => {
|
|
||||||
loading.value = true;
|
|
||||||
listBanner(queryParams.value)
|
|
||||||
.then((res) => {
|
|
||||||
bannerList.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
const handleQuery = () => {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryFormRef.value?.resetFields();
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
|
||||||
const handleSelectionChange = (selection: BannerVO[]) => {
|
|
||||||
ids.value = selection.map((item) => item.id);
|
|
||||||
single.value = selection.length != 1;
|
|
||||||
multiple.value = !selection.length;
|
|
||||||
};
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
const handleAdd = () => {
|
|
||||||
router.push({
|
|
||||||
path: '/system/addBanner'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
const handleUpdate = (row?: BannerVO) => {
|
|
||||||
const _id = row?.id || ids.value[0];
|
|
||||||
router.push({
|
|
||||||
path: '/system/editBanner',
|
|
||||||
query: {
|
|
||||||
id: _id
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
const handleDelete = async (row?: BannerVO) => {
|
|
||||||
const _ids = row?.id || ids.value;
|
|
||||||
await proxy?.$modal.confirm('是否确认删除该Banner图?').finally(() => (loading.value = false));
|
|
||||||
await delBanner(_ids);
|
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
|
||||||
await getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
function handleSwitch(id: string, status: string) {
|
|
||||||
switchBanner(id, status).then(() => {
|
|
||||||
ElMessage.success('操作成功');
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.el-table {
|
|
||||||
height: calc(100% - 80px);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,267 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="ResidentMainBox p-2 w-full">
|
|
||||||
<PageHeader title="投诉详情"></PageHeader>
|
|
||||||
<div class="ResidentMainBody">
|
|
||||||
<!-- 投诉信息 -->
|
|
||||||
<div class="mb-10">
|
|
||||||
<el-card>
|
|
||||||
<template #header>
|
|
||||||
<div class="card-header">
|
|
||||||
<span>投诉信息</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<div>
|
|
||||||
<div class="carInfoBox">
|
|
||||||
<div class="carInfo_item">
|
|
||||||
<div class="label">投诉类型</div>
|
|
||||||
<div class="main">{{ formInfo.type }}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="carInfo_item">
|
|
||||||
<div class="label">投诉人姓名</div>
|
|
||||||
<div class="main">{{ formInfo.complaintName }}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="carInfo_item">
|
|
||||||
<div class="label">手机号码</div>
|
|
||||||
<div class="main">{{ formInfo.phone }}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="carInfo_item">
|
|
||||||
<div class="label">投诉时间</div>
|
|
||||||
<div class="main">{{ formInfo.createTime }}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="carInfo_item">
|
|
||||||
<div class="label">处理状态</div>
|
|
||||||
<div class="main">
|
|
||||||
<DictTag :options="com_complaint_status" :value="formInfo.status"></DictTag>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="carInfoBox signLe">
|
|
||||||
<div class="carInfo_item">
|
|
||||||
<div class="label">问题描述</div>
|
|
||||||
<div class="main">{{ formInfo.problemDes }}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="carInfoBox signLe">
|
|
||||||
<div class="carInfo_item">
|
|
||||||
<div class="label">问题照片</div>
|
|
||||||
<div class="main">
|
|
||||||
<el-image
|
|
||||||
v-for="(item, index) in problemImageUrlList"
|
|
||||||
:key="index"
|
|
||||||
:initial-index="index"
|
|
||||||
:preview-src-list="problemImageUrlList"
|
|
||||||
:preview-teleported="true"
|
|
||||||
:src="item"
|
|
||||||
style="width: 120px; height: 120px; margin-right: 10px"
|
|
||||||
></el-image>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
<!-- 处理情况 -->
|
|
||||||
<div class="mb-10">
|
|
||||||
<el-card>
|
|
||||||
<template #header>
|
|
||||||
<div class="card-header">
|
|
||||||
<span>处理情况</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<div class="formBox">
|
|
||||||
<el-form ref="formRef" :inline="false" :model="form" :rules="rules" class="m-auto" label-width="100px">
|
|
||||||
<el-form-item label="处理状态" prop="status">
|
|
||||||
<el-radio-group v-model="form.status">
|
|
||||||
<el-radio value="1">处理完成</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="处理人员" prop="handleId">
|
|
||||||
<complainUser
|
|
||||||
:is-multiple="false"
|
|
||||||
:userid="formInfo.handleId"
|
|
||||||
:username="formInfo.handleName"
|
|
||||||
returnvalue="*"
|
|
||||||
title-name="选择处理人员"
|
|
||||||
@change="handleChange"
|
|
||||||
></complainUser>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="处理描述" prop="handleContent">
|
|
||||||
<el-input v-model.trim="form.handleContent" :rows="5" maxlength="200" show-word-limit type="textarea"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button v-if="formInfo.status !== '1'" type="primary" @click="submitForm">提交</el-button>
|
|
||||||
<el-button @click="handleBack">返回</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import DictTag from '@/components/DictTag/index.vue';
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import complainUser from '@/components/Holder/complainUser.vue';
|
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
|
||||||
import { getComplaint, updateComplaint } from '@/api/system/Complaint';
|
|
||||||
import { listComplaintType } from '@/api/system/ComplainType';
|
|
||||||
import { ResidentVO } from '@/api/system/residentReviewProcess/resident/type';
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { com_complaint_status } = toRefs<any>(proxy?.useDict('com_complaint_status'));
|
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const formInfo = ref({
|
|
||||||
'id': null,
|
|
||||||
'type': '',
|
|
||||||
'typeId': null,
|
|
||||||
'problemDes': '',
|
|
||||||
'complaintName': '',
|
|
||||||
'phone': '',
|
|
||||||
'problemImageUrl': '',
|
|
||||||
/**
|
|
||||||
* 投诉状态 0 待处理 1 已处理
|
|
||||||
*/
|
|
||||||
'status': '1',
|
|
||||||
'handleId': '',
|
|
||||||
'handleName': '',
|
|
||||||
'handleContent': '',
|
|
||||||
'createTime': null
|
|
||||||
});
|
|
||||||
const form = ref({
|
|
||||||
'id': null,
|
|
||||||
'status': '1',
|
|
||||||
'handleId': '',
|
|
||||||
'handleName': '',
|
|
||||||
'handleContent': ''
|
|
||||||
});
|
|
||||||
const rules = {
|
|
||||||
status: [{ required: true, message: '选择投诉处理状态', trigger: 'blur' }],
|
|
||||||
handleContent: [{ required: false, message: '投诉处理内容不能为空', trigger: 'blur' }],
|
|
||||||
handleId: [{ required: true, message: '投诉处理人员不能为空', trigger: 'blur' }]
|
|
||||||
};
|
|
||||||
const userid = ref();
|
|
||||||
const problemImageUrlList = ref([]);
|
|
||||||
|
|
||||||
// ! 投诉 ====================================================================================================
|
|
||||||
async function init() {
|
|
||||||
const res2 = await listComplaintType();
|
|
||||||
getComplaint(userid.value).then((res) => {
|
|
||||||
formInfo.value = {
|
|
||||||
...formInfo.value,
|
|
||||||
...res.data
|
|
||||||
};
|
|
||||||
form.value = {
|
|
||||||
...form.value,
|
|
||||||
...res.data,
|
|
||||||
status: '1'
|
|
||||||
};
|
|
||||||
// 处理照片
|
|
||||||
problemImageUrlList.value = res.data.problemImageUrl ? res.data.problemImageUrl.split(',') : [];
|
|
||||||
// 处理 投诉类型
|
|
||||||
const find = res2.rows.find((item) => item.id === formInfo.value.typeId);
|
|
||||||
if (find) {
|
|
||||||
formInfo.value.type = find.name;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (route.query.id) {
|
|
||||||
userid.value = route.query.id;
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleChange(pop: ResidentVO) {
|
|
||||||
form.value.handleId = pop.userId;
|
|
||||||
form.value.handleName = pop.nickName;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提交
|
|
||||||
const formRef = ref();
|
|
||||||
const submitForm = () => {
|
|
||||||
formRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
if (userid.value) {
|
|
||||||
form.value.id = userid.value;
|
|
||||||
const obj = {
|
|
||||||
...formInfo.value,
|
|
||||||
...form.value
|
|
||||||
};
|
|
||||||
updateComplaint(obj).then(() => {
|
|
||||||
ElMessage.success('编辑成功');
|
|
||||||
handleBack();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 返回
|
|
||||||
function handleBack() {
|
|
||||||
router.push({
|
|
||||||
path: '/repair/complaint'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.ResidentMainBox {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
.ResidentMainBody {
|
|
||||||
margin-top: 20px;
|
|
||||||
flex: 1;
|
|
||||||
font-size: 14px;
|
|
||||||
|
|
||||||
.carInfoBox {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(3, 1fr);
|
|
||||||
grid-template-rows: repeat(2, 1fr);
|
|
||||||
gap: 20px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
|
|
||||||
.carInfo_item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
.label {
|
|
||||||
margin-right: 20px;
|
|
||||||
min-width: 60px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&.signLe {
|
|
||||||
grid-template-columns: repeat(1, 1fr);
|
|
||||||
grid-template-rows: repeat(1, 1fr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.formBox {
|
|
||||||
width: 500px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
&:deep(div.el-step__head.is-process) {
|
|
||||||
& > div.el-step__line {
|
|
||||||
width: 0;
|
|
||||||
border: 1px dashed gray;
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:deep(.el-step.is-vertical .el-step__line) {
|
|
||||||
top: 20px;
|
|
||||||
}
|
|
||||||
&:deep(div.el-step__head.is-finish) {
|
|
||||||
& > div.el-step__line {
|
|
||||||
width: 0;
|
|
||||||
border: 1px solid var(--el-color-primary);
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,161 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="h-full p-2 flex flex-col">
|
|
||||||
<Pageheader title="投诉管理"></Pageheader>
|
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
|
||||||
<el-card shadow="hover">
|
|
||||||
<el-form ref="queryFormRef" :inline="true" :model="queryParams" label-position="left" label-width="90px">
|
|
||||||
<el-form-item label="投诉状态" prop="status">
|
|
||||||
<el-select v-model="queryParams.status" clearable placeholder="请选择投诉状态" style="width: 240px" @clear="handleClear">
|
|
||||||
<el-option v-for="item in com_complaint_status" :key="item.value" :label="item.label" :value="item.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="投诉人姓名" prop="complaintName">
|
|
||||||
<el-input v-model="queryParams.complaintName" clearable placeholder="请输入投诉人姓名" @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
<el-card class="flex-1" shadow="never">
|
|
||||||
<el-table v-loading="loading" :data="complaintList" border @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column align="center" type="selection" width="55" />
|
|
||||||
<el-table-column align="center" label="投诉类型" prop="typeName" />
|
|
||||||
<el-table-column align="center" label="问题描述" prop="problemDes" show-overflow-tooltip />
|
|
||||||
<el-table-column align="center" label="投诉人姓名" prop="complaintName" />
|
|
||||||
<el-table-column align="center" label="手机号" prop="phone" />
|
|
||||||
<el-table-column align="center" label="投诉时间" prop="createTime" />
|
|
||||||
<el-table-column align="center" label="投诉状态" prop="status">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="com_complaint_status" :value="scope.row.status"></dict-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="处理人" prop="handleName" />
|
|
||||||
<el-table-column align="center" label="处理描述" prop="handleContent" show-overflow-tooltip />
|
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button v-has-permi="['complaint:complaint:query']" link type="primary" @click="handleUpdate(scope.row)">查看详情</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<pagination v-show="total > 0" v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNum" :total="total" @pagination="getList" />
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script lang="ts" name="Complaint" setup>
|
|
||||||
import { listComplaint } from '@/api/system/Complaint';
|
|
||||||
import { ComplaintVO, ComplaintQuery, ComplaintForm } from '@/api/system/Complaint/type';
|
|
||||||
import { listComplaintType } from '@/api/system/ComplainType';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { com_complaint_status } = toRefs<any>(proxy?.useDict('com_complaint_status'));
|
|
||||||
|
|
||||||
const complaintList = ref<ComplaintVO[]>([]);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const ids = ref<Array<string | number>>([]);
|
|
||||||
const single = ref(true);
|
|
||||||
const multiple = ref(true);
|
|
||||||
const total = ref(0);
|
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
|
||||||
|
|
||||||
const initFormData: ComplaintForm = {
|
|
||||||
id: undefined,
|
|
||||||
typeId: undefined,
|
|
||||||
problemDes: undefined,
|
|
||||||
complaintName: undefined,
|
|
||||||
phone: undefined,
|
|
||||||
problemImageUrl: undefined,
|
|
||||||
status: undefined,
|
|
||||||
handleId: undefined,
|
|
||||||
handleName: undefined,
|
|
||||||
handleContent: undefined
|
|
||||||
};
|
|
||||||
const data = reactive<PageData<ComplaintForm, ComplaintQuery>>({
|
|
||||||
form: { ...initFormData },
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
typeId: undefined,
|
|
||||||
problemDes: undefined,
|
|
||||||
complaintName: undefined,
|
|
||||||
phone: undefined,
|
|
||||||
problemImageUrl: undefined,
|
|
||||||
status: undefined,
|
|
||||||
handleId: undefined,
|
|
||||||
handleName: undefined,
|
|
||||||
handleContent: undefined
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
id: [{ required: true, message: '投诉管理表id不能为空', trigger: 'blur' }]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams } = toRefs(data);
|
|
||||||
|
|
||||||
const complainTypeList = ref([]);
|
|
||||||
/** 查询投诉管理列表 ╬╬╬*/
|
|
||||||
const getList = async () => {
|
|
||||||
loading.value = true;
|
|
||||||
const res2 = await listComplaintType();
|
|
||||||
complainTypeList.value = res2.rows;
|
|
||||||
listComplaint(queryParams.value)
|
|
||||||
.then((res) => {
|
|
||||||
complaintList.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
const handleQuery = () => {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 清空投诉状态 */
|
|
||||||
const handleClear = () => {
|
|
||||||
queryParams.value.status = undefined;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryFormRef.value?.resetFields();
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
|
||||||
const handleSelectionChange = (selection: ComplaintVO[]) => {
|
|
||||||
ids.value = selection.map((item) => item.id);
|
|
||||||
single.value = selection.length != 1;
|
|
||||||
multiple.value = !selection.length;
|
|
||||||
};
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
/** 详情按钮操作 */
|
|
||||||
const handleUpdate = (row?: ComplaintVO) => {
|
|
||||||
router.push({
|
|
||||||
path: '/repair/complainMain',
|
|
||||||
query: {
|
|
||||||
id: row.id
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.el-table {
|
|
||||||
height: calc(100% - 80px);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="ResidentMainBox p-2 w-full">
|
|
||||||
<PageHeader title="投诉类型"></PageHeader>
|
|
||||||
<div class="ResidentMainBody">
|
|
||||||
<el-card>
|
|
||||||
<template #header>
|
|
||||||
<div class="title">基本信息</div>
|
|
||||||
</template>
|
|
||||||
<div class="addBuildingFormBody">
|
|
||||||
<div class="formbox">
|
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
|
||||||
<el-form-item label="投诉类型名称" prop="name">
|
|
||||||
<el-input maxlength="20" show-word-limit v-model.trim="form.name" placeholder="请输入投诉类型名称" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="投诉类型状态" prop="status">
|
|
||||||
<el-radio-group v-model="form.status">
|
|
||||||
<el-radio v-for="(item, index) in com_repair_project_status" :key="index" :value="item.value">{{ item.label }}</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
|
||||||
<el-button @click="handleBack">返回</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
|
||||||
import { addComplaintType, getComplaintType, updateComplaintType } from '@/api/system/ComplainType';
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { com_repair_project_status } = toRefs<any>(proxy?.useDict('com_repair_project_status'));
|
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const router = useRouter();
|
|
||||||
const formRef = ref();
|
|
||||||
const form = ref({
|
|
||||||
'id': null,
|
|
||||||
'name': '',
|
|
||||||
'status': '0'
|
|
||||||
});
|
|
||||||
const rules = {
|
|
||||||
name: [{ required: true, message: '请输入投诉类型名称', trigger: 'blur' }]
|
|
||||||
};
|
|
||||||
const userid = ref();
|
|
||||||
|
|
||||||
// ! 投诉 ====================================================================================================
|
|
||||||
function init() {
|
|
||||||
getComplaintType(userid.value).then((res) => {
|
|
||||||
form.value = {
|
|
||||||
...form.value,
|
|
||||||
...res.data
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (route.query.id) {
|
|
||||||
userid.value = route.query.id;
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提交
|
|
||||||
const submitForm = () => {
|
|
||||||
formRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
if (userid.value) {
|
|
||||||
updateComplaintType(form.value).then(() => {
|
|
||||||
ElMessage.success('编辑成功');
|
|
||||||
handleBack();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addComplaintType(form.value).then(() => {
|
|
||||||
ElMessage.success('添加成功');
|
|
||||||
handleBack();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 返回
|
|
||||||
function handleBack() {
|
|
||||||
router.push({
|
|
||||||
path: '/system/complaintType'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.ResidentMainBox {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
.ResidentMainBody {
|
|
||||||
margin-top: 20px;
|
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
.formbox {
|
|
||||||
width: 500px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
&:deep(div.el-step__head.is-process) {
|
|
||||||
& > div.el-step__line {
|
|
||||||
width: 0;
|
|
||||||
border: 1px dashed gray;
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:deep(.el-step.is-vertical .el-step__line) {
|
|
||||||
top: 20px;
|
|
||||||
}
|
|
||||||
&:deep(div.el-step__head.is-finish) {
|
|
||||||
& > div.el-step__line {
|
|
||||||
width: 0;
|
|
||||||
border: 1px solid var(--el-color-primary);
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,183 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="p-2 h-full flex flex-col">
|
|
||||||
<Pageheader title="投诉类型管理"></Pageheader>
|
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
|
||||||
<el-card shadow="hover">
|
|
||||||
<el-form ref="queryFormRef" :inline="true" :model="queryParams" label-width="100px">
|
|
||||||
<el-form-item label="投诉类型名称" prop="name">
|
|
||||||
<el-input v-model.trim="queryParams.name" clearable maxlength="20" placeholder="请输入投诉类型名称" @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
|
|
||||||
<el-card class="flex-1" shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<right-toolbar
|
|
||||||
:disable-delete="multiple"
|
|
||||||
:disable-edit="single"
|
|
||||||
:show-add="checkPermi(['complaintType:complaintType:add'])"
|
|
||||||
:show-delete="checkPermi(['complaintType:complaintType:remove'])"
|
|
||||||
:show-edit="checkPermi(['complaintType:complaintType:edit'])"
|
|
||||||
@update:add="handleAdd"
|
|
||||||
@update:edit="handleUpdate()"
|
|
||||||
@update:delete="handleDelete()"
|
|
||||||
></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="complaintTypeList" border @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column align="center" type="selection" width="55" />
|
|
||||||
<el-table-column align="center" label="投诉类型名称" prop="name" />
|
|
||||||
<el-table-column align="center" label="状态" prop="status">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-switch
|
|
||||||
v-model="scope.row.status"
|
|
||||||
active-value="0"
|
|
||||||
inactive-value="1"
|
|
||||||
@change="(val: string) => handleChange(val, scope.row)"
|
|
||||||
></el-switch>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="添加人" prop="createName" width="180">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ scope.row.createName }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="创建时间" prop="createTime" width="180">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ scope.row.createTime }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button v-has-permi="['complaintType:complaintType:edit']" link type="primary" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
||||||
<el-button v-has-permi="['complaintType:complaintType:remove']" link type="primary" @click="handleDelete(scope.row)">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination v-show="total > 0" v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNum" :total="total" @pagination="getList" />
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="ComplaintType" setup>
|
|
||||||
import { listComplaintType, delComplaintType, updateComplaintType } from '@/api/system/ComplainType';
|
|
||||||
import { ComplaintTypeVO, ComplaintTypeQuery, ComplaintTypeForm } from '@/api/system/ComplainType/type';
|
|
||||||
import { checkPermi } from '@/utils/permission';
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
|
|
||||||
const complaintTypeList = ref<ComplaintTypeVO[]>([]);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const ids = ref<Array<string | number>>([]);
|
|
||||||
const single = ref(true);
|
|
||||||
const multiple = ref(true);
|
|
||||||
const total = ref(0);
|
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
|
||||||
|
|
||||||
const initFormData: ComplaintTypeForm = {
|
|
||||||
id: undefined,
|
|
||||||
name: undefined
|
|
||||||
};
|
|
||||||
const data = reactive<PageData<ComplaintTypeForm, ComplaintTypeQuery>>({
|
|
||||||
form: { ...initFormData },
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
name: undefined
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
id: [{ required: true, message: '投诉类型管理表id不能为空', trigger: 'blur' }]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams } = toRefs(data);
|
|
||||||
|
|
||||||
/** 查询投诉类型管理列表 */
|
|
||||||
const getList = async () => {
|
|
||||||
loading.value = true;
|
|
||||||
listComplaintType(queryParams.value)
|
|
||||||
.then((res) => {
|
|
||||||
complaintTypeList.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
const handleQuery = () => {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryFormRef.value?.resetFields();
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
|
||||||
const handleSelectionChange = (selection: ComplaintTypeVO[]) => {
|
|
||||||
ids.value = selection.map((item) => item.id);
|
|
||||||
single.value = selection.length != 1;
|
|
||||||
multiple.value = !selection.length;
|
|
||||||
};
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
const handleAdd = () => {
|
|
||||||
router.push({
|
|
||||||
path: '/system/addComplantType'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const handleChange = (val: string, row: ComplaintTypeVO) => {
|
|
||||||
updateComplaintType({
|
|
||||||
id: row.id,
|
|
||||||
status: val
|
|
||||||
}).then(() => {
|
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
const handleUpdate = (row?: ComplaintTypeVO) => {
|
|
||||||
const _id = row?.id || ids.value[0];
|
|
||||||
router.push({
|
|
||||||
path: '/system/addComplantType',
|
|
||||||
query: {
|
|
||||||
id: _id
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
const handleDelete = async (row?: ComplaintTypeVO) => {
|
|
||||||
const _ids = row?.id || ids.value;
|
|
||||||
await proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').finally(() => (loading.value = false));
|
|
||||||
await delComplaintType(_ids);
|
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
|
||||||
await getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.el-table {
|
|
||||||
height: calc(100% - 80px);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,228 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="ResidentMainBox p-2 w-full">
|
|
||||||
<PageHeader></PageHeader>
|
|
||||||
<div class="ResidentMainBody">
|
|
||||||
<el-card>
|
|
||||||
<template #header>
|
|
||||||
<div class="title">基本信息</div>
|
|
||||||
</template>
|
|
||||||
<div class="addBuildingFormBody">
|
|
||||||
<div class="formBox">
|
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="房屋" prop="houseId">
|
|
||||||
<el-cascader v-model="userHousepath" :options="treedata" @change="handleChange" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="申请人" prop="applyName">
|
|
||||||
<el-input v-model.trim="form.applyName" maxlength="20" placeholder="请输入申请人" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="装修公司" prop="decorationCompany">
|
|
||||||
<el-input v-model.trim="form.decorationCompany" maxlength="20" placeholder="请输入装修公司" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="装修内容" prop="decorationContent">
|
|
||||||
<el-input v-model.trim="form.decorationContent" maxlength="200" placeholder="请输入装修内容" show-word-limit type="textarea" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="装修押金(元)" prop="decorationDeposit">
|
|
||||||
<el-input v-model.number.trim="form.decorationDeposit" maxlength="8" placeholder="请输入装修押金,最多保留2位小数" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
|
||||||
<el-button @click="handleBack">返回</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
|
||||||
import { addDecoration, getDecoration, updateDecoration } from '@/api/system/Decoration';
|
|
||||||
import { useHouseStore } from '@/store/modules/house';
|
|
||||||
import { validator } from '@/utils/Reg';
|
|
||||||
|
|
||||||
const houseStore = useHouseStore();
|
|
||||||
const treedata = ref([]);
|
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const router = useRouter();
|
|
||||||
const formRef = ref();
|
|
||||||
const form = ref({
|
|
||||||
'id': null,
|
|
||||||
'houseId': null,
|
|
||||||
'buildingId': null,
|
|
||||||
'unitNoId': null,
|
|
||||||
'applyName': '',
|
|
||||||
'inspectionResult': '0',
|
|
||||||
'decorationCompany': '',
|
|
||||||
'decorationContent': '',
|
|
||||||
'decorationDeposit': null
|
|
||||||
});
|
|
||||||
|
|
||||||
const rules = {
|
|
||||||
houseId: [{ required: true, message: '请选择具体房屋', trigger: 'blur' }],
|
|
||||||
applyName: [
|
|
||||||
{ required: true, message: '请输入申请人', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number, callback: any) => {
|
|
||||||
if (value === '' || value === undefined) {
|
|
||||||
return callback(new Error('请输入申请人姓名'));
|
|
||||||
}
|
|
||||||
return !validator(value, 'fullFilterReg') ? callback() : callback(new Error('请输入正确的申请人姓名'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
decorationCompany: [
|
|
||||||
{ required: true, message: '请输入装修公司名称', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number, callback: any) => {
|
|
||||||
if (value === '' || value === '') {
|
|
||||||
return callback();
|
|
||||||
}
|
|
||||||
return !validator(value, 'fullFilterReg') ? callback() : callback(new Error('请输入正确的装修公司名称'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
decorationDeposit: [
|
|
||||||
{ required: true, message: '请输入装修押金', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, val: string, callback: (arg0?: Error) => any) => {
|
|
||||||
if (val === '' || val === null) {
|
|
||||||
return callback(new Error('请输入装修押金'));
|
|
||||||
}
|
|
||||||
const num = Number(val);
|
|
||||||
if (Number.isNaN(num)) {
|
|
||||||
return callback(new Error('请输入装修押金'));
|
|
||||||
}
|
|
||||||
if (num < 0) {
|
|
||||||
return callback(new Error('装修押金不能为负数'));
|
|
||||||
}
|
|
||||||
if (num > 99999999) {
|
|
||||||
return callback(new Error('装修押金过大'));
|
|
||||||
}
|
|
||||||
return validator(val, 'money');
|
|
||||||
},
|
|
||||||
trigger: ['blur', 'change']
|
|
||||||
}
|
|
||||||
],
|
|
||||||
decorationContent: [
|
|
||||||
{ required: true, message: '请输入装修内容', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number, callback: any) => {
|
|
||||||
if (value === '' || value === '') {
|
|
||||||
return callback();
|
|
||||||
}
|
|
||||||
return !validator(value, 'fullFilterReg') ? callback() : callback(new Error('请输入正确的装修内容'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
const userid = ref();
|
|
||||||
|
|
||||||
// 获取房屋
|
|
||||||
const userHousepath = ref([]);
|
|
||||||
function handleChange(val: (string | number)[]) {
|
|
||||||
if (val.length >= 3) {
|
|
||||||
form.value.houseId = val.at(2) as number;
|
|
||||||
} else {
|
|
||||||
form.value.houseId = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ! 投诉 蚱蝉====================================================================================================
|
|
||||||
function getTree() {
|
|
||||||
houseStore.getCurrentVilageTreeHouse().then((res) => {
|
|
||||||
treedata.value = res;
|
|
||||||
if (route.query.id) {
|
|
||||||
userid.value = route.query.id;
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
getTree();
|
|
||||||
// TODO
|
|
||||||
function init() {
|
|
||||||
getDecoration(userid.value).then((res) => {
|
|
||||||
form.value = {
|
|
||||||
...form.value,
|
|
||||||
...res.data
|
|
||||||
};
|
|
||||||
userHousepath.value = [form.value.buildingId, form.value.unitNoId, form.value.houseId];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提交
|
|
||||||
const submitForm = () => {
|
|
||||||
formRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
if (userid.value) {
|
|
||||||
updateDecoration(form.value).then(() => {
|
|
||||||
ElMessage.success('编辑成功');
|
|
||||||
handleBack();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addDecoration(form.value).then(() => {
|
|
||||||
ElMessage.success('添加成功');
|
|
||||||
handleBack();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 返回
|
|
||||||
function handleBack() {
|
|
||||||
router.back();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.ResidentMainBox {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
.ResidentMainBody {
|
|
||||||
margin-top: 20px;
|
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
.formBox {
|
|
||||||
width: 1000px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
&:deep(div.el-step__head.is-process) {
|
|
||||||
& > div.el-step__line {
|
|
||||||
width: 0;
|
|
||||||
border: 1px dashed gray;
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:deep(.el-step.is-vertical .el-step__line) {
|
|
||||||
top: 20px;
|
|
||||||
}
|
|
||||||
&:deep(div.el-step__head.is-finish) {
|
|
||||||
& > div.el-step__line {
|
|
||||||
width: 0;
|
|
||||||
border: 1px solid var(--el-color-primary);
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,340 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="flex flex-col h-full p-2">
|
|
||||||
<Pageheader title="装修管理"></Pageheader>
|
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
|
||||||
<el-card shadow="hover">
|
|
||||||
<el-form ref="queryFormRef" :inline="true" :model="queryParams" :rules="rules" label-width="120px">
|
|
||||||
<el-form-item label="申请人姓名" prop="applyName">
|
|
||||||
<el-input v-model.trim="queryParams.applyName" clearable maxlength="20" placeholder="请输入申请人姓名" @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="装修验收结果">
|
|
||||||
<el-select v-model="queryParams.inspectionResult" clearable placeholder="请选择装修验收结果" style="width: 240px" @clear="handleClear">
|
|
||||||
<el-option v-for="item in com_decoration_status" :key="item.value" :label="item.label" :value="item.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
|
|
||||||
<el-card class="flex-1" shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<right-toolbar
|
|
||||||
:disable-delete="multiple"
|
|
||||||
:disable-edit="single"
|
|
||||||
:show-add="checkPermi(['decoration:decoration:add'])"
|
|
||||||
:show-delete="checkPermi(['decoration:decoration:remove'])"
|
|
||||||
:show-edit="checkPermi(['decoration:decoration:edit'])"
|
|
||||||
@update:add="handleAdd"
|
|
||||||
@update:edit="handleUpdate()"
|
|
||||||
@update:delete="handleDelete()"
|
|
||||||
></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="decorationList" border @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column align="center" type="selection" width="55" />
|
|
||||||
<el-table-column align="center" label="小区名称" prop="villageName" />
|
|
||||||
<el-table-column align="center" label="房屋号" prop="houseName" show-overflow-tooltip />
|
|
||||||
<el-table-column align="center" label="申请人姓名" prop="applyName" />
|
|
||||||
<el-table-column align="center" label="装修公司" prop="decorationCompany" />
|
|
||||||
<el-table-column align="center" label="装修内容" prop="decorationContent" />
|
|
||||||
<el-table-column align="center" label="申请时间" prop="createTime" width="170" />
|
|
||||||
<el-table-column align="center" label="装修押金(元)" prop="decorationDeposit" width="120" />
|
|
||||||
<el-table-column align="center" label="验收结果" prop="inspectionResult" width="100">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="com_decoration_status" :value="Number(scope.row.inspectionResult)"></dict-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="验收人" prop="inspectionName" />
|
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作" width="170">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button
|
|
||||||
v-if="scope.row.inspectionResult !== '1'"
|
|
||||||
v-has-permi="['decoration:decoration:edit']"
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
@click="handleInspection(scope.row, EditType.Add, '验收')"
|
|
||||||
>验收</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
v-else
|
|
||||||
v-has-permi="['decoration:decoration:query']"
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
@click="handleInspection(scope.row, EditType.Detail, '详情')"
|
|
||||||
>详情</el-button
|
|
||||||
>
|
|
||||||
<el-button v-has-permi="['decoration:decoration:edit']" link type="primary" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
||||||
<el-button v-has-permi="['decoration:decoration:remove']" link type="primary" @click="handleDelete(scope.row)">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination v-show="total > 0" v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNum" :total="total" @pagination="getList" />
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
<el-dialog v-model="dialog.visible" :title="dialog.title" append-to-body width="500px">
|
|
||||||
<el-form ref="decorationFormRef" :model="form" :rules="rules" label-width="120px">
|
|
||||||
<div v-if="isEditComputed">
|
|
||||||
<el-form-item label="小区名称" prop="villageName">
|
|
||||||
<el-input v-model="form.villageName" :disabled="isEditComputed" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="房屋号" prop="houseName">
|
|
||||||
<el-input v-model="form.houseName" :disabled="isEditComputed" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="申请人" prop="applyName">
|
|
||||||
<el-input v-model="form.applyName" :disabled="isEditComputed" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="装修公司" prop="decorationCompany">
|
|
||||||
<el-input v-model="form.decorationCompany" :disabled="isEditComputed" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="装修内容" prop="decorationContent">
|
|
||||||
<el-input v-model="form.decorationContent" :disabled="isEditComputed" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="装修押金" prop="decorationDeposit">
|
|
||||||
<el-input v-model="form.decorationDeposit" :disabled="isEditComputed" />
|
|
||||||
</el-form-item>
|
|
||||||
</div>
|
|
||||||
<el-form-item :prop="isEditComputed ? '' : 'inspectionResult'" label="验收结果">
|
|
||||||
<el-select v-model="form.inspectionResult" :disabled="isEditComputed" placeholder="请选择装修验收结果">
|
|
||||||
<el-option v-for="item in com_decoration_status" :key="item.value" :label="item.label" :value="item.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item :prop="isEditComputed ? '' : 'inspectionName'" label="验收人">
|
|
||||||
<el-input v-model.trim="form.inspectionName" :disabled="isEditComputed" placeholder="请输入验收人" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input
|
|
||||||
v-model="form.remark"
|
|
||||||
:disabled="isEditComputed"
|
|
||||||
:placeholder="isEditComputed ? '' : '请输入'"
|
|
||||||
:rows="5"
|
|
||||||
maxlength="200"
|
|
||||||
show-word-limit
|
|
||||||
type="textarea"
|
|
||||||
></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template v-if="!isEditComputed" #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="Decoration" setup>
|
|
||||||
import { listDecoration, delDecoration, updateDecoration } from '@/api/system/Decoration';
|
|
||||||
import { DecorationVO, DecorationQuery, DecorationForm } from '@/api/system/Decoration/type';
|
|
||||||
import { checkPermi } from '@/utils/permission';
|
|
||||||
import { validator } from '@/utils/Reg';
|
|
||||||
import '@/types/axios.d.ts';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { com_decoration_status } = toRefs<any>(proxy?.useDict('com_decoration_status'));
|
|
||||||
|
|
||||||
const decorationList = ref<DecorationVO[]>([]);
|
|
||||||
const buttonLoading = ref(false);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const ids = ref<Array<string | number>>([]);
|
|
||||||
const single = ref(true);
|
|
||||||
const multiple = ref(true);
|
|
||||||
const total = ref(0);
|
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
|
||||||
const decorationFormRef = ref<ElFormInstance>();
|
|
||||||
const dialog = reactive<DialogOption>({
|
|
||||||
visible: false,
|
|
||||||
title: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const initFormData: DecorationForm = {
|
|
||||||
id: undefined,
|
|
||||||
villageId: undefined,
|
|
||||||
houseId: undefined,
|
|
||||||
applyName: undefined,
|
|
||||||
decorationCompany: undefined,
|
|
||||||
decorationContent: undefined,
|
|
||||||
decorationDeposit: undefined,
|
|
||||||
inspectionResult: undefined,
|
|
||||||
remark: undefined,
|
|
||||||
villageName: undefined,
|
|
||||||
houseName: undefined,
|
|
||||||
inspectionName: undefined
|
|
||||||
};
|
|
||||||
const data = reactive<PageData<DecorationForm, DecorationQuery>>({
|
|
||||||
form: { ...initFormData },
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
houseId: undefined,
|
|
||||||
applyName: undefined,
|
|
||||||
decorationCompany: undefined,
|
|
||||||
decorationContent: undefined,
|
|
||||||
decorationDeposit: undefined,
|
|
||||||
inspectionResult: undefined,
|
|
||||||
inspectionName: undefined,
|
|
||||||
params: {}
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
inspectionName: [
|
|
||||||
{ required: true, message: '验收人姓名不能为空', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number, callback: any) => {
|
|
||||||
if (value === '' || value === '') {
|
|
||||||
return callback(new Error('请输入验收人姓名'));
|
|
||||||
}
|
|
||||||
return validator(value, 'ChineseName') ? callback() : callback(new Error('请输入正确的验收人姓名'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
applyName: [
|
|
||||||
{ required: false, message: '申请人姓名不能为空', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number, callback: any) => {
|
|
||||||
if (value === '' || value === undefined) {
|
|
||||||
return callback();
|
|
||||||
}
|
|
||||||
return !validator(value, 'fullFilterReg') ? callback() : callback(new Error('请输入正确的申请人姓名'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
inspectionResult: [{ required: true, message: '验收结果不能为空', trigger: 'blur' }]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
|
||||||
|
|
||||||
/** 查询装修管理列表 */
|
|
||||||
const getList = async () => {
|
|
||||||
loading.value = true;
|
|
||||||
listDecoration(queryParams.value)
|
|
||||||
.then((res) => {
|
|
||||||
decorationList.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 取消按钮 */
|
|
||||||
const cancel = () => {
|
|
||||||
reset();
|
|
||||||
dialog.visible = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 表单重置 */
|
|
||||||
const reset = () => {
|
|
||||||
form.value = { ...initFormData };
|
|
||||||
decorationFormRef.value?.resetFields();
|
|
||||||
};
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
const handleQuery = () => {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 清空按钮操作 */
|
|
||||||
const handleClear = () => {
|
|
||||||
queryParams.value.inspectionResult = undefined;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryFormRef.value?.resetFields();
|
|
||||||
queryParams.value.inspectionResult = undefined;
|
|
||||||
queryParams.value.applyName = undefined;
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
|
||||||
const handleSelectionChange = (selection: DecorationVO[]) => {
|
|
||||||
ids.value = selection.map((item) => item.id);
|
|
||||||
single.value = selection.length != 1;
|
|
||||||
multiple.value = !selection.length;
|
|
||||||
};
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
const handleAdd = () => {
|
|
||||||
router.push({
|
|
||||||
path: '/repair/addDecoration'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
const handleUpdate = (row?: DecorationVO) => {
|
|
||||||
const _id = row?.id || ids.value[0];
|
|
||||||
router.push({
|
|
||||||
path: '/repair/editDecoration',
|
|
||||||
query: {
|
|
||||||
id: _id
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
enum EditType {
|
|
||||||
/** 验收 */
|
|
||||||
Add = 1,
|
|
||||||
/** 详情 */
|
|
||||||
Detail = 2
|
|
||||||
}
|
|
||||||
const isEdit = ref(EditType.Add);
|
|
||||||
const isEditComputed = computed(() => isEdit.value !== EditType.Add);
|
|
||||||
|
|
||||||
/** 验收 */
|
|
||||||
const handleInspection = (row: DecorationVO, edit: EditType, type: string) => {
|
|
||||||
form.value = {
|
|
||||||
...form.value,
|
|
||||||
...row
|
|
||||||
};
|
|
||||||
dialog.visible = true;
|
|
||||||
dialog.title = type;
|
|
||||||
isEdit.value = edit;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
const submitForm = () => {
|
|
||||||
decorationFormRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
buttonLoading.value = true;
|
|
||||||
if (form.value.id) {
|
|
||||||
await updateDecoration(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
}
|
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
|
||||||
dialog.visible = false;
|
|
||||||
await getList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
const handleDelete = async (row?: DecorationVO) => {
|
|
||||||
const _ids = row?.id || ids.value;
|
|
||||||
await proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').finally(() => (loading.value = false));
|
|
||||||
await delDecoration(_ids);
|
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
|
||||||
await getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.el-table {
|
|
||||||
height: calc(100% - 80px);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,308 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="AddBuildingBox">
|
|
||||||
<PageHeader :title="userid ? '编辑月卡' : '添加月卡'"></PageHeader>
|
|
||||||
<div class="AddBuildingBody">
|
|
||||||
<div class="title">基本信息</div>
|
|
||||||
<div class="addBuildingFormBody">
|
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" class="formBody" label-position="right" label-width="130px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="月卡编号" prop="cardCode">
|
|
||||||
<el-input v-model.trim="form.cardCode" maxlength="15" placeholder="请输入月卡编号" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="2"></el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="持卡人姓名" prop="cardName">
|
|
||||||
<el-input v-model.trim="form.cardName" maxlength="15" placeholder="请输入持卡人姓名" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="手机号码" prop="phone">
|
|
||||||
<el-input v-model.number="form.phone" maxlength="11" placeholder="请输入手机号码" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="2"></el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="绑定车牌号" prop="carNum">
|
|
||||||
<el-input
|
|
||||||
v-model.trim="form.carNum"
|
|
||||||
maxlength="10"
|
|
||||||
placeholder="请输入车牌号"
|
|
||||||
style="text-transform: uppercase; letter-spacing: 2px"
|
|
||||||
@input="handleInputCarNum"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="办理人" prop="handleName">
|
|
||||||
<el-input v-model="form.handleName" maxlength="15" placeholder="请输入办理人姓名" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="2"></el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="有效日期" prop="startTime">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="checkDate"
|
|
||||||
:disabled-date="disableDate"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
placeholder="选择日期"
|
|
||||||
range-separator="到"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
type="daterange"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
@change="handleDate"
|
|
||||||
@clear="handleClear"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="费用" prop="cost">
|
|
||||||
<el-input v-model.number.trim="form.cost" maxlength="8" placeholder="请输入费用">
|
|
||||||
<template #suffix>元</template>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="2"></el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="支付方式" prop="payMethod">
|
|
||||||
<el-select v-model="form.payMethod" clearable placeholder="请选择支付方式">
|
|
||||||
<el-option v-for="dict in com_pay_method" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model.trim="form.remark" :rows="5" maxlength="200" placeholder="请输入" show-word-limit type="textarea" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-form-item style="margin-top: 30px">
|
|
||||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
|
||||||
<el-button @click="cancelForm">返回</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
|
||||||
import { addMonthCard, getMonthCard, updateMonthCard } from '@/api/system/MonthCard';
|
|
||||||
import { validator } from '@/utils/Reg';
|
|
||||||
import { LicensePlateValidator2 } from '@/utils/Reg2';
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { com_pay_method } = toRefs<any>(proxy?.useDict('com_pay_method'));
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const formRef = ref();
|
|
||||||
const form = ref({
|
|
||||||
id: null,
|
|
||||||
cardCode: '', // 月卡编号
|
|
||||||
cardName: null, // 持卡人姓名
|
|
||||||
phone: '', // 手机号
|
|
||||||
carNum: '', // 绑定车牌号
|
|
||||||
handleName: '', // 办理人姓名
|
|
||||||
cost: null, // 费用/元
|
|
||||||
payMethod: '', // 支付方式
|
|
||||||
remark: '', // 备注
|
|
||||||
startTime: '', // 开始日期
|
|
||||||
endTime: '' // 结束日期
|
|
||||||
});
|
|
||||||
const checkDate = ref([]);
|
|
||||||
// 禁用 过去日期
|
|
||||||
function disableDate(time: Date) {
|
|
||||||
return time.getTime() < new Date(new Date().toLocaleDateString()).getTime();
|
|
||||||
}
|
|
||||||
// 处理日期选择
|
|
||||||
function handleDate(data: string[]) {
|
|
||||||
form.value.startTime = data[0] + ' 00:00:00';
|
|
||||||
form.value.endTime = data[1] + ' 23:59:59';
|
|
||||||
}
|
|
||||||
// 清空日期选择
|
|
||||||
function handleClear() {
|
|
||||||
checkDate.value = [];
|
|
||||||
form.value.startTime = '';
|
|
||||||
form.value.endTime = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
const rules = ref({
|
|
||||||
cardCode: [
|
|
||||||
{ required: true, message: '请输入月卡编号', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number) => validator(value, 'Character'),
|
|
||||||
message: '请输入中文,字母,数字,-,_等字符',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
cardName: [
|
|
||||||
{ required: true, message: '请输入姓名', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number) => validator(value, 'ChineseName'),
|
|
||||||
message: '请输入正确的中文姓名',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
handleName: [
|
|
||||||
{ required: false, message: '请输入姓名', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number, callback: (error?: Error) => void) => {
|
|
||||||
if (value === '' || value === null || value === undefined) {
|
|
||||||
return callback();
|
|
||||||
}
|
|
||||||
if (!validator(value, 'ChineseName')) {
|
|
||||||
return callback(new Error('请输入正确的中文姓名'));
|
|
||||||
}
|
|
||||||
return callback();
|
|
||||||
},
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
phone: [
|
|
||||||
{ required: true, message: '请输入手机号', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number) => validator(value, 'phone'),
|
|
||||||
message: '请输入正确的手机号码',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
carNum: [
|
|
||||||
{ required: true, message: '请输入车牌号', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string, callback: any) => {
|
|
||||||
if (!value) {
|
|
||||||
callback(new Error('请输入车牌号'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!LicensePlateValidator2.isValidPlate(value)) {
|
|
||||||
callback(new Error('请输入正确的车牌号'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
callback();
|
|
||||||
},
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
startTime: [{ required: true, message: '请选择有效日期', trigger: 'blur' }],
|
|
||||||
payMethod: [{ required: true, message: '请选择支付方式', trigger: 'blur' }],
|
|
||||||
cost: [
|
|
||||||
{ required: true, message: '请输入费用', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string | number, callback) => {
|
|
||||||
if (value === null || value === undefined || value === 0) {
|
|
||||||
return callback(new Error('请输入费用'));
|
|
||||||
}
|
|
||||||
if (!validator(value, 'money')) {
|
|
||||||
return callback(new Error('请输入正确的金额,最多两位小数'));
|
|
||||||
}
|
|
||||||
return callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const userid = ref(null);
|
|
||||||
|
|
||||||
if (route.query.id) {
|
|
||||||
userid.value = route.query.id;
|
|
||||||
getMonthCard(userid.value).then((res) => {
|
|
||||||
form.value = {
|
|
||||||
...form.value,
|
|
||||||
...res.data
|
|
||||||
};
|
|
||||||
checkDate.value = [form.value.startTime, form.value.endTime];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理 车牌号 输入 大写问题
|
|
||||||
function handleInputCarNum(val: string) {
|
|
||||||
form.value.carNum = val.toUpperCase();
|
|
||||||
}
|
|
||||||
|
|
||||||
// !== 提交 =============================================================================
|
|
||||||
// 提交
|
|
||||||
const submitForm = () => {
|
|
||||||
formRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
if (!form.value.startTime.trim() || !form.value.endTime.trim()) {
|
|
||||||
ElMessage.warning('请选择有效日期');
|
|
||||||
}
|
|
||||||
if (userid.value) {
|
|
||||||
updateMonthCard(form.value).then(() => {
|
|
||||||
ElMessage.success('编辑成功');
|
|
||||||
cancelForm();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addMonthCard(form.value).then(() => {
|
|
||||||
ElMessage.success('添加成功');
|
|
||||||
|
|
||||||
cancelForm();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
// 推出
|
|
||||||
const cancelForm = () => {
|
|
||||||
router.back();
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.AddBuildingBox {
|
|
||||||
padding: 15px;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.AddBuildingBody {
|
|
||||||
margin-top: 20px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
background-color: white;
|
|
||||||
padding: 15px;
|
|
||||||
.title {
|
|
||||||
height: 40px;
|
|
||||||
line-height: 40px;
|
|
||||||
padding-left: 20px;
|
|
||||||
background-color: rgba(255, 255, 255, 1);
|
|
||||||
color: rgba(16, 16, 16, 1);
|
|
||||||
border-bottom: 1px solid #bbbbbb;
|
|
||||||
margin-bottom: 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formBody {
|
|
||||||
width: 1050px;
|
|
||||||
margin: 0 auto;
|
|
||||||
&:deep(.el-form-item__content, .el-select, .el-input) {
|
|
||||||
width: 350px !important;
|
|
||||||
margin-right: 10px;
|
|
||||||
.el-cascader {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.el-form-item {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.el-button {
|
|
||||||
width: 80px;
|
|
||||||
height: 35px;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,305 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="h-full flex flex-col p-2">
|
|
||||||
<pageheader title="月卡管理"></pageheader>
|
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
|
||||||
<el-card shadow="hover">
|
|
||||||
<el-form ref="queryFormRef" :inline="true" :model="queryParams" @submit.prevent="handleQuery">
|
|
||||||
<el-form-item label="月卡编号" prop="cardCode">
|
|
||||||
<el-input v-model="queryParams.cardCode" clearable maxlength="12" placeholder="请输入月卡编号" @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
|
|
||||||
<el-card class="flex-1" shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<right-toolbar
|
|
||||||
:disable-delete="multiple"
|
|
||||||
:disable-edit="single"
|
|
||||||
:show-add="checkPermi(['monthCard:monthCard:add'])"
|
|
||||||
:show-delete="checkPermi(['monthCard:monthCard:remove'])"
|
|
||||||
:show-edit="checkPermi(['monthCard:monthCard:edit'])"
|
|
||||||
@update:add="handleAdd"
|
|
||||||
@update:edit="handleUpdate()"
|
|
||||||
@update:delete="handleDelete()"
|
|
||||||
></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="monthCardList" border @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column align="center" type="selection" width="55" />
|
|
||||||
<el-table-column v-if="true" align="center" label="月卡编号" prop="cardCode" />
|
|
||||||
<el-table-column align="center" label="办理时间" prop="handleTime" width="150">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ parseTime(scope.row.handleTime, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="业主" prop="cardName" width="150" />
|
|
||||||
<el-table-column align="center" label="绑定车牌号" prop="carNum" width="150" />
|
|
||||||
<el-table-column align="center" label="剩余有效天数" prop="handleName" width="120">
|
|
||||||
<template #default="scope">
|
|
||||||
{{ handleDiffDays(scope.row.startTime, scope.row.endTime) }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="支付方式" prop="payMethod" width="150">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="com_pay_method" :value="scope.row.payMethod" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="备注" prop="remark" show-overflow-tooltip></el-table-column>
|
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button v-has-permi="['monthCard:monthCard:edit']" link type="primary" @click="handleUpdate(scope.row)">修改</el-button>
|
|
||||||
<el-button v-has-permi="['monthCard:monthCard:remove']" link type="primary" @click="handleDelete(scope.row)">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination v-show="total > 0" v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNum" :total="total" @pagination="getList" />
|
|
||||||
</el-card>
|
|
||||||
<!-- 添加或修改月卡管理对话框 -->
|
|
||||||
<el-dialog v-model="dialog.visible" :title="dialog.title" append-to-body width="500px">
|
|
||||||
<el-form ref="monthCardFormRef" :model="form" :rules="rules" label-width="80px">
|
|
||||||
<el-form-item label="办理时间" prop="handleTime">
|
|
||||||
<el-date-picker v-model="form.handleTime" clearable placeholder="请选择办理时间" type="datetime" value-format="YYYY-MM-DD HH:mm:ss">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="持卡人姓名" prop="cardName">
|
|
||||||
<el-input v-model="form.cardName" placeholder="请输入持卡人姓名" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="手机号码" prop="phone">
|
|
||||||
<el-input v-model="form.phone" placeholder="请输入手机号码" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="绑定车牌号" prop="carNum">
|
|
||||||
<el-input v-model="form.carNum" placeholder="请输入绑定车牌号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="办理人姓名" prop="handleName">
|
|
||||||
<el-input v-model="form.handleName" placeholder="请输入办理人姓名" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="月卡编号" prop="cardCode">
|
|
||||||
<el-input v-model="form.cardCode" placeholder="请输入月卡编号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="费用/元" prop="cost">
|
|
||||||
<el-input v-model="form.cost" placeholder="请输入费用/元" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="支付方式 0微信 1支付宝 2线下缴费" prop="payMethod">
|
|
||||||
<el-input v-model="form.payMethod" placeholder="请输入支付方式 0微信 1支付宝 2线下缴费" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="开始日期" prop="startTime">
|
|
||||||
<el-date-picker v-model="form.startTime" clearable placeholder="请选择开始日期" type="datetime" value-format="YYYY-MM-DD HH:mm:ss">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="结束日期" prop="endTime">
|
|
||||||
<el-date-picker v-model="form.endTime" clearable placeholder="请选择结束日期" type="datetime" value-format="YYYY-MM-DD HH:mm:ss">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="MonthCard" setup>
|
|
||||||
import { listMonthCard, delMonthCard, addMonthCard, updateMonthCard } from '@/api/system/MonthCard';
|
|
||||||
import { MonthCardVO, MonthCardQuery, MonthCardForm } from '@/api/system/MonthCard/type';
|
|
||||||
import { checkPermi } from '@/utils/permission';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { com_pay_method } = toRefs<any>(proxy?.useDict('com_pay_method'));
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const monthCardList = ref<MonthCardVO[]>([]);
|
|
||||||
const buttonLoading = ref(false);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const ids = ref<Array<string | number>>([]);
|
|
||||||
const single = ref(true);
|
|
||||||
const multiple = ref(true);
|
|
||||||
const total = ref(0);
|
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
|
||||||
const monthCardFormRef = ref<ElFormInstance>();
|
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
|
||||||
visible: false,
|
|
||||||
title: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const initFormData: MonthCardForm = {
|
|
||||||
id: undefined,
|
|
||||||
handleTime: undefined,
|
|
||||||
cardName: undefined,
|
|
||||||
phone: undefined,
|
|
||||||
carNum: undefined,
|
|
||||||
handleName: undefined,
|
|
||||||
cardCode: undefined,
|
|
||||||
cost: undefined,
|
|
||||||
payMethod: undefined,
|
|
||||||
remark: undefined,
|
|
||||||
startTime: undefined,
|
|
||||||
endTime: undefined
|
|
||||||
};
|
|
||||||
const data = reactive<PageData<MonthCardForm, MonthCardQuery>>({
|
|
||||||
form: { ...initFormData },
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
handleTime: undefined,
|
|
||||||
cardName: undefined,
|
|
||||||
phone: undefined,
|
|
||||||
carNum: undefined,
|
|
||||||
handleName: undefined,
|
|
||||||
cardCode: undefined,
|
|
||||||
cost: undefined,
|
|
||||||
payMethod: undefined,
|
|
||||||
startTime: undefined,
|
|
||||||
endTime: undefined,
|
|
||||||
params: {}
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
id: [{ required: true, message: '月卡管理表id不能为空', trigger: 'blur' }]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
|
||||||
|
|
||||||
/** 一天对应的毫秒数 */
|
|
||||||
const ONE_DAY_MS = 1000 * 60 * 60 * 24;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 计算月卡剩余有效天数
|
|
||||||
* 规则:
|
|
||||||
* - endTime <= 当前时间 → 已过期,返回 0
|
|
||||||
* - startTime > endTime → 参数非法,返回 0
|
|
||||||
* - 同一天(如 9/2 00:00:00 ~ 9/2 23:59:59)视为 1 天
|
|
||||||
*/
|
|
||||||
function handleDiffDays(startTime: Date | string | number, endTime: Date | string | number): number {
|
|
||||||
const now = Date.now();
|
|
||||||
const start = new Date(startTime).getTime();
|
|
||||||
const end = new Date(endTime).getTime();
|
|
||||||
|
|
||||||
// 非法参数:开始时间晚于结束时间
|
|
||||||
if (start > end) return 0;
|
|
||||||
// 已过期
|
|
||||||
if (end <= now) return 0;
|
|
||||||
|
|
||||||
// 取「开始时间」和「当前时间」中较晚的那个作为计算起点
|
|
||||||
const effectiveStart = Math.max(start, now);
|
|
||||||
const diff = end - effectiveStart;
|
|
||||||
|
|
||||||
return Math.round(diff / ONE_DAY_MS);
|
|
||||||
}
|
|
||||||
/** 查询月卡管理列表 */
|
|
||||||
const getList = async () => {
|
|
||||||
loading.value = true;
|
|
||||||
listMonthCard(queryParams.value)
|
|
||||||
.then((res) => {
|
|
||||||
monthCardList.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 取消按钮 */
|
|
||||||
const cancel = () => {
|
|
||||||
reset();
|
|
||||||
dialog.visible = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 表单重置 */
|
|
||||||
const reset = () => {
|
|
||||||
form.value = { ...initFormData };
|
|
||||||
monthCardFormRef.value?.resetFields();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
const handleQuery = () => {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryFormRef.value?.resetFields();
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
|
||||||
const handleSelectionChange = (selection: MonthCardVO[]) => {
|
|
||||||
ids.value = selection.map((item) => item.id);
|
|
||||||
single.value = selection.length != 1;
|
|
||||||
multiple.value = !selection.length;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
const handleAdd = () => {
|
|
||||||
router.push({
|
|
||||||
path: '/carArea/addMonthCard'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
const handleUpdate = (row?: MonthCardVO) => {
|
|
||||||
const _id = row?.id || ids.value[0];
|
|
||||||
// reset();
|
|
||||||
router.push({
|
|
||||||
path: '/carArea/editMonthCard',
|
|
||||||
query: {
|
|
||||||
id: _id
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
const submitForm = () => {
|
|
||||||
monthCardFormRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
buttonLoading.value = true;
|
|
||||||
if (form.value.id) {
|
|
||||||
await updateMonthCard(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
} else {
|
|
||||||
await addMonthCard(form.value).finally(() => (buttonLoading.value = false));
|
|
||||||
}
|
|
||||||
proxy?.$modal.msgSuccess('操作成功');
|
|
||||||
dialog.visible = false;
|
|
||||||
await getList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
const handleDelete = async (row?: MonthCardVO) => {
|
|
||||||
const _ids = row?.id || ids.value;
|
|
||||||
await proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').finally(() => (loading.value = false));
|
|
||||||
await delMonthCard(_ids);
|
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
|
||||||
await getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.el-table {
|
|
||||||
height: calc(100% - 80px);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,172 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="ResidentMainBox p-2 w-full">
|
|
||||||
<PageHeader title="公告"></PageHeader>
|
|
||||||
<div class="ResidentMainBody">
|
|
||||||
<el-card>
|
|
||||||
<template #header>
|
|
||||||
<div class="title">基本信息</div>
|
|
||||||
</template>
|
|
||||||
<div class="addBuildingFormBody">
|
|
||||||
<div class="formbox">
|
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="公告标题" prop="noticeTitle">
|
|
||||||
<el-input v-model.trim="form.noticeTitle" maxlength="50" placeholder="请输入公告标题" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="作者" prop="author">
|
|
||||||
<el-input v-model.trim="form.author" placeholder="请输入作者" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="公告紧急程度" prop="urgencyLevel">
|
|
||||||
<el-select v-model="form.urgencyLevel" clearable placeholder="请选择公告紧急程度">
|
|
||||||
<el-option v-for="dict in com_noticepc_level" :key="dict.value" :label="dict.label" :value="Number(dict.value)" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="是否发布" prop="publishStatus">
|
|
||||||
<el-radio-group v-model="form.publishStatus">
|
|
||||||
<el-radio v-for="dict in com_publish_status" :key="dict.value" :value="Number(dict.value)">{{
|
|
||||||
dict.value === '0' ? dict.label : '发布'
|
|
||||||
}}</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col>
|
|
||||||
<el-form-item label="公告详情" prop="noticeContent">
|
|
||||||
<editor
|
|
||||||
:file-size="5"
|
|
||||||
:height="500"
|
|
||||||
:min-height="300"
|
|
||||||
:model-value="form.noticeContent"
|
|
||||||
:read-only="false"
|
|
||||||
type="url"
|
|
||||||
@update:model-value="handleContent"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
|
||||||
<el-button @click="handleBack">返回</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import editor from '@/components/Editor/index.vue';
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
|
||||||
import { addNotice, getNotice } from '@/api/system/NoticePc';
|
|
||||||
import { updateNotice } from '@/api/system/NoticePc';
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { com_publish_status, com_noticepc_level } = toRefs<any>(proxy?.useDict('com_publish_status', 'com_noticepc_level'));
|
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const router = useRouter();
|
|
||||||
const formRef = ref();
|
|
||||||
const form = ref({
|
|
||||||
'id': null,
|
|
||||||
'author': '',
|
|
||||||
'noticeTitle': '',
|
|
||||||
'urgencyLevel': 0,
|
|
||||||
'publishStatus': 1,
|
|
||||||
'noticeContent': ''
|
|
||||||
});
|
|
||||||
const rules = {
|
|
||||||
noticeTitle: [{ required: true, message: '请输入公告标题', trigger: 'blur' }],
|
|
||||||
urgencyLevel: [{ required: true, message: '请选择紧急程度', trigger: 'blur' }],
|
|
||||||
author: [{ required: true, message: '请输入作者名称', trigger: 'blur' }],
|
|
||||||
noticeContent: [{ required: true, message: '请输入公告内容', trigger: 'blur' }]
|
|
||||||
};
|
|
||||||
const userid = ref();
|
|
||||||
// ! 富文本 =============================================================================================================
|
|
||||||
function handleContent(val: string) {
|
|
||||||
form.value.noticeContent = val.trim();
|
|
||||||
}
|
|
||||||
// ! 富文本 =============================================================================================================
|
|
||||||
|
|
||||||
// ! 投诉 ====================================================================================================
|
|
||||||
function init() {
|
|
||||||
getNotice(userid.value).then((res) => {
|
|
||||||
form.value = {
|
|
||||||
...form.value,
|
|
||||||
...res.data
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (route.query.id) {
|
|
||||||
userid.value = route.query.id;
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提交
|
|
||||||
const submitForm = () => {
|
|
||||||
formRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
if (userid.value) {
|
|
||||||
updateNotice(form.value).then(() => {
|
|
||||||
ElMessage.success('编辑成功');
|
|
||||||
handleBack();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addNotice(form.value).then(() => {
|
|
||||||
ElMessage.success('添加成功');
|
|
||||||
handleBack();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// 返回
|
|
||||||
function handleBack() {
|
|
||||||
router.back();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.ResidentMainBox {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
.ResidentMainBody {
|
|
||||||
margin-top: 20px;
|
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
.formbox {
|
|
||||||
width: 1000px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
&:deep(div.el-step__head.is-process) {
|
|
||||||
& > div.el-step__line {
|
|
||||||
width: 0;
|
|
||||||
border: 1px dashed gray;
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&:deep(.el-step.is-vertical .el-step__line) {
|
|
||||||
top: 20px;
|
|
||||||
}
|
|
||||||
&:deep(div.el-step__head.is-finish) {
|
|
||||||
& > div.el-step__line {
|
|
||||||
width: 0;
|
|
||||||
border: 1px solid var(--el-color-primary);
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,220 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="p-2 h-full flex flex-col">
|
|
||||||
<Pageheader></Pageheader>
|
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
|
||||||
<el-card shadow="hover">
|
|
||||||
<el-form ref="queryFormRef" :inline="true" :model="queryParams" @submit.prevent="handleQuery">
|
|
||||||
<el-form-item label="公告标题" prop="noticeTitle">
|
|
||||||
<el-input v-model="queryParams.noticeTitle" clearable maxlength="30" placeholder="请输入公告标题" @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
|
|
||||||
<el-card class="flex-1" shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<right-toolbar
|
|
||||||
:disable-delete="multiple"
|
|
||||||
:disable-edit="single"
|
|
||||||
:show-add="checkPermi(['notice:notice:add'])"
|
|
||||||
:show-delete="checkPermi(['notice:notice:remove'])"
|
|
||||||
:show-edit="checkPermi(['notice:notice:edit'])"
|
|
||||||
@update:add="handleAdd"
|
|
||||||
@update:edit="handleUpdate()"
|
|
||||||
@update:delete="handleDelete()"
|
|
||||||
></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="noticeList" border @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column align="center" type="selection" width="55" />
|
|
||||||
<el-table-column align="center" label="公告标题" prop="noticeTitle" />
|
|
||||||
<el-table-column align="center" label="作者" prop="author" width="120" />
|
|
||||||
<el-table-column align="center" label="紧急程度" prop="urgencyLevel">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="com_noticepc_level" :value="scope.row.urgencyLevel"></dict-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="发布状态" prop="publishStatus">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="com_publish_status" :value="scope.row.publishStatus"></dict-tag>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="已读" prop="readNum">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ scope.row.readNum ?? '--' }} 人</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="未读" prop="unReadNum">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ scope.row.unReadNum ?? '--' }} 人</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<!-- <el-table-column label="发布人" align="center" prop="publishBy" />-->
|
|
||||||
<!-- <el-table-column label="发布日期" align="center" prop="publishTime" width="100">-->
|
|
||||||
<!-- <template #default="scope">-->
|
|
||||||
<!-- <span>{{ parseTime(scope.row.publishTime, '{y}-{m}-{d}') }}</span>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button v-has-permi="['notice:notice:query']" link type="primary" @click="handleMain(scope.row)">详情</el-button>
|
|
||||||
<el-button v-has-permi="['notice:notice:edit']" link type="primary" @click="handleUpdate(scope.row)">编辑</el-button>
|
|
||||||
<el-button v-has-permi="['notice:notice:remove']" link type="primary" @click="handleDelete(scope.row)">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination v-show="total > 0" v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNum" :total="total" @pagination="getList" />
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
<el-dialog v-model="MainForm.visible" title="公告详情">
|
|
||||||
<div class="w-full h-full">
|
|
||||||
<div v-html="MainForm.content"></div>
|
|
||||||
</div>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button @click="MainForm.visible = false">关闭</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="Notice" setup>
|
|
||||||
import { listNotice, delNotice } from '@/api/system/NoticePc';
|
|
||||||
import { NoticeVO, NoticeQuery, NoticeForm } from '@/api/system/NoticePc/type';
|
|
||||||
import { checkPermi } from '@/utils/permission';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { com_publish_status, com_noticepc_level } = toRefs<any>(proxy?.useDict('com_publish_status', 'com_noticepc_level'));
|
|
||||||
|
|
||||||
const noticeList = ref<NoticeVO[]>([]);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const ids = ref<Array<string | number>>([]);
|
|
||||||
const single = ref(true);
|
|
||||||
const multiple = ref(true);
|
|
||||||
const total = ref(0);
|
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
|
||||||
|
|
||||||
const initFormData: NoticeForm = {
|
|
||||||
noticeId: undefined,
|
|
||||||
noticeTitle: undefined,
|
|
||||||
noticeContent: undefined,
|
|
||||||
author: undefined,
|
|
||||||
urgencyLevel: undefined,
|
|
||||||
publishStatus: undefined,
|
|
||||||
publishBy: undefined,
|
|
||||||
publishTime: undefined
|
|
||||||
};
|
|
||||||
const data = reactive<PageData<NoticeForm, NoticeQuery>>({
|
|
||||||
form: { ...initFormData },
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
noticeTitle: undefined,
|
|
||||||
noticeContent: undefined,
|
|
||||||
author: undefined,
|
|
||||||
urgencyLevel: undefined,
|
|
||||||
publishStatus: undefined,
|
|
||||||
publishBy: undefined,
|
|
||||||
publishTime: undefined,
|
|
||||||
params: {}
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
noticeId: [{ required: true, message: '公告ID不能为空', trigger: 'blur' }],
|
|
||||||
noticeTitle: [{ required: true, message: '公告标题不能为空', trigger: 'blur' }],
|
|
||||||
urgencyLevel: [{ required: true, message: '紧急程度不能为空', trigger: 'blur' }],
|
|
||||||
publishStatus: [{ required: true, message: '发布状态不能为空', trigger: 'change' }]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams } = toRefs(data);
|
|
||||||
|
|
||||||
/** 查询公告信息列表 */
|
|
||||||
const getList = async () => {
|
|
||||||
loading.value = true;
|
|
||||||
listNotice(queryParams.value)
|
|
||||||
.then((res) => {
|
|
||||||
noticeList.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
const handleQuery = () => {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryFormRef.value?.resetFields();
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
|
||||||
const handleSelectionChange = (selection: NoticeVO[]) => {
|
|
||||||
ids.value = selection.map((item) => item.noticeId);
|
|
||||||
single.value = selection.length != 1;
|
|
||||||
multiple.value = !selection.length;
|
|
||||||
};
|
|
||||||
const router = useRouter();
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
const handleAdd = () => {
|
|
||||||
router.push({
|
|
||||||
path: '/repair/addNoticePc'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
const handleUpdate = (row?: NoticeVO) => {
|
|
||||||
const _id = row?.noticeId || ids.value[0];
|
|
||||||
router.push({
|
|
||||||
path: '/repair/editNoticePc',
|
|
||||||
query: {
|
|
||||||
id: _id
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const MainForm = ref({
|
|
||||||
visible: false,
|
|
||||||
content: ''
|
|
||||||
});
|
|
||||||
/** 详情按钮操作 */
|
|
||||||
const handleMain = (row: NoticeVO) => {
|
|
||||||
MainForm.value.visible = true;
|
|
||||||
MainForm.value.content = row.noticeContent;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
const handleDelete = async (row?: NoticeVO) => {
|
|
||||||
const _noticeIds = row?.noticeId || ids.value;
|
|
||||||
await proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').finally(() => (loading.value = false));
|
|
||||||
await delNotice(_noticeIds);
|
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
|
||||||
await getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.el-table {
|
|
||||||
height: calc(100% - 80px);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,197 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="h-full p-2 flex flex-col">
|
|
||||||
<Pageheader></Pageheader>
|
|
||||||
<div class="NotificationBody">
|
|
||||||
<ul class="lefttabs">
|
|
||||||
<li style="height: 50px"></li>
|
|
||||||
<li
|
|
||||||
:class="{
|
|
||||||
active: activeTabs === 1
|
|
||||||
}"
|
|
||||||
@click="handleClick(1)"
|
|
||||||
>
|
|
||||||
待办
|
|
||||||
<span v-if="todonum !== 0">({{ todonum }})</span>
|
|
||||||
</li>
|
|
||||||
<li
|
|
||||||
:class="{
|
|
||||||
active: activeTabs === 2
|
|
||||||
}"
|
|
||||||
@click="handleClick(2)"
|
|
||||||
>
|
|
||||||
通知
|
|
||||||
<span v-if="noticnum !== 0">({{ noticnum }})</span>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<div class="rightbody">
|
|
||||||
<div class="flex" v-if="activeTabs === 1">
|
|
||||||
<h3 class="title">
|
|
||||||
代办 <span v-if="todonum !== 0">({{ todonum }})</span>
|
|
||||||
</h3>
|
|
||||||
<el-button link type="primary">全部已读</el-button>
|
|
||||||
</div>
|
|
||||||
<div class="flex" v-else-if="activeTabs === 2">
|
|
||||||
<h3 class="title">
|
|
||||||
通知<span v-if="noticnum !== 0">({{ noticnum }})</span>
|
|
||||||
</h3>
|
|
||||||
<el-button link type="primary">清除未读</el-button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ul v-if="activeTabs === 1">
|
|
||||||
<li
|
|
||||||
v-for="(item, index) in awaitList"
|
|
||||||
:key="index"
|
|
||||||
@click="handleRead(item)"
|
|
||||||
:class="{
|
|
||||||
disable: !disable(item)
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<div class="subtitle">{{ item.title }}</div>
|
|
||||||
<div class="info">{{ item.content }},保修标题:{{ item.item }}</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<ul v-else-if="activeTabs === 2">
|
|
||||||
<li
|
|
||||||
v-for="(item, index) in novelist"
|
|
||||||
:key="index"
|
|
||||||
@click="handleRead(item)"
|
|
||||||
:class="{
|
|
||||||
disable: !disable(item)
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<div class="subtitle">报修工单通知</div>
|
|
||||||
<div class="info">您有一条新的报修工单需要处理,保修标题:下水道堵塞</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="init" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import pagination from '@/components/Pagination/index.vue';
|
|
||||||
import { getNotificationList, NotificationVo, ReadNotificationByID } from '@/api/system/Notification';
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
// 1 代办 2 通知
|
|
||||||
const activeTabs = ref(1);
|
|
||||||
const todonum = computed(() => {
|
|
||||||
return awaitList.value.filter((item) => disable(item)).length;
|
|
||||||
});
|
|
||||||
const noticnum = computed(() => {
|
|
||||||
return novelist.value.filter((item) => disable(item)).length;
|
|
||||||
});
|
|
||||||
const total = ref(0);
|
|
||||||
const queryParams = ref({
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleClick(tab: number) {
|
|
||||||
activeTabs.value = tab;
|
|
||||||
}
|
|
||||||
|
|
||||||
function disable(item) {
|
|
||||||
return item.repairIsCheck ? item.repairIsCheck === '1' : item.manageIsCheck === '1';
|
|
||||||
}
|
|
||||||
const novelist = ref([]);
|
|
||||||
const awaitList = ref<NotificationVo[]>([]);
|
|
||||||
function init() {
|
|
||||||
getNotificationList(queryParams.value).then((res) => {
|
|
||||||
awaitList.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
init();
|
|
||||||
|
|
||||||
function handleRead(row: NotificationVo) {
|
|
||||||
ReadNotificationByID([row.id]).then(() => {
|
|
||||||
init();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.NotificationBody {
|
|
||||||
margin-top: 20px;
|
|
||||||
background-color: #fff;
|
|
||||||
display: flex;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
flex: 1;
|
|
||||||
overflow: hidden;
|
|
||||||
.lefttabs {
|
|
||||||
width: 275px;
|
|
||||||
height: 100%;
|
|
||||||
border-right: 1px solid #ccc;
|
|
||||||
@media (max-width: 1500px) {
|
|
||||||
width: 150px;
|
|
||||||
}
|
|
||||||
|
|
||||||
li {
|
|
||||||
height: 50px;
|
|
||||||
line-height: 50px;
|
|
||||||
padding-left: 25px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
&:hover {
|
|
||||||
background-color: #e8f1ff;
|
|
||||||
color: #1a75ff;
|
|
||||||
}
|
|
||||||
&.active {
|
|
||||||
background-color: #e8f1ff;
|
|
||||||
color: #1a75ff;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
width: 5px;
|
|
||||||
height: 50px;
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background-color: #1a75ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.rightbody {
|
|
||||||
flex: 1;
|
|
||||||
.title {
|
|
||||||
padding: 40px;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
ul {
|
|
||||||
height: calc(100% - 250px);
|
|
||||||
overflow-y: auto;
|
|
||||||
overflow-x: hidden;
|
|
||||||
padding-right: 10px;
|
|
||||||
li {
|
|
||||||
padding: 20px 40px;
|
|
||||||
border-bottom: 1px solid #cccccc7a;
|
|
||||||
cursor: pointer;
|
|
||||||
.subtitle {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.disable {
|
|
||||||
position: relative;
|
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
left: 0;
|
|
||||||
top: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
z-index: 10;
|
|
||||||
background: rgba(255, 255, 255, 0.8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,301 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="AddBuildingBox">
|
|
||||||
<PageHeader :title="userid ? '编辑停车缴费' : '添加停车缴费'"></PageHeader>
|
|
||||||
<div class="AddBuildingBody">
|
|
||||||
<div class="title">基本信息</div>
|
|
||||||
<div class="addBuildingFormBody">
|
|
||||||
<el-form class="formBody" label-position="right" ref="formRef" :model="form" :rules="rules" label-width="130px">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="区域" prop="areaId">
|
|
||||||
<el-select @change="handleArea" v-model="form.areaId" placeholder="请选择区域" clearable>
|
|
||||||
<el-option v-for="dict in CarRealist" :key="dict.id" :label="dict.areaName" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="2"></el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="选择车位" prop="parkingId">
|
|
||||||
<el-select v-model="form.parkingId" placeholder="请选择车位">
|
|
||||||
<el-option v-for="dict in parkingList" :key="dict.id" :label="dict.parkingCode" :value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="缴费项目" prop="chargeItem">
|
|
||||||
<el-select :disabled="com_parking_charge.length > 0" v-model="form.chargeItem" placeholder="请选择缴费项目" clearable>
|
|
||||||
<el-option v-for="dict in com_parking_charge" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="2"></el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="缴费人" prop="payerName">
|
|
||||||
<el-input maxlength="15" v-model.trim="form.payerName" placeholder="请输入缴费人姓名" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="车牌号" prop="carNum">
|
|
||||||
<el-input
|
|
||||||
maxlength="15"
|
|
||||||
v-model.trim="form.carNum"
|
|
||||||
placeholder="请输入车牌号"
|
|
||||||
@input="handleInput"
|
|
||||||
style="text-transform: uppercase; letter-spacing: 2px"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="2"></el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="停车时长" prop="startTime">
|
|
||||||
<el-date-picker
|
|
||||||
:clearable="false"
|
|
||||||
range-separator="到"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
v-model="checkDate"
|
|
||||||
type="datetimerange"
|
|
||||||
placeholder="选择日期"
|
|
||||||
@change="handleDate"
|
|
||||||
format="YYYY-MM-DD HH:mm"
|
|
||||||
value-format="YYYY-MM-DD HH:mm"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="费用" prop="cost">
|
|
||||||
<el-input maxlength="8" v-model.number.trim="form.cost" placeholder="请输入费用">
|
|
||||||
<template #suffix>元</template>
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="2"></el-col>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="缴纳状态" prop="payerStatus">
|
|
||||||
<el-radio-group v-model="form.payerStatus">
|
|
||||||
<el-radio v-for="item in com_parking_payer_status" :key="item.value" :value="item.value" :label="item.label"></el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="11">
|
|
||||||
<el-form-item label="支付方式" prop="payMethod">
|
|
||||||
<el-select v-model="form.payMethod" placeholder="请选择支付方式" clearable>
|
|
||||||
<el-option v-for="dict in com_pay_method" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input maxlength="200" show-word-limit type="textarea" :rows="5" v-model.trim="form.remark" placeholder="请输入" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-form-item style="margin-top: 30px">
|
|
||||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
|
||||||
<el-button @click="cancelForm">返回</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
|
||||||
import { listArea } from '@/api/system/carArea';
|
|
||||||
import { addParkingCost, getParkingCost, updateParkingCost, getParkingCostCarAreaApi } from '@/api/system/ParkingCost';
|
|
||||||
import { validator } from '@/utils/Reg';
|
|
||||||
import { LicensePlateValidator2 } from '@/utils/Reg2';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { com_pay_method } = toRefs<any>(proxy?.useDict('com_pay_method'));
|
|
||||||
const { com_parking_charge } = toRefs<any>(proxy?.useDict('com_parking_charge'));
|
|
||||||
const { com_parking_payer_status } = toRefs<any>(proxy?.useDict('com_parking_payer_status'));
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const formRef = ref();
|
|
||||||
const form = ref({
|
|
||||||
id: null,
|
|
||||||
areaId: null, // 区域id
|
|
||||||
parkingId: '', // 车位id
|
|
||||||
chargeItem: '0', // 临时停车
|
|
||||||
payerName: '', // 缴纳人姓名
|
|
||||||
carNum: null, // 车牌号
|
|
||||||
startTime: '', // 开始时间
|
|
||||||
endTime: '', // 结束时间
|
|
||||||
cost: null, // 费用
|
|
||||||
payMethod: '', // 支付方式
|
|
||||||
payerStatus: '0', // 缴纳人状态
|
|
||||||
remark: '' // 备注 最多200个字符
|
|
||||||
});
|
|
||||||
const checkDate = ref([]);
|
|
||||||
// 改变时间日期
|
|
||||||
function handleDate() {
|
|
||||||
form.value.startTime = checkDate.value[0];
|
|
||||||
form.value.endTime = checkDate.value[1];
|
|
||||||
}
|
|
||||||
const rules = ref({
|
|
||||||
areaId: [{ required: true, message: '请选择区域', trigger: 'blur' }],
|
|
||||||
parkingId: [{ required: true, message: '请选择车位', trigger: 'blur' }],
|
|
||||||
chargeItem: [{ required: true, message: '请选择缴费项目', trigger: 'blur' }],
|
|
||||||
payerName: [
|
|
||||||
{ required: true, message: '请输入缴纳人姓名', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string) => validator(value, 'ChineseName'),
|
|
||||||
message: '请输入缴纳人姓名',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
carNum: [
|
|
||||||
{ required: true, message: '请绑定车牌号', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: string, callback: any) => {
|
|
||||||
if (!value) {
|
|
||||||
callback(new Error('请输入车牌号'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!LicensePlateValidator2.isValidPlate(value)) {
|
|
||||||
callback(new Error('请输入正确的车牌号'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
callback();
|
|
||||||
},
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
startTime: [{ required: true, message: '请选择有效日期', trigger: 'blur' }],
|
|
||||||
payMethod: [{ required: true, message: '请选择支付方式', trigger: 'blur' }],
|
|
||||||
cost: [
|
|
||||||
{ required: true, message: '请输入费用', trigger: 'blur' },
|
|
||||||
{
|
|
||||||
validator: (_: any, value: number, callback: any) => {
|
|
||||||
if (value === null || value === undefined || value === 0) {
|
|
||||||
return callback(new Error('请输入费用'));
|
|
||||||
}
|
|
||||||
return validator(value, 'money');
|
|
||||||
},
|
|
||||||
message: '请输入费用, 保留2位小数',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
const userid = ref(null);
|
|
||||||
|
|
||||||
// 区域
|
|
||||||
const CarRealist = ref([]);
|
|
||||||
// 车位
|
|
||||||
const parkingList = ref([]);
|
|
||||||
function init() {
|
|
||||||
listArea().then((res) => {
|
|
||||||
CarRealist.value = res.rows;
|
|
||||||
});
|
|
||||||
if (route.query.id) {
|
|
||||||
userid.value = route.query.id;
|
|
||||||
form.value.id = userid.value;
|
|
||||||
getParkingCost(userid.value).then((res) => {
|
|
||||||
form.value = {
|
|
||||||
...form.value,
|
|
||||||
...res.data
|
|
||||||
};
|
|
||||||
checkDate.value = [form.value.startTime, form.value.endTime];
|
|
||||||
handleArea(form.value.areaId);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
init();
|
|
||||||
|
|
||||||
// 选择区域后 动态车位
|
|
||||||
function handleArea(val: string) {
|
|
||||||
getParkingCostCarAreaApi({ areaId: val }).then((res) => {
|
|
||||||
parkingList.value = res.data;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// !== 提交 =============================================================================
|
|
||||||
// 提交
|
|
||||||
const submitForm = () => {
|
|
||||||
formRef.value?.validate(async (valid: boolean) => {
|
|
||||||
if (valid) {
|
|
||||||
if (userid.value) {
|
|
||||||
updateParkingCost(form.value).then(() => {
|
|
||||||
ElMessage.success('编辑成功');
|
|
||||||
cancelForm();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
addParkingCost(form.value).then(() => {
|
|
||||||
ElMessage.success('添加成功');
|
|
||||||
cancelForm();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
function handleInput(res: string) {
|
|
||||||
form.value.carNum = res.toUpperCase();
|
|
||||||
}
|
|
||||||
// 推出
|
|
||||||
const cancelForm = () => {
|
|
||||||
router.back();
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.AddBuildingBox {
|
|
||||||
padding: 15px;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.AddBuildingBody {
|
|
||||||
margin-top: 20px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
background-color: white;
|
|
||||||
padding: 15px;
|
|
||||||
.title {
|
|
||||||
height: 40px;
|
|
||||||
line-height: 40px;
|
|
||||||
padding-left: 20px;
|
|
||||||
background-color: rgba(255, 255, 255, 1);
|
|
||||||
color: rgba(16, 16, 16, 1);
|
|
||||||
border-bottom: 1px solid #bbbbbb;
|
|
||||||
margin-bottom: 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formBody {
|
|
||||||
width: 1050px;
|
|
||||||
margin: 0 auto;
|
|
||||||
&:deep(.el-form-item__content, .el-select, .el-input) {
|
|
||||||
width: 350px !important;
|
|
||||||
margin-right: 10px;
|
|
||||||
.el-cascader {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.el-form-item {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.el-button {
|
|
||||||
width: 80px;
|
|
||||||
height: 35px;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,219 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="p-2 h-full flex flex-col">
|
|
||||||
<pageHeader title="停车缴费管理"></pageHeader>
|
|
||||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
|
||||||
<div v-show="showSearch" class="mb-[10px]">
|
|
||||||
<el-card shadow="hover">
|
|
||||||
<el-form ref="queryFormRef" :inline="true" :model="queryParams" @submit.prevent="handleQuery">
|
|
||||||
<el-form-item label="缴费人" prop="payerName">
|
|
||||||
<el-input v-model="queryParams.payerName" clearable maxlength="12" placeholder="请输入缴费人" @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="车牌号" prop="carNum">
|
|
||||||
<el-input v-model="queryParams.carNum" clearable maxlength="8" placeholder="请输入车牌号" @keyup.enter="handleQuery" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
|
|
||||||
<el-card class="flex-1" shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<right-toolbar
|
|
||||||
:disable-delete="multiple"
|
|
||||||
:disable-edit="single"
|
|
||||||
:show-add="checkPermi(['parkingCost:parkingCost:add'])"
|
|
||||||
:show-delete="checkPermi(['parkingCost:parkingCost:remove'])"
|
|
||||||
:show-edit="checkPermi(['parkingCost:parkingCost:edit'])"
|
|
||||||
@update:add="handleAdd"
|
|
||||||
@update:edit="handleUpdate()"
|
|
||||||
@update:delete="handleDelete()"
|
|
||||||
></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="parkingCostList" border @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column align="center" type="selection" width="55" />
|
|
||||||
<el-table-column align="center" label="车位" prop="areaId">
|
|
||||||
<template #default="scope"> {{ scope.row.name }} </template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="收费项目" prop="chargeItem">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="com_parking_charge" :value="scope.row.chargeItem" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="缴纳人" prop="payerName" />
|
|
||||||
<el-table-column align="center" label="车牌号" prop="carNum" />
|
|
||||||
<el-table-column align="center" label="停车时长" width="100">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ formatTimeDiff(scope.row.startTime, scope.row.endTime) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="费用" prop="cost">
|
|
||||||
<template #default="scope"> {{ Number(scope.row.cost).toFixed(2) }}元 </template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="缴纳状态" prop="payerStatus">
|
|
||||||
<template #default="scope">
|
|
||||||
<dict-tag :options="com_parking_payer_status" :value="scope.row.payerStatus" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<!-- <el-table-column label="支付方式" align="center" prop="payMethod">-->
|
|
||||||
<!-- <template #default="scope">-->
|
|
||||||
<!-- <dict-tag v-if="scope.row.payMethod" :options="com_pay_method" :value="scope.row.payMethod" />-->
|
|
||||||
<!-- <span v-else>--</span>-->
|
|
||||||
<!-- </template>-->
|
|
||||||
<!-- </el-table-column>-->
|
|
||||||
<el-table-column align="center" label="备注" prop="remark" />
|
|
||||||
<el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button v-has-permi="['parkingCost:parkingCost:edit']" link type="primary" @click="handleUpdate(scope.row)">修改</el-button>
|
|
||||||
<el-button v-has-permi="['parkingCost:parkingCost:remove']" link type="primary" @click="handleDelete(scope.row)">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<Pagination v-show="total > 0" v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNum" :total="total" @pagination="getList" />
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" name="ParkingCost" setup>
|
|
||||||
import Pagination from '@/components/Pagination/index.vue';
|
|
||||||
import pageHeader from '@/components/Pageheader/index.vue';
|
|
||||||
import RightToolbar from '@/components/RightToolbar/index.vue';
|
|
||||||
import { listParkingCost, delParkingCost } from '@/api/system/ParkingCost';
|
|
||||||
import { ParkingCostVO, ParkingCostQuery, ParkingCostForm } from '@/api/system/ParkingCost/type';
|
|
||||||
import { checkPermi } from '@/utils/permission';
|
|
||||||
import { formatTimeDiff } from '@/utils/time';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { com_parking_charge } = toRefs<any>(proxy?.useDict('com_parking_charge'));
|
|
||||||
const { com_parking_payer_status } = toRefs<any>(proxy?.useDict('com_parking_payer_status'));
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
interface ParkingCostType extends ParkingCostVO {
|
|
||||||
areaName?: string;
|
|
||||||
parkingName?: string;
|
|
||||||
}
|
|
||||||
const parkingCostList = ref<ParkingCostType[]>([]);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const ids = ref<Array<string | number>>([]);
|
|
||||||
const single = ref(true);
|
|
||||||
const multiple = ref(true);
|
|
||||||
const total = ref(0);
|
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
|
||||||
|
|
||||||
const initFormData: ParkingCostForm = {
|
|
||||||
id: undefined,
|
|
||||||
areaId: undefined,
|
|
||||||
parkingId: undefined,
|
|
||||||
chargeItem: undefined,
|
|
||||||
payerName: undefined,
|
|
||||||
carNum: undefined,
|
|
||||||
startTime: undefined,
|
|
||||||
endTime: undefined,
|
|
||||||
cost: undefined,
|
|
||||||
payerStatus: undefined,
|
|
||||||
payMethod: undefined,
|
|
||||||
remark: undefined,
|
|
||||||
villageId: undefined
|
|
||||||
};
|
|
||||||
const data = reactive<PageData<ParkingCostForm, ParkingCostQuery>>({
|
|
||||||
form: { ...initFormData },
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
areaId: undefined,
|
|
||||||
parkingId: undefined,
|
|
||||||
chargeItem: undefined,
|
|
||||||
payerName: undefined,
|
|
||||||
carNum: undefined,
|
|
||||||
startTime: undefined,
|
|
||||||
endTime: undefined,
|
|
||||||
cost: undefined,
|
|
||||||
payerStatus: undefined,
|
|
||||||
payMethod: undefined,
|
|
||||||
params: {}
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
id: [{ required: true, message: '停车缴费表id不能为空', trigger: 'blur' }]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams } = toRefs(data);
|
|
||||||
/** 查询停车缴费管理列表 */
|
|
||||||
const getList = async () => {
|
|
||||||
loading.value = true;
|
|
||||||
// 停车缴费
|
|
||||||
listParkingCost(queryParams.value)
|
|
||||||
.then((res) => {
|
|
||||||
parkingCostList.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
const handleQuery = () => {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryFormRef.value?.resetFields();
|
|
||||||
handleQuery();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 多选框选中数据 */
|
|
||||||
const handleSelectionChange = (selection: ParkingCostVO[]) => {
|
|
||||||
ids.value = selection.map((item) => item.id);
|
|
||||||
single.value = selection.length != 1;
|
|
||||||
multiple.value = !selection.length;
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
const handleAdd = () => {
|
|
||||||
router.push({
|
|
||||||
path: '/carArea/addParkingCost'
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
const handleUpdate = (row?: ParkingCostVO) => {
|
|
||||||
const _id = row?.id || ids.value[0];
|
|
||||||
router.push({
|
|
||||||
path: '/carArea/editParkingCost',
|
|
||||||
query: {
|
|
||||||
id: _id
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
const handleDelete = async (row?: ParkingCostVO) => {
|
|
||||||
const _ids = row?.id || ids.value;
|
|
||||||
await proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').finally(() => (loading.value = false));
|
|
||||||
await delParkingCost(_ids);
|
|
||||||
proxy?.$modal.msgSuccess('删除成功');
|
|
||||||
await getList();
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getList();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.el-table {
|
|
||||||
height: calc(100% - 80px);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,350 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="p-2 h-full flex flex-col">
|
|
||||||
<PageHeader></PageHeader>
|
|
||||||
<el-card class="mt-20px" style="min-height: 80px">
|
|
||||||
<div class="flex justify-between">
|
|
||||||
<div class="tabs">
|
|
||||||
<div :class="{ 'active': activeTab == 'preview' }" class="tab-item" @click="handleTabClick('preview')">
|
|
||||||
<div class="tab-content">问卷预览</div>
|
|
||||||
</div>
|
|
||||||
<div :class="{ 'active': activeTab == 'detail' }" class="tab-item" @click="handleTabClick('detail')">
|
|
||||||
<div class="tab-content">调查详情</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="tabs">
|
|
||||||
<el-button @click="handleBack">返回</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
<div class="flex-1 mt-20px">
|
|
||||||
<el-card v-if="activeTab == 'preview'">
|
|
||||||
<div class="container_box flex-1">
|
|
||||||
<div v-loading="viewLoading" class="contentBox h-full">
|
|
||||||
<div class="detail-header">
|
|
||||||
<h2>{{ viewData.title }}</h2>
|
|
||||||
<p style="color: #666">{{ viewData.description }}</p>
|
|
||||||
</div>
|
|
||||||
<el-divider />
|
|
||||||
<div class="detail-content">
|
|
||||||
<div v-for="(q, index) in viewData.content" :key="q.cid" class="question-item">
|
|
||||||
<div class="title">
|
|
||||||
<span style="font-weight: bold">{{ index + 1 }}. {{ q.title }}</span>
|
|
||||||
<span v-if="q.required" style="color: #f56c6c; margin-left: 5px">*</span>
|
|
||||||
</div>
|
|
||||||
<div class="type-tag">
|
|
||||||
<el-tag size="small">{{ getComponentLabel(q.type) }}</el-tag>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 单选题/多选题选项展示 -->
|
|
||||||
<div v-if="q.type === 'radio' || q.type === 'checkbox'" class="options">
|
|
||||||
<div v-for="(opt, idx) in q.options" :key="idx" class="option-item">
|
|
||||||
<span :class="q.type === 'radio' ? 'radio__type' : 'checkbox__type'"></span>
|
|
||||||
<span class="option-label">{{ opt.label }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 填空题/多行文本展示 -->
|
|
||||||
<div v-else-if="q.type === 'input'" class="input-placeholder">
|
|
||||||
<el-input disabled placeholder="用户输入区域" />
|
|
||||||
</div>
|
|
||||||
<div v-else-if="q.type === 'textarea'" class="input-placeholder">
|
|
||||||
<el-input disabled placeholder="用户输入区域" type="textarea" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<el-divider />
|
|
||||||
<div>
|
|
||||||
<span>备注: {{ viewData.remark ? viewData.remark : '暂无' }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
<el-card v-else-if="activeTab == 'detail'">
|
|
||||||
<div>
|
|
||||||
<el-table :data="list" style="width: 100%">
|
|
||||||
<el-table-column type="index" />
|
|
||||||
<el-table-column label="答题人" prop="answerName" />
|
|
||||||
<el-table-column label="提交时间" prop="updateTime" />
|
|
||||||
<el-table-column label="操作" prop="options">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button link type="primary" @click="handleGetMain(scope.row.id)">查看详情</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<Pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
v-model:limit="queryParams.pageSize"
|
|
||||||
v-model:page="queryParams.pageNum"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</div>
|
|
||||||
<el-dialog v-model="dialog.visible" :title="dialog.title" append-to-body width="680px">
|
|
||||||
<el-form ref="houseRentalFormRef" :model="form.content" label-width="120px">
|
|
||||||
<div class="detail-header">
|
|
||||||
<h2>{{ viewData.title }}</h2>
|
|
||||||
<p style="color: #666">{{ viewData.description }}</p>
|
|
||||||
</div>
|
|
||||||
<el-divider />
|
|
||||||
<div class="detail-content">
|
|
||||||
<div v-for="(q, index) in form.content" :key="q.cid" class="question-item">
|
|
||||||
<div class="title">
|
|
||||||
<span style="font-weight: bold">{{ index + 1 }}. {{ q.title }}</span>
|
|
||||||
<span v-if="q.required" style="color: #f56c6c; margin-left: 5px">*</span>
|
|
||||||
</div>
|
|
||||||
<div class="type-tag">
|
|
||||||
<el-tag size="small">{{ getComponentLabel(q.type) }}</el-tag>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 单选题/多选题选项展示 -->
|
|
||||||
<div v-if="q.type === 'radio'" class="options">
|
|
||||||
<el-radio-group v-model="q.value as string">
|
|
||||||
<div>
|
|
||||||
<div v-for="(opt, idx) in q.options" :key="idx">
|
|
||||||
<el-radio :value="opt.label" disabled>{{ opt.label }}</el-radio>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-radio-group>
|
|
||||||
</div>
|
|
||||||
<div v-if="q.type === 'checkbox'" class="options">
|
|
||||||
<el-checkbox-group v-model="q.value as string[]">
|
|
||||||
<div v-for="(opt, idx) in q.options" :key="idx">
|
|
||||||
<el-checkbox :label="opt.label" :value="opt.label" disabled />
|
|
||||||
</div>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</div>
|
|
||||||
<!-- 填空题/多行文本展示 -->
|
|
||||||
<div v-else-if="q.type === 'input'" class="input-placeholder">
|
|
||||||
<el-input v-model="q.value as string" disabled placeholder="" />
|
|
||||||
</div>
|
|
||||||
<div v-else-if="q.type === 'textarea'" class="input-placeholder">
|
|
||||||
<el-input v-model="q.value as string" disabled placeholder="" type="textarea" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<el-divider />
|
|
||||||
<div>
|
|
||||||
<span>备注: {{ viewData.remark ? viewData.remark : '暂无' }}</span>
|
|
||||||
</div>
|
|
||||||
</el-form>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { getQuestionnaire, getQuestionnaireAnswer, getQuestionnaireAnswerMain } from '@/api/system/Questionnaire';
|
|
||||||
import { QuestionComponentItem } from '@/api/system/Questionnaire/type';
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
|
||||||
import QuestionnaireEdit from '@/views/system/Questionnaire/components/QuestionnaireEdit.vue';
|
|
||||||
import Pagination from '@/components/Pagination/index.vue';
|
|
||||||
import { UploadFilled } from '@element-plus/icons-vue';
|
|
||||||
const viewLoading = ref(false);
|
|
||||||
const viewData = ref({
|
|
||||||
'id': '',
|
|
||||||
'villageId': null,
|
|
||||||
'title': '',
|
|
||||||
'description': '',
|
|
||||||
'content': [] as QuestionComponentItem[],
|
|
||||||
'status': '0',
|
|
||||||
'scope': '0',
|
|
||||||
'residents': '',
|
|
||||||
'startTime': '2026-04-03 00:00:00',
|
|
||||||
'endTime': '2026-04-09 00:00:00',
|
|
||||||
'remark': ''
|
|
||||||
});
|
|
||||||
const queryParams = ref({
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10
|
|
||||||
});
|
|
||||||
const total = ref(0);
|
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const activeTab = ref<'preview' | 'detail'>('preview');
|
|
||||||
function handleTabClick(tab: 'preview' | 'detail') {
|
|
||||||
activeTab.value = tab;
|
|
||||||
if (activeTab.value === 'detail') {
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const viewid = ref(null);
|
|
||||||
// 组件库定义(用于获取类型名称)
|
|
||||||
const componentList = [
|
|
||||||
{ type: 'radio', label: '单选题' },
|
|
||||||
{ type: 'checkbox', label: '多选题' },
|
|
||||||
{ type: 'input', label: '填空题' },
|
|
||||||
{ type: 'textarea', label: '多行文本' }
|
|
||||||
];
|
|
||||||
// 辅助方法:获取组件名称
|
|
||||||
function getComponentLabel(type) {
|
|
||||||
const item = componentList.find((c) => c.type === type);
|
|
||||||
return item ? item.label : '';
|
|
||||||
}
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
if (route.query.id) {
|
|
||||||
viewid.value = route.query.id;
|
|
||||||
}
|
|
||||||
viewLoading.value = true;
|
|
||||||
getQuestionnaire(viewid.value).then((res) => {
|
|
||||||
viewData.value = {
|
|
||||||
...viewData.value,
|
|
||||||
...res.data,
|
|
||||||
content: [] as QuestionComponentItem[]
|
|
||||||
};
|
|
||||||
if (typeof res.data.content === 'string') {
|
|
||||||
viewData.value.content = JSON.parse(res.data.content) as QuestionComponentItem[];
|
|
||||||
} else {
|
|
||||||
viewData.value.content = res.data.content as QuestionComponentItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
viewLoading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
init();
|
|
||||||
const router = useRouter();
|
|
||||||
function handleBack() {
|
|
||||||
router.back();
|
|
||||||
}
|
|
||||||
|
|
||||||
const dialog = reactive<DialogOption>({
|
|
||||||
visible: false,
|
|
||||||
title: ''
|
|
||||||
});
|
|
||||||
type FormQuestionComponentItem = QuestionComponentItem & { value?: string | string[] };
|
|
||||||
const form = ref({
|
|
||||||
id: '',
|
|
||||||
questionnaireId: '',
|
|
||||||
answerContent: [] as FormQuestionComponentItem[],
|
|
||||||
answerId: '',
|
|
||||||
answerName: '',
|
|
||||||
answerStatus: '',
|
|
||||||
content: [] as FormQuestionComponentItem[]
|
|
||||||
});
|
|
||||||
const list = ref([]);
|
|
||||||
function getList() {
|
|
||||||
getQuestionnaireAnswer({
|
|
||||||
pageSize: queryParams.value.pageSize,
|
|
||||||
pageNum: queryParams.value.pageNum,
|
|
||||||
questionnaireId: viewid.value
|
|
||||||
}).then((res) => {
|
|
||||||
list.value = res.rows;
|
|
||||||
total.value = res.total;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function handleGetMain(id: string) {
|
|
||||||
getQuestionnaireAnswerMain(id).then((res) => {
|
|
||||||
form.value = res.data;
|
|
||||||
form.value.answerContent = (JSON.parse(res.data.answerContent) as QuestionComponentItem[]) ?? [];
|
|
||||||
form.value.content = (JSON.parse(res.data.content) as QuestionComponentItem[]) ?? [];
|
|
||||||
form.value.content.forEach((item) => {
|
|
||||||
const find = form.value.answerContent.find((i) => i.cid === item.cid);
|
|
||||||
if (find) {
|
|
||||||
item.value = find.value;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
dialog.visible = true;
|
|
||||||
dialog.title = '问卷调查回答详情';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.tabs {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: start;
|
|
||||||
.tab-item {
|
|
||||||
font-weight: bold;
|
|
||||||
padding: 10px 10px;
|
|
||||||
cursor: pointer;
|
|
||||||
margin-right: 10px;
|
|
||||||
letter-spacing: 3px;
|
|
||||||
font-size: 16px;
|
|
||||||
&:hover {
|
|
||||||
color: #409eff;
|
|
||||||
}
|
|
||||||
&.active {
|
|
||||||
color: #409eff;
|
|
||||||
border-bottom: 4px solid #409eff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.titlebox {
|
|
||||||
height: 50px;
|
|
||||||
line-height: 50px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
}
|
|
||||||
.container_box {
|
|
||||||
background-color: white;
|
|
||||||
font-size: 16px;
|
|
||||||
padding: 20px 20px 60px;
|
|
||||||
}
|
|
||||||
.contentBox {
|
|
||||||
width: 1200px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
.detail-header {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
|
|
||||||
h2 {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.question-item {
|
|
||||||
margin-bottom: 25px;
|
|
||||||
padding: 15px;
|
|
||||||
border-radius: 8px;
|
|
||||||
background: #fafafa;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.type-tag {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.options {
|
|
||||||
margin-top: 10px;
|
|
||||||
.option-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
color: #666;
|
|
||||||
position: relative;
|
|
||||||
.option-label {
|
|
||||||
padding-left: 20px;
|
|
||||||
}
|
|
||||||
.radio__type {
|
|
||||||
position: absolute;
|
|
||||||
top: 6px;
|
|
||||||
width: 12px;
|
|
||||||
height: 12px;
|
|
||||||
border: 1px solid #666;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
.checkbox__type {
|
|
||||||
position: absolute;
|
|
||||||
top: 6px;
|
|
||||||
width: 12px;
|
|
||||||
height: 12px;
|
|
||||||
border: 1px solid #666;
|
|
||||||
}
|
|
||||||
.el-icon {
|
|
||||||
margin-right: 8px;
|
|
||||||
color: #909399;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-placeholder {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,315 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="AddBuildingBox">
|
|
||||||
<PageHeader :title="userid ? '编辑问卷' : '添加问卷'"></PageHeader>
|
|
||||||
<div class="AddBuildingBody">
|
|
||||||
<el-form class="formBody" label-position="right" label-width="130px">
|
|
||||||
<el-card>
|
|
||||||
<template #header>
|
|
||||||
<span>基本信息</span>
|
|
||||||
</template>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="参与范围" prop="cardName">
|
|
||||||
<div class="flex flex-items-center">
|
|
||||||
<el-radio-group v-model="form.scope">
|
|
||||||
<el-radio v-for="item in com_questionnaire_scope" :key="item.value" :label="item.label" :value="item.value"></el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
<Holder v-if="form.scope === '1'" ref="HolderRef" :isMultiple="true" :userid="checkoutUses" returnvalue="id" @change="handleSelect">
|
|
||||||
<template #default>
|
|
||||||
<el-button link type="primary" @click="OpenUseTablesFun">选择业主</el-button>
|
|
||||||
</template>
|
|
||||||
</Holder>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="时间范围" required>
|
|
||||||
<el-date-picker
|
|
||||||
v-model="timeData"
|
|
||||||
:disabled-date="handleDate"
|
|
||||||
end-placeholder="结束日期时间"
|
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
placeholder="请选择问卷时间范围"
|
|
||||||
range-separator="到"
|
|
||||||
start-placeholder="开始日期时间"
|
|
||||||
style="min-width: 380px"
|
|
||||||
type="datetimerange"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
@update:model-value="handleModelDate"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="备注" prop="remark">
|
|
||||||
<el-input v-model="form.remark" :rows="5" maxlength="200" placeholder="请输入" show-word-limit type="textarea"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-card>
|
|
||||||
<el-card class="mt-20px">
|
|
||||||
<template #header>
|
|
||||||
<span>问卷题目</span>
|
|
||||||
</template>
|
|
||||||
<QuestionnaireEdit ref="questionnaireEditRef" :initial-data="editData" @cancel="handleCancel" @publish="handlePublish" @save="handleSave" />
|
|
||||||
</el-card>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import Holder from '@/components/Holder/index.vue';
|
|
||||||
import QuestionnaireEdit from './components/QuestionnaireEdit.vue';
|
|
||||||
|
|
||||||
import PageHeader from '@/components/Pageheader/index.vue';
|
|
||||||
import { QuestionComponentnaireForm } from '@/api/system/Questionnaire/type';
|
|
||||||
import { addQuestionnaire, getQuestionnaire, updateQuestionnaire } from '@/api/system/Questionnaire';
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
||||||
const { com_questionnaire_scope } = toRefs<any>(proxy?.useDict('com_questionnaire_scope'));
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
const route = useRoute();
|
|
||||||
|
|
||||||
const form = ref({
|
|
||||||
scope: '0',
|
|
||||||
residents: '',
|
|
||||||
remark: '',
|
|
||||||
startTime: '',
|
|
||||||
endTime: ''
|
|
||||||
});
|
|
||||||
const timeData = ref([]);
|
|
||||||
function handleDate(data: string) {
|
|
||||||
const date = new Date(new Date().toLocaleDateString());
|
|
||||||
return date.getTime() > new Date(data).getTime();
|
|
||||||
}
|
|
||||||
function handleModelDate(date: string) {
|
|
||||||
form.value.startTime = date[0];
|
|
||||||
form.value.endTime = date[1];
|
|
||||||
}
|
|
||||||
// ! 路由参数 --------------------------------------------------------------------------------
|
|
||||||
// 打开
|
|
||||||
const HolderRef = ref<InstanceType<typeof Holder>>();
|
|
||||||
function OpenUseTablesFun() {
|
|
||||||
HolderRef.value.open(form.value.residents.split(',').filter((item) => item));
|
|
||||||
}
|
|
||||||
// 多选
|
|
||||||
const checkoutUses = ref([]);
|
|
||||||
function handleSelect(val) {
|
|
||||||
checkoutUses.value = val;
|
|
||||||
form.value.residents = val
|
|
||||||
.map((item: string) => item)
|
|
||||||
.filter((item: string) => item)
|
|
||||||
.join(',');
|
|
||||||
}
|
|
||||||
|
|
||||||
// ! 编辑问卷 ------------------------------------------------------------------------
|
|
||||||
const questionnaireEditRef = ref<InstanceType<typeof QuestionnaireEdit>>();
|
|
||||||
const editData = ref<QuestionComponentnaireForm>(null);
|
|
||||||
|
|
||||||
// ! 路由参数 --------------------------------------------------------------------------------
|
|
||||||
const userid = ref(null);
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
if (route.query.id) {
|
|
||||||
userid.value = route.query.id;
|
|
||||||
handleEdit(userid.value);
|
|
||||||
} else {
|
|
||||||
handleAdd();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// 新增问卷
|
|
||||||
function handleAdd() {
|
|
||||||
editData.value = null;
|
|
||||||
questionnaireEditRef.value?.reset();
|
|
||||||
}
|
|
||||||
// 编辑问卷
|
|
||||||
function handleEdit(id: string | number) {
|
|
||||||
// 父组件自己调用接口获取数据
|
|
||||||
getQuestionnaire(id).then((res) => {
|
|
||||||
editData.value = res.data as QuestionComponentnaireForm;
|
|
||||||
editData.value.content = JSON.parse(res.data.content as string);
|
|
||||||
questionnaireEditRef.value?.init(res.data as QuestionComponentnaireForm);
|
|
||||||
form.value = {
|
|
||||||
scope: res.data.scope,
|
|
||||||
residents: res.data.residents,
|
|
||||||
remark: res.data.remark,
|
|
||||||
startTime: '',
|
|
||||||
endTime: ''
|
|
||||||
};
|
|
||||||
checkoutUses.value = res.data.residents
|
|
||||||
.split(',')
|
|
||||||
.filter((item) => item)
|
|
||||||
.map((item) => item);
|
|
||||||
timeData.value = [res.data.startTime, res.data.endTime];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存草稿
|
|
||||||
async function handleSave(data: QuestionComponentnaireForm) {
|
|
||||||
if (timeData.value.length <= 0) {
|
|
||||||
return ElMessage.warning('请选择问卷时间范围');
|
|
||||||
}
|
|
||||||
const list = data.content ?? [];
|
|
||||||
if (list.length <= 0) {
|
|
||||||
return ElMessage.warning('请添加问卷题目');
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
// 父组件自己调用接口提交
|
|
||||||
if (userid.value !== null) {
|
|
||||||
await updateQuestionnaire({
|
|
||||||
...data,
|
|
||||||
content: JSON.stringify(list),
|
|
||||||
status: '0', // 草稿状态
|
|
||||||
startTime: timeData.value[0],
|
|
||||||
endTime: timeData.value[1],
|
|
||||||
...form.value
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
await addQuestionnaire({
|
|
||||||
...data,
|
|
||||||
content: JSON.stringify(list),
|
|
||||||
status: '0', // 草稿状态
|
|
||||||
startTime: timeData.value[0],
|
|
||||||
endTime: timeData.value[1],
|
|
||||||
...form.value
|
|
||||||
});
|
|
||||||
}
|
|
||||||
ElMessage.success('保存成功');
|
|
||||||
handleCancel();
|
|
||||||
} catch (e) {
|
|
||||||
// 错误处理
|
|
||||||
console.log(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 发布问卷
|
|
||||||
async function handlePublish(data: QuestionComponentnaireForm) {
|
|
||||||
if (timeData.value.length <= 0) {
|
|
||||||
return ElMessage.warning('请选择问卷时间范围');
|
|
||||||
}
|
|
||||||
const list = data.content ?? [];
|
|
||||||
if (list.length <= 0) {
|
|
||||||
return ElMessage.warning('请添加问卷题目');
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
if (userid.value !== null) {
|
|
||||||
await updateQuestionnaire({
|
|
||||||
...data,
|
|
||||||
content: JSON.stringify(list),
|
|
||||||
status: '1', // 发布状态
|
|
||||||
startTime: timeData.value[0],
|
|
||||||
endTime: timeData.value[1],
|
|
||||||
...form.value
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
await addQuestionnaire({
|
|
||||||
...data,
|
|
||||||
content: JSON.stringify(list),
|
|
||||||
status: '1', // 发布状态
|
|
||||||
endTime: timeData.value[1],
|
|
||||||
startTime: timeData.value[0],
|
|
||||||
...form.value
|
|
||||||
});
|
|
||||||
}
|
|
||||||
ElMessage.success('发布成功');
|
|
||||||
handleCancel();
|
|
||||||
} catch (e) {
|
|
||||||
// 错误处理
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 取消
|
|
||||||
function handleCancel() {
|
|
||||||
// 跳转到列表页或关闭弹窗
|
|
||||||
router.push('/repair/Questionnaire');
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.AddBuildingBox {
|
|
||||||
padding: 15px;
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
.AddBuildingBody {
|
|
||||||
margin-top: 20px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.formBody {
|
|
||||||
.checkoutSideUsesBox {
|
|
||||||
margin-left: 130px;
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(5, 1fr);
|
|
||||||
gap: 10px;
|
|
||||||
li {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
height: 35px;
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 0 10px;
|
|
||||||
line-height: 35px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
background-color: #f3f9ff;
|
|
||||||
border: 1px solid #8fc0f1;
|
|
||||||
|
|
||||||
@media (max-width: 2000px) {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
@media (max-width: 1650px) {
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
|
||||||
@media (max-width: 1650px) {
|
|
||||||
font-size: 8px;
|
|
||||||
}
|
|
||||||
.el-icon {
|
|
||||||
cursor: pointer;
|
|
||||||
&:hover {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&.add {
|
|
||||||
cursor: pointer;
|
|
||||||
justify-content: center;
|
|
||||||
color: #409eff;
|
|
||||||
border: 1px dashed #409eff;
|
|
||||||
background-color: transparent;
|
|
||||||
&:hover {
|
|
||||||
background-color: #40a0ff10;
|
|
||||||
}
|
|
||||||
span {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&:deep(.el-form-item__content, .el-select, .el-input) {
|
|
||||||
width: 350px !important;
|
|
||||||
margin-right: 10px;
|
|
||||||
.el-cascader {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.el-form-item {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.el-button {
|
|
||||||
width: 100px;
|
|
||||||
height: 35px;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user