mirror of
http://183.237.82.114:10086/kilo/leaser_front.git
synced 2026-10-23 20:36:02 +00:00
feat: 设置-合同设置-(合同编号设置100% & 合同条款设置10%)
This commit is contained in:
parent
503b5968ff
commit
381c40eeb4
25 changed files with 1553 additions and 310 deletions
|
|
@ -46,7 +46,8 @@
|
||||||
"vue": "^3.2.40",
|
"vue": "^3.2.40",
|
||||||
"vue-echarts": "^6.2.3",
|
"vue-echarts": "^6.2.3",
|
||||||
"vue-i18n": "^9.2.2",
|
"vue-i18n": "^9.2.2",
|
||||||
"vue-router": "^4.0.14"
|
"vue-router": "^4.0.14",
|
||||||
|
"vuedraggable": "^4.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@arco-plugins/vite-vue": "^1.4.5",
|
"@arco-plugins/vite-vue": "^1.4.5",
|
||||||
|
|
|
||||||
18
pnpm-lock.yaml
generated
18
pnpm-lock.yaml
generated
|
|
@ -64,6 +64,9 @@ importers:
|
||||||
vue-router:
|
vue-router:
|
||||||
specifier: ^4.0.14
|
specifier: ^4.0.14
|
||||||
version: 4.5.1(vue@3.5.17(typescript@4.9.5))
|
version: 4.5.1(vue@3.5.17(typescript@4.9.5))
|
||||||
|
vuedraggable:
|
||||||
|
specifier: ^4.1.0
|
||||||
|
version: 4.1.0(vue@3.5.17(typescript@4.9.5))
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@arco-plugins/vite-vue':
|
'@arco-plugins/vite-vue':
|
||||||
specifier: ^1.4.5
|
specifier: ^1.4.5
|
||||||
|
|
@ -3834,6 +3837,9 @@ packages:
|
||||||
resolution: {integrity: sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==}
|
resolution: {integrity: sha512-/dPCrG1s3ePpWm6yBbxZq5Be1dXGLyLn9Z791chDC3NFrpkVbWGzkBwPN1knaciexFXgRJ7hzdnwZ4stHSDmjg==}
|
||||||
engines: {node: '>=4'}
|
engines: {node: '>=4'}
|
||||||
|
|
||||||
|
sortablejs@1.14.0:
|
||||||
|
resolution: {integrity: sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==}
|
||||||
|
|
||||||
sortablejs@1.15.6:
|
sortablejs@1.15.6:
|
||||||
resolution: {integrity: sha512-aNfiuwMEpfBM/CN6LY0ibyhxPfPbyFeBTYJKCvzkJ2GkUpazIt3H+QIPAMHwqQ7tMKaHz1Qj+rJJCqljnf4p3A==}
|
resolution: {integrity: sha512-aNfiuwMEpfBM/CN6LY0ibyhxPfPbyFeBTYJKCvzkJ2GkUpazIt3H+QIPAMHwqQ7tMKaHz1Qj+rJJCqljnf4p3A==}
|
||||||
|
|
||||||
|
|
@ -4400,6 +4406,11 @@ packages:
|
||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
vuedraggable@4.1.0:
|
||||||
|
resolution: {integrity: sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==}
|
||||||
|
peerDependencies:
|
||||||
|
vue: ^3.0.1
|
||||||
|
|
||||||
webpack-virtual-modules@0.6.2:
|
webpack-virtual-modules@0.6.2:
|
||||||
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
|
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
|
||||||
|
|
||||||
|
|
@ -8440,6 +8451,8 @@ snapshots:
|
||||||
dependencies:
|
dependencies:
|
||||||
is-plain-obj: 1.1.0
|
is-plain-obj: 1.1.0
|
||||||
|
|
||||||
|
sortablejs@1.14.0: {}
|
||||||
|
|
||||||
sortablejs@1.15.6: {}
|
sortablejs@1.15.6: {}
|
||||||
|
|
||||||
source-map-js@1.2.1: {}
|
source-map-js@1.2.1: {}
|
||||||
|
|
@ -9114,6 +9127,11 @@ snapshots:
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
typescript: 4.9.5
|
typescript: 4.9.5
|
||||||
|
|
||||||
|
vuedraggable@4.1.0(vue@3.5.17(typescript@4.9.5)):
|
||||||
|
dependencies:
|
||||||
|
sortablejs: 1.14.0
|
||||||
|
vue: 3.5.17(typescript@4.9.5)
|
||||||
|
|
||||||
webpack-virtual-modules@0.6.2: {}
|
webpack-virtual-modules@0.6.2: {}
|
||||||
|
|
||||||
which-boxed-primitive@1.1.1:
|
which-boxed-primitive@1.1.1:
|
||||||
|
|
|
||||||
|
|
@ -1,268 +1,38 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import type { UserPermission } from '@/types/api';
|
import {
|
||||||
|
DepartmentFormParams,
|
||||||
|
DepartmentFormRes,
|
||||||
|
DepartmentListRes,
|
||||||
|
DepartmentDetailRes,
|
||||||
|
PaginationParams,
|
||||||
|
AllUserListRes,
|
||||||
|
FormUserItem,
|
||||||
|
UserInfoRes,
|
||||||
|
DisableUserParam,
|
||||||
|
RoleListRes,
|
||||||
|
RoleFormParam,
|
||||||
|
PermissionRes,
|
||||||
|
RolePermissionRes,
|
||||||
|
SaveRolePermissionParam,
|
||||||
|
UpdateUserRoleParam,
|
||||||
|
SafeInfoRes,
|
||||||
|
SafeParams,
|
||||||
|
SettingProjectRes,
|
||||||
|
SettingProjectParam,
|
||||||
|
SettingProjectTypeListRes,
|
||||||
|
SettingProjectTypeRes,
|
||||||
|
SettingProjectProvinceRes,
|
||||||
|
DictionaryForm,
|
||||||
|
CheckProjectParam,
|
||||||
|
SettingRoomTagsRes,
|
||||||
|
SettingRoomTagRes,
|
||||||
|
SettingTenantDictionaryRes,
|
||||||
|
TenantDictionaryType,
|
||||||
|
SettingContractNumbeRes,
|
||||||
|
CreateCodeSettingParam,
|
||||||
|
} from '@/types/setting';
|
||||||
import { HttpResponse } from './interceptor';
|
import { HttpResponse } from './interceptor';
|
||||||
|
|
||||||
// ==================== 通用类型定义 ====================
|
|
||||||
export interface BaseEntity {
|
|
||||||
id: number;
|
|
||||||
createdAt: string;
|
|
||||||
updatedAt: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PaginationParams {
|
|
||||||
keyword?: string;
|
|
||||||
role_id?: number | null;
|
|
||||||
page?: number;
|
|
||||||
page_size?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface PaginationResult {
|
|
||||||
total?: number;
|
|
||||||
total_pages?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type UserStatus = 1 | 2; // 1: 启用, 2: 禁用
|
|
||||||
export type ManagerStatus = 1 | 2; // 1: 是主管, 2: 否
|
|
||||||
export type DataType = 1 | 2 | 3; // 1: 全部数据权限, 2: 自定义数据权限, 3: 仅本人数据
|
|
||||||
export type CheckedStatus = 1 | 2; // 是否选择:1是,2否
|
|
||||||
export type DeleteStatus = 0 | 1; // 是否选择:1是 0否
|
|
||||||
export type ProjectTypeChecked = 0 | 1; // 是否选择:1是 0否
|
|
||||||
export type TenantDictionaryType = 1 | 2 | 3 | 4; // 类型:1租客类型,2租客来源,3租客行业分类,4租客企业规模
|
|
||||||
|
|
||||||
// ==================== 部门相关类型 ====================
|
|
||||||
export interface DepartmentFormParams {
|
|
||||||
parent_id: number | null;
|
|
||||||
name: string;
|
|
||||||
leaderId?: number;
|
|
||||||
remark?: string;
|
|
||||||
id?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DepartmentIdData {
|
|
||||||
departmentId: number | string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DepartmentItem extends BaseEntity {
|
|
||||||
systemTenantId: number;
|
|
||||||
name: string;
|
|
||||||
parentId: number;
|
|
||||||
UserId: number;
|
|
||||||
level: number;
|
|
||||||
path: string;
|
|
||||||
remark: string;
|
|
||||||
isDelete: number;
|
|
||||||
sort: number;
|
|
||||||
children?: DepartmentItem[]; // 递归结构
|
|
||||||
isShowEditIcon?: boolean; // 是否展示编辑icon
|
|
||||||
username?: string;
|
|
||||||
parentName?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DepartmentDetailData {
|
|
||||||
department: DepartmentItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ==================== 用户相关类型 ====================
|
|
||||||
export interface UserItem {
|
|
||||||
id: number;
|
|
||||||
username: string;
|
|
||||||
realname: string;
|
|
||||||
email: string;
|
|
||||||
tel: string;
|
|
||||||
status: UserStatus;
|
|
||||||
roleId: number;
|
|
||||||
departmentId: number;
|
|
||||||
roleName: string;
|
|
||||||
deptName: string;
|
|
||||||
lastLoginTime: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FormUserItem {
|
|
||||||
username: string;
|
|
||||||
realname: string;
|
|
||||||
tel: string | number;
|
|
||||||
password: string;
|
|
||||||
repassword: string;
|
|
||||||
role_id: number | null;
|
|
||||||
department_id: number | null;
|
|
||||||
email: string;
|
|
||||||
is_manager: ManagerStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DisableUserParam {
|
|
||||||
id: number;
|
|
||||||
status: UserStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UserInfo {
|
|
||||||
user: FormUserItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface AllUserList {
|
|
||||||
page: PaginationParams & PaginationResult;
|
|
||||||
user?: UserItem[];
|
|
||||||
userList?: UserItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
// ==================== 角色相关类型 ====================
|
|
||||||
export interface RoleItem extends BaseEntity {
|
|
||||||
systemTenantId: number;
|
|
||||||
name: string;
|
|
||||||
createUserId?: number;
|
|
||||||
isDelete?: number;
|
|
||||||
remark?: string;
|
|
||||||
dataType: DataType;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RoleFormParam {
|
|
||||||
id?: number;
|
|
||||||
name: string;
|
|
||||||
remark?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RoleList {
|
|
||||||
rolesList: RoleItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UserPermissionItem {
|
|
||||||
permission: UserPermission;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface UserPermissionItemList {
|
|
||||||
permission: number[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SaveRolePermissionParam {
|
|
||||||
id: number;
|
|
||||||
children?: Array<{
|
|
||||||
id: number;
|
|
||||||
path: string;
|
|
||||||
}>;
|
|
||||||
}
|
|
||||||
export interface UpdateUserRoleParam {
|
|
||||||
role_id: number | null;
|
|
||||||
user_id: number | null;
|
|
||||||
}
|
|
||||||
// ==================== 系统设置相关类型 ====================
|
|
||||||
export type SafeDefaultPage = 1 | 2 | 3; // 默认登录页:1工作台 2项目管理 3房源剖视
|
|
||||||
export type SafeLoginTimeType = 1 | 2 | 3 | 4; // 登录状态保存时间:1:7天, 2:1天, 3:12小时, 4:1小时
|
|
||||||
export type SafeMoreLogin = 1 | 2; // 多点登录支持:1支持 2不支持
|
|
||||||
export type DefaultPriceType = 1 | 2; // 默认单价:1 元/㎡*月 , 2 元/㎡*天
|
|
||||||
export type AreaAccuracyType = 1 | 2 | 3; // 面积精度:1:两位数,2:1位数,3:整数
|
|
||||||
export type ExpireSoonType = 1 | 2 | 3; // 房源即将到期设置:1:30天,2:60天,3:90天
|
|
||||||
export type CumulativeDayType = 1 | 2 | 3 | 4; // 累计出租率天数类型:1:按本年累计天数计算(从1月1日至今),2:按 本年整年天数 计算(本年:365天),3:按 本月累计天数 计算(从本月1日至今),4:按 本月整月天数 计算(本月:31天)
|
|
||||||
|
|
||||||
export interface SafeParams {
|
|
||||||
default_url_typee: SafeDefaultPage;
|
|
||||||
login_time_type: SafeLoginTimeType;
|
|
||||||
is_more_login: SafeMoreLogin;
|
|
||||||
}
|
|
||||||
export interface SafeInfo {
|
|
||||||
id: number;
|
|
||||||
systemTenantId: number | null; // 租户id
|
|
||||||
defaultUrlType: SafeDefaultPage; // 默认登录页:1工作台 2项目管理 3房源剖视
|
|
||||||
loginTimeType: SafeLoginTimeType; // 登录状态保存时间:1:7天, 2:1天, 3:12小时, 4:1小时
|
|
||||||
isMoreLogin: SafeMoreLogin; // 多点登录支持:1支持 2不支持
|
|
||||||
createdAt?: string;
|
|
||||||
updatedAt?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SettingProjectParam {
|
|
||||||
default_price_type: DefaultPriceType;
|
|
||||||
area_accuracy_type: AreaAccuracyType;
|
|
||||||
expire_soon_type: ExpireSoonType;
|
|
||||||
rent_rate_type: number; // 出租率:1:在租面积 / 总可出租面积 * 100 = 出租率
|
|
||||||
rent_area_type: string; // 在租面积定义:1:合同起始日期,2:合同免租期,3:合同装修期,4:房源保留 (ps:1,2 以逗号隔开)
|
|
||||||
rentable_area_type: string; // 总可出租面积定义:1:房源招商,2:房源保留,3:房源已到期,4:房源下架 (ps:1,2 以逗号隔开)
|
|
||||||
cumulative_rent_rate_type: number; // 累计出租率:1:∑(在租面积 × 在租天数) / ∑(可出租面积 × 可出租天数) = 累计出租率
|
|
||||||
cumulative_day_type: CumulativeDayType;
|
|
||||||
}
|
|
||||||
export interface projectSettingInfo {
|
|
||||||
id: number;
|
|
||||||
systemTenantId: number; // 租户id
|
|
||||||
defaultPriceType: DefaultPriceType;
|
|
||||||
areaAccuracyType: AreaAccuracyType;
|
|
||||||
expireSoonType: ExpireSoonType;
|
|
||||||
rentRateType: number; // 出租率:1:在租面积 / 总可出租面积 * 100 = 出租率
|
|
||||||
rentAreaType: string; // 在租面积定义:1:合同起始日期,2:合同免租期,3:合同装修期,4:房源保留 (ps:1,2 以逗号隔开)
|
|
||||||
rentableAreaType: string; // 总可出租面积定义:1:房源招商,2:房源保留,3:房源已到期,4:房源下架 (ps:1,2 以逗号隔开)
|
|
||||||
cumulativeRentRateType: number; // 累计出租率:1:∑(在租面积 × 在租天数) / ∑(可出租面积 × 可出租天数) = 累计出租率
|
|
||||||
cumulativeDayType: CumulativeDayType;
|
|
||||||
createdAt?: string;
|
|
||||||
updatedAt?: string;
|
|
||||||
}
|
|
||||||
export interface projectTypeInfo {
|
|
||||||
id: number;
|
|
||||||
systemTenantId: number; // 租户id
|
|
||||||
name: string; // 类型名称
|
|
||||||
color: string; // 颜色
|
|
||||||
type: 1 | 2; // 1系统类型,2租户类型
|
|
||||||
createUserId: number; // 创建人id
|
|
||||||
isCheck: CheckedStatus; // 是否选择:1是,2否
|
|
||||||
isDelete?: DeleteStatus; // 是否选择:1是,0否
|
|
||||||
createdAt?: string;
|
|
||||||
updatedAt?: string;
|
|
||||||
}
|
|
||||||
export interface ProvinceItem {
|
|
||||||
id: number;
|
|
||||||
name: string; // 省份
|
|
||||||
code: string; // 编码
|
|
||||||
isCheck: 0 | 1;
|
|
||||||
}
|
|
||||||
export interface DictionaryForm {
|
|
||||||
id?: number;
|
|
||||||
name: string;
|
|
||||||
color?: string;
|
|
||||||
type?: TenantDictionaryType | null;
|
|
||||||
}
|
|
||||||
export interface CheckProjectParam {
|
|
||||||
id?: number;
|
|
||||||
is_check: ProjectTypeChecked;
|
|
||||||
type?: TenantDictionaryType;
|
|
||||||
}
|
|
||||||
export interface SettingTenantDictionaryObj {
|
|
||||||
TenantTypeList: projectTypeInfo[];
|
|
||||||
TenantSourceList: projectTypeInfo[];
|
|
||||||
TenantIndustryList: projectTypeInfo[];
|
|
||||||
TenantEnterpriseList: projectTypeInfo[];
|
|
||||||
}
|
|
||||||
|
|
||||||
// ==================== 响应类型别名 ====================
|
|
||||||
export type DepartmentFormRes = HttpResponse<DepartmentIdData>;
|
|
||||||
export type DepartmentList = DepartmentItem[];
|
|
||||||
export type DepartmentListRes = HttpResponse<{
|
|
||||||
departmentList: DepartmentItem[];
|
|
||||||
}>;
|
|
||||||
export type DepartmentDetailRes = HttpResponse<DepartmentDetailData>;
|
|
||||||
export type UserList = UserItem[];
|
|
||||||
export type UserListRes = HttpResponse<UserList>;
|
|
||||||
export type AllUserListRes = HttpResponse<AllUserList>;
|
|
||||||
export type UserInfoRes = HttpResponse<UserInfo>;
|
|
||||||
export type RoleListRes = HttpResponse<RoleList>;
|
|
||||||
export type PermissionRes = HttpResponse<UserPermissionItem>;
|
|
||||||
export type RolePermissionRes = HttpResponse<UserPermissionItemList>;
|
|
||||||
export type SafeInfoRes = HttpResponse<{ safeSetting: SafeInfo }>;
|
|
||||||
export type SettingProjectRes = HttpResponse<{
|
|
||||||
projectSetting: projectSettingInfo;
|
|
||||||
}>;
|
|
||||||
export type SettingProjectTypeListRes = HttpResponse<{
|
|
||||||
projectTypesList: projectTypeInfo[];
|
|
||||||
}>;
|
|
||||||
export type SettingProjectTypeRes = HttpResponse<{
|
|
||||||
projectType: projectTypeInfo;
|
|
||||||
}>;
|
|
||||||
export type SettingProjectProvinceRes = HttpResponse<{
|
|
||||||
list: ProvinceItem[];
|
|
||||||
}>;
|
|
||||||
export type SettingRoomTagsRes = HttpResponse<{
|
|
||||||
roomTagsList: projectTypeInfo[];
|
|
||||||
}>;
|
|
||||||
export type SettingRoomTagRes = HttpResponse<{
|
|
||||||
roomTag: projectTypeInfo;
|
|
||||||
}>;
|
|
||||||
export type SettingTenantDictionaryRes = HttpResponse<{
|
|
||||||
allList: SettingTenantDictionaryObj;
|
|
||||||
}>;
|
|
||||||
// ==================== 部门相关 API ====================
|
// ==================== 部门相关 API ====================
|
||||||
export function createDepartment(
|
export function createDepartment(
|
||||||
params: DepartmentFormParams
|
params: DepartmentFormParams
|
||||||
|
|
@ -520,3 +290,80 @@ export function getTenantDictionaryListByType(
|
||||||
): Promise<SettingRoomTagsRes> {
|
): Promise<SettingRoomTagsRes> {
|
||||||
return axios.get(`dictionary/getTenantDictionaryList?type=${type}`);
|
return axios.get(`dictionary/getTenantDictionaryList?type=${type}`);
|
||||||
}
|
}
|
||||||
|
// 合同设置-合同编号设置-全部启用列表
|
||||||
|
export function getAllCodeSettingList(): Promise<SettingContractNumbeRes> {
|
||||||
|
return axios.get(`contractSetting/getAllCodeSettingList`);
|
||||||
|
}
|
||||||
|
// 合同设置-合同编号设置-新增
|
||||||
|
export function createCodeSetting(
|
||||||
|
params: CreateCodeSettingParam
|
||||||
|
): Promise<HttpResponse> {
|
||||||
|
return axios.post(`contractSetting/createCodeSetting`, params);
|
||||||
|
}
|
||||||
|
// 合同设置-合同编号设置-编辑
|
||||||
|
export function updateCodeSetting(
|
||||||
|
params: CreateCodeSettingParam
|
||||||
|
): Promise<HttpResponse> {
|
||||||
|
return axios.post(`contractSetting/updateCodeSetting`, params);
|
||||||
|
}
|
||||||
|
// 合同设置-合同编号设置-删除
|
||||||
|
export function delCodeSetting(id: number): Promise<HttpResponse> {
|
||||||
|
return axios.get(`contractSetting/delCodeSetting?id=${id}`);
|
||||||
|
}
|
||||||
|
// 合同设置-合同编号设置-单个详情
|
||||||
|
export function getCodeSettingFromId(
|
||||||
|
id: number
|
||||||
|
): Promise<SettingContractNumbeRes> {
|
||||||
|
return axios.get(`contractSetting/getCodeSetting?id=${id}`);
|
||||||
|
}
|
||||||
|
// 合同设置-合同编号设置-启用/禁用
|
||||||
|
export function disableCodeSetting(
|
||||||
|
params: DisableUserParam
|
||||||
|
): Promise<HttpResponse> {
|
||||||
|
return axios.post(`contractSetting/disableCodeSetting`, params);
|
||||||
|
}
|
||||||
|
// 合同设置-合同编号设置-列表(带分页)
|
||||||
|
export function getCodeSettingList(
|
||||||
|
params: PaginationParams
|
||||||
|
): Promise<SettingContractNumbeRes> {
|
||||||
|
return axios.post(`contractSetting/getCodeSettingList`, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合同设置-合同条款设置-全部启用列表
|
||||||
|
export function getAllTermsSettingList(): Promise<SettingContractNumbeRes> {
|
||||||
|
return axios.get(`contractSetting/getAllTermsSettingList`);
|
||||||
|
}
|
||||||
|
// 合同设置-合同条款设置-新增
|
||||||
|
export function createTermsSetting(
|
||||||
|
params: CreateCodeSettingParam
|
||||||
|
): Promise<HttpResponse> {
|
||||||
|
return axios.post(`contractSetting/createTermsSetting`, params);
|
||||||
|
}
|
||||||
|
// 合同设置-合同条款设置-编辑
|
||||||
|
export function updateTermsSetting(
|
||||||
|
params: CreateCodeSettingParam
|
||||||
|
): Promise<HttpResponse> {
|
||||||
|
return axios.post(`contractSetting/updateTermsSetting`, params);
|
||||||
|
}
|
||||||
|
// 合同设置-合同条款设置-删除
|
||||||
|
export function delTermsSetting(id: number): Promise<HttpResponse> {
|
||||||
|
return axios.get(`contractSetting/delTermsSetting?id=${id}`);
|
||||||
|
}
|
||||||
|
// 合同设置-合同条款设置-单个详情
|
||||||
|
export function getTermsSettingFromId(
|
||||||
|
id: number
|
||||||
|
): Promise<SettingContractNumbeRes> {
|
||||||
|
return axios.get(`contractSetting/getTermsSetting?id=${id}`);
|
||||||
|
}
|
||||||
|
// 合同设置-合同条款设置-启用/禁用
|
||||||
|
export function disableTermsSetting(
|
||||||
|
params: DisableUserParam
|
||||||
|
): Promise<HttpResponse> {
|
||||||
|
return axios.post(`contractSetting/disableTermsSetting`, params);
|
||||||
|
}
|
||||||
|
// 合同设置-合同条款设置-列表(带分页)
|
||||||
|
export function getTermsSettingList(
|
||||||
|
params: PaginationParams
|
||||||
|
): Promise<SettingContractNumbeRes> {
|
||||||
|
return axios.post(`contractSetting/getTermsSettingList`, params);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import {
|
import { getDepartmentList, getDepartmentDetail } from '@/api/setting';
|
||||||
getDepartmentList,
|
import { DepartmentItem } from '@/types/setting';
|
||||||
DepartmentItem,
|
|
||||||
getDepartmentDetail,
|
|
||||||
} from '@/api/setting';
|
|
||||||
import useLoading from '@/hooks/loading';
|
|
||||||
|
|
||||||
export default function useDepartmentList(autoFetch = true) {
|
export default function useDepartmentList(autoFetch = true) {
|
||||||
const departmentListData = ref<DepartmentItem[]>([]);
|
const departmentListData = ref<DepartmentItem[]>([]);
|
||||||
|
|
|
||||||
287
src/types/setting.ts
Normal file
287
src/types/setting.ts
Normal file
|
|
@ -0,0 +1,287 @@
|
||||||
|
import type { UserPermission } from '@/types/api';
|
||||||
|
import { HttpResponse } from '@/api/interceptor';
|
||||||
|
// ==================== 通用类型定义 ====================
|
||||||
|
export interface BaseEntity {
|
||||||
|
id: number;
|
||||||
|
createdAt: string;
|
||||||
|
updatedAt: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PaginationParams {
|
||||||
|
keyword?: string;
|
||||||
|
role_id?: number | null;
|
||||||
|
page?: number;
|
||||||
|
page_size?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PaginationResult {
|
||||||
|
total?: number;
|
||||||
|
total_pages?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserStatus = 1 | 2; // 1: 启用, 2: 禁用
|
||||||
|
export type ManagerStatus = 1 | 2; // 1: 是主管, 2: 否
|
||||||
|
export type DataType = 1 | 2 | 3; // 1: 全部数据权限, 2: 自定义数据权限, 3: 仅本人数据
|
||||||
|
export type CheckedStatus = 1 | 2; // 是否选择:1是,2否
|
||||||
|
export type DeleteStatus = 0 | 1; // 是否选择:1是 0否
|
||||||
|
export type ProjectTypeChecked = 0 | 1; // 是否选择:1是 0否
|
||||||
|
export type TenantDictionaryType = 1 | 2 | 3 | 4; // 类型:1租客类型,2租客来源,3租客行业分类,4租客企业规模
|
||||||
|
export type ContractSettingStatus = 0 | 1; // 0不回收,1回收
|
||||||
|
export type delCodeRecycling = 0 | 1; // 删除合同编号回收:0不回收,1回收
|
||||||
|
export type cancelCodeRecycling = 0 | 1;
|
||||||
|
// ==================== 部门相关类型 ====================
|
||||||
|
export interface DepartmentFormParams {
|
||||||
|
parent_id: number | null;
|
||||||
|
name: string;
|
||||||
|
leaderId?: number;
|
||||||
|
remark?: string;
|
||||||
|
id?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DepartmentIdData {
|
||||||
|
departmentId: number | string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DepartmentItem extends BaseEntity {
|
||||||
|
systemTenantId: number;
|
||||||
|
name: string;
|
||||||
|
parentId: number;
|
||||||
|
UserId: number;
|
||||||
|
level: number;
|
||||||
|
path: string;
|
||||||
|
remark: string;
|
||||||
|
isDelete: number;
|
||||||
|
sort: number;
|
||||||
|
children?: DepartmentItem[]; // 递归结构
|
||||||
|
isShowEditIcon?: boolean; // 是否展示编辑icon
|
||||||
|
username?: string;
|
||||||
|
parentName?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DepartmentDetailData {
|
||||||
|
department: DepartmentItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 用户相关类型 ====================
|
||||||
|
export interface UserItem {
|
||||||
|
id: number;
|
||||||
|
username: string;
|
||||||
|
realname: string;
|
||||||
|
email: string;
|
||||||
|
tel: string;
|
||||||
|
status: UserStatus;
|
||||||
|
roleId: number;
|
||||||
|
departmentId: number;
|
||||||
|
roleName: string;
|
||||||
|
deptName: string;
|
||||||
|
lastLoginTime: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FormUserItem {
|
||||||
|
username: string;
|
||||||
|
realname: string;
|
||||||
|
tel: string | number;
|
||||||
|
password: string;
|
||||||
|
repassword: string;
|
||||||
|
role_id: number | null;
|
||||||
|
department_id: number | null;
|
||||||
|
email: string;
|
||||||
|
is_manager: ManagerStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DisableUserParam {
|
||||||
|
id: number;
|
||||||
|
status: UserStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserInfo {
|
||||||
|
user: FormUserItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AllUserList {
|
||||||
|
page: PaginationParams & PaginationResult;
|
||||||
|
user?: UserItem[];
|
||||||
|
userList?: UserItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 角色相关类型 ====================
|
||||||
|
export interface RoleItem extends BaseEntity {
|
||||||
|
systemTenantId: number;
|
||||||
|
name: string;
|
||||||
|
createUserId?: number;
|
||||||
|
isDelete?: number;
|
||||||
|
remark?: string;
|
||||||
|
dataType: DataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RoleFormParam {
|
||||||
|
id?: number;
|
||||||
|
name: string;
|
||||||
|
remark?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RoleList {
|
||||||
|
rolesList: RoleItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserPermissionItem {
|
||||||
|
permission: UserPermission;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserPermissionItemList {
|
||||||
|
permission: number[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SaveRolePermissionParam {
|
||||||
|
id: number;
|
||||||
|
children?: Array<{
|
||||||
|
id: number;
|
||||||
|
path: string;
|
||||||
|
}>;
|
||||||
|
}
|
||||||
|
export interface UpdateUserRoleParam {
|
||||||
|
role_id: number | null;
|
||||||
|
user_id: number | null;
|
||||||
|
}
|
||||||
|
// ==================== 系统设置相关类型 ====================
|
||||||
|
export type SafeDefaultPage = 1 | 2 | 3; // 默认登录页:1工作台 2项目管理 3房源剖视
|
||||||
|
export type SafeLoginTimeType = 1 | 2 | 3 | 4; // 登录状态保存时间:1:7天, 2:1天, 3:12小时, 4:1小时
|
||||||
|
export type SafeMoreLogin = 1 | 2; // 多点登录支持:1支持 2不支持
|
||||||
|
export type DefaultPriceType = 1 | 2; // 默认单价:1 元/㎡*月 , 2 元/㎡*天
|
||||||
|
export type AreaAccuracyType = 1 | 2 | 3; // 面积精度:1:两位数,2:1位数,3:整数
|
||||||
|
export type ExpireSoonType = 1 | 2 | 3; // 房源即将到期设置:1:30天,2:60天,3:90天
|
||||||
|
export type CumulativeDayType = 1 | 2 | 3 | 4; // 累计出租率天数类型:1:按本年累计天数计算(从1月1日至今),2:按 本年整年天数 计算(本年:365天),3:按 本月累计天数 计算(从本月1日至今),4:按 本月整月天数 计算(本月:31天)
|
||||||
|
|
||||||
|
export interface SafeParams {
|
||||||
|
default_url_typee: SafeDefaultPage;
|
||||||
|
login_time_type: SafeLoginTimeType;
|
||||||
|
is_more_login: SafeMoreLogin;
|
||||||
|
}
|
||||||
|
export interface SafeInfo extends BaseEntity {
|
||||||
|
systemTenantId: number | null; // 租户id
|
||||||
|
defaultUrlType: SafeDefaultPage; // 默认登录页:1工作台 2项目管理 3房源剖视
|
||||||
|
loginTimeType: SafeLoginTimeType; // 登录状态保存时间:1:7天, 2:1天, 3:12小时, 4:1小时
|
||||||
|
isMoreLogin: SafeMoreLogin; // 多点登录支持:1支持 2不支持
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SettingProjectParam {
|
||||||
|
default_price_type: DefaultPriceType;
|
||||||
|
area_accuracy_type: AreaAccuracyType;
|
||||||
|
expire_soon_type: ExpireSoonType;
|
||||||
|
rent_rate_type: number; // 出租率:1:在租面积 / 总可出租面积 * 100 = 出租率
|
||||||
|
rent_area_type: string; // 在租面积定义:1:合同起始日期,2:合同免租期,3:合同装修期,4:房源保留 (ps:1,2 以逗号隔开)
|
||||||
|
rentable_area_type: string; // 总可出租面积定义:1:房源招商,2:房源保留,3:房源已到期,4:房源下架 (ps:1,2 以逗号隔开)
|
||||||
|
cumulative_rent_rate_type: number; // 累计出租率:1:∑(在租面积 × 在租天数) / ∑(可出租面积 × 可出租天数) = 累计出租率
|
||||||
|
cumulative_day_type: CumulativeDayType;
|
||||||
|
}
|
||||||
|
export interface projectSettingInfo extends BaseEntity {
|
||||||
|
systemTenantId: number; // 租户id
|
||||||
|
defaultPriceType: DefaultPriceType;
|
||||||
|
areaAccuracyType: AreaAccuracyType;
|
||||||
|
expireSoonType: ExpireSoonType;
|
||||||
|
rentRateType: number; // 出租率:1:在租面积 / 总可出租面积 * 100 = 出租率
|
||||||
|
rentAreaType: string; // 在租面积定义:1:合同起始日期,2:合同免租期,3:合同装修期,4:房源保留 (ps:1,2 以逗号隔开)
|
||||||
|
rentableAreaType: string; // 总可出租面积定义:1:房源招商,2:房源保留,3:房源已到期,4:房源下架 (ps:1,2 以逗号隔开)
|
||||||
|
cumulativeRentRateType: number; // 累计出租率:1:∑(在租面积 × 在租天数) / ∑(可出租面积 × 可出租天数) = 累计出租率
|
||||||
|
cumulativeDayType: CumulativeDayType;
|
||||||
|
}
|
||||||
|
export interface projectTypeInfo extends BaseEntity {
|
||||||
|
systemTenantId: number; // 租户id
|
||||||
|
name: string; // 类型名称
|
||||||
|
color: string; // 颜色
|
||||||
|
type: 1 | 2; // 1系统类型,2租户类型
|
||||||
|
createUserId: number; // 创建人id
|
||||||
|
isCheck: CheckedStatus; // 是否选择:1是,2否
|
||||||
|
isDelete?: DeleteStatus; // 是否选择:1是,0否
|
||||||
|
}
|
||||||
|
export interface ProvinceItem {
|
||||||
|
id: number;
|
||||||
|
name: string; // 省份
|
||||||
|
code: string; // 编码
|
||||||
|
isCheck: 0 | 1;
|
||||||
|
}
|
||||||
|
export interface DictionaryForm {
|
||||||
|
id?: number;
|
||||||
|
name: string;
|
||||||
|
color?: string;
|
||||||
|
type?: TenantDictionaryType | null;
|
||||||
|
}
|
||||||
|
export interface CheckProjectParam {
|
||||||
|
id?: number;
|
||||||
|
is_check: ProjectTypeChecked;
|
||||||
|
type?: TenantDictionaryType;
|
||||||
|
}
|
||||||
|
export interface SettingTenantDictionaryObj {
|
||||||
|
TenantTypeList: projectTypeInfo[];
|
||||||
|
TenantSourceList: projectTypeInfo[];
|
||||||
|
TenantIndustryList: projectTypeInfo[];
|
||||||
|
TenantEnterpriseList: projectTypeInfo[];
|
||||||
|
}
|
||||||
|
export interface ContractTermInfo extends BaseEntity {
|
||||||
|
systemTenantId: number; // 系统租户id
|
||||||
|
name: string; // 编号名称
|
||||||
|
cancelCodeRecycling: ContractSettingStatus; // 作废合同编号是否回收
|
||||||
|
delCodeRecycling: ContractSettingStatus; // 删除合同编号是否回收
|
||||||
|
createUserId: number; // 创建人id
|
||||||
|
status: UserStatus; // 状态:1 启用,2 禁用
|
||||||
|
isDelete: DeleteStatus; // 是否删除:0否,1是
|
||||||
|
statusStr: string;
|
||||||
|
contractSettingStr?: string;
|
||||||
|
code?: string;
|
||||||
|
}
|
||||||
|
export interface ArrangeInfo {
|
||||||
|
type: number;
|
||||||
|
content?: string;
|
||||||
|
sort: number;
|
||||||
|
date_type?: number;
|
||||||
|
data_type?: number;
|
||||||
|
data_digit?: number | string;
|
||||||
|
}
|
||||||
|
export interface CreateCodeSettingParam {
|
||||||
|
id?: number;
|
||||||
|
name: string;
|
||||||
|
cancel_code_recycling: delCodeRecycling;
|
||||||
|
del_code_recycling: delCodeRecycling;
|
||||||
|
arrange: ArrangeInfo[];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 响应类型别名 ====================
|
||||||
|
export type DepartmentFormRes = HttpResponse<DepartmentIdData>;
|
||||||
|
export type DepartmentList = DepartmentItem[];
|
||||||
|
export type DepartmentListRes = HttpResponse<{
|
||||||
|
departmentList: DepartmentItem[];
|
||||||
|
}>;
|
||||||
|
export type DepartmentDetailRes = HttpResponse<DepartmentDetailData>;
|
||||||
|
export type UserList = UserItem[];
|
||||||
|
export type UserListRes = HttpResponse<UserList>;
|
||||||
|
export type AllUserListRes = HttpResponse<AllUserList>;
|
||||||
|
export type UserInfoRes = HttpResponse<UserInfo>;
|
||||||
|
export type RoleListRes = HttpResponse<RoleList>;
|
||||||
|
export type PermissionRes = HttpResponse<UserPermissionItem>;
|
||||||
|
export type RolePermissionRes = HttpResponse<UserPermissionItemList>;
|
||||||
|
export type SafeInfoRes = HttpResponse<{ safeSetting: SafeInfo }>;
|
||||||
|
export type SettingProjectRes = HttpResponse<{
|
||||||
|
projectSetting: projectSettingInfo;
|
||||||
|
}>;
|
||||||
|
export type SettingProjectTypeListRes = HttpResponse<{
|
||||||
|
projectTypesList: projectTypeInfo[];
|
||||||
|
}>;
|
||||||
|
export type SettingProjectTypeRes = HttpResponse<{
|
||||||
|
projectType: projectTypeInfo;
|
||||||
|
}>;
|
||||||
|
export type SettingProjectProvinceRes = HttpResponse<{
|
||||||
|
list: ProvinceItem[];
|
||||||
|
}>;
|
||||||
|
export type SettingRoomTagsRes = HttpResponse<{
|
||||||
|
roomTagsList: projectTypeInfo[];
|
||||||
|
}>;
|
||||||
|
export type SettingRoomTagRes = HttpResponse<{
|
||||||
|
roomTag: projectTypeInfo;
|
||||||
|
}>;
|
||||||
|
export type SettingTenantDictionaryRes = HttpResponse<{
|
||||||
|
allList: SettingTenantDictionaryObj;
|
||||||
|
}>;
|
||||||
|
export type SettingContractNumbeRes = HttpResponse<{
|
||||||
|
contractCodeSetting: ContractTermInfo[];
|
||||||
|
page?: PaginationParams & PaginationResult;
|
||||||
|
}>;
|
||||||
16
src/utils/caseConvert.ts
Normal file
16
src/utils/caseConvert.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
export function camelToSnake(obj) {
|
||||||
|
if (Array.isArray(obj)) {
|
||||||
|
return obj.map(camelToSnake);
|
||||||
|
}
|
||||||
|
if (obj !== null && typeof obj === 'object') {
|
||||||
|
const newObj = {};
|
||||||
|
Object.keys(obj).forEach((key) => {
|
||||||
|
const newKey = key.replace(/([A-Z])/g, '_$1').toLowerCase();
|
||||||
|
newObj[newKey] = camelToSnake(obj[key]); // 递归处理嵌套对象或数组
|
||||||
|
});
|
||||||
|
return newObj;
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {};
|
||||||
217
src/views/setting/system/contract-settings/contract-number.vue
Normal file
217
src/views/setting/system/contract-settings/contract-number.vue
Normal file
|
|
@ -0,0 +1,217 @@
|
||||||
|
<template>
|
||||||
|
<a-card title="合同编号设置">
|
||||||
|
<template #extra>
|
||||||
|
<a-button type="primary" @click="handleAddContractNumber"
|
||||||
|
><icon-plus />新增</a-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
<DataTable
|
||||||
|
:data="renderData"
|
||||||
|
:columns="projectColumn"
|
||||||
|
:loading="loading"
|
||||||
|
:total="total"
|
||||||
|
:current="current"
|
||||||
|
:page-size="pageSize"
|
||||||
|
pagination
|
||||||
|
@page-change="onPageChange"
|
||||||
|
@page-size-change="onPageSizeChange"
|
||||||
|
>
|
||||||
|
<template #realname="{ record }">
|
||||||
|
<span>{{ record.realname }}</span>
|
||||||
|
<icon-idcard v-if="record.isManager === 1" />
|
||||||
|
</template>
|
||||||
|
<template #status="{ record }">
|
||||||
|
<a-tag :color="record.status == 1 ? 'green' : 'red'">
|
||||||
|
{{ record.status == 1 ? $t('enable') : $t('disable') }}</a-tag
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
<template #operate="{ record }">
|
||||||
|
<a-space>
|
||||||
|
<a-button type="primary" @click="handleEditContractNumber(record.id)">
|
||||||
|
{{ $t('edit') }}</a-button
|
||||||
|
>
|
||||||
|
<a-popover trigger="click" position="bottom">
|
||||||
|
<a-button>{{ $t('more') }}</a-button>
|
||||||
|
<template #content>
|
||||||
|
<a-space direction="vertical">
|
||||||
|
<a-button @click="handleToggleStatus(record.id, record.status)">
|
||||||
|
{{ record.status == 1 ? $t('disable') : $t('enable') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button status="danger" @click="handleDel(record.id)">
|
||||||
|
{{ $t('delete') }}
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</a-popover>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</DataTable>
|
||||||
|
<contractNumberFormModal
|
||||||
|
v-model:visible="showModal"
|
||||||
|
:record="currentNumberInfo"
|
||||||
|
:is-edit="isEdit"
|
||||||
|
@submitted="getCodeSettingListData"
|
||||||
|
/>
|
||||||
|
</a-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, onMounted } from 'vue';
|
||||||
|
import type { TableColumnData } from '@arco-design/web-vue';
|
||||||
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
import useDataTable from '@/composables/useDataTable';
|
||||||
|
import {
|
||||||
|
getCodeSettingList,
|
||||||
|
getCodeSettingFromId,
|
||||||
|
disableCodeSetting,
|
||||||
|
delCodeSetting,
|
||||||
|
} from '@/api/setting';
|
||||||
|
import { ContractTermInfo, UserStatus } from '@/types/setting';
|
||||||
|
import { camelToSnake } from '@/utils/caseConvert';
|
||||||
|
import contractNumberFormModal from './modal/contract-number-form-modal.vue';
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: renderData,
|
||||||
|
columns: projectColumn,
|
||||||
|
loading,
|
||||||
|
total,
|
||||||
|
current,
|
||||||
|
pageSize,
|
||||||
|
setData,
|
||||||
|
setColumns,
|
||||||
|
setLoading,
|
||||||
|
setTotal,
|
||||||
|
setCurrent,
|
||||||
|
setPageSize,
|
||||||
|
} = useDataTable({
|
||||||
|
initialPage: 1,
|
||||||
|
initialPageSize: 10,
|
||||||
|
pageSizeOptions: [10, 20, 50, 100],
|
||||||
|
});
|
||||||
|
|
||||||
|
const contractNumbeList = ref<ContractTermInfo[]>([]);
|
||||||
|
const showModal = ref<boolean>(false);
|
||||||
|
const isEdit = ref<boolean>(false);
|
||||||
|
const currentNumberInfo = ref<any>(null);
|
||||||
|
// 列配置
|
||||||
|
const columns: TableColumnData[] = [
|
||||||
|
{
|
||||||
|
title: '编号名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name',
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '编号预览',
|
||||||
|
dataIndex: 'code',
|
||||||
|
key: 'code',
|
||||||
|
width: 250,
|
||||||
|
ellipsis: true,
|
||||||
|
// slotName: 'code',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建合同模板关联',
|
||||||
|
dataIndex: 'contractSettingStr',
|
||||||
|
key: 'contractSettingStr',
|
||||||
|
render: ({ record }) => record.contractSettingStr || '-',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态',
|
||||||
|
dataIndex: 'status',
|
||||||
|
key: 'status',
|
||||||
|
slotName: 'status',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'operate',
|
||||||
|
slotName: 'operate',
|
||||||
|
width: 200,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
// 获取列表数据
|
||||||
|
const getCodeSettingListData = async () => {
|
||||||
|
const params = {
|
||||||
|
page: current.value,
|
||||||
|
page_size: pageSize.value,
|
||||||
|
};
|
||||||
|
setLoading(true);
|
||||||
|
const { code, data } = await getCodeSettingList(params);
|
||||||
|
if (code === 200 && data) {
|
||||||
|
const { contractCodeSetting, page } = data;
|
||||||
|
contractNumbeList.value = Array.isArray(contractCodeSetting)
|
||||||
|
? contractCodeSetting
|
||||||
|
: [];
|
||||||
|
setData(contractNumbeList.value);
|
||||||
|
if (page?.total) setTotal(page?.total);
|
||||||
|
}
|
||||||
|
setLoading(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 分页事件处理
|
||||||
|
const onPageChange = (page: number) => {
|
||||||
|
setCurrent(page);
|
||||||
|
current.value = page;
|
||||||
|
getCodeSettingListData();
|
||||||
|
};
|
||||||
|
const onPageSizeChange = (size: number) => {
|
||||||
|
setPageSize(size);
|
||||||
|
pageSize.value = size;
|
||||||
|
getCodeSettingListData();
|
||||||
|
};
|
||||||
|
const handleToggleStatus = async (id: number, currentStatus: UserStatus) => {
|
||||||
|
try {
|
||||||
|
const status: UserStatus = currentStatus === 1 ? 2 : 1;
|
||||||
|
const param = { id, status };
|
||||||
|
const { code, message } = await disableCodeSetting(param);
|
||||||
|
if (code === 200) {
|
||||||
|
Message.success(message);
|
||||||
|
getCodeSettingListData();
|
||||||
|
} else {
|
||||||
|
Message.error(message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// 处理错误
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const handleDel = async (id: number) => {
|
||||||
|
try {
|
||||||
|
const { code, message } = await delCodeSetting(id);
|
||||||
|
if (code === 200) {
|
||||||
|
Message.success(message);
|
||||||
|
getCodeSettingListData();
|
||||||
|
} else {
|
||||||
|
Message.error(message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// 处理错误
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const getCodeSettingFromIdData = async (id: number) => {
|
||||||
|
const { code, data } = await getCodeSettingFromId(id);
|
||||||
|
if (code === 200 && data) {
|
||||||
|
const { contractCodeSetting } = data;
|
||||||
|
currentNumberInfo.value = contractCodeSetting || null;
|
||||||
|
currentNumberInfo.value.arrange = camelToSnake(
|
||||||
|
currentNumberInfo.value.arrange
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const handleAddContractNumber = () => {
|
||||||
|
currentNumberInfo.value = null;
|
||||||
|
isEdit.value = false;
|
||||||
|
showModal.value = true;
|
||||||
|
};
|
||||||
|
const handleEditContractNumber = async (id: number) => {
|
||||||
|
await getCodeSettingFromIdData(id);
|
||||||
|
isEdit.value = true;
|
||||||
|
// currentNumberInfo.value = info
|
||||||
|
showModal.value = true;
|
||||||
|
};
|
||||||
|
// 初始化数据
|
||||||
|
onMounted(() => {
|
||||||
|
setColumns(columns);
|
||||||
|
getCodeSettingListData();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
<template>
|
||||||
|
<div>123</div>
|
||||||
|
</template>
|
||||||
216
src/views/setting/system/contract-settings/contract-terms.vue
Normal file
216
src/views/setting/system/contract-settings/contract-terms.vue
Normal file
|
|
@ -0,0 +1,216 @@
|
||||||
|
<template>
|
||||||
|
<a-card title="合同条款设置">
|
||||||
|
<template #extra>
|
||||||
|
<a-button type="primary" @click="handleAddContractNumber"
|
||||||
|
><icon-plus />新增</a-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
<DataTable
|
||||||
|
:data="renderData"
|
||||||
|
:columns="projectColumn"
|
||||||
|
:loading="loading"
|
||||||
|
:total="total"
|
||||||
|
:current="current"
|
||||||
|
:page-size="pageSize"
|
||||||
|
pagination
|
||||||
|
@page-change="onPageChange"
|
||||||
|
@page-size-change="onPageSizeChange"
|
||||||
|
>
|
||||||
|
<template #realname="{ record }">
|
||||||
|
<span>{{ record.realname }}</span>
|
||||||
|
<icon-idcard v-if="record.isManager === 1" />
|
||||||
|
</template>
|
||||||
|
<template #status="{ record }">
|
||||||
|
<a-tag :color="record.status == 1 ? 'green' : 'red'">
|
||||||
|
{{ record.status == 1 ? $t('enable') : $t('disable') }}</a-tag
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
<template #operate="{ record }">
|
||||||
|
<a-space>
|
||||||
|
<a-button type="primary" @click="handleEditContractNumber(record.id)">
|
||||||
|
{{ $t('edit') }}</a-button
|
||||||
|
>
|
||||||
|
<a-popover trigger="click" position="bottom">
|
||||||
|
<a-button>{{ $t('more') }}</a-button>
|
||||||
|
<template #content>
|
||||||
|
<a-space direction="vertical">
|
||||||
|
<a-button @click="handleToggleStatus(record.id, record.status)">
|
||||||
|
{{ record.status == 1 ? $t('disable') : $t('enable') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button status="danger" @click="handleDel(record.id)">
|
||||||
|
{{ $t('delete') }}
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</a-popover>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</DataTable>
|
||||||
|
<contractNumberFormModal
|
||||||
|
v-model:visible="showModal"
|
||||||
|
:record="currentNumberInfo"
|
||||||
|
:is-edit="isEdit"
|
||||||
|
@submitted="getTermsSettingListData"
|
||||||
|
/>
|
||||||
|
</a-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, onMounted } from 'vue';
|
||||||
|
import type { TableColumnData } from '@arco-design/web-vue';
|
||||||
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
import useDataTable from '@/composables/useDataTable';
|
||||||
|
import {
|
||||||
|
getTermsSettingList,
|
||||||
|
getTermsSettingFromId,
|
||||||
|
disableTermsSetting,
|
||||||
|
delTermsSetting,
|
||||||
|
} from '@/api/setting';
|
||||||
|
import { ContractTermInfo, UserStatus } from '@/types/setting';
|
||||||
|
import { camelToSnake } from '@/utils/caseConvert';
|
||||||
|
import contractNumberFormModal from './modal/contract-terms-form-modal.vue';
|
||||||
|
|
||||||
|
const {
|
||||||
|
data: renderData,
|
||||||
|
columns: projectColumn,
|
||||||
|
loading,
|
||||||
|
total,
|
||||||
|
current,
|
||||||
|
pageSize,
|
||||||
|
setData,
|
||||||
|
setColumns,
|
||||||
|
setLoading,
|
||||||
|
setTotal,
|
||||||
|
setCurrent,
|
||||||
|
setPageSize,
|
||||||
|
} = useDataTable({
|
||||||
|
initialPage: 1,
|
||||||
|
initialPageSize: 10,
|
||||||
|
pageSizeOptions: [10, 20, 50, 100],
|
||||||
|
});
|
||||||
|
|
||||||
|
const contractNumbeList = ref<ContractTermInfo[]>([]);
|
||||||
|
const showModal = ref<boolean>(false);
|
||||||
|
const isEdit = ref<boolean>(false);
|
||||||
|
const currentNumberInfo = ref<any>(null);
|
||||||
|
// 列配置
|
||||||
|
const columns: TableColumnData[] = [
|
||||||
|
{
|
||||||
|
title: '条款名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name',
|
||||||
|
width: 120,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '条款类别',
|
||||||
|
dataIndex: 'type',
|
||||||
|
key: 'type',
|
||||||
|
// width: 250,
|
||||||
|
ellipsis: true,
|
||||||
|
render: ({ record }) => record.type || '-',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '条款项',
|
||||||
|
dataIndex: 'feeStr',
|
||||||
|
key: 'feeStr',
|
||||||
|
render: ({ record }) => record.feeStr || '-',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态',
|
||||||
|
dataIndex: 'status',
|
||||||
|
key: 'status',
|
||||||
|
slotName: 'status',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'operate',
|
||||||
|
slotName: 'operate',
|
||||||
|
width: 200,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
// 获取列表数据
|
||||||
|
const getTermsSettingListData = async () => {
|
||||||
|
const params = {
|
||||||
|
page: current.value,
|
||||||
|
page_size: pageSize.value,
|
||||||
|
};
|
||||||
|
setLoading(true);
|
||||||
|
const { code, data } = await getTermsSettingList(params);
|
||||||
|
if (code === 200 && data) {
|
||||||
|
const { contractCodeSetting, page } = data;
|
||||||
|
contractNumbeList.value = Array.isArray(contractCodeSetting)
|
||||||
|
? contractCodeSetting
|
||||||
|
: [];
|
||||||
|
setData(contractNumbeList.value);
|
||||||
|
if (page?.total) setTotal(page?.total);
|
||||||
|
}
|
||||||
|
setLoading(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 分页事件处理
|
||||||
|
const onPageChange = (page: number) => {
|
||||||
|
setCurrent(page);
|
||||||
|
current.value = page;
|
||||||
|
getTermsSettingListData();
|
||||||
|
};
|
||||||
|
const onPageSizeChange = (size: number) => {
|
||||||
|
setPageSize(size);
|
||||||
|
pageSize.value = size;
|
||||||
|
getTermsSettingListData();
|
||||||
|
};
|
||||||
|
const handleToggleStatus = async (id: number, currentStatus: UserStatus) => {
|
||||||
|
try {
|
||||||
|
const status: UserStatus = currentStatus === 1 ? 2 : 1;
|
||||||
|
const param = { id, status };
|
||||||
|
const { code, message } = await disableTermsSetting(param);
|
||||||
|
if (code === 200) {
|
||||||
|
Message.success(message);
|
||||||
|
getTermsSettingListData();
|
||||||
|
} else {
|
||||||
|
Message.error(message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// 处理错误
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const handleDel = async (id: number) => {
|
||||||
|
try {
|
||||||
|
const { code, message } = await delTermsSetting(id);
|
||||||
|
if (code === 200) {
|
||||||
|
Message.success(message);
|
||||||
|
getTermsSettingListData();
|
||||||
|
} else {
|
||||||
|
Message.error(message);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// 处理错误
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const getTermsSettingFromIdData = async (id: number) => {
|
||||||
|
const { code, data } = await getTermsSettingFromId(id);
|
||||||
|
if (code === 200 && data) {
|
||||||
|
const { contractCodeSetting } = data;
|
||||||
|
currentNumberInfo.value = contractCodeSetting || null;
|
||||||
|
currentNumberInfo.value.arrange = camelToSnake(
|
||||||
|
currentNumberInfo.value.arrange
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const handleAddContractNumber = () => {
|
||||||
|
currentNumberInfo.value = null;
|
||||||
|
isEdit.value = false;
|
||||||
|
showModal.value = true;
|
||||||
|
};
|
||||||
|
const handleEditContractNumber = async (id: number) => {
|
||||||
|
await getTermsSettingFromIdData(id);
|
||||||
|
isEdit.value = true;
|
||||||
|
// currentNumberInfo.value = info
|
||||||
|
showModal.value = true;
|
||||||
|
};
|
||||||
|
// 初始化数据
|
||||||
|
onMounted(() => {
|
||||||
|
setColumns(columns);
|
||||||
|
getTermsSettingListData();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
<template>
|
||||||
|
<div>123</div>
|
||||||
|
</template>
|
||||||
|
|
@ -1,3 +1,136 @@
|
||||||
<template>
|
<template>
|
||||||
<div> Data Dictionary </div>
|
<div class="system-setting-general">
|
||||||
|
<Breadcrumb
|
||||||
|
:items="['menu.setting', 'menu.setting.system', 'setting.contract']"
|
||||||
|
/>
|
||||||
|
<a-card class="full_height" :title="t('setting.contract')">
|
||||||
|
<a-row :gutter="12">
|
||||||
|
<a-col :span="6">
|
||||||
|
<ul class="setting_tabs_list">
|
||||||
|
<li
|
||||||
|
v-for="item in contractSettingTabs"
|
||||||
|
:key="item.id"
|
||||||
|
:class="[
|
||||||
|
'setting_tabs_item',
|
||||||
|
{ isChoose: currentSettingId === item.id },
|
||||||
|
]"
|
||||||
|
@click="chooseSettingTab(item.id)"
|
||||||
|
>
|
||||||
|
{{ item.text }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="18">
|
||||||
|
<contractNumber v-if="currentSettingId === 1" />
|
||||||
|
<contractTerms v-if="currentSettingId === 2" />
|
||||||
|
<ContractTemplate v-if="currentSettingId === 3" />
|
||||||
|
<createContractTemplate v-if="currentSettingId === 4" />
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import contractNumber from './contract-number.vue';
|
||||||
|
import contractTerms from './contract-terms.vue';
|
||||||
|
import ContractTemplate from './contract-template.vue';
|
||||||
|
import createContractTemplate from './create-contract-template.vue';
|
||||||
|
// import { } from '@/api/setting';
|
||||||
|
// import { Message } from '@arco-design/web-vue';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const currentSettingId = ref<number>(1);
|
||||||
|
const contractSettingTabs = [
|
||||||
|
{ id: 1, text: '合同编号设置' },
|
||||||
|
{ id: 2, text: '合同条款设置' },
|
||||||
|
{ id: 3, text: '合同文档模板设置' },
|
||||||
|
{ id: 4, text: '创建合同模板设置' },
|
||||||
|
];
|
||||||
|
const chooseSettingTab = (id: number) => {
|
||||||
|
if (id === currentSettingId.value) return;
|
||||||
|
currentSettingId.value = id;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.system-setting-general {
|
||||||
|
.setting_tabs_list {
|
||||||
|
border-radius: 6px;
|
||||||
|
border: 1px solid rgba(239, 239, 239, 1);
|
||||||
|
padding: 14px 0;
|
||||||
|
padding-bottom: 200px;
|
||||||
|
|
||||||
|
.setting_tabs_item {
|
||||||
|
padding: 0 20px;
|
||||||
|
height: 42px;
|
||||||
|
line-height: 42px;
|
||||||
|
color: #000;
|
||||||
|
background-color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&.isChoose {
|
||||||
|
background-color: #efefef;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.project_house_list {
|
||||||
|
.project_house_item {
|
||||||
|
margin-top: 20px;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.options {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
background-color: #f2f3f5;
|
||||||
|
width: 430px;
|
||||||
|
height: 36px;
|
||||||
|
margin-top: 10px;
|
||||||
|
padding: 0 3px;
|
||||||
|
|
||||||
|
.subItem {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
padding: 4px 0;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&.isActive {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.in_rented_area,
|
||||||
|
.cumulative_leasing_rate {
|
||||||
|
.tips {
|
||||||
|
color: rgba(187, 187, 187, 1);
|
||||||
|
font-size: 12px;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
background-color: #eaf3fe;
|
||||||
|
border-radius: 2px;
|
||||||
|
background-color: rgba(232, 243, 255, 1);
|
||||||
|
color: rgba(29, 33, 41, 1);
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: left;
|
||||||
|
border: 0px solid rgba(121, 121, 121, 1);
|
||||||
|
padding: 12px;
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title_item {
|
||||||
|
margin-top: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,323 @@
|
||||||
|
<template>
|
||||||
|
<a-drawer
|
||||||
|
:width="430"
|
||||||
|
:visible="visible"
|
||||||
|
:title="isEdit ? '编辑合同编号' : '新增合同编号'"
|
||||||
|
unmount-on-close
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
auto-label-width
|
||||||
|
layout="vertical"
|
||||||
|
>
|
||||||
|
<!-- 合同编号 -->
|
||||||
|
<a-form-item label="合同编号" field="name" required>
|
||||||
|
<a-input
|
||||||
|
v-model="form.name"
|
||||||
|
:placeholder="$t('please.enter', { placeholder: '合同编号' })"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<!-- 编号回收 -->
|
||||||
|
<a-form-item label="编号回收" field="ecycling" required>
|
||||||
|
<a-checkbox-group v-model="form.ecycling">
|
||||||
|
<a-checkbox :value="1">作废合同编号回收</a-checkbox>
|
||||||
|
<a-checkbox :value="2">删除合同编号回收</a-checkbox>
|
||||||
|
</a-checkbox-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="编号编排" field="arrange" required>
|
||||||
|
<div class="numbering">编号预览:{{ numbering }}</div>
|
||||||
|
</a-form-item>
|
||||||
|
<draggable
|
||||||
|
v-model="arrangeList"
|
||||||
|
:animation="200"
|
||||||
|
item-key="sort"
|
||||||
|
@end="handleDragEnd"
|
||||||
|
>
|
||||||
|
<template #item="{ element }">
|
||||||
|
<a-row align="center" style="margin-top: 10px">
|
||||||
|
<a-col :span="6">
|
||||||
|
<div class="arrange_left">
|
||||||
|
<icon-unordered-list :size="24" />
|
||||||
|
<p class="text">{{ getArrangeText(element.type) }}</p>
|
||||||
|
</div>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="14">
|
||||||
|
<a-input
|
||||||
|
v-if="element.type === 1"
|
||||||
|
v-model="element.content"
|
||||||
|
placeholder="请输入固定文本"
|
||||||
|
/>
|
||||||
|
<a-select
|
||||||
|
v-else-if="element.type === 2"
|
||||||
|
v-model="element.date_type"
|
||||||
|
>
|
||||||
|
<a-option
|
||||||
|
v-for="(item, index) in dateTypeOptions"
|
||||||
|
:key="index"
|
||||||
|
:value="item.type"
|
||||||
|
>
|
||||||
|
{{ item.text }}</a-option
|
||||||
|
>
|
||||||
|
</a-select>
|
||||||
|
<template v-else>
|
||||||
|
<a-select v-model="element.data_type">
|
||||||
|
<a-option
|
||||||
|
v-for="(item, index) in dataTypeOptions"
|
||||||
|
:key="index"
|
||||||
|
:value="item.type"
|
||||||
|
>
|
||||||
|
{{ item.text }}</a-option
|
||||||
|
>
|
||||||
|
</a-select>
|
||||||
|
<a-input-number
|
||||||
|
v-model="element.data_digit"
|
||||||
|
:style="{ marginTop: '10px' }"
|
||||||
|
placeholder="Please enter something"
|
||||||
|
>
|
||||||
|
<template #append>位数</template>
|
||||||
|
</a-input-number>
|
||||||
|
</template>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="4">
|
||||||
|
<icon-delete
|
||||||
|
v-if="element.type === 1"
|
||||||
|
:size="16"
|
||||||
|
style="cursor: pointer"
|
||||||
|
@click="handleDeleteText(element)"
|
||||||
|
/>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</template>
|
||||||
|
</draggable>
|
||||||
|
<a-divider />
|
||||||
|
<a-button style="width: 130px" type="outline" @click="handleAddText"
|
||||||
|
><icon-plus /> 新增固定文本</a-button
|
||||||
|
>
|
||||||
|
</a-form>
|
||||||
|
</a-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, watch, reactive, computed } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import type { FormInstance } from '@arco-design/web-vue';
|
||||||
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
import { createCodeSetting, updateCodeSetting } from '@/api/setting';
|
||||||
|
// import { CreateCodeSettingParam } from '@/types/setting'
|
||||||
|
import draggable from 'vuedraggable';
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
visible: boolean;
|
||||||
|
isEdit: boolean;
|
||||||
|
record?: any | null;
|
||||||
|
}>();
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'update:visible', val: boolean): void;
|
||||||
|
(e: 'submitted'): void;
|
||||||
|
}>();
|
||||||
|
const arrangeList = ref([
|
||||||
|
{ type: 1, content: '', sort: 1 },
|
||||||
|
{ type: 2, date_type: 1, sort: 2 },
|
||||||
|
{ type: 3, data_type: 1, data_digit: 5, sort: 3 },
|
||||||
|
]);
|
||||||
|
const dateTypeOptions = [
|
||||||
|
{ text: '年月日时分', type: 1 },
|
||||||
|
{ text: '年月日时', type: 2 },
|
||||||
|
{ text: '年月日', type: 3 },
|
||||||
|
{ text: '年月', type: 4 },
|
||||||
|
];
|
||||||
|
const dataTypeOptions = [
|
||||||
|
{ text: '每月重置计数(每月1日零点重置)', type: 1 },
|
||||||
|
{ text: '按年顺序计数', type: 2 },
|
||||||
|
{ text: '按创建合同顺序计数', type: 3 },
|
||||||
|
];
|
||||||
|
// 表单数据
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
const defaultForm: any = {
|
||||||
|
name: '',
|
||||||
|
ecycling: [1],
|
||||||
|
arrange: arrangeList.value,
|
||||||
|
};
|
||||||
|
const form = reactive<any>({ ...defaultForm });
|
||||||
|
const { t } = useI18n();
|
||||||
|
// 校验规则
|
||||||
|
const rules = reactive({
|
||||||
|
name: [{ required: true, message: '请输入合同编号' }],
|
||||||
|
ecycling: [{ required: true, message: '请选择编号回收规则' }],
|
||||||
|
arrange: [{ required: true, message: '请选择编号回收规则' }],
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
if (props.isEdit && props.record) {
|
||||||
|
Object.assign(form, { ...props.record, ecycling: [] });
|
||||||
|
if (props.record.cancelCodeRecycling === 1) form.ecycling.push(1);
|
||||||
|
if (props.record.delCodeRecycling === 1) form.ecycling.push(2);
|
||||||
|
arrangeList.value = (props.record.arrange || []).map(
|
||||||
|
(item, index) => ({
|
||||||
|
...item,
|
||||||
|
sort: index + 1,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
arrangeList.value = [
|
||||||
|
{ type: 1, content: '', sort: 1 },
|
||||||
|
{ type: 2, date_type: 1, sort: 2 },
|
||||||
|
{ type: 3, data_type: 1, data_digit: 5, sort: 3 },
|
||||||
|
];
|
||||||
|
Object.assign(form, defaultForm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
// 生成日期字符串
|
||||||
|
function getDateStr(type) {
|
||||||
|
const now = new Date();
|
||||||
|
const pad = (n) => n.toString().padStart(2, '0');
|
||||||
|
|
||||||
|
const year = now.getFullYear();
|
||||||
|
const month = pad(now.getMonth() + 1);
|
||||||
|
const day = pad(now.getDate());
|
||||||
|
const hour = pad(now.getHours());
|
||||||
|
const minute = pad(now.getMinutes());
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case 1:
|
||||||
|
return `${year}${month}${day}${hour}${minute}`;
|
||||||
|
case 2:
|
||||||
|
return `${year}${month}${day}${hour}`;
|
||||||
|
case 3:
|
||||||
|
return `${year}${month}${day}`;
|
||||||
|
case 4:
|
||||||
|
return `${year}${month}`;
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const numbering = computed(() => {
|
||||||
|
const parts: string[] = [];
|
||||||
|
arrangeList.value.forEach((item) => {
|
||||||
|
if (item.type === 1) {
|
||||||
|
parts.push(item.content || '');
|
||||||
|
} else if (item.type === 2) {
|
||||||
|
parts.push(getDateStr(item.date_type));
|
||||||
|
} else if (item.type === 3) {
|
||||||
|
const digit = item.data_digit ? item.data_digit : 1;
|
||||||
|
parts.push('1'.padStart(digit, '0'));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return parts.filter(Boolean).join('-');
|
||||||
|
});
|
||||||
|
const getArrangeText = (type: number) => {
|
||||||
|
const textMap = { 1: '固定文本', 2: '日期', 3: '流水号' };
|
||||||
|
return type ? textMap[type] : '固定文本';
|
||||||
|
};
|
||||||
|
const handleAddText = () => {
|
||||||
|
const maxSort = Math.max(...arrangeList.value.map((i) => i.sort || 0));
|
||||||
|
arrangeList.value.push({
|
||||||
|
type: 1,
|
||||||
|
content: '',
|
||||||
|
sort: maxSort + 1,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const handleDeleteText = (targetItem) => {
|
||||||
|
const index = arrangeList.value.findIndex((item) => item === targetItem);
|
||||||
|
if (index !== -1) {
|
||||||
|
arrangeList.value.splice(index, 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const handleDragEnd = () => {
|
||||||
|
// 更新 sort 字段
|
||||||
|
arrangeList.value.forEach((item, index) => {
|
||||||
|
item.sort = index + 1;
|
||||||
|
});
|
||||||
|
// 同步到 form.arrange
|
||||||
|
form.arrange = JSON.parse(JSON.stringify(arrangeList.value));
|
||||||
|
};
|
||||||
|
const handleOk = async () => {
|
||||||
|
try {
|
||||||
|
const valid = await formRef.value.validate();
|
||||||
|
if (valid) return;
|
||||||
|
// 同步编号排序
|
||||||
|
form.arrange = arrangeList.value.map((item, index) => ({
|
||||||
|
...item,
|
||||||
|
sort: index + 1,
|
||||||
|
}));
|
||||||
|
const params = {
|
||||||
|
...form,
|
||||||
|
cancel_code_recycling: form.ecycling.includes(1) ? 1 : 0,
|
||||||
|
del_code_recycling: form.ecycling.includes(2) ? 1 : 0,
|
||||||
|
};
|
||||||
|
delete params.ecycling;
|
||||||
|
console.log('提交参数:', params);
|
||||||
|
const res = props?.isEdit
|
||||||
|
? await updateCodeSetting(params)
|
||||||
|
: await createCodeSetting(params);
|
||||||
|
if (res?.code === 200) {
|
||||||
|
Message.success(res?.message);
|
||||||
|
emit('submitted');
|
||||||
|
emit('update:visible', false);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
// 捕获异常,暂不处理
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCancel = () => {
|
||||||
|
emit('update:visible', false);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
:deep(label.arco-form-item-label) {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label_wrap {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.required {
|
||||||
|
color: #f53f3f;
|
||||||
|
margin-right: 4px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.numbering {
|
||||||
|
background-color: #eaf3fe;
|
||||||
|
padding: 5px 10px;
|
||||||
|
width: 100%;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.arrange_left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
margin-left: 7px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,196 @@
|
||||||
|
<template>
|
||||||
|
<a-drawer
|
||||||
|
:width="430"
|
||||||
|
:visible="visible"
|
||||||
|
:title="isEdit ? '编辑条款设置' : '编辑条款设置'"
|
||||||
|
unmount-on-close
|
||||||
|
@ok="handleOk"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
auto-label-width
|
||||||
|
layout="vertical"
|
||||||
|
>
|
||||||
|
<!-- 条款名称 -->
|
||||||
|
<a-form-item label="条款名称" field="name" required>
|
||||||
|
<a-input
|
||||||
|
v-model="form.name"
|
||||||
|
:max-length="20"
|
||||||
|
show-word-limit
|
||||||
|
:placeholder="$t('please.enter', { placeholder: '条款名称' })"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<!-- 条款类别 -->
|
||||||
|
<a-form-item label="条款类别" field="type" required>
|
||||||
|
<a-select v-model="form.type">
|
||||||
|
<a-option
|
||||||
|
v-for="item in termsType"
|
||||||
|
:key="item.type"
|
||||||
|
:value="item.type"
|
||||||
|
>{{ item.text }}</a-option
|
||||||
|
>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
<!-- 条款项配置 -->
|
||||||
|
<a-form-item label="条款项配置" required> </a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</a-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, watch, reactive } from 'vue';
|
||||||
|
import { useI18n } from 'vue-i18n';
|
||||||
|
import type { FormInstance } from '@arco-design/web-vue';
|
||||||
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
import { createCodeSetting, updateCodeSetting } from '@/api/setting';
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
visible: boolean;
|
||||||
|
isEdit: boolean;
|
||||||
|
record?: any | null;
|
||||||
|
}>();
|
||||||
|
const termsType = [
|
||||||
|
{ text: '租赁类', type: 1 },
|
||||||
|
{ text: '物业类', type: 2 },
|
||||||
|
{ text: '特殊类', type: 3 },
|
||||||
|
{ text: '其他类', type: 4 },
|
||||||
|
];
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'update:visible', val: boolean): void;
|
||||||
|
(e: 'submitted'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const formRef = ref<FormInstance>();
|
||||||
|
const defaultForm: any = {
|
||||||
|
name: '',
|
||||||
|
type: 1,
|
||||||
|
};
|
||||||
|
const form = reactive<any>({ ...defaultForm });
|
||||||
|
const { t } = useI18n();
|
||||||
|
// 校验规则
|
||||||
|
const rules = reactive({
|
||||||
|
name: [{ required: true, message: '请输入合同编号' }],
|
||||||
|
type: [{ required: true, message: '请选择编号回收规则' }],
|
||||||
|
});
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
if (props.isEdit && props.record) {
|
||||||
|
Object.assign(form, { ...props.record, ecycling: [] });
|
||||||
|
if (props.record.cancelCodeRecycling === 1) form.ecycling.push(1);
|
||||||
|
if (props.record.delCodeRecycling === 1) form.ecycling.push(2);
|
||||||
|
} else {
|
||||||
|
Object.assign(form, defaultForm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
// 生成日期字符串
|
||||||
|
function getDateStr(type) {
|
||||||
|
const now = new Date();
|
||||||
|
const pad = (n) => n.toString().padStart(2, '0');
|
||||||
|
|
||||||
|
const year = now.getFullYear();
|
||||||
|
const month = pad(now.getMonth() + 1);
|
||||||
|
const day = pad(now.getDate());
|
||||||
|
const hour = pad(now.getHours());
|
||||||
|
const minute = pad(now.getMinutes());
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case 1:
|
||||||
|
return `${year}${month}${day}${hour}${minute}`;
|
||||||
|
case 2:
|
||||||
|
return `${year}${month}${day}${hour}`;
|
||||||
|
case 3:
|
||||||
|
return `${year}${month}${day}`;
|
||||||
|
case 4:
|
||||||
|
return `${year}${month}`;
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleOk = async () => {
|
||||||
|
try {
|
||||||
|
const valid = await formRef.value.validate();
|
||||||
|
if (valid) return;
|
||||||
|
// 同步编号排序
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
...form,
|
||||||
|
cancel_code_recycling: form.ecycling.includes(1) ? 1 : 0,
|
||||||
|
del_code_recycling: form.ecycling.includes(2) ? 1 : 0,
|
||||||
|
};
|
||||||
|
delete params.ecycling;
|
||||||
|
console.log('提交参数:', params);
|
||||||
|
const res = props?.isEdit
|
||||||
|
? await updateCodeSetting(params)
|
||||||
|
: await createCodeSetting(params);
|
||||||
|
if (res?.code === 200) {
|
||||||
|
Message.success(res?.message);
|
||||||
|
emit('submitted');
|
||||||
|
emit('update:visible', false);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
// 捕获异常,暂不处理
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCancel = () => {
|
||||||
|
emit('update:visible', false);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
:deep(label.arco-form-item-label) {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label_wrap {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.required {
|
||||||
|
color: #f53f3f;
|
||||||
|
margin-right: 4px;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.numbering {
|
||||||
|
background-color: #eaf3fe;
|
||||||
|
padding: 5px 10px;
|
||||||
|
width: 100%;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.arrange_left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
margin-left: 7px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import type { FormInstance } from '@arco-design/web-vue';
|
import type { FormInstance } from '@arco-design/web-vue';
|
||||||
import { DictionaryForm, TenantDictionaryType } from '@/api/setting';
|
import { DictionaryForm, TenantDictionaryType } from '@/types/setting';
|
||||||
import { HttpResponse } from '@/api/interceptor';
|
import { HttpResponse } from '@/api/interceptor';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,18 +96,20 @@
|
||||||
// getProjectTypeById
|
// getProjectTypeById
|
||||||
import {
|
import {
|
||||||
getAllProjectTypeList,
|
getAllProjectTypeList,
|
||||||
projectTypeInfo,
|
|
||||||
getProvinceList,
|
getProvinceList,
|
||||||
ProvinceItem,
|
|
||||||
checkProjectType,
|
checkProjectType,
|
||||||
checkAllProjectType,
|
checkAllProjectType,
|
||||||
ProjectTypeChecked,
|
|
||||||
checkAllProvince,
|
checkAllProvince,
|
||||||
checkProvince,
|
checkProvince,
|
||||||
createProjectType,
|
createProjectType,
|
||||||
updateProjectType,
|
updateProjectType,
|
||||||
delProjectType,
|
delProjectType,
|
||||||
} from '@/api/setting';
|
} from '@/api/setting';
|
||||||
|
import {
|
||||||
|
projectTypeInfo,
|
||||||
|
ProvinceItem,
|
||||||
|
ProjectTypeChecked,
|
||||||
|
} from '@/types/setting';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import labelFormModal from './label-form-modal.vue';
|
import labelFormModal from './label-form-modal.vue';
|
||||||
|
|
|
||||||
|
|
@ -66,14 +66,13 @@
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import {
|
import {
|
||||||
getRoomTagList,
|
getRoomTagList,
|
||||||
projectTypeInfo,
|
|
||||||
checkRoomTag,
|
checkRoomTag,
|
||||||
checkAllRoomTag,
|
checkAllRoomTag,
|
||||||
ProjectTypeChecked,
|
|
||||||
createRoomTag,
|
createRoomTag,
|
||||||
updateRoomTag,
|
updateRoomTag,
|
||||||
delRoomTag,
|
delRoomTag,
|
||||||
} from '@/api/setting';
|
} from '@/api/setting';
|
||||||
|
import { projectTypeInfo, ProjectTypeChecked } from '@/types/setting';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import labelFormModal from './label-form-modal.vue';
|
import labelFormModal from './label-form-modal.vue';
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,8 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import { getSafeSettingInfo, SafeInfo, saveSafeSetting } from '@/api/setting';
|
import { getSafeSettingInfo, saveSafeSetting } from '@/api/setting';
|
||||||
|
import { SafeInfo } from '@/types/setting';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import { generalList, safeSettingList } from './contrant';
|
import { generalList, safeSettingList } from './contrant';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,12 +67,8 @@
|
||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import type { FormInstance } from '@arco-design/web-vue';
|
import type { FormInstance } from '@arco-design/web-vue';
|
||||||
import {
|
import { createDepartment, updateDepartment } from '@/api/setting';
|
||||||
createDepartment,
|
import { DepartmentItem, UserList } from '@/types/setting';
|
||||||
updateDepartment,
|
|
||||||
DepartmentItem,
|
|
||||||
UserList,
|
|
||||||
} from '@/api/setting';
|
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
// Props & Emits
|
// Props & Emits
|
||||||
// interface LeaderOption {
|
// interface LeaderOption {
|
||||||
|
|
|
||||||
|
|
@ -102,13 +102,12 @@
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import useDepartmentList from '@/composables/useDepartmentList';
|
import useDepartmentList from '@/composables/useDepartmentList';
|
||||||
import {
|
import {
|
||||||
DepartmentItem,
|
|
||||||
getAllUserList,
|
getAllUserList,
|
||||||
UserList,
|
|
||||||
departmentSetUp,
|
departmentSetUp,
|
||||||
departmentSetDown,
|
departmentSetDown,
|
||||||
delDepartment,
|
delDepartment,
|
||||||
} from '@/api/setting';
|
} from '@/api/setting';
|
||||||
|
import { DepartmentItem, UserList } from '@/types/setting';
|
||||||
import { debounce } from '@/utils';
|
import { debounce } from '@/utils';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import departmentFormModal from './components/department-form-modal.vue';
|
import departmentFormModal from './components/department-form-modal.vue';
|
||||||
|
|
|
||||||
|
|
@ -107,11 +107,8 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted, computed } from 'vue';
|
import { ref, onMounted, computed } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import {
|
import { getProjectSetting, saveProjectSetting } from '@/api/setting';
|
||||||
getProjectSetting,
|
import { projectSettingInfo } from '@/types/setting';
|
||||||
projectSettingInfo,
|
|
||||||
saveProjectSetting,
|
|
||||||
} from '@/api/setting';
|
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import {
|
import {
|
||||||
projectSetting,
|
projectSetting,
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,8 @@
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import type { FormInstance } from '@arco-design/web-vue';
|
import type { FormInstance } from '@arco-design/web-vue';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import { UpdateUserRoleParam, updateUserRole, RoleItem } from '@/api/setting';
|
import { updateUserRole } from '@/api/setting';
|
||||||
|
import { UpdateUserRoleParam, RoleItem } from '@/types/setting';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
|
|
|
||||||
|
|
@ -37,12 +37,8 @@
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import type { FormInstance } from '@arco-design/web-vue';
|
import type { FormInstance } from '@arco-design/web-vue';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import {
|
import { updateRole, createRole } from '@/api/setting';
|
||||||
RoleFormParam,
|
import { RoleFormParam, RoleItem } from '@/types/setting';
|
||||||
RoleItem,
|
|
||||||
updateRole,
|
|
||||||
createRole,
|
|
||||||
} from '@/api/setting';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
|
|
|
||||||
|
|
@ -111,13 +111,8 @@
|
||||||
import { ref, watch, reactive } from 'vue';
|
import { ref, watch, reactive } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import type { FormInstance } from '@arco-design/web-vue';
|
import type { FormInstance } from '@arco-design/web-vue';
|
||||||
import {
|
import { createUser, updateUser } from '@/api/setting';
|
||||||
DepartmentItem,
|
import { DepartmentItem, RoleItem, FormUserItem } from '@/types/setting';
|
||||||
RoleItem,
|
|
||||||
FormUserItem,
|
|
||||||
createUser,
|
|
||||||
updateUser,
|
|
||||||
} from '@/api/setting';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
|
|
|
||||||
|
|
@ -121,15 +121,17 @@
|
||||||
import type { TableColumnData } from '@arco-design/web-vue';
|
import type { TableColumnData } from '@arco-design/web-vue';
|
||||||
import {
|
import {
|
||||||
getUserList,
|
getUserList,
|
||||||
UserList,
|
|
||||||
getRoleList,
|
getRoleList,
|
||||||
RoleItem,
|
|
||||||
getUserInfo,
|
getUserInfo,
|
||||||
FormUserItem,
|
|
||||||
disableUser,
|
disableUser,
|
||||||
delUser,
|
delUser,
|
||||||
UserStatus,
|
|
||||||
} from '@/api/setting';
|
} from '@/api/setting';
|
||||||
|
import {
|
||||||
|
UserList,
|
||||||
|
RoleItem,
|
||||||
|
FormUserItem,
|
||||||
|
UserStatus,
|
||||||
|
} from '@/types/setting';
|
||||||
import useDepartmentList from '@/composables/useDepartmentList';
|
import useDepartmentList from '@/composables/useDepartmentList';
|
||||||
import useDataTable from '@/composables/useDataTable';
|
import useDataTable from '@/composables/useDataTable';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
|
|
|
||||||
|
|
@ -170,13 +170,12 @@
|
||||||
import { ref, onMounted, watch } from 'vue';
|
import { ref, onMounted, watch } from 'vue';
|
||||||
import {
|
import {
|
||||||
getRoleList,
|
getRoleList,
|
||||||
RoleItem,
|
|
||||||
delRole,
|
delRole,
|
||||||
saveRolePermission,
|
saveRolePermission,
|
||||||
getPermissionList,
|
getPermissionList,
|
||||||
getUserListFromRole,
|
getUserListFromRole,
|
||||||
UserList,
|
|
||||||
} from '@/api/setting';
|
} from '@/api/setting';
|
||||||
|
import { UserList, RoleItem } from '@/types/setting';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
import { Message } from '@arco-design/web-vue';
|
import { Message } from '@arco-design/web-vue';
|
||||||
import useDataTable from '@/composables/useDataTable';
|
import useDataTable from '@/composables/useDataTable';
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue