5.1日 暂定 水电表管理
This commit is contained in:
@@ -23,14 +23,14 @@ export interface BannerVO {
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId: string | number;
|
||||
villageId: string;
|
||||
}
|
||||
|
||||
export interface BannerForm extends BaseEntity {
|
||||
/**
|
||||
* Banner图管理表id
|
||||
*/
|
||||
id?: string | number;
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
@@ -50,7 +50,7 @@ export interface BannerForm extends BaseEntity {
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId?: string | number;
|
||||
villageId?: string;
|
||||
}
|
||||
|
||||
export interface BannerQuery extends PageQuery {
|
||||
@@ -72,7 +72,7 @@ export interface BannerQuery extends PageQuery {
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId?: string | number;
|
||||
villageId?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
|
||||
@@ -7,7 +7,7 @@ export interface DecorationVO {
|
||||
/**
|
||||
* 所属小区id
|
||||
*/
|
||||
villageId: number;
|
||||
villageId: string;
|
||||
|
||||
/**
|
||||
* 所属房屋id
|
||||
@@ -59,7 +59,7 @@ export interface DecorationForm extends BaseEntity {
|
||||
/**
|
||||
* 所属小区id
|
||||
*/
|
||||
villageId?: number;
|
||||
villageId?: string;
|
||||
|
||||
/**
|
||||
* 所属房屋id
|
||||
@@ -106,7 +106,7 @@ export interface DecorationQuery extends PageQuery {
|
||||
/**
|
||||
* 所属小区id
|
||||
*/
|
||||
villageId?: number;
|
||||
villageId?: string;
|
||||
|
||||
/**
|
||||
* 所属房屋id
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { ParkingCostVO, ParkingCostForm, ParkingCostQuery } from '@/api/system/type';
|
||||
import { ParkingCostVO, ParkingCostForm, ParkingCostQuery } from './type';
|
||||
|
||||
/**
|
||||
* 查询停车缴费管理列表
|
||||
|
||||
@@ -62,7 +62,7 @@ export interface ParkingCostVO {
|
||||
/**
|
||||
* 所属小区id
|
||||
*/
|
||||
villageId: string | number;
|
||||
villageId: string;
|
||||
}
|
||||
|
||||
export interface ParkingCostForm extends BaseEntity {
|
||||
@@ -129,7 +129,7 @@ export interface ParkingCostForm extends BaseEntity {
|
||||
/**
|
||||
* 所属小区id
|
||||
*/
|
||||
villageId?: string | number;
|
||||
villageId?: string;
|
||||
}
|
||||
|
||||
export interface ParkingCostQuery extends PageQuery {
|
||||
@@ -186,7 +186,7 @@ export interface ParkingCostQuery extends PageQuery {
|
||||
/**
|
||||
* 所属小区id
|
||||
*/
|
||||
villageId?: string | number;
|
||||
villageId?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
|
||||
@@ -2,12 +2,12 @@ export interface QuestionnaireVO {
|
||||
/**
|
||||
* 问卷ID
|
||||
*/
|
||||
id: string | number;
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* 所属小区id
|
||||
*/
|
||||
villageId: string | number;
|
||||
villageId: string;
|
||||
|
||||
/**
|
||||
* 问卷标题
|
||||
@@ -54,7 +54,7 @@ export interface QuestionnaireForm extends BaseEntity {
|
||||
/**
|
||||
* 所属小区id
|
||||
*/
|
||||
villageId?: string | number;
|
||||
villageId?: string;
|
||||
|
||||
/**
|
||||
* 问卷标题
|
||||
@@ -86,6 +86,8 @@ export interface QuestionnaireForm extends BaseEntity {
|
||||
*/
|
||||
residents?: string;
|
||||
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@@ -96,7 +98,7 @@ export interface QuestionnaireQuery extends PageQuery {
|
||||
/**
|
||||
* 所属小区id
|
||||
*/
|
||||
villageId?: string | number;
|
||||
villageId?: string;
|
||||
|
||||
/**
|
||||
* 问卷标题
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { RepairProjectVO, RepairProjectForm, RepairProjectQuery } from '@/api/repairProject/types';
|
||||
import { RepairProjectVO, RepairProjectForm, RepairProjectQuery } from './type';
|
||||
|
||||
/**
|
||||
* 查询报修维修项目管理列表
|
||||
|
||||
@@ -61,3 +61,24 @@ export const delBill = (id: string | number | Array<string | number>) => {
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
|
||||
export interface BillHouse {
|
||||
'buildingName': string;
|
||||
'houseId': number;
|
||||
'unitNo': number;
|
||||
'houseNo': string;
|
||||
'floorNo': number;
|
||||
'villageName': string;
|
||||
'villageId': string;
|
||||
'buildingId': string;
|
||||
'userName': string;
|
||||
'userId': string;
|
||||
}
|
||||
/** 查询房屋列表 */
|
||||
export const listBillHouse = (query: { pageNum: number; pageSize: number }): AxiosPromise<BillHouse[]> => {
|
||||
return request({
|
||||
url: '/bill/getHouseList',
|
||||
method: 'GET',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
@@ -33,11 +33,11 @@ export interface BillVO {
|
||||
* 结束日期
|
||||
*/
|
||||
endDate: string;
|
||||
|
||||
houseIds: string[];
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId: number;
|
||||
villageId: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
@@ -60,6 +60,10 @@ export interface BillForm extends BaseEntity {
|
||||
* 账单编号
|
||||
*/
|
||||
billCode?: string;
|
||||
/**
|
||||
* 账单名称
|
||||
*/
|
||||
billName?: string;
|
||||
|
||||
/**
|
||||
* 收费项目id
|
||||
@@ -89,7 +93,7 @@ export interface BillForm extends BaseEntity {
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId?: string | number;
|
||||
villageId?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
@@ -136,7 +140,7 @@ export interface BillQuery extends PageQuery {
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId?: string | number;
|
||||
villageId?: string;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
|
||||
@@ -51,7 +51,7 @@ export interface ChargeItemVO {
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId: string | number;
|
||||
villageId: string;
|
||||
}
|
||||
|
||||
export interface ChargeItemForm extends BaseEntity {
|
||||
@@ -63,7 +63,7 @@ export interface ChargeItemForm extends BaseEntity {
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
name?: string;
|
||||
itemName?: string;
|
||||
|
||||
/**
|
||||
* 计费方式 0单次收费 1周期收费 2仪表收费
|
||||
@@ -100,17 +100,18 @@ export interface ChargeItemForm extends BaseEntity {
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
status?: string;
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId?: string | number;
|
||||
villageId?: string;
|
||||
}
|
||||
|
||||
export interface ChargeItemQuery extends PageQuery {
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
name?: string;
|
||||
itemName?: string;
|
||||
|
||||
/**
|
||||
* 计费方式 0单次收费 1周期收费 2仪表收费
|
||||
@@ -145,7 +146,7 @@ export interface ChargeItemQuery extends PageQuery {
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId?: string | number;
|
||||
villageId?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
|
||||
@@ -85,3 +85,14 @@ export const WaterDeviceMakerQrcode = (data: { deviceCode: string; id: string }[
|
||||
data: data
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 更新固件
|
||||
* @param id
|
||||
*/
|
||||
export const WaterDeviceUpdateBin = (data: { deviceCodes: string[]; urlA: string; urlB: string }) => {
|
||||
return request({
|
||||
url: '/waterDevice/updateBin',
|
||||
method: 'POST',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
@@ -54,7 +54,7 @@ export interface WarehouseForm extends BaseEntity {
|
||||
/**
|
||||
* 仓库归属id*(关联com_village)
|
||||
*/
|
||||
villageId?: number;
|
||||
villageId?: string;
|
||||
|
||||
/**
|
||||
* 联系人*
|
||||
@@ -91,7 +91,7 @@ export interface WarehouseQuery extends PageQuery {
|
||||
/**
|
||||
* 仓库归属id*(关联com_village)
|
||||
*/
|
||||
villageId?: number;
|
||||
villageId?: string;
|
||||
|
||||
/**
|
||||
* 联系人*
|
||||
|
||||
@@ -10,14 +10,14 @@ export function getCommunitylistAPI(): AxiosPromise<communitylist_rows_type[]> {
|
||||
});
|
||||
}
|
||||
/** 通过小区id获取小区信息 */
|
||||
export function getVillageByIdAPI(id: number): AxiosPromise<communitylist_rows_type> {
|
||||
export function getVillageByIdAPI(id: string): AxiosPromise<communitylist_rows_type> {
|
||||
return request({
|
||||
url: `/village/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 删除小区 */
|
||||
export function deleteVillageByIdAPI(id: number): AxiosPromise<null> {
|
||||
export function deleteVillageByIdAPI(id: string): AxiosPromise<null> {
|
||||
return request({
|
||||
url: `/village/${id}`,
|
||||
method: 'delete'
|
||||
@@ -60,7 +60,7 @@ export function editVillageAPI<T>(data: T) {
|
||||
});
|
||||
}
|
||||
/**切换小区 */
|
||||
export function switchVillageAPI(villageId: number) {
|
||||
export function switchVillageAPI(villageId: string) {
|
||||
return request({
|
||||
url: `/village/switchVillage/${villageId}`,
|
||||
method: 'POST'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export interface communitylist_rows_type {
|
||||
villageId: number;
|
||||
villageId: string;
|
||||
villageName: string;
|
||||
villageCode: string;
|
||||
address: string;
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { addBuildingType, addHouseType, BuildingUnit, BuildingVo } from './type';
|
||||
import { number } from 'vue-types';
|
||||
|
||||
// 楼栋---------------------------------------------------------------------------------------
|
||||
|
||||
/** 根据 小区id 和 类型 查询楼栋信息 */
|
||||
export function getBuildinglistAPI(villageId: number, buildingUse: number): AxiosPromise<BuildingVo[]> {
|
||||
export function getBuildinglistAPI(buildingUse: string): AxiosPromise<BuildingVo[]> {
|
||||
return request({
|
||||
url: '/building/byVillage',
|
||||
method: 'get',
|
||||
params: {
|
||||
villageId: villageId,
|
||||
buildingUse: buildingUse
|
||||
}
|
||||
});
|
||||
@@ -96,7 +94,7 @@ export function EditHouseApi(data: addHouseType) {
|
||||
});
|
||||
}
|
||||
/** 根据小区id,获取当前小区的树状结构 */
|
||||
export function getVillageTree(id: number) {
|
||||
export function getVillageTree(id: string) {
|
||||
return request({
|
||||
url: `/house/villageTree/${id}`,
|
||||
method: 'GET'
|
||||
|
||||
@@ -38,7 +38,7 @@ export interface BuildingVo {
|
||||
/**
|
||||
* 所属小区ID
|
||||
*/
|
||||
villageId?: number;
|
||||
villageId?: string;
|
||||
villageName?: string;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ export interface HouseType {
|
||||
|
||||
export interface addBuildingType {
|
||||
buildingName: string;
|
||||
villageId?: number;
|
||||
villageId?: string;
|
||||
buildStructure?: string;
|
||||
buildTall?: string;
|
||||
buildToward?: string;
|
||||
@@ -79,7 +79,7 @@ export interface addBuildingType {
|
||||
export interface addHouseType {
|
||||
'houseId'?: string;
|
||||
'buildingId'?: string;
|
||||
'villageId'?: number;
|
||||
'villageId'?: string;
|
||||
'unitNo': string;
|
||||
'floorNo': string;
|
||||
'houseNo': string;
|
||||
|
||||
@@ -37,7 +37,7 @@ export interface ResidentVO {
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId: string | number;
|
||||
villageId: string;
|
||||
|
||||
/**
|
||||
* 楼栋id
|
||||
@@ -112,7 +112,7 @@ export interface ResidentForm extends BaseEntity {
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId?: string | number;
|
||||
villageId?: string;
|
||||
|
||||
/**
|
||||
* 楼栋id
|
||||
@@ -163,7 +163,7 @@ export interface ResidentQuery extends PageQuery {
|
||||
status?: string;
|
||||
|
||||
houseId?: number;
|
||||
villageId?: number;
|
||||
villageId?: string;
|
||||
buildingId?: number;
|
||||
unitNo?: number;
|
||||
}
|
||||
|
||||
@@ -17,10 +17,12 @@ export interface UserQuery extends PageQuery {
|
||||
userName?: string;
|
||||
nickName?: string;
|
||||
phonenumber?: string;
|
||||
// villageIds?: string[] | number[];
|
||||
villageIds?: string;
|
||||
status?: string;
|
||||
deptId?: string | number;
|
||||
roleId?: string | number;
|
||||
userIds?: string | number | (string | number)[] | undefined;
|
||||
userIds?: string | number | (string | number)[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,6 +50,7 @@ export interface UserVO extends BaseEntity {
|
||||
postIds: any;
|
||||
roleId: any;
|
||||
admin: boolean;
|
||||
villageIds: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,6 +62,8 @@ export interface UserForm {
|
||||
deptId?: number;
|
||||
userName: string;
|
||||
nickName?: string;
|
||||
// villageIds: string[] | number[];
|
||||
villageIds: string;
|
||||
password: string;
|
||||
phonenumber?: string;
|
||||
email?: string;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { AxiosPromise } from 'axios';
|
||||
* @returns {*}
|
||||
*/
|
||||
export const workSpaceTotalListApi = (
|
||||
villageId: number
|
||||
villageId: string
|
||||
): Promise<{
|
||||
totalResident: number;
|
||||
totalHouse: number;
|
||||
@@ -17,6 +17,8 @@ export const workSpaceTotalListApi = (
|
||||
return request({
|
||||
url: '/workSpace/totalList',
|
||||
method: 'get',
|
||||
params: villageId
|
||||
params: {
|
||||
villageId: villageId
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -16,11 +16,14 @@ import { usePermissionStore } from '@/store/modules/permission';
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const permissionStore = usePermissionStore();
|
||||
const levelList = ref<RouteLocationMatched[]>([]);
|
||||
|
||||
const levelList = ref<LooseRouteMatched[]>([]);
|
||||
type LooseRouteMatched = Partial<RouteLocationMatched> & {
|
||||
path: string; // 确保必要字段存在
|
||||
meta?: any;
|
||||
};
|
||||
const getBreadcrumb = () => {
|
||||
// 1. 先获取原生的 matched
|
||||
let matched = route.matched.filter((item) => item.meta && item.meta.title);
|
||||
let matched = route.matched.filter((item) => item.meta && item.meta.title) as LooseRouteMatched[];
|
||||
|
||||
// 🔥 关键:如果当前路由有 parentTitle,手动插入虚拟父级
|
||||
if (route.meta?.parentTitle) {
|
||||
@@ -30,7 +33,7 @@ const getBreadcrumb = () => {
|
||||
// 创建虚拟父级路由对象
|
||||
const virtualParent = {
|
||||
path: matched[lastIndex].path,
|
||||
meta: { title: route.meta.parentTitle }
|
||||
meta: { title: route.meta.parentTitle as string }
|
||||
};
|
||||
|
||||
// 插入到倒数第二个位置
|
||||
@@ -40,8 +43,6 @@ const getBreadcrumb = () => {
|
||||
|
||||
// 2. 过滤掉设置了 breadcrumb: false 的路由
|
||||
levelList.value = matched.filter((item) => item.meta && item.meta.title && item.meta.breadcrumb !== false);
|
||||
|
||||
console.log('最终面包屑:', levelList.value);
|
||||
};
|
||||
|
||||
const handleLink = (item) => {
|
||||
|
||||
@@ -59,7 +59,7 @@ const props = defineProps({
|
||||
// 大小限制(MB)
|
||||
fileSize: propTypes.number.def(5),
|
||||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||
fileType: propTypes.array.def(['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf']),
|
||||
fileType: propTypes.array.def(['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'pdf', 'bin']),
|
||||
// 是否显示提示
|
||||
isShowTip: propTypes.bool.def(true),
|
||||
// 禁用组件(仅查看文件)
|
||||
|
||||
295
src/components/Holder/house.vue
Normal file
295
src/components/Holder/house.vue
Normal file
@@ -0,0 +1,295 @@
|
||||
<template>
|
||||
<slot name="default" />
|
||||
|
||||
<el-dialog append-to-body v-model="dialog.dialogVisible" :title="dialog.dialogTitle" 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="flex-1">
|
||||
<el-select @change="handleChangeHouse" style="width: 140px" v-model="queryParams.buildingUse">
|
||||
<el-option v-for="(item, index) in com_build_use" :key="index" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-items-center">
|
||||
<div style="width: 60px; text-align: right; padding-right: 10px">楼栋</div>
|
||||
<div class="flex-1"></div>
|
||||
<el-select @change="handleChangebuilding" style="width: 140px" v-model="queryParams.buildingId">
|
||||
<el-option v-for="(item, index) in buildinglist" :key="index" :label="item.buildingName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</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-select style="width: 140px" v-model="queryParams.unitNo">
|
||||
<el-option v-for="(item, index) in unitlist" :key="index" :label="`${item.unitNo}单元`" :value="item.unitNo"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" @click="getlist">查询</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</nav>
|
||||
<el-table @row-click="handleRowClick" ref="multipleTableRef" :data="tableData" border @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="序号" align="center" width="55" type="index" />
|
||||
<el-table-column label="小区" align="center" prop="villageName" />
|
||||
<el-table-column label="楼栋" align="center" prop="buildingName" />
|
||||
<el-table-column label="单元" align="center" prop="unitNo" />
|
||||
<el-table-column label="房间" align="center" prop="houseNo" />
|
||||
<el-table-column label="业主" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.userName ? scope.row.userName : '---' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<div class="dialog-footer flex flex-items-center flex-justify-between">
|
||||
<pagination
|
||||
style="margin-top: 0"
|
||||
layout="total, prev, pager, next, jumper"
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getlist"
|
||||
/>
|
||||
<div>
|
||||
<el-button @click="conback">退出</el-button>
|
||||
<el-button type="primary" @click="confirm"> 确定 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getBuildinglistAPI, getBuildingOnly, getHouselistAPI } from '@/api/system/house';
|
||||
import { BillHouse, listBillHouse } from '@/api/system/SdbBill';
|
||||
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'));
|
||||
const { com_build_use } = toRefs<any>(proxy?.useDict('com_build_use'));
|
||||
|
||||
const props = defineProps({
|
||||
userid: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
returnvalue: {
|
||||
type: String,
|
||||
default: 'houseId'
|
||||
},
|
||||
titleName: {
|
||||
type: String,
|
||||
default: '选择房屋'
|
||||
},
|
||||
/** 是否多选 false 单选 */
|
||||
isMultiple: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
const { userid, titleName, returnvalue } = toRefs(props);
|
||||
|
||||
// ✅ 手动设置默认值(替代 withDefaults)
|
||||
const emit = defineEmits<{
|
||||
change: [value: string | number | (string | number)[] | BillHouse | BillHouse[]]; // 支持返回数组
|
||||
}>();
|
||||
|
||||
const dialog = ref({
|
||||
dialogVisible: false,
|
||||
dialogTitle: titleName.value
|
||||
});
|
||||
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
buildingUse: null,
|
||||
buildingId: null,
|
||||
unitNo: null
|
||||
});
|
||||
|
||||
const multipleTableRef = ref();
|
||||
const tableData = ref<BillHouse[]>([]);
|
||||
const total = ref(0);
|
||||
const loading = ref(false);
|
||||
|
||||
// 存储选中项
|
||||
const multipleSelection = ref<BillHouse[]>([]);
|
||||
|
||||
const isMultiple = computed(() => props.isMultiple ?? false);
|
||||
|
||||
// 优化 handleUserSelection,避免重复查找
|
||||
const handleUserSelection = () => {
|
||||
if (!userid.value || !tableData.value.length) return;
|
||||
|
||||
multipleSelection.value = [];
|
||||
if (userid.value.trim() !== '') {
|
||||
const arr = userid.value.split(',');
|
||||
arr.forEach((item) => {
|
||||
const target = tableData.value.find((row) => row.userId == item);
|
||||
target && multipleSelection.value.push(target);
|
||||
});
|
||||
nextTick(() => {
|
||||
if (multipleTableRef.value) {
|
||||
multipleTableRef.value.clearSelection();
|
||||
multipleSelection.value.forEach((item) => {
|
||||
multipleTableRef.value.toggleRowSelection(item, true);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// ====================== 方法 ======================
|
||||
|
||||
// 获取列表
|
||||
function getlist() {
|
||||
loading.value = true;
|
||||
listBillHouse(queryParams.value)
|
||||
.then((res) => {
|
||||
tableData.value = res.rows;
|
||||
total.value = res.total;
|
||||
handleUserSelection();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取用户列表失败:', error);
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 楼栋列表 */
|
||||
const buildinglist = ref([]);
|
||||
/** 房屋列表 */
|
||||
const unitlist = ref([]);
|
||||
|
||||
/** 筛选房屋类型 */
|
||||
function handleChangeHouse(val: string) {
|
||||
getBuildinglistAPI(val).then((res) => {
|
||||
buildinglist.value = res.data;
|
||||
});
|
||||
}
|
||||
/** 单元列表 */
|
||||
function handleChangebuilding(val: string) {
|
||||
getHouselistAPI(val).then((res) => {
|
||||
unitlist.value = res.data.units;
|
||||
});
|
||||
}
|
||||
|
||||
// ==============================================
|
||||
// ✅ 新增:处理 selection-change(多选专用)
|
||||
// ==============================================
|
||||
function handleSelectionChange(selection: BillHouse[]) {
|
||||
if (isMultiple.value) {
|
||||
multipleSelection.value = selection;
|
||||
}
|
||||
}
|
||||
// ==============================================
|
||||
// 最佳单选方案:点击行选中,无报错、无循环、最稳定
|
||||
// ==============================================
|
||||
// 优化 handleRowClick,避免重复
|
||||
function handleRowClick(row: BillHouse) {
|
||||
if (!multipleTableRef.value) return;
|
||||
|
||||
if (isMultiple.value) {
|
||||
const index = multipleSelection.value.findIndex((item) => item.houseId === row.houseId);
|
||||
if (index > -1) {
|
||||
// 取消选中
|
||||
multipleSelection.value.splice(index, 1);
|
||||
multipleTableRef.value?.toggleRowSelection(row, false);
|
||||
} else {
|
||||
// 选中
|
||||
multipleSelection.value.push(row);
|
||||
multipleTableRef.value?.toggleRowSelection(row, true);
|
||||
}
|
||||
} else {
|
||||
// 【单选模式】先清空,再选中当前行
|
||||
multipleSelection.value = [];
|
||||
multipleTableRef.value.clearSelection();
|
||||
multipleSelection.value = [row];
|
||||
multipleTableRef.value.toggleRowSelection(row, true);
|
||||
}
|
||||
}
|
||||
// 重置查询
|
||||
function resetQuery() {
|
||||
queryParams.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
houseuse: null,
|
||||
buildingId: null,
|
||||
unitNo: 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 BillHouse])
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// 单选
|
||||
if (returnvalue.value === '*') {
|
||||
// ✅ 返回整个对象
|
||||
emit('change', multipleSelection.value[0]);
|
||||
} else {
|
||||
// 返回指定字段
|
||||
emit('change', multipleSelection.value[0][returnvalue.value as keyof BillHouse]);
|
||||
}
|
||||
}
|
||||
|
||||
multipleSelection.value = [];
|
||||
multipleTableRef.value.clearSelection();
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open: () => {
|
||||
getlist();
|
||||
dialog.value.dialogVisible = true;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.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>
|
||||
@@ -83,7 +83,6 @@ const houseStore = useHouseStore();
|
||||
const treedata = ref([]);
|
||||
function init() {
|
||||
houseStore.getCurrentVilageTreeHouse().then((res) => {
|
||||
console.log(res);
|
||||
treedata.value = res;
|
||||
});
|
||||
}
|
||||
@@ -273,7 +272,6 @@ function confirm() {
|
||||
// ✅ 返回整个对象
|
||||
emit('change', multipleSelection.value[0]);
|
||||
} else {
|
||||
console.log(multipleSelection.value[0], returnvalue.value);
|
||||
// 返回指定字段
|
||||
emit('change', multipleSelection.value[0][returnvalue.value as keyof tableType]);
|
||||
}
|
||||
|
||||
@@ -157,7 +157,6 @@ function getlist() {
|
||||
// ✅ 新增:处理 selection-change(多选专用)
|
||||
// ==============================================
|
||||
function handleSelectionChange(selection: MaterialVO[]) {
|
||||
console.log(selection);
|
||||
if (isMultiple.value) {
|
||||
multipleSelection.value = selection;
|
||||
}
|
||||
@@ -228,7 +227,6 @@ function confirm() {
|
||||
// ✅ 返回整个对象
|
||||
emit('change', multipleSelection.value[0]);
|
||||
} else {
|
||||
console.log(multipleSelection.value[0], returnvalue.value);
|
||||
// 返回指定字段
|
||||
emit('change', multipleSelection.value[0][returnvalue.value as keyof MaterialVO]);
|
||||
}
|
||||
|
||||
@@ -252,7 +252,6 @@ function confirm() {
|
||||
// ✅ 返回整个对象
|
||||
emit('change', multipleSelection.value[0]);
|
||||
} else {
|
||||
console.log(multipleSelection.value[0], returnvalue.value);
|
||||
// 返回指定字段
|
||||
emit('change', multipleSelection.value[0][returnvalue.value as keyof tableType]);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<img src="@/assets/images/dark.svg" alt="dark" />
|
||||
<div v-if="sideTheme === 'theme-dark'" class="setting-drawer-block-checbox-selectIcon" style="display: block">
|
||||
<i aria-label="图标: check" class="anticon anticon-check">
|
||||
<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class>
|
||||
<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false">
|
||||
<path
|
||||
d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"
|
||||
/>
|
||||
@@ -54,7 +54,7 @@
|
||||
<img src="@/assets/images/light.svg" alt="light" />
|
||||
<div v-if="sideTheme === 'theme-light'" class="setting-drawer-block-checbox-selectIcon" style="display: block">
|
||||
<i aria-label="图标: check" class="anticon anticon-check">
|
||||
<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false" class>
|
||||
<svg viewBox="64 64 896 896" data-icon="check" width="1em" height="1em" :fill="theme" aria-hidden="true" focusable="false">
|
||||
<path
|
||||
d="M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 0 0-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"
|
||||
/>
|
||||
|
||||
@@ -44,14 +44,12 @@ router.beforeEach(async (to, from) => {
|
||||
if (isWhiteList(to.path)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (userStore.roles.length === 0 && !isDynamicRoutesAdded) {
|
||||
if (userStore.roles.length === 0) {
|
||||
isRelogin.show = true;
|
||||
|
||||
// 获取用户信息
|
||||
const [err, res] = await tos(userStore.getInfo());
|
||||
if (err) {
|
||||
console.error('❌ 获取用户信息失败:', err);
|
||||
await userStore.logout();
|
||||
ElMessage.error(err);
|
||||
isDynamicRoutesAdded = false;
|
||||
@@ -59,7 +57,7 @@ router.beforeEach(async (to, from) => {
|
||||
}
|
||||
|
||||
isRelogin.show = false;
|
||||
|
||||
permissionStore.resetRoutes();
|
||||
// 生成动态路由
|
||||
const accessRoutes = await permissionStore.generateRoutes();
|
||||
|
||||
@@ -74,36 +72,27 @@ router.beforeEach(async (to, from) => {
|
||||
isDynamicRoutesAdded = true;
|
||||
|
||||
// 管理员登录强制跳转
|
||||
if (res.user.userId === 1 && from.path === '/login') {
|
||||
console.log('👑 管理员登录,跳转到社区列表');
|
||||
if (from.path === '/login') {
|
||||
return { path: '/community/communitylist', replace: true };
|
||||
} else {
|
||||
// 重新进入当前路由(让新添加的路由生效)
|
||||
console.log('🔄 重新跳转目标页面:', to.path);
|
||||
return { ...to, replace: true };
|
||||
}
|
||||
}
|
||||
|
||||
// ==============================================
|
||||
// ✅ 已经初始化完成 → 直接放行!
|
||||
// ==============================================
|
||||
console.log('✅ 已完成初始化,直接放行');
|
||||
return;
|
||||
} else {
|
||||
// 未登录
|
||||
isDynamicRoutesAdded = false;
|
||||
console.log('🔒 未登录,跳转到登录页');
|
||||
|
||||
if (isWhiteList(to.path)) {
|
||||
return;
|
||||
} else {
|
||||
NProgress.done();
|
||||
return `/login?redirect=${to.fullPath}`;
|
||||
return `/login`;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
router.afterEach(() => {
|
||||
NProgress.done();
|
||||
console.log('✅ 跳转完成\n\n');
|
||||
});
|
||||
|
||||
@@ -89,12 +89,13 @@ export const constantRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
redirect: '/index',
|
||||
redirect: '/equipment/WaterDevice',
|
||||
children: [
|
||||
{
|
||||
path: '/index',
|
||||
component: () => import('@/views/workbench/index2.vue'),
|
||||
name: 'Index',
|
||||
hidden: true,
|
||||
meta: { title: '工作台', icon: 'dashboard', affix: true }
|
||||
}
|
||||
]
|
||||
|
||||
@@ -23,7 +23,7 @@ export const useHouseStore = defineStore(
|
||||
// 当前小区信息
|
||||
const currentVilageInfo = ref<communitylist_rows_type>();
|
||||
// 住宅类型
|
||||
const buildingtype = ref<number>(0);
|
||||
const buildingtype = ref<string>('0');
|
||||
// 住宅列表
|
||||
const buildingtypelist = ref([]);
|
||||
// 房屋树状结构
|
||||
@@ -51,6 +51,9 @@ export const useHouseStore = defineStore(
|
||||
|
||||
// 当前楼栋 所有楼层数据
|
||||
const currentFloorInfoList = computed(() => {
|
||||
if (floorslist.value.size === 0) {
|
||||
return [];
|
||||
}
|
||||
return [...floorslist.value].sort(sortNumberStr);
|
||||
});
|
||||
// 楼层列表 set
|
||||
@@ -70,10 +73,10 @@ export const useHouseStore = defineStore(
|
||||
};
|
||||
|
||||
// 初始化
|
||||
const initHouse = async (currentbuildingtype: number) => {
|
||||
const initHouse = async (currentbuildingtype: string) => {
|
||||
currentBuildingInfoList.value = [];
|
||||
// 获取当前小区 所有楼栋信息
|
||||
const res2 = await getBuildinglistAPI(currentVilageInfo.value.villageId, currentbuildingtype);
|
||||
const res2 = await getBuildinglistAPI(currentbuildingtype);
|
||||
currentBuildingInfoList.value = res2.data;
|
||||
|
||||
// 获取当前小区 第一个楼栋信息
|
||||
@@ -111,11 +114,11 @@ export const useHouseStore = defineStore(
|
||||
};
|
||||
|
||||
// 切换住宅类型
|
||||
const switchHouseType = async (housetype: number) => {
|
||||
const switchHouseType = async (housetype: string) => {
|
||||
// 清空
|
||||
currentBuildingInfoList.value = [];
|
||||
// 获取当前小区 所有楼栋信息
|
||||
const res2 = await getBuildinglistAPI(currentVilageInfo.value.villageId, housetype);
|
||||
const res2 = await getBuildinglistAPI(housetype);
|
||||
currentBuildingInfoList.value = res2.data;
|
||||
// 获取当前小区 第一个楼栋信息
|
||||
if ((currentBuildingInfo.value && currentBuildingInfo.value.id === null) || buildingtype.value !== housetype) {
|
||||
@@ -143,7 +146,6 @@ export const useHouseStore = defineStore(
|
||||
floorslist.value = new Set();
|
||||
}
|
||||
buildingtype.value = housetype;
|
||||
console.log(housetype);
|
||||
ElMessage.success('切换成功');
|
||||
};
|
||||
|
||||
|
||||
@@ -89,11 +89,9 @@ export const usePermissionStore = defineStore('permission', () => {
|
||||
const generateRoutes = async (): Promise<RouteRecordRaw[]> => {
|
||||
const res = await getRouters();
|
||||
const { data } = res;
|
||||
console.log('后端原始路由:', data);
|
||||
|
||||
// 🔥 关键:先把后端扁平路由转成嵌套格式
|
||||
const nestedData = transformRoutes(data);
|
||||
console.log('转换后的嵌套路由:', nestedData);
|
||||
|
||||
// 深拷贝数据(保留原有逻辑)
|
||||
const sdata = JSON.parse(JSON.stringify(nestedData));
|
||||
@@ -161,6 +159,14 @@ export const usePermissionStore = defineStore('permission', () => {
|
||||
});
|
||||
return children;
|
||||
};
|
||||
|
||||
const resetRoutes = () => {
|
||||
routes.value = [];
|
||||
addRoutes.value = [];
|
||||
defaultRoutes.value = [];
|
||||
topbarRouters.value = [];
|
||||
sidebarRouters.value = [];
|
||||
};
|
||||
return {
|
||||
routes,
|
||||
topbarRouters,
|
||||
@@ -174,7 +180,8 @@ export const usePermissionStore = defineStore('permission', () => {
|
||||
|
||||
setRoutes,
|
||||
generateRoutes,
|
||||
setSidebarRouters
|
||||
setSidebarRouters,
|
||||
resetRoutes
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -42,9 +42,10 @@ export const useUserStore = defineStore('user', () => {
|
||||
const data = res.data;
|
||||
const user = data.user;
|
||||
const profile = user.avatar == '' || user.avatar == null ? defAva : user.avatar;
|
||||
if (data.user.userId !== 1) {
|
||||
localStorage.setItem('villageid', data.user.villageId);
|
||||
}
|
||||
|
||||
roles.value = [];
|
||||
permissions.value = [];
|
||||
|
||||
if (data.roles && data.roles.length > 0) {
|
||||
// 验证返回的roles是否是一个非空数组
|
||||
roles.value = data.roles;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useUserStore } from '@/store/modules/user';
|
||||
* @param {Array} value 校验值
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
export const checkPermi = (value: any) => {
|
||||
export const checkPermi = (value: string[]) => {
|
||||
if (value && value instanceof Array && value.length > 0) {
|
||||
const permissions = useUserStore().permissions;
|
||||
const permissionDatas = value;
|
||||
|
||||
@@ -40,7 +40,9 @@ const whiteVillageId = [
|
||||
'/village',
|
||||
'/village/*',
|
||||
'/waterDevice/generateBarCode', // 水表 条码
|
||||
'/electricityDevice/generateBarCodee' // 电表 条码
|
||||
'/electricityDevice/generateBarCodee', // 电表 条码
|
||||
|
||||
'/payRecordList/payRecordList/list'
|
||||
// 以后直接在这里加新地址,支持 /xxx/*、/xxx/xxx 写法
|
||||
];
|
||||
|
||||
@@ -83,18 +85,17 @@ service.interceptors.request.use(
|
||||
if (getToken() && !isToken) {
|
||||
config.headers['Authorization'] = 'Bearer ' + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||
}
|
||||
console.log(needVillageId(config.url), config.url);
|
||||
// get请求映射params参数
|
||||
const villageid = localStorage.getItem('villageid');
|
||||
if (config.method === 'get' && config.params) {
|
||||
let url = '';
|
||||
if (villageid != 'null' && !Number.isNaN(Number(villageid)) && needVillageId(config.url)) {
|
||||
if (villageid != 'null' && needVillageId(config.url)) {
|
||||
url =
|
||||
config.url +
|
||||
'?' +
|
||||
tansParams({
|
||||
...config.params,
|
||||
villageId: Number(villageid)
|
||||
villageId: villageid
|
||||
});
|
||||
} else {
|
||||
url = config.url + '?' + tansParams(config.params);
|
||||
@@ -106,10 +107,10 @@ service.interceptors.request.use(
|
||||
|
||||
if (!isRepeatSubmit && (config.method === 'post' || config.method === 'put')) {
|
||||
let obj = null;
|
||||
if (villageid != 'null' && !Number.isNaN(Number(villageid)) && needVillageId(config.url)) {
|
||||
if (villageid != 'null' && needVillageId(config.url)) {
|
||||
obj = {
|
||||
...config.data,
|
||||
villageId: Number(villageid)
|
||||
villageId: villageid
|
||||
};
|
||||
} else {
|
||||
obj = config.data;
|
||||
@@ -130,7 +131,7 @@ service.interceptors.request.use(
|
||||
const s_url = sessionObj.url; // 请求地址
|
||||
const s_data = sessionObj.data; // 请求数据
|
||||
const s_time = sessionObj.time; // 请求时间
|
||||
const interval = 500; // 间隔时间(ms),小于此时间视为重复提交
|
||||
const interval = 200; // 间隔时间(ms),小于此时间视为重复提交
|
||||
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
|
||||
const message = '数据正在处理,请勿重复提交';
|
||||
console.warn(`[${s_url}]: ` + message);
|
||||
@@ -154,7 +155,6 @@ service.interceptors.request.use(
|
||||
delete config.headers['Content-Type'];
|
||||
}
|
||||
|
||||
console.log(config, config.data);
|
||||
return config;
|
||||
},
|
||||
(error: any) => {
|
||||
@@ -215,9 +215,6 @@ service.interceptors.response.use(
|
||||
return Promise.reject('无效的会话,或者会话已过期,请重新登录。');
|
||||
} else if (code === HttpStatus.SERVER_ERROR) {
|
||||
// 500
|
||||
console.log(res);
|
||||
|
||||
console.log(res.config.url.split('?')[0]);
|
||||
ElMessage({ message: msg, type: 'error' });
|
||||
return Promise.reject(res.data);
|
||||
} else if (code === HttpStatus.WARN) {
|
||||
|
||||
@@ -182,9 +182,10 @@ const rules = ref({
|
||||
|
||||
/** 获取编辑小区的信息 */
|
||||
function getCommunityinfo() {
|
||||
const id = Number(editId.value);
|
||||
const id = editId.value;
|
||||
getVillageByIdAPI(id).then((res) => {
|
||||
city.value = (res.data.city as string).split('/');
|
||||
city.value = res.data.city.split('/');
|
||||
console.log(res.data.city.split('/'));
|
||||
if (res.data.villageImageUrl) {
|
||||
villageImg.value = res.data.villageImageUrl
|
||||
.split(',')
|
||||
@@ -196,7 +197,9 @@ function getCommunityinfo() {
|
||||
};
|
||||
});
|
||||
}
|
||||
builtTime.value = res.data.completDate.split(' ')[0];
|
||||
if (res.data.completDate) {
|
||||
builtTime.value = res.data.completDate.split(' ')[0];
|
||||
}
|
||||
form.value = {
|
||||
...res.data,
|
||||
completDate: builtTime.value
|
||||
@@ -204,7 +207,6 @@ function getCommunityinfo() {
|
||||
});
|
||||
}
|
||||
if (isedit.value) {
|
||||
console.log('编辑小区id', editId.value, typeof editId.value, Boolean(editId.value));
|
||||
getCommunityinfo();
|
||||
}
|
||||
// 请求头
|
||||
@@ -335,7 +337,6 @@ function submitFormInfo() {
|
||||
}
|
||||
|
||||
if (isedit.value) {
|
||||
console.log('编辑小区提交的数据', form.value);
|
||||
editVillageAPI<communitylist_rows_type>(form.value).then((res) => {
|
||||
ElMessage.success('编辑成功');
|
||||
cancelForm();
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
</div>
|
||||
<div class="actions flex">
|
||||
<div @click="handleclick(item)">管理</div>
|
||||
<div @click="handleEdit(item)">编辑</div>
|
||||
<div @click="handleDelete(item)">删除</div>
|
||||
<div @click="handleEdit(item)" v-hasPermi="['system:village:edit']">编辑</div>
|
||||
<div @click="handleDelete(item)" v-hasPermi="['system:village:remove']">删除</div>
|
||||
</div>
|
||||
</div>
|
||||
<div @click="handleAdd" class="coummunity_card addActions flex flex-items-center justify-center">
|
||||
<div v-hasPermi="['system:village:add']" @click="handleAdd" class="coummunity_card addActions flex flex-items-center justify-center">
|
||||
<div class="addCoummunity">
|
||||
<el-icon>
|
||||
<AddLocation></AddLocation>
|
||||
@@ -60,7 +60,7 @@ function getlist() {
|
||||
getCommunitylistAPI().then((res) => {
|
||||
list.value = res.rows;
|
||||
const villageid = localStorage.getItem('villageid');
|
||||
const find = list.value.find((item) => item.villageId === Number(villageid));
|
||||
const find = list.value.find((item) => item.villageId === villageid);
|
||||
if (find) {
|
||||
currentViliageInfo.value = find;
|
||||
}
|
||||
@@ -95,10 +95,10 @@ function handleEdit(item: communitylist_rows_type) {
|
||||
/** 管理小区 */
|
||||
function handleclick(item: communitylist_rows_type) {
|
||||
switchVillageAPI(item.villageId).then(() => {
|
||||
localStorage.setItem('villageid', String(item.villageId));
|
||||
localStorage.setItem('villageid', item.villageId);
|
||||
houseStore.getviliageinfo(item.villageId);
|
||||
router.push({
|
||||
path: '/index'
|
||||
path: '/'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['activity:activity:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['repair:add:activity']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['activity:activity:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['repair:edit:activity']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -50,8 +50,9 @@
|
||||
<el-table-column label="发布人" align="center" prop="createName" />
|
||||
<el-table-column label="操作" align="center" width="300px" fixed="right">
|
||||
<template #default="scope">
|
||||
<!-- TODO 发布按钮 -->
|
||||
<el-button v-if="scope.row.status === '0'" link type="primary" @click="handleSend(scope.row)">发布</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['activity:activity:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['repair:edit:activity']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['activity:activity:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -146,7 +147,6 @@ const handleSend = (row: ActivityVO) => {
|
||||
...form.value,
|
||||
...row
|
||||
};
|
||||
console.log(form.value);
|
||||
dialog.visible = true;
|
||||
};
|
||||
/** 取消按钮 */
|
||||
@@ -200,7 +200,6 @@ const handleUpdate = async (row?: ActivityVO) => {
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
activityFormRef.value?.validate(async (valid: boolean) => {
|
||||
console.log(valid);
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
await updateActivity(form.value).finally(() => (buttonLoading.value = false));
|
||||
|
||||
@@ -77,7 +77,6 @@ const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile)
|
||||
}
|
||||
};
|
||||
const handleAvatarSuccess: UploadProps['onSuccess'] = (response: any) => {
|
||||
console.log(response);
|
||||
if (response.code === 500) {
|
||||
form.value.url = '';
|
||||
} else if (response.code === 200) {
|
||||
@@ -85,9 +84,7 @@ const handleAvatarSuccess: UploadProps['onSuccess'] = (response: any) => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleAvatarError: UploadProps['onError'] = (respones) => {
|
||||
console.log(respones);
|
||||
};
|
||||
const handleAvatarError: UploadProps['onError'] = (respones) => {};
|
||||
|
||||
const formRef = ref();
|
||||
const form = ref({
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['complaint:complaint:edit']">查看详情</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['repair:main:complaint']">查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -110,7 +110,6 @@ function init() {
|
||||
...res.data
|
||||
};
|
||||
const arr = getHousePathById(treedata.value, form.value.houseId);
|
||||
console.log(arr);
|
||||
userHousepath.value = arr;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['decoration:decoration:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['repair:add:decoration']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['decoration:decoration:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['repair:edit:decoration']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -60,16 +60,17 @@
|
||||
<el-table-column label="验收人" align="center" prop="inspectionName" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<!-- TODO 验收 -->
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
v-if="scope.row.inspectionResult !== '1'"
|
||||
@click="handleInspection(scope.row)"
|
||||
v-hasPermi="['decoration:decoration:edit']"
|
||||
v-hasPermi="['repair:edit:decoration']"
|
||||
>验收</el-button
|
||||
>
|
||||
<el-button link type="primary" v-else @click="handleUpdate(scope.row)" v-hasPermi="['decoration:decoration:edit']">详情</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['decoration:decoration:edit']">修改</el-button>
|
||||
<el-button link type="primary" v-else @click="handleInspection(scope.row)" v-hasPermi="['repair:edit:decoration']">详情</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['repair:edit:decoration']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['decoration:decoration:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['handleLog:handleLog:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['repair:add:handlelog']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['handleLog:handleLog:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['repair:edit:handlelog']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -54,7 +54,7 @@
|
||||
<el-table-column label="办事地点" align="center" prop="handlePosition" />
|
||||
<el-table-column label="操作" width="200" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['handleLog:handleLog:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['repair:edit:handlelog']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['handleLog:handleLog:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['monthCard:monthCard:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['carArea:add:monthcard']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['monthCard:monthCard:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['carArea:edit:monthcard']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -71,7 +71,7 @@
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['monthCard:monthCard:edit']"></el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['carArea:edit:monthcard']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['monthCard:monthCard:remove']"></el-button>
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['notice:notice:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['repair:add:noticepc']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['notice:notice:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['repair:edit:noticepc']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -61,7 +61,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="220" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['notice:notice:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['repair:edit:noticepc']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['notice:notice:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['parkingCost:parkingCost:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['carArea:add:parkingcost']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['parkingCost:parkingCost:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['carArea:edit:parkingcost']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -74,7 +74,7 @@
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['parkingCost:parkingCost:edit']"></el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['carArea:edit:parkingcost']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
|
||||
@@ -98,7 +98,6 @@ function init() {
|
||||
viewData.value.content = res.data.content as QuestionComponentItem[];
|
||||
}
|
||||
|
||||
console.log('问卷内容:', viewData.value);
|
||||
viewLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -173,7 +173,6 @@ async function handleEdit(id: string | number) {
|
||||
// 保存草稿
|
||||
async function handleSave(data: QuestionnaireForm) {
|
||||
try {
|
||||
console.log(data);
|
||||
// 父组件自己调用接口提交
|
||||
if (userid.value) {
|
||||
await updateQuestionnaire({
|
||||
@@ -205,7 +204,6 @@ async function handleSave(data: QuestionnaireForm) {
|
||||
// 发布问卷
|
||||
async function handlePublish(data: QuestionnaireForm) {
|
||||
try {
|
||||
console.log(data);
|
||||
if (userid.value) {
|
||||
await updateQuestionnaire({
|
||||
...data,
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['questionnaire:questionnaire:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['repair:add:questionnaire']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['questionnaire:questionnaire:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['repair:edit:questionnaire']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -63,8 +63,8 @@
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" fixed="right" width="200">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleView(scope.row)">查看</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['questionnaire:questionnaire:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleView(scope.row)" v-hasPermi="['repair:main:questionnaire']">查看</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['repair:edit:questionnaire']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['questionnaire:questionnaire:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button style="width: 120px" type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['repair:repair:add']">新增</el-button>
|
||||
<el-button style="width: 120px" type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['repair:add:repair']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['repair:repair:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['repair:edit:repair']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -68,8 +68,10 @@
|
||||
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleShare(scope.row)">{{ scope.row.problemStatus === '0' ? '分配' : '详情' }}</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['repair:repair:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleShare(scope.row)" v-hasPermi="['repair:main:repair']">{{
|
||||
scope.row.problemStatus === '0' ? '分配' : '详情'
|
||||
}}</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['repair:edit:repair']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['repair:repair:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -227,7 +227,6 @@ async function init() {
|
||||
}
|
||||
|
||||
const houseinfo = getHousePathById(treedata.value, form.value.houseId, 'label');
|
||||
console.log(treedata.value, form.value.houseId, houseinfo);
|
||||
form.value.house = houseinfo.join(' - ');
|
||||
|
||||
const residentinfo = residentList.value.find((item) => item.id === form.value.residentId);
|
||||
|
||||
@@ -118,8 +118,6 @@ if (route.query.id) {
|
||||
}
|
||||
// !== 提交 =============================================================================
|
||||
// 提交
|
||||
// TODO 收费项目提交
|
||||
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="项目名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
|
||||
<el-form-item label="项目名称" prop="itemName">
|
||||
<el-input v-model="queryParams.itemName" placeholder="请输入项目名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
@@ -21,10 +21,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['chargeItem:chargeItem:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['sdb:add:chargeitem']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['chargeItem:chargeItem:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['sdb:edit:chargeitem']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -85,7 +85,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['chargeItem:chargeItem:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['sdb:edit:chargeitem']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['chargeItem:chargeItem:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -126,34 +126,16 @@ const dialog = reactive<DialogOption>({
|
||||
|
||||
const initFormData: ChargeItemForm = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
billingMethod: undefined,
|
||||
price: undefined,
|
||||
unit: undefined,
|
||||
precision: undefined,
|
||||
carryMethod: undefined,
|
||||
lateFee: undefined,
|
||||
remark: undefined,
|
||||
villageId: undefined
|
||||
itemName: undefined
|
||||
};
|
||||
const data = reactive<PageData<ChargeItemForm, ChargeItemQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
billingMethod: undefined,
|
||||
price: undefined,
|
||||
unit: undefined,
|
||||
precision: undefined,
|
||||
carryMethod: undefined,
|
||||
lateFee: undefined,
|
||||
villageId: undefined,
|
||||
params: {}
|
||||
itemName: undefined
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '收费项目管理表id不能为空', trigger: 'blur' }]
|
||||
}
|
||||
rules: {}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
@@ -217,7 +199,6 @@ const handleUpdate = async (row?: ChargeItemVO) => {
|
||||
};
|
||||
|
||||
const handleSwitch = (val: string, row: ChargeItemVO) => {
|
||||
console.log(val, typeof val, row);
|
||||
// 1停用 0 启用
|
||||
updateChargeItem({
|
||||
id: row.id,
|
||||
|
||||
@@ -5,23 +5,19 @@
|
||||
<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="抄表名称" prop="name">
|
||||
<el-input v-model.trim="form.name" placeholder="请输入抄表名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="抄表设备类型" prop="deviceType">
|
||||
<el-form-item label="选择仪表" prop="deviceType">
|
||||
<el-radio-group v-model="form.deviceType" @change="handlechange">
|
||||
<el-radio label="电表" value="0"></el-radio>
|
||||
<el-radio label="水表" value="1"></el-radio>
|
||||
<el-radio label="电表" value="1"></el-radio>
|
||||
<el-radio label="水表" value="2"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="抄表项目" prop="payType">
|
||||
<!-- <el-form-item label="抄表项目" prop="payType">
|
||||
<el-radio-group v-model="form.payType" @change="handlechange2">
|
||||
<el-radio label="电费" value="0"></el-radio>
|
||||
<el-radio label="水费" value="1"></el-radio>
|
||||
<el-radio v-for="(item, index) in chargeitemlist" :key="index" :label="item.itemName" :value="item.id"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="抄表月份" prop="recordMonth">
|
||||
<el-date-picker v-model="form.recordMonth" :disabled-date="disabledDate" value-format="YYYY-MM" format="YYYY-MM" type="month" />
|
||||
<el-date-picker @update:model-value="handleMonth" v-model="form.recordMonth" value-format="YYYY-MM" format="YYYY-MM" type="month" />
|
||||
</el-form-item>
|
||||
<el-form-item label="起止日期" prop="price">
|
||||
<el-date-picker
|
||||
@@ -29,10 +25,10 @@
|
||||
@update:model-value="handleDate"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
:disabled-date="disabledDate"
|
||||
type="daterange"
|
||||
range-separator="到"
|
||||
start-placeholder="开始"
|
||||
:disabled-date="disabledDate"
|
||||
end-placeholder="结束"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -48,39 +44,23 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import Holder from '@/components/Holder/index.vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { listChargeItem } from '@/api/system/SdbChargeItem';
|
||||
import { getBill, updateBill, addBill } from '@/api/system/SdbBill';
|
||||
import type { DatePickerType } from 'element-plus';
|
||||
import { formatDate, formatDate2 } from '@/utils';
|
||||
import { Delete } from '@element-plus/icons-vue';
|
||||
import { func } from 'vue-types';
|
||||
import { addPayRecord, getPayRecord, updatePayRecord } from '@/api/system/SdbPayRecord';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_questionnaire_scope } = toRefs<any>(proxy?.useDict('com_questionnaire_scope'));
|
||||
const { com_bill_charge_period } = toRefs<any>(proxy?.useDict('com_bill_charge_period'));
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const formRef = ref();
|
||||
const form = ref({
|
||||
'deviceType': '0', // 设备类型 0电表 1水表
|
||||
'payType': '0', // 收费项目 0电费 1水费
|
||||
'name': '测试1', // 项目名称
|
||||
'deviceType': '1', // 设备类型 1电表 2水表
|
||||
'payType': '1', // 设备类型 1电表 2水表
|
||||
'recordMonth': '', // 抄表月份
|
||||
'startTime': '', // 开始时间
|
||||
'endTime': '' // 结束时间
|
||||
});
|
||||
const disabledDate = (time: Date) => {
|
||||
return time.getTime() > Date.now();
|
||||
};
|
||||
|
||||
// TODO 添加抄表
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: '请输入 项目名称', trigger: 'blur' }],
|
||||
chargeItemId: [{ required: true, message: '请选择 收费项目', trigger: 'blur' }],
|
||||
chargePeriod: [{ required: true, message: '请选择 费用周期', trigger: 'blur' }],
|
||||
startDate: [{ required: true, message: '请选择 起止日期', trigger: 'blur' }],
|
||||
endDate: [{ required: true, message: '请选择 起止日期', trigger: 'blur' }]
|
||||
});
|
||||
@@ -88,18 +68,58 @@ const userid = ref(null);
|
||||
|
||||
// 开始结束日期
|
||||
const StartEndDate = ref([]);
|
||||
|
||||
function handleDate(val: string[]) {
|
||||
form.value.startTime = val[0];
|
||||
form.value.endTime = val[1];
|
||||
if (val) {
|
||||
form.value.startTime = val[0];
|
||||
form.value.endTime = val[1];
|
||||
} else {
|
||||
form.value.endTime = '';
|
||||
form.value.startTime = '';
|
||||
}
|
||||
}
|
||||
const chargeitemlist = ref([]);
|
||||
|
||||
// 限制日期区间
|
||||
const chooseStart = ref<Date | null>(null);
|
||||
const chooseEnd = ref<Date | null>(null);
|
||||
|
||||
// =====================================
|
||||
// 月份选择后触发(修复时区BUG版)
|
||||
// =====================================
|
||||
function handleMonth(val: string) {
|
||||
form.value.recordMonth = val;
|
||||
|
||||
if (!val) {
|
||||
chooseStart.value = null;
|
||||
chooseEnd.value = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// ✅ 修复时区问题:强制解析为本地时间
|
||||
const [year, month] = val.split('-');
|
||||
const firstDay = new Date(Number(year), Number(month) - 1, 1); // 当月1号
|
||||
const lastDay = new Date(Number(year), Number(month), 0); // 当月最后1天
|
||||
|
||||
chooseStart.value = firstDay;
|
||||
chooseEnd.value = lastDay;
|
||||
}
|
||||
|
||||
// =====================================
|
||||
// 日期禁用逻辑(正确版)
|
||||
// =====================================
|
||||
const disabledDate = (time: Date) => {
|
||||
if (!chooseStart.value || !chooseEnd.value) return false;
|
||||
// 不在 [当月1号 ~ 当月最后1号] 之间 → 禁用
|
||||
return time < chooseStart.value || time > chooseEnd.value;
|
||||
};
|
||||
// const chargeitemlist = ref([]);
|
||||
function init() {
|
||||
listChargeItem().then((res) => {
|
||||
chargeitemlist.value = res.rows;
|
||||
});
|
||||
// listChargeItem().then((res) => {
|
||||
// chargeitemlist.value = res.rows;
|
||||
// });
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
getBill(userid.value).then((res) => {
|
||||
getPayRecord(userid.value).then((res) => {
|
||||
form.value = {
|
||||
...form.value,
|
||||
...res.data
|
||||
@@ -114,26 +134,19 @@ function handlechange(val: string) {
|
||||
form.value.deviceType = val;
|
||||
form.value.payType = val;
|
||||
}
|
||||
function handlechange2(val: string) {
|
||||
form.value.payType = val;
|
||||
form.value.deviceType = val;
|
||||
}
|
||||
|
||||
// !== 提交 =============================================================================
|
||||
|
||||
// 提交
|
||||
// TODO 收费项目提交
|
||||
|
||||
const submitForm = () => {
|
||||
form.value.startTime = form.value.startTime.split(' ')[0] + ' 00:00:00';
|
||||
form.value.endTime = form.value.endTime.split(' ')[0] + ' 23:59:59';
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (userid.value) {
|
||||
updateBill(form.value).then((res) => {
|
||||
updatePayRecord(form.value).then((res) => {
|
||||
ElMessage.success('编辑成功');
|
||||
cancelForm();
|
||||
});
|
||||
} else {
|
||||
addBill(form.value).then((res) => {
|
||||
addPayRecord(form.value).then((res) => {
|
||||
ElMessage.success('添加成功');
|
||||
cancelForm();
|
||||
});
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['payRecord:payRecord:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['sdb:add:payrecord']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['payRecord:payRecord:remove']"
|
||||
@@ -34,17 +34,19 @@
|
||||
|
||||
<el-table v-loading="loading" border :data="payRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="仪表名称" align="center" prop="name">
|
||||
<template #default="scope">{{ scope.row.name }} </template>
|
||||
<el-table-column label="收费设备类型" align="center" prop="deviceType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_waterelectricity_topup_type" :value="scope.row.deviceType"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收费项目" align="center" prop="payType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_payrecord_pay_type" :value="scope.row.payType"></dict-tag>
|
||||
<dict-tag :options="com_payrecord_pay_type" :value="scope.row.payType || ''"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="抄表周期" align="center" prop="recordMonth" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.recordMonth, '{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.recordMonth, '{y}-{m}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始日期" align="center" prop="startTime" width="180">
|
||||
@@ -64,8 +66,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleMain(scope.row)" v-hasPermi="['payRecord:payRecord:edit']">明细</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['payRecord:payRecord:remove']">删除</el-button>
|
||||
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['sdb:main:payrecord']">明细</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['payRecord:payRecord:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -171,7 +173,6 @@ const handleMain = async (row?: PayRecordVO) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
// TODO 抄表名称
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: PayRecordVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
|
||||
@@ -267,7 +267,6 @@ const handleUpdate = async (row?: PayRecordListVO) => {
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getPayRecordList(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
console.log(res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '抄表详细';
|
||||
};
|
||||
|
||||
@@ -5,39 +5,42 @@
|
||||
<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="账单名称" prop="name">
|
||||
<el-input v-model.trim="form.name" placeholder="请输入账单名称" />
|
||||
<el-form-item label="账单名称" prop="billName">
|
||||
<el-input v-model.trim="form.billName" placeholder="请输入账单名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收费项目" prop="chargeItemId">
|
||||
<el-select v-model="form.chargeItemId">
|
||||
<el-select v-model="form.chargeItemId" @change="handleChange">
|
||||
<el-option v-for="(item, index) in chargeitemlist" :key="index" :value="item.id" :label="item.itemName"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="收费范围" prop="chargeScope">
|
||||
<el-radio-group v-model="form.chargeScope">
|
||||
<el-radio v-for="(item, index) in com_questionnaire_scope" :key="index" :value="item.value" :label="item.label"></el-radio>
|
||||
<el-radio v-for="(item, index) in com_bill_charge_scope_house" :key="index" :value="item.value" :label="item.label"></el-radio>
|
||||
</el-radio-group>
|
||||
<div @click="() => handleClearCheckout" v-if="form.chargeScope === '1'" class="ml-10px cursor-pointer color-red">清空</div>
|
||||
<div @click="handleClearCheckout" v-if="form.chargeScope === '1'" class="ml-10px cursor-pointer color-red">清空</div>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.chargeScope === '1'">
|
||||
<div class="residentBox">
|
||||
<ul class="checkoutSideUsesbox">
|
||||
<li v-for="(item, index) in checkoutUses" :key="index">
|
||||
<span>{{ item.name }}</span>
|
||||
<el-icon @click="delteUse(item.id)">
|
||||
<span>{{ item.buildingName }}/</span>
|
||||
<span>{{ item.unitNo }}单元/</span>
|
||||
<span>{{ item.floorNo }}楼/</span>
|
||||
<span>{{ item.houseNo }}室</span>
|
||||
<el-icon @click="delteUse(item.houseId)">
|
||||
<Delete></Delete>
|
||||
</el-icon>
|
||||
</li>
|
||||
<Holder returnvalue="*" ref="HolderRef" :isMultiple="true" :userid="checkoutUses" @change="handleSelect">
|
||||
<House returnvalue="*" ref="HolderRef" :isMultiple="true" :userid="form.houseIds.join(',')" @change="handleSelect">
|
||||
<template #default>
|
||||
<li @click="OpenUseTablesfun" class="add justify-center">
|
||||
<el-icon>
|
||||
<DocumentAdd></DocumentAdd>
|
||||
</el-icon>
|
||||
<span>添加业主</span>
|
||||
<span>添加房屋</span>
|
||||
</li>
|
||||
</template>
|
||||
</Holder>
|
||||
</House>
|
||||
</ul>
|
||||
</div>
|
||||
</el-form-item>
|
||||
@@ -74,16 +77,16 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import Holder from '@/components/Holder/index.vue';
|
||||
import House from '@/components/Holder/house.vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { listChargeItem } from '@/api/system/SdbChargeItem';
|
||||
import { getBill, updateBill, addBill } from '@/api/system/SdbBill';
|
||||
import { getBill, updateBill, addBill, BillHouse, listBillHouse } from '@/api/system/SdbBill';
|
||||
import type { DatePickerType } from 'element-plus';
|
||||
import { formatDate, formatDate2 } from '@/utils';
|
||||
import { Delete } from '@element-plus/icons-vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_questionnaire_scope } = toRefs<any>(proxy?.useDict('com_questionnaire_scope'));
|
||||
const { com_bill_charge_scope_house } = toRefs<any>(proxy?.useDict('com_bill_charge_scope_house'));
|
||||
const { com_bill_charge_period } = toRefs<any>(proxy?.useDict('com_bill_charge_period'));
|
||||
|
||||
type PickerConfig = {
|
||||
@@ -101,19 +104,18 @@ const route = useRoute();
|
||||
const formRef = ref();
|
||||
const form = ref({
|
||||
'id': null,
|
||||
'name': '',
|
||||
'billName': '',
|
||||
'chargeItemId': '', // 收费项目
|
||||
'chargeScope': '0', // 业主范围
|
||||
'chargePeriod': '2', // 费用周期
|
||||
residents: '', // 部分业主
|
||||
houseIds: [], // 部分业主
|
||||
charegeTypeId: '', // typeid
|
||||
'startDate': '', // 开始
|
||||
'endDate': '', // 结束
|
||||
'remark': ''
|
||||
});
|
||||
// TODO 添加账单
|
||||
// TODO 账单详情
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: '请输入 项目名称', trigger: 'blur' }],
|
||||
billName: [{ required: true, message: '请输入 项目名称', trigger: 'blur' }],
|
||||
chargeItemId: [{ required: true, message: '请选择 收费项目', trigger: 'blur' }],
|
||||
chargePeriod: [{ required: true, message: '请选择 费用周期', trigger: 'blur' }],
|
||||
startDate: [{ required: true, message: '请选择 起止日期', trigger: 'blur' }],
|
||||
@@ -126,13 +128,21 @@ const StartEndDate = ref([]);
|
||||
function handleDate(val: string[]) {
|
||||
form.value.startDate = formatDate2(val[0]);
|
||||
form.value.endDate = formatDate2(val[1]);
|
||||
console.log(formatDate2(val[0]), formatDate2(val[1]));
|
||||
}
|
||||
|
||||
// 收费类型
|
||||
const chargeitemlist = ref([]);
|
||||
function init() {
|
||||
|
||||
// 房屋列表
|
||||
const houselist = ref([]);
|
||||
async function init() {
|
||||
listChargeItem().then((res) => {
|
||||
chargeitemlist.value = res.rows;
|
||||
});
|
||||
|
||||
const res = await listBillHouse({ pageNum: 1, pageSize: 999999 });
|
||||
houselist.value = res.rows;
|
||||
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
getBill(userid.value).then((res) => {
|
||||
@@ -140,38 +150,65 @@ function init() {
|
||||
...form.value,
|
||||
...res.data
|
||||
};
|
||||
form.value.houseIds = res.data.houseIds || [];
|
||||
form.value.startDate = formatDate2(form.value.startDate);
|
||||
form.value.endDate = formatDate2(form.value.endDate);
|
||||
StartEndDate.value = [form.value.startDate, form.value.endDate];
|
||||
|
||||
checkoutUses.value = form.value.houseIds
|
||||
.map((item) => {
|
||||
if (item) {
|
||||
const find = houselist.value.find((it) => it.houseId === item);
|
||||
if (find) {
|
||||
return find;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
})
|
||||
.filter((item) => item !== null);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
init();
|
||||
onMounted(() => {
|
||||
init();
|
||||
});
|
||||
|
||||
// 获取收费类型id
|
||||
function handleChange(val) {
|
||||
const find = chargeitemlist.value.find((item) => item.id === val);
|
||||
if (find) {
|
||||
form.value.charegeTypeId = find.typeId;
|
||||
}
|
||||
}
|
||||
// !== 业主 =============================================================================
|
||||
|
||||
// 打开
|
||||
const HolderRef = ref<InstanceType<typeof Holder>>();
|
||||
const HolderRef = ref<InstanceType<typeof House>>();
|
||||
function OpenUseTablesfun() {
|
||||
HolderRef.value.open();
|
||||
}
|
||||
// 多选
|
||||
const checkoutUses = ref([]);
|
||||
function handleSelect(val) {
|
||||
const checkoutUses = ref<BillHouse[]>([]);
|
||||
function handleSelect(val: BillHouse[]) {
|
||||
checkoutUses.value = val;
|
||||
form.value.residents = checkoutUses.value.join(',');
|
||||
form.value.houseIds = checkoutUses.value.map((item) => item.houseId);
|
||||
}
|
||||
// 删除
|
||||
|
||||
/** 删除房屋 */
|
||||
function delteUse(id: string | number) {
|
||||
checkoutUses.value = checkoutUses.value.filter((item) => item.id !== id);
|
||||
checkoutUses.value = checkoutUses.value.filter((item) => item.houseId !== id);
|
||||
}
|
||||
|
||||
/** 清空 */
|
||||
function handleClearCheckout() {
|
||||
checkoutUses.value = [];
|
||||
form.value.residents = '';
|
||||
form.value.houseIds = [];
|
||||
}
|
||||
// !== 业主 =============================================================================
|
||||
|
||||
// !== 提交 =============================================================================
|
||||
// 提交
|
||||
// TODO 收费项目提交
|
||||
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
@@ -219,7 +256,7 @@ const cancelForm = () => {
|
||||
}
|
||||
|
||||
.formBody {
|
||||
width: 650px;
|
||||
width: 950px;
|
||||
margin: 0 auto;
|
||||
|
||||
.residentBox {
|
||||
@@ -228,21 +265,31 @@ const cancelForm = () => {
|
||||
padding: 10px 5px;
|
||||
}
|
||||
.checkoutSideUsesbox {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 5px;
|
||||
// display: grid;
|
||||
// grid-template-columns: repeat(3, 1fr);
|
||||
// gap: 5px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-content: flex-start;
|
||||
justify-content: space-between;
|
||||
padding: 10px 5px;
|
||||
li {
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-width: 120px;
|
||||
|
||||
min-width: 240px;
|
||||
height: 35px;
|
||||
padding: 0 10px;
|
||||
line-height: 35px;
|
||||
margin-bottom: 10px;
|
||||
|
||||
background-color: #f3f9ff;
|
||||
border: 1px solid #8fc0f1;
|
||||
|
||||
margin-bottom: 10px;
|
||||
|
||||
@media (max-width: 2000px) {
|
||||
font-size: 12px;
|
||||
}
|
||||
@@ -253,6 +300,7 @@ const cancelForm = () => {
|
||||
font-size: 8px;
|
||||
}
|
||||
.el-icon {
|
||||
margin-left: 20px;
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: red;
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
<el-option v-for="(item, index) in chargeItems" :key="index" :value="item.id" :label="item.itemName"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="精确查询" prop="type">
|
||||
<!-- <el-form-item label="精确查询" prop="type">
|
||||
<el-select style="width: 150px; margin-right: 10px" v-model="queryParams.type">
|
||||
<el-option v-for="(item, index) in com_bill_search_filter" :key="index" :value="item.value" :label="item.label"></el-option>
|
||||
</el-select>
|
||||
<el-input v-model="queryParams.billCode" placeholder="请输入" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
@@ -29,10 +29,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:bill:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['bill:bill:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:bill:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['bill:bill:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:bill:remove']"
|
||||
@@ -46,14 +46,14 @@
|
||||
<el-table v-loading="loading" border :data="billList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="账单编号" align="center" prop="billCode" />
|
||||
<el-table-column label="账单名称" align="center" prop="billCode" />
|
||||
<el-table-column label="收费范围" align="center" prop="chargeScope">
|
||||
<el-table-column label="账单名称" align="center" prop="billName" />
|
||||
<el-table-column label="收费范围" align="center" prop="chargeScope" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_questionnaire_scope" :value="scope.row.chargeScope"></dict-tag>
|
||||
<dict-tag :options="com_bill_charge_scope_house" :value="scope.row.chargeScope"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收费项目" align="center" prop="chargeItemName" />
|
||||
<el-table-column label="收费周期" align="center" prop="chargePeriod">
|
||||
<el-table-column label="收费周期" align="center" prop="chargePeriod" width="80">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_bill_charge_period" :value="scope.row.chargePeriod"></dict-tag>
|
||||
</template>
|
||||
@@ -75,11 +75,11 @@
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="数量" align="center" prop="chargePeriod" />
|
||||
<el-table-column label="费用合计" align="center" prop="chargePeriod" /> -->
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" width="120" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:bill:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleMain(scope.row)" v-hasPermi="['system:bill:edit']">详情</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:bill:remove']">删除</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['bill:bill:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['bill:bill:query']">详情</el-button>
|
||||
<!-- <el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['system:bill:remove']">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -98,6 +98,7 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_bill_search_filter } = toRefs<any>(proxy?.useDict('com_bill_search_filter'));
|
||||
const { com_questionnaire_scope } = toRefs<any>(proxy?.useDict('com_questionnaire_scope'));
|
||||
const { com_bill_charge_period } = toRefs<any>(proxy?.useDict('com_bill_charge_period'));
|
||||
const { com_bill_charge_scope_house } = toRefs<any>(proxy?.useDict('com_bill_charge_scope_house'));
|
||||
|
||||
const billList = ref<BillVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
@@ -152,10 +153,14 @@ init();
|
||||
/** 查询账单管理列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listBill(queryParams.value);
|
||||
billList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
listBill(queryParams.value)
|
||||
.then((res) => {
|
||||
billList.value = res.rows;
|
||||
total.value = res.total;
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
@@ -178,7 +183,6 @@ const handleSelectionChange = (selection: BillVO[]) => {
|
||||
};
|
||||
|
||||
const router = useRouter();
|
||||
// TODO 添加账单
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
router.push({
|
||||
|
||||
@@ -5,28 +5,47 @@
|
||||
<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="账单名称" prop="name">
|
||||
<el-input disabled v-model.trim="form.name" placeholder="请输入账单名称" />
|
||||
<el-form-item label="账单名称" prop="billName">
|
||||
<el-input disabled v-model.trim="form.billName" placeholder="请输入账单名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收费项目" prop="materialName">
|
||||
<el-select disabled v-model="form.formula">
|
||||
<el-option v-for="(item, index) in com_charge_item_formula" :key="index" :value="item.value" :label="item.label"></el-option>
|
||||
<el-form-item label="收费项目" prop="chargeItemId">
|
||||
<el-select disabled v-model="form.chargeItemId" @change="handleChange">
|
||||
<el-option v-for="(item, index) in chargeitemlist" :key="index" :value="item.id" :label="item.itemName"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="收费范围" prop="billingMethod">
|
||||
<el-radio-group disabled v-model="form.billingMethod">
|
||||
<el-radio value="0">固定单价</el-radio>
|
||||
<el-form-item label="收费范围" prop="chargeScope">
|
||||
<el-radio-group disabled v-model="form.chargeScope">
|
||||
<el-radio v-for="(item, index) in com_questionnaire_scope" :key="index" :value="item.value" :label="item.label"></el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="费用周期" prop="unit">
|
||||
<el-select disabled v-model="form.unit">
|
||||
<el-option v-for="(item, index) in com_charge_item_unit" :key="index" :value="item.value" :label="item.label"></el-option>
|
||||
<el-form-item v-if="form.chargeScope === '1'">
|
||||
<div class="residentBox">
|
||||
<ul class="checkoutSideUsesbox">
|
||||
<li v-for="(item, index) in checkoutUses" :key="index">
|
||||
<span>{{ item.buildingName }} </span> / <span>{{ item.unitNo }}单元 </span> / <span>{{ item.floorNo }}楼 </span> /
|
||||
<span>{{ item.houseNo }}室</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="费用周期" prop="chargePeriod">
|
||||
<el-select disabled v-model="form.chargePeriod">
|
||||
<el-option v-for="(item, index) in com_bill_charge_period" :key="index" :value="item.value" :label="item.label"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="起止日期" prop="price">
|
||||
<el-input disabled v-model.trim="form.price" placeholder="请输入费用单价" />
|
||||
<el-date-picker
|
||||
disabled
|
||||
v-model="StartEndDate"
|
||||
@update:model-value="handleDate"
|
||||
:value-format="datepicker[form.chargePeriod].format"
|
||||
:format="datepicker[form.chargePeriod].format"
|
||||
:type="datepicker[form.chargePeriod].type"
|
||||
range-separator="到"
|
||||
start-placeholder="开始"
|
||||
end-placeholder="结束"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input disabled type="textarea" :rows="5" v-model.trim="form.remark" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
@@ -42,70 +61,105 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import Holder from '@/components/Holder/index.vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { getChargeItem, updateChargeItem, addChargeItem } from '@/api/system/SdbChargeItem';
|
||||
import { listChargeItem } from '@/api/system/SdbChargeItem';
|
||||
import { getBill, updateBill, addBill, listBillHouse } from '@/api/system/SdbBill';
|
||||
import type { DatePickerType } from 'element-plus';
|
||||
import { formatDate, formatDate2 } from '@/utils';
|
||||
import { Delete } from '@element-plus/icons-vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_charge_item_unit } = toRefs<any>(proxy?.useDict('com_charge_item_unit'));
|
||||
const { com_charge_item_precision } = toRefs<any>(proxy?.useDict('com_charge_item_precision'));
|
||||
const { com_charge_item_carry_method } = toRefs<any>(proxy?.useDict('com_charge_item_carry_method'));
|
||||
const { com_charge_item_formula } = toRefs<any>(proxy?.useDict('com_charge_item_formula'));
|
||||
const { com_questionnaire_scope } = toRefs<any>(proxy?.useDict('com_questionnaire_scope'));
|
||||
const { com_bill_charge_period } = toRefs<any>(proxy?.useDict('com_bill_charge_period'));
|
||||
|
||||
type PickerConfig = {
|
||||
type: DatePickerType;
|
||||
format: string;
|
||||
};
|
||||
const datepicker: Record<string, PickerConfig> = {
|
||||
'0': { type: 'yearrange', format: 'YYYY' },
|
||||
'1': { type: 'monthrange', format: 'YYYY-MM' },
|
||||
'2': { type: 'daterange', format: 'YYYY-MM-DD' }
|
||||
};
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const formRef = ref();
|
||||
const form = ref({
|
||||
'id': null,
|
||||
'name': '',
|
||||
'billingMethod': '0',
|
||||
'price': null,
|
||||
'unit': '',
|
||||
'precision': '',
|
||||
'carryMethod': '',
|
||||
'remark': '',
|
||||
'formula': ''
|
||||
'billName': '',
|
||||
'chargeItemId': '', // 收费项目
|
||||
'chargeScope': '0', // 业主范围
|
||||
'chargePeriod': '2', // 费用周期
|
||||
houseIds: [], // 部分业主
|
||||
charegeTypeId: '', // typeid
|
||||
'startDate': '', // 开始
|
||||
'endDate': '', // 结束
|
||||
'remark': ''
|
||||
});
|
||||
const rules = ref({
|
||||
name: [{ required: true, message: '请输入 项目名称', trigger: 'blur' }],
|
||||
billingMethod: [{ required: true, message: '请输入 计费方式', trigger: 'blur' }],
|
||||
price: [{ required: true, message: '请输入 费用单价', trigger: 'blur' }],
|
||||
formula: [{ required: true, message: '请选择 计费公式', trigger: 'blur' }],
|
||||
unit: [{ required: true, message: '请选择 计费单位', trigger: 'blur' }],
|
||||
precision: [{ required: true, message: '选择 计算精度', trigger: 'blur' }],
|
||||
carryMethod: [{ required: true, message: '请选择 进位方式', trigger: 'blur' }]
|
||||
billName: [{ required: true, message: '请输入 项目名称', trigger: 'blur' }],
|
||||
chargeItemId: [{ required: true, message: '请选择 收费项目', trigger: 'blur' }],
|
||||
chargePeriod: [{ required: true, message: '请选择 费用周期', trigger: 'blur' }],
|
||||
startDate: [{ required: true, message: '请选择 起止日期', trigger: 'blur' }],
|
||||
endDate: [{ required: true, message: '请选择 起止日期', trigger: 'blur' }]
|
||||
});
|
||||
const userid = ref(null);
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
getChargeItem(userid.value).then((res) => {
|
||||
form.value = {
|
||||
...form.value,
|
||||
...res.data
|
||||
};
|
||||
});
|
||||
}
|
||||
// !== 提交 =============================================================================
|
||||
// 提交
|
||||
// TODO 收费项目提交
|
||||
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (userid.value) {
|
||||
updateChargeItem(form.value).then((res) => {
|
||||
ElMessage.success('编辑成功');
|
||||
cancelForm();
|
||||
});
|
||||
} else {
|
||||
addChargeItem(form.value).then((res) => {
|
||||
ElMessage.success('添加成功');
|
||||
cancelForm();
|
||||
});
|
||||
}
|
||||
}
|
||||
// 开始结束日期
|
||||
const StartEndDate = ref([]);
|
||||
function handleDate(val: string[]) {
|
||||
form.value.startDate = formatDate2(val[0]);
|
||||
form.value.endDate = formatDate2(val[1]);
|
||||
}
|
||||
const chargeitemlist = ref([]);
|
||||
const houselist = ref([]);
|
||||
|
||||
const checkoutUses = ref([]);
|
||||
async function init() {
|
||||
listChargeItem().then((res) => {
|
||||
chargeitemlist.value = res.rows;
|
||||
});
|
||||
};
|
||||
const res = await listBillHouse({ pageNum: 1, pageSize: 999999 });
|
||||
houselist.value = res.rows;
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
getBill(userid.value).then((res) => {
|
||||
form.value = {
|
||||
...form.value,
|
||||
...res.data
|
||||
};
|
||||
form.value.houseIds = res.data.houseIds || [];
|
||||
StartEndDate.value = [formatDate(res.data.startDate), formatDate(res.data.endDate)];
|
||||
checkoutUses.value = form.value.houseIds
|
||||
.map((item) => {
|
||||
if (item) {
|
||||
const find = houselist.value.find((it) => it.houseId === item);
|
||||
if (find) {
|
||||
return find;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
})
|
||||
.filter((item) => item !== null);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
// 获取收费类型id
|
||||
function handleChange(val) {
|
||||
const find = chargeitemlist.value.find((item) => item.id === val);
|
||||
if (find) {
|
||||
form.value.charegeTypeId = find.typeId;
|
||||
}
|
||||
}
|
||||
|
||||
// !== 提交 =============================================================================
|
||||
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.back();
|
||||
@@ -138,6 +192,69 @@ const cancelForm = () => {
|
||||
.formBody {
|
||||
width: 650px;
|
||||
margin: 0 auto;
|
||||
|
||||
.residentBox {
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
padding: 10px 5px;
|
||||
}
|
||||
.checkoutSideUsesbox {
|
||||
// display: grid;
|
||||
// grid-template-columns: repeat(3, 1fr);
|
||||
// gap: 5px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-content: flex-start;
|
||||
justify-content: space-between;
|
||||
padding: 10px 5px;
|
||||
li {
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
min-width: 240px;
|
||||
height: 35px;
|
||||
padding: 0 10px;
|
||||
line-height: 35px;
|
||||
|
||||
background-color: #f3f9ff;
|
||||
border: 1px solid #8fc0f1;
|
||||
|
||||
margin-bottom: 10px;
|
||||
|
||||
@media (max-width: 2000px) {
|
||||
font-size: 12px;
|
||||
}
|
||||
@media (max-width: 1650px) {
|
||||
font-size: 10px;
|
||||
}
|
||||
@media (max-width: 1650px) {
|
||||
font-size: 8px;
|
||||
}
|
||||
.el-icon {
|
||||
margin-left: 20px;
|
||||
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;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" label-width="100px" :model="queryParams" :inline="true">
|
||||
<el-form-item label="设备状态" prop="status">
|
||||
<el-select v-model="queryParams.status">
|
||||
<!-- <el-form-item label="设备状态" prop="eleStatus">
|
||||
<el-select v-model="queryParams.eleStatus">
|
||||
<el-option v-for="(item, index) in com_waterdevice_on_status" :key="index" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -19,7 +19,7 @@
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="房间号" prop="houseName">
|
||||
<el-input v-model="queryParams.houseName" placeholder="请输入房间号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
@@ -36,7 +36,7 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleMarkqrcode" v-hasPermi="['waterRecord:waterRecord:add']"
|
||||
<el-button type="primary" plain icon="Plus" @click="handleMarkqrcode" v-hasPermi="['equipment:addqrcode:electricitydevice']"
|
||||
>批量生成条形码</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
<el-table v-loading="loading" border :data="ElectricityDeviceList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="电表设备编码" align="center" prop="deviceCode" />
|
||||
<el-table-column label="电表设备编码" width="250" align="center" prop="deviceCode" />
|
||||
<el-table-column label="设备状态" width="100" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="com_waterdevice_on_status" :value="scope.row.status"></dict-tag>
|
||||
@@ -63,14 +63,14 @@
|
||||
<span v-else>-----</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="户号" align="center" prop="houseName" />
|
||||
<el-table-column label="房屋" align="center" prop="houseName" />
|
||||
<el-table-column label="余额" width="100" align="center" prop="elePrice">
|
||||
<template #defaul="scope">
|
||||
<span v-if="scope.row.electricityRecord">{{ scope.row.electricityRecord.balance }}</span>
|
||||
<span v-else>-----</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="条形码" width="140" align="center" prop="deleted">
|
||||
<el-table-column label="条形码" width="250" align="center" prop="deleted">
|
||||
<template #default="scope">
|
||||
<el-image
|
||||
v-if="scope.row.url && scope.row.url.includes('http')"
|
||||
@@ -92,24 +92,44 @@
|
||||
<span>{{ scope.row.waterRecord ? scope.row.waterRecord.readTime : '--' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<!-- <el-table-column width="150" label="启停" align="center" prop="deleted" v-hasPermi="['equipment:isUse:electricitydevice']">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleRecode(scope.row)">充值记录</el-button>
|
||||
<el-button link type="primary" @click="handleQrCode(scope.row)">生成条码</el-button>
|
||||
<el-button link type="primary" @click="handleOpenDialog('usedWater', scope.row)">用电量</el-button>
|
||||
<el-button link type="primary" @click="handleOpenDialog('Upload', scope.row)">更新固件</el-button>
|
||||
<el-button link type="primary" @click="handleOpenDialog('UpdateHouse', scope.row)" v-hasPermi="['system:waterDevice:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-switch
|
||||
@change="(val: string) => handleChangeWater(val, scope.row)"
|
||||
v-model="scope.row.deleted"
|
||||
active-text="启用"
|
||||
inactive-text="停止"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-row>
|
||||
<el-col :span="24" class="flex flex-items-center">
|
||||
<el-button link type="primary" @click="handleRecode(scope.row)">充值记录</el-button>
|
||||
<el-button link type="primary" @click="handleQrCode(scope.row)">生成条码</el-button>
|
||||
<el-dropdown style="vertical-align: text-top">
|
||||
<el-button link type="primary" @click="handleRecode(scope.row)" v-hasPermi="['equipment:view:electricitydevice']">充值记录</el-button>
|
||||
<el-button link type="primary" @click="handleQrCode(scope.row)" v-hasPermi="['equipment:addqrcode:electricitydevice']"
|
||||
>生成条码</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleOpenDialog('usedWater', scope.row)" v-hasPermi="['equipment:useWater:electricitydevice']"
|
||||
>用水量</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleOpenDialog('Upload', scope.row)"
|
||||
v-hasPermi="['equipment:updatehardware:electricitydevice']"
|
||||
>更新固件</el-button
|
||||
>
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleOpenDialog('UpdateHouse', scope.row)"
|
||||
v-hasPermi="['equipment:edithouse:electricitydevice']"
|
||||
>修改</el-button
|
||||
>
|
||||
<!-- <el-dropdown style="vertical-align: text-top">
|
||||
<el-button link type="primary">
|
||||
<div>
|
||||
更多<el-icon><arrow-down /></el-icon>
|
||||
@@ -118,17 +138,17 @@
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item>
|
||||
<div @click="handleOpenDialog('usedWater', scope.row)">用电量</div>
|
||||
<div @click="handleOpenDialog('usedWater', scope.row)" v-hasPermi="['equipment:used:electricitydevice']">用电量</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<div @click="handleOpenDialog('Upload', scope.row)">更新固件</div>
|
||||
<div @click="handleOpenDialog('Upload', scope.row)" v-hasPermi="['equipment:updatehardware:electricitydevice']">更新固件</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<div @click="handleOpenDialog('UpdateHouse', scope.row)" v-hasPermi="['system:waterDevice:edit']">修改</div>
|
||||
<div @click="handleOpenDialog('UpdateHouse', scope.row)" v-hasPermi="['equipment:edithouse:electricitydevice']">修改</div>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</el-dropdown> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
@@ -306,7 +326,6 @@ function headerToken() {
|
||||
}
|
||||
const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) => {
|
||||
// 1. 校验后缀
|
||||
console.log(rawFile);
|
||||
if (!rawFile.name.endsWith('.bin')) {
|
||||
ElMessage.warning('请上传 .bin 后缀的文件');
|
||||
return false;
|
||||
@@ -367,7 +386,6 @@ const handleSelectionChange = (selection: ElectricityDeviceVO[]) => {
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
// TODO 生成条码
|
||||
/** 生成二维码 */
|
||||
const handleQrCode = (row: ElectricityDeviceVO) => {
|
||||
// 1.电表 2.电表
|
||||
@@ -426,7 +444,6 @@ function getTree() {
|
||||
/** 电表 启停*/
|
||||
// TODO 修改水电表 启停
|
||||
const handleChangeWater = (val: string, row: ElectricityDeviceVO) => {};
|
||||
// TODO 修改电表户号
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
if (dialogType.value === 'usedWater') {
|
||||
@@ -503,7 +520,6 @@ const resetQuery = () => {
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
// TODO 充值记录 查询
|
||||
/** 充值记录 */
|
||||
const handleRecode = (row: ElectricityDeviceVO) => {
|
||||
// 1.电表 2.电表
|
||||
@@ -522,7 +538,6 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
const download = (url: string) => {
|
||||
console.log(url);
|
||||
if (!url) return;
|
||||
if (!url.includes('http')) return;
|
||||
// 创建一个隐藏的 a 标签,直接跳转下载
|
||||
|
||||
@@ -5,16 +5,16 @@
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" label-width="100px" :model="queryParams" :inline="true">
|
||||
<el-form-item label="设备状态" prop="eleStatus">
|
||||
<!-- <el-form-item label="设备状态" prop="eleStatus">
|
||||
<el-select v-model="queryParams.eleStatus">
|
||||
<el-option v-for="(item, index) in com_waterdevice_on_status" :key="index" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="分合状态" prop="status">
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="分合状态" prop="status">
|
||||
<el-select v-model="queryParams.status">
|
||||
<el-option v-for="(item, index) in com_water_readrecord_status" :key="index" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="房间号" prop="houseName">
|
||||
<el-input v-model="queryParams.houseName" placeholder="请输入房间号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
@@ -31,7 +31,7 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleMarkqrcode" v-hasPermi="['waterRecord:waterRecord:add']"
|
||||
<el-button type="primary" plain icon="Plus" @click="handleMarkqrcode" v-hasPermi="['equipment:addqrcode:waterdevice']"
|
||||
>批量生成条形码</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -53,11 +53,11 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="分合状态" width="100" align="center">
|
||||
<template #default="scope">
|
||||
<dict-tag v-if="scope.row.status" :options="com_water_readrecord_status" :value="scope.row.status"></dict-tag>
|
||||
<dict-tag v-if="scope.row.status" :options="com_electricity_readrecord_status" :value="scope.row.waterRecord.status"></dict-tag>
|
||||
<span v-else>-------</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="户号" align="center" prop="houseName" />
|
||||
<el-table-column label="房屋" align="center" prop="houseName" />
|
||||
<el-table-column label="余额" width="120" align="center" prop="deviceCode">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.waterRecord">{{ scope.row.waterRecord.balance }}</span>
|
||||
@@ -81,12 +81,12 @@
|
||||
<span v-else>暂未生成</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="抄表时间" width="200" align="center">
|
||||
<el-table-column label="抄表时间" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.waterRecord ? scope.row.waterRecord.readTime : '--' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column width="150" label="启停" align="center" prop="deleted">
|
||||
<!-- <el-table-column width="150" label="启停" align="center" prop="deleted" v-hasPermi="['equipment:isUse:waterdevice']">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
@change="(val: string) => handleChangeWater(val, scope.row)"
|
||||
@@ -98,13 +98,22 @@
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" align="center" width="250" fixed="right" class-name="small-padding fixed-width">
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-row>
|
||||
<el-col :span="24" class="flex flex-items-center">
|
||||
<el-button link type="primary" @click="handleRecode(scope.row)">充值记录</el-button>
|
||||
<el-button link type="primary" @click="handleQrCode(scope.row)">生成条码</el-button>
|
||||
<el-dropdown style="vertical-align: text-top">
|
||||
<el-button link type="primary" @click="handleRecode(scope.row)" v-hasPermi="['equipment:view:waterdevice']">充值记录</el-button>
|
||||
<el-button link type="primary" @click="handleQrCode(scope.row)" v-hasPermi="['equipment:addqrcode:waterdevice']">生成条码</el-button>
|
||||
<el-button link type="primary" @click="handleOpenDialog('usedWater', scope.row)" v-hasPermi="['equipment:useWater:waterdevice']"
|
||||
>用水量</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleOpenDialog('Upload', scope.row)" v-hasPermi="['equipment:updatehardware:waterdevice']"
|
||||
>更新固件</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleOpenDialog('UpdateHouse', scope.row)" v-hasPermi="['equipment:edithouse:waterdevice']"
|
||||
>绑定房屋</el-button
|
||||
>
|
||||
<!-- <el-dropdown style="vertical-align: text-top">
|
||||
<el-button link type="primary">
|
||||
<div>
|
||||
更多<el-icon><arrow-down /></el-icon>
|
||||
@@ -113,17 +122,17 @@
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item>
|
||||
<div @click="handleOpenDialog('usedWater', scope.row)">用水量</div>
|
||||
<div @click="handleOpenDialog('usedWater', scope.row)" v-hasPermi="['equipment:useWater:waterdevice']">用水量</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<div @click="handleOpenDialog('Upload', scope.row)">更新固件</div>
|
||||
<div @click="handleOpenDialog('Upload', scope.row)" v-hasPermi="['equipment:updatehardware:waterdevice']">更新固件</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<div @click="handleOpenDialog('UpdateHouse', scope.row)" v-hasPermi="['system:waterDevice:edit']">修改</div>
|
||||
<div @click="handleOpenDialog('UpdateHouse', scope.row)" v-hasPermi="['equipment:edithouse:waterdevice']">修改</div>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</el-dropdown> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
@@ -139,8 +148,8 @@
|
||||
<el-form-item label="设备编号" prop="deviceCode"> {{ UsedWaterform.deviceCode }} </el-form-item>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker
|
||||
format="YYYY-MM-DD HH:MM:ss"
|
||||
value-format="YYYY-MM-DD HH:MM:ss"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
v-model="UsedWaterform.startTime"
|
||||
type="datetime"
|
||||
placeholder="开始时间"
|
||||
@@ -148,8 +157,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker
|
||||
format="YYYY-MM-DD HH:MM:ss"
|
||||
value-format="YYYY-MM-DD HH:MM:ss"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
v-model="UsedWaterform.endTime"
|
||||
type="datetime"
|
||||
placeholder="结束时间"
|
||||
@@ -160,24 +169,47 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- upload file -->
|
||||
<el-form v-else-if="dialogType === 'Upload'" ref="UploadFileformRef" :model="UploadFileform" :rules="UploadFileformRules" label-width="120px">
|
||||
<el-form-item label="上传更新文件" prop="file">
|
||||
<el-form v-else-if="dialogType === 'Upload'" ref="UploadFileformRef" :model="UploadFileform" :rules="UploadFileformRules" label-width="140px">
|
||||
<el-form-item label="上传 A槽更新 文件" prop="fileA">
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
accept=".bin"
|
||||
:action="uploadUrl"
|
||||
:action="uploadAUrl"
|
||||
name="file"
|
||||
:headers="headerToken()"
|
||||
:show-file-list="true"
|
||||
class="upload-demo"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:on-success="handleAvatarSuccessA"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
>
|
||||
<div class="uploadFileBox flex flex-items-center">
|
||||
<el-icon>
|
||||
<upload></upload>
|
||||
</el-icon>
|
||||
<div style="margin-left: 10px">上传文件</div>
|
||||
<div style="margin-left: 10px">上传A文件</div>
|
||||
</div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip">文件格式必须是 bin 格式</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传 B槽更新 文件" prop="fileB">
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
accept=".bin"
|
||||
:action="uploadBUrl"
|
||||
name="file"
|
||||
:headers="headerToken()"
|
||||
:show-file-list="true"
|
||||
class="upload-demo"
|
||||
:on-success="handleAvatarSuccessB"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
>
|
||||
<div class="uploadFileBox flex flex-items-center">
|
||||
<el-icon>
|
||||
<upload></upload>
|
||||
</el-icon>
|
||||
<div style="margin-left: 10px">上传B文件</div>
|
||||
</div>
|
||||
<template #tip>
|
||||
<div class="el-upload__tip">文件格式必须是 bin 格式</div>
|
||||
@@ -214,20 +246,28 @@
|
||||
|
||||
<script setup name="WaterDevice" lang="ts">
|
||||
import 'element-plus/theme-chalk/display.css';
|
||||
import { listWaterDevice, getWaterDeviceTimeRangeUsedWater, WaterDeviceMakerQrcode, updateWaterDevice } from '@/api/system/SdbWaterDevice/index';
|
||||
import {
|
||||
listWaterDevice,
|
||||
getWaterDeviceTimeRangeUsedWater,
|
||||
WaterDeviceMakerQrcode,
|
||||
updateWaterDevice,
|
||||
WaterDeviceUpdateBin
|
||||
} from '@/api/system/SdbWaterDevice/index';
|
||||
import { WaterDeviceVO, WaterDeviceQuery, WaterDeviceForm } from '@/api/system/SdbWaterDevice/type';
|
||||
import { useHouseStore } from '@/store/modules/house';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { getHousePathById } from '@/utils/house';
|
||||
import { Upload } from '@element-plus/icons-vue';
|
||||
import { CascaderValue, tourEmits, UploadProps, UploadRawFile } from 'element-plus';
|
||||
import { formatDate } from '@/utils/time';
|
||||
|
||||
const huhao = 3096371295;
|
||||
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/waterDevice/upload';
|
||||
const uploadAUrl = import.meta.env.VITE_APP_BASE_API + '/waterDevice/uploadA';
|
||||
const uploadBUrl = import.meta.env.VITE_APP_BASE_API + '/waterDevice/uploadB';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_waterdevice_on_status } = toRefs<any>(proxy?.useDict('com_waterdevice_on_status'));
|
||||
const { com_water_readrecord_status } = toRefs<any>(proxy?.useDict('com_water_readrecord_status'));
|
||||
const { com_electricity_readrecord_status } = toRefs<any>(proxy?.useDict('com_electricity_readrecord_status'));
|
||||
|
||||
const waterDeviceList = ref<WaterDeviceVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
@@ -284,9 +324,9 @@ const UsedWaterInfo = ref({
|
||||
const UploadFileformRef = ref(null);
|
||||
const uploadRef = ref();
|
||||
const UploadFileform = ref({
|
||||
id: '',
|
||||
deviceCode: '',
|
||||
file: ''
|
||||
deviceCodes: [],
|
||||
urlA: '',
|
||||
urlB: ''
|
||||
});
|
||||
const UploadFileformRules = {
|
||||
file: [{ required: true, message: '更新文件不能为空', trigger: 'blur' }]
|
||||
@@ -299,7 +339,6 @@ function headerToken() {
|
||||
}
|
||||
const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) => {
|
||||
// 1. 校验后缀
|
||||
console.log(rawFile);
|
||||
if (!rawFile.name.endsWith('.bin')) {
|
||||
ElMessage.warning('请上传 .bin 后缀的文件');
|
||||
return false;
|
||||
@@ -318,8 +357,11 @@ const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile)
|
||||
}
|
||||
return true;
|
||||
};
|
||||
const handleAvatarSuccess: UploadProps['onSuccess'] = (response: any) => {
|
||||
UploadFileform.value.file = response.data.url;
|
||||
const handleAvatarSuccessA: UploadProps['onSuccess'] = (response: any) => {
|
||||
UploadFileform.value.urlA = response.data.url;
|
||||
};
|
||||
const handleAvatarSuccessB: UploadProps['onSuccess'] = (response: any) => {
|
||||
UploadFileform.value.urlB = response.data.url;
|
||||
};
|
||||
|
||||
// ? 上传固件 ==============================================================================================
|
||||
@@ -328,7 +370,8 @@ const handleAvatarSuccess: UploadProps['onSuccess'] = (response: any) => {
|
||||
// 编辑房屋
|
||||
const EditHouseformRef = ref(null);
|
||||
const EditHouseformRules = {
|
||||
file: [{ required: true, message: '更新文件不能为空', trigger: 'blur' }]
|
||||
fileA: [{ required: true, message: 'A文件不能为空', trigger: 'blur' }],
|
||||
fileB: [{ required: true, message: 'B文件不能为空', trigger: 'blur' }]
|
||||
};
|
||||
const EditHouseform = ref({
|
||||
id: '',
|
||||
@@ -388,13 +431,11 @@ const handleOpenDialog = (type: 'usedWater' | 'Upload' | 'UpdateHouse', row: Wat
|
||||
reset();
|
||||
if (type === 'usedWater') {
|
||||
UsedWaterform.value.deviceCode = row.deviceCode;
|
||||
UsedWaterform.value.startTime = new Date().toLocaleString();
|
||||
UsedWaterform.value.endTime = new Date().toLocaleString();
|
||||
UsedWaterform.value.startTime = '';
|
||||
UsedWaterform.value.endTime = '';
|
||||
usedWaterInfo.value = true;
|
||||
} else if (type === 'Upload') {
|
||||
UploadFileform.value.file = '';
|
||||
UploadFileform.value.deviceCode = row.deviceCode;
|
||||
UploadFileform.value.id = row.id;
|
||||
UploadFileform.value.deviceCodes = [row.deviceCode];
|
||||
} else if (type === 'UpdateHouse') {
|
||||
EditHouseform.value.id = row.id;
|
||||
EditHouseform.value.deviceCode = row.deviceCode;
|
||||
@@ -444,6 +485,8 @@ const submitForm = () => {
|
||||
unSubmit();
|
||||
}
|
||||
});
|
||||
} else if (dialogType.value === 'Upload') {
|
||||
WaterDeviceUpdateBin(UploadFileform.value);
|
||||
}
|
||||
};
|
||||
const unSubmit = () => {
|
||||
@@ -469,6 +512,11 @@ const reset = () => {
|
||||
deviceCode: '',
|
||||
houseId: ''
|
||||
};
|
||||
|
||||
UploadFileform.value.deviceCodes = [];
|
||||
UploadFileform.value.urlA = '';
|
||||
UploadFileform.value.urlB = '';
|
||||
|
||||
// 上传 清空
|
||||
UploadFileformRef.value?.resetFields();
|
||||
// 使用水量 清空
|
||||
@@ -508,7 +556,6 @@ onMounted(() => {
|
||||
});
|
||||
|
||||
const download = (url: string) => {
|
||||
console.log(url);
|
||||
if (!url) return;
|
||||
if (!url.includes('http')) return;
|
||||
// 创建一个隐藏的 a 标签,直接跳转下载
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['visitor:visitor:remove']">访客详情</el-button>
|
||||
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['repair:main:visitor']">访客详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -76,7 +76,6 @@ const parkingid = ref(null);
|
||||
if (route.query.id) {
|
||||
parkingid.value = route.query.id;
|
||||
getArea(parkingid.value).then((res) => {
|
||||
console.log(res);
|
||||
form.value = {
|
||||
...form.value,
|
||||
...res.data
|
||||
|
||||
@@ -24,10 +24,12 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['area:area:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['carArea:add:carArea']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['area:area:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['carArea:edit:carArea']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['area:area:remove']"
|
||||
|
||||
@@ -230,7 +230,6 @@ const cancelForm = () => {
|
||||
|
||||
// 选择住户
|
||||
function handleChange(pop) {
|
||||
console.log(pop);
|
||||
form.value.residentId = pop;
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['car:car:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['carArea:add:cars']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['car:car:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['carArea:edit:car']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['car:car:remove']">删除</el-button>
|
||||
@@ -129,9 +129,7 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 持有人 */
|
||||
const ResidentList = ref([]);
|
||||
const getResidentName = (id: string | number) => {
|
||||
console.log(ResidentList.value, id);
|
||||
const find = ResidentList.value.find((item) => item.id == id);
|
||||
console.log(find);
|
||||
return find.name;
|
||||
};
|
||||
|
||||
|
||||
@@ -139,7 +139,6 @@ const checkoutuseid = computed(() => {
|
||||
});
|
||||
const checkoutuser = ref([]);
|
||||
function handleCheckoutUser(row) {
|
||||
console.log(row);
|
||||
checkoutuser.value = row;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:device:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['equipment:add:archive']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:device:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['equipment:edit:archive']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -56,8 +56,8 @@
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleMain(scope.row)">查看详情</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['system:device:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['equipment:main:archive']">查看详情</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['equipment:edit:archive']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['system:device:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:deviceCategory:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['equipment:add:deviceCategory']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:deviceCategory:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['equipment:edit:deviceCategory']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:deviceCategory:remove']"
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['equipment:delete:deviceCategory']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -49,12 +49,8 @@
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:deviceCategory:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:deviceCategory:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['equipment:edit:deviceCategory']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['equipment:delete:deviceCategory']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -142,7 +142,6 @@ const checkoutuseid = computed(() => {
|
||||
});
|
||||
const checkoutuser = ref([]);
|
||||
function handleCheckoutUser(row) {
|
||||
console.log(row);
|
||||
checkoutuser.value = row;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:deviceRepair:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['equipment:add:repair']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:deviceRepair:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['equipment:edit:repair']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -61,8 +61,8 @@
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" width="160" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleMain(scope.row)">详情</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['system:deviceRepair:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['equipment:main:repair']">详情</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['equipment:edit:repair']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['system:deviceRepair:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="buildingheader flex align-center justify-between">
|
||||
<div>楼栋</div>
|
||||
<div>
|
||||
<span class="pointer" @click="handleAddBuilding">+增加楼栋</span>
|
||||
<span class="pointer" @click="handleAddBuilding" v-hasPermi="['house:add:building']">+增加楼栋</span>
|
||||
</div>
|
||||
</div>
|
||||
<ul>
|
||||
@@ -14,10 +14,10 @@
|
||||
}"
|
||||
:key="index"
|
||||
>
|
||||
<div class="buildingname" @click="switchBuilding(item.id ?? null)">{{ item.buildingName ?? '测试数据' }}</div>
|
||||
<div class="buildingname" @click="switchBuilding(item.id ?? null)">{{ item.buildingName ?? '' }}</div>
|
||||
<div class="buildactions flex align-center justify-around">
|
||||
<el-icon class="pointer hover-color-blue" @click="editBuilding(item.id)"><Setting /></el-icon>
|
||||
<el-icon class="pointer hover-color-red" @click="deleteBuilding(item.id)"><Delete /></el-icon>
|
||||
<el-icon class="pointer hover-color-blue" @click="editBuilding(item.id)" v-hasPermi="['house:edit:building']"><Setting /></el-icon>
|
||||
<el-icon class="pointer hover-color-red" @click="deleteBuilding(item.id)" v-hasPermi="['house:delete:building']"><Delete /></el-icon>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -39,7 +39,7 @@ const handleAddBuilding = () => {
|
||||
path: '/house/addbuilding'
|
||||
});
|
||||
};
|
||||
const editBuilding = (id: number) => {
|
||||
const editBuilding = (id: string) => {
|
||||
router.push({
|
||||
path: '/house/editbuilding',
|
||||
query: {
|
||||
@@ -47,7 +47,7 @@ const editBuilding = (id: number) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
const deleteBuilding = (id: number) => {
|
||||
const deleteBuilding = (id: string) => {
|
||||
proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').then(() => {
|
||||
deleteBuildingApi(id).then(() => {
|
||||
houseStore.deleteBuildingFun(id);
|
||||
|
||||
@@ -57,7 +57,6 @@ const handleCalp = (event: MouseEvent, houseid: string) => {
|
||||
border-radius: 4px;
|
||||
margin: 5px;
|
||||
padding-left: 10px;
|
||||
padding-top: 3px;
|
||||
}
|
||||
.house:hover {
|
||||
background: #e8f3ff;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
min-width="260"
|
||||
align="center"
|
||||
:label="`${unit.unitNo}单元`"
|
||||
v-for="(unit, index) in houseStore.currentHouseInfoList?.units ?? []"
|
||||
v-for="(unit, index) in houseStore.currentHouseInfoList?.units.length > 0 ? houseStore.currentHouseInfoList?.units : []"
|
||||
:key="index"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
@@ -27,6 +27,7 @@
|
||||
import { deleteHouseApi } from '@/api/system/house';
|
||||
import houseItem from './houseItem.vue';
|
||||
import { useHouseStore } from '@/store/modules/house';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
|
||||
const houseStore = useHouseStore();
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@@ -35,9 +36,12 @@ const router = useRouter();
|
||||
const menutlist = [
|
||||
{ label: '编辑', value: 'edit' },
|
||||
// { label: '收费标准', value: 'money' },
|
||||
{ label: '详情', value: 'main' },
|
||||
{ label: '删除', value: 'delete' }
|
||||
{ label: '详情', value: 'main' }
|
||||
];
|
||||
|
||||
if (checkPermi(['house:delete:house'])) {
|
||||
menutlist.push({ label: '删除', value: 'delete' });
|
||||
}
|
||||
function handleChangeCheckhouses(val: string[]) {
|
||||
houseStore.checkoutHousesFun([]);
|
||||
houseStore.checkoutHousesFun(val);
|
||||
@@ -53,7 +57,6 @@ function contextMenuFun(val: { type: string; value: string }) {
|
||||
});
|
||||
break;
|
||||
case 'money':
|
||||
console.log('你选择了:', val);
|
||||
break;
|
||||
case 'main':
|
||||
router.push({
|
||||
@@ -64,6 +67,10 @@ function contextMenuFun(val: { type: string; value: string }) {
|
||||
});
|
||||
break;
|
||||
case 'delete':
|
||||
if (!checkPermi(['house:delete:house'])) {
|
||||
break;
|
||||
}
|
||||
|
||||
proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').then(() => {
|
||||
deleteHouseApi(val.value).then(() => {
|
||||
houseStore.switchBuilding(houseStore.currentBuildingInfo.id);
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
<span class="mr-30px">楼栋结构:{{ houseStore.currentBuildingInfo?.buildStructure }} </span>
|
||||
</div>
|
||||
<div class="rightActions">
|
||||
<span class="mr-20px" @click="handleAddHouse">+增加房屋</span>
|
||||
<span class="mr-20px" @click="handleAddHouse" v-hasPermi="['house:add:house']">+增加房屋</span>
|
||||
<!-- <span class="mr-20px">收费标准设置</span> -->
|
||||
<span @click="deleteAllhouse">删除</span>
|
||||
<span @click="deleteAllhouse" v-hasPermi="['house:delete:house']">删除</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="UnitBody">
|
||||
|
||||
@@ -39,7 +39,6 @@ const { buildingtype, currentVilageInfo } = storeToRefs(houseStore);
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_build_use } = toRefs<any>(proxy?.useDict('com_build_use'));
|
||||
|
||||
houseStore.initHouse(houseStore.buildingtype);
|
||||
// 初始化数据
|
||||
</script>
|
||||
|
||||
@@ -251,7 +251,6 @@ async function gettreedata() {
|
||||
...form.value,
|
||||
...res.data
|
||||
};
|
||||
console.log(form.value);
|
||||
housedeviceslist.value = form.value.facilities.split(',').filter((item) => item);
|
||||
const imgurllist = splitStringUrl(form.value.houseImageUrl);
|
||||
fileList.value = imgurllist;
|
||||
|
||||
@@ -137,7 +137,6 @@ async function init() {
|
||||
getHouseRental(houseRentalid.value).then((res) => {
|
||||
HouseInfo.value = res.data;
|
||||
HouseInfo.value.facilitieslist = res.data.facilities.split(',').filter((item) => item);
|
||||
console.log(HouseInfo.value.facilitieslist);
|
||||
HouseInfo.value.houseImageUrls = HouseInfo.value.houseImageUrl.split(',').filter((item) => item);
|
||||
const arr = getHousePathById(treedata.value, HouseInfo.value.houseId, 'label');
|
||||
HouseInfo.value.house = arr.join(' - ');
|
||||
@@ -147,7 +146,6 @@ init();
|
||||
|
||||
function handlefacilities(id: string) {
|
||||
const find = housefacilities.value.find((item) => item.id === id);
|
||||
console.log(find, id);
|
||||
return find ? find.name : '';
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:item:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['inspection:add:item']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:item:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['inspection:edit:item']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:item:remove']"
|
||||
@@ -54,7 +56,7 @@
|
||||
<el-table-column label="操作" width="300" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:item:edit']"></el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['inspection:edit:item']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:item:remove']"></el-button>
|
||||
@@ -190,7 +192,6 @@ const handleUpdate = async (row?: ItemVO) => {
|
||||
};
|
||||
|
||||
const handleChange = (value: string, id: string) => {
|
||||
console.log(value, id, typeof value, typeof id);
|
||||
updateItemStatus({
|
||||
id,
|
||||
status: value
|
||||
|
||||
@@ -268,7 +268,6 @@ function handleEcartsData(row: (typeof ecartslist.value)[number]) {
|
||||
// 根据 x 轴日期生成数据数组
|
||||
const xAxisDates = getLastNDays(diffday.value, undefined, 'YYYY/MM/DD'); // 确保格式为 ['2024-04-16', ...]
|
||||
const arr = xAxisDates.map((date) => dataMap.get(date) || 0);
|
||||
console.log(xAxisDates, dataMap);
|
||||
xAxislist.value = xAxisDates;
|
||||
handleEcartsOptions(arr, row.name, [row.color]);
|
||||
}
|
||||
|
||||
@@ -190,7 +190,6 @@ function handlChangeMap(val) {
|
||||
}
|
||||
if (find.pathPoints && typeof find.pathPoints === 'string') {
|
||||
const path = JSON.parse(find.pathPoints);
|
||||
console.log(path);
|
||||
//创建 Polyline 实例
|
||||
const polyline = new AMapLib.value.Polyline({
|
||||
path: path,
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:plan:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['inspection:add:plan']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:plan:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['inspection:edit:plan']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:plan:remove']"
|
||||
@@ -53,7 +55,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="110" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['system:plan:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['inspection:edit:plan']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['system:plan:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -140,7 +142,6 @@ const getList = async () => {
|
||||
.split(',')
|
||||
.sort((a, b) => Number(a) - Number(b))
|
||||
.map((item) => Number(item));
|
||||
console.log(item.executeDayNames);
|
||||
});
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
|
||||
@@ -169,8 +169,7 @@ onMounted(async () => {
|
||||
version: '2.0',
|
||||
plugins: ['AMap.Scale', 'AMap.Marker']
|
||||
}).then(async (AMap) => {
|
||||
const villageinfo = await getVillageByIdAPI(Number(villageid));
|
||||
console.log(villageinfo);
|
||||
const villageinfo = await getVillageByIdAPI(villageid);
|
||||
map.value = new AMap.Map('containerMap', {
|
||||
viewMode: '3D',
|
||||
zoom: 11,
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:point:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['inspection:add:point']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:point:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['inspection:edit:point']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:point:remove']"
|
||||
@@ -53,7 +55,7 @@
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:point:edit']"></el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['inspection:edit:point']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:point:remove']"></el-button>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<el-table-column label="关联计划" align="center" prop="planName" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)">查看详情</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['inspection:main:record']">查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -21,10 +21,12 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:route:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['inspection:add:route']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:route:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['inspection:edit:route']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:route:remove']"
|
||||
@@ -54,7 +56,7 @@
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:route:edit']"></el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['inspection:edit:route']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:route:remove']"></el-button>
|
||||
|
||||
@@ -91,7 +91,6 @@ const handleQuery = () => {
|
||||
queryParams.value.taskTimeBegin = checkdata.value[0];
|
||||
queryParams.value.taskTimeEnd = checkdata.value[1];
|
||||
queryParams.value.pageNum = 1;
|
||||
console.log(queryParams.value);
|
||||
getList();
|
||||
};
|
||||
|
||||
|
||||
@@ -156,7 +156,6 @@ function handleUserChange(val) {
|
||||
checkoutUserlist.value = val;
|
||||
}
|
||||
function handleDelete(id) {
|
||||
console.log(id, checkoutUserlist.value);
|
||||
checkoutUserlist.value = checkoutUserlist.value.filter((item) => item.userId !== id);
|
||||
}
|
||||
|
||||
@@ -224,7 +223,6 @@ function handleRoute(route: RouteVO) {
|
||||
// ! 添加路线
|
||||
if (route.pathPoints && typeof route.pathPoints === 'string') {
|
||||
const path = JSON.parse(route.pathPoints);
|
||||
console.log(path);
|
||||
//创建 Polyline 实例
|
||||
const polyline = new AMapLib.value.Polyline({
|
||||
path: path,
|
||||
|
||||
@@ -35,10 +35,12 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:task:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['inspection:add:task']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:task:edit']">修改</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['inspection:edit:task']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:task:remove']"
|
||||
@@ -69,7 +71,7 @@
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:task:edit']"></el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['inspection:edit:task']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:task:remove']"></el-button>
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['parking:parking:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['carArea:add:parking']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['parking:parking:edit']"
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['carArea:edit:parking']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
@@ -74,8 +74,8 @@
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleMain(scope.row)" v-hasPermi="['parking:parking:edit']">审核</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['parking:parking:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleMain(scope.row)" v-hasPermi="['carArea:main:parking']">审核</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['carArea:edit:parking']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['parking:parking:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -229,8 +229,6 @@ function handleActivestaus(rews) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log(active.value);
|
||||
}
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -191,10 +191,8 @@ if (route.query.id) {
|
||||
userInfo.value = res.data;
|
||||
// 获取 审核流程
|
||||
getresidentReviewlistAPI(userid.value).then((res) => {
|
||||
console.log(res);
|
||||
if (res.rows[0]) {
|
||||
reviewInfo.value = res.rows[0];
|
||||
console.log(reviewInfo.value);
|
||||
handleActivestaus(reviewInfo.value);
|
||||
}
|
||||
});
|
||||
@@ -258,7 +256,6 @@ function updatePass(val: '0' | '1' | '2') {
|
||||
'propertyStatus': val,
|
||||
'residentId': userid.value
|
||||
};
|
||||
console.log(reviewInfo.value);
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,9 @@ const currentVilageInfo = ref({
|
||||
|
||||
function init() {
|
||||
houseStore.getviliageinfo(localStorage.getItem('villageid')).then((res) => {
|
||||
currentVilageInfo.value = res;
|
||||
if (res) {
|
||||
currentVilageInfo.value = res;
|
||||
}
|
||||
});
|
||||
}
|
||||
init();
|
||||
|
||||
@@ -308,6 +308,7 @@ const initFormData: UserForm = {
|
||||
userName: '',
|
||||
nickName: undefined,
|
||||
password: '',
|
||||
villageIds: '',
|
||||
phonenumber: undefined,
|
||||
email: undefined,
|
||||
sex: undefined,
|
||||
@@ -323,6 +324,7 @@ const initData: PageData<UserForm, UserQuery> = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userName: '',
|
||||
villageIds: '',
|
||||
phonenumber: '',
|
||||
status: '',
|
||||
deptId: '',
|
||||
@@ -534,6 +536,9 @@ const handleUpdate = async (row?: UserForm) => {
|
||||
roleOptions.value = Array.from(new Map([...data.roles, ...data.user.roles].map((role) => [role.roleId, role])).values());
|
||||
form.value.postIds = data.postIds;
|
||||
form.value.roleIds = data.roleIds;
|
||||
if (data.user.villageIds) {
|
||||
villags.value = data.user.villageIds.split(',').filter((item) => item);
|
||||
}
|
||||
form.value.password = '';
|
||||
};
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<el-table-column label="备注" show-overflow-tooltip align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['system:material:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['warehouse:edit:inventory']">修改</el-button>
|
||||
<!-- <el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['system:material:remove']">删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -100,7 +100,6 @@ function init() {
|
||||
}
|
||||
init();
|
||||
const handlePrint = () => {
|
||||
console.log('print');
|
||||
// window.print();
|
||||
printVueDiv('print-area', '仓库出库单');
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:stockOut:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['warehouse:add:issueout']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:stockOut:remove']"
|
||||
@@ -31,7 +31,7 @@
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<!-- TODO 没有编辑 -->
|
||||
<el-table v-loading="loading" border :data="stockOutList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" flexd width="55" align="center" />
|
||||
<el-table-column label="出库单号" flexd align="center" prop="outNo" />
|
||||
@@ -47,7 +47,7 @@
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" width="180" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['system:stockOut:edit']">查看清单</el-button>
|
||||
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['warehouse:main:stockoutmain']">查看清单</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['system:stockOut:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:material:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['warehouse:add:material']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:material:remove']"
|
||||
@@ -41,12 +41,8 @@
|
||||
<el-table-column label="备注" show-overflow-tooltip align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:material:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:material:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['warehouse:edit:material']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['system:material:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -100,7 +100,6 @@ function init() {
|
||||
}
|
||||
init();
|
||||
const handlePrint = () => {
|
||||
console.log('print');
|
||||
// window.print();
|
||||
printVueDiv('print-area', '仓库入库单');
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:stockIn:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['warehouse:add:purchasein']">新增</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@@ -42,8 +42,8 @@
|
||||
<el-table-column label="备注" show-overflow-tooltip align="center" prop="remark" />
|
||||
<el-table-column label="操作" width="200" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['system:stockIn:edit']">查看清单</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['system:stockIn:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['warehouse:main:purchasein']">查看清单</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['warehouse:edit:purchasein']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['system:stockIn:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:supplier:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['warehouse:add:supplier']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:supplier:remove']"
|
||||
@@ -42,12 +42,8 @@
|
||||
<el-table-column label="备注" show-overflow-tooltip align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:supplier:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:supplier:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['warehouse:edit:supplier']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['system:supplier:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:warehouse:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['warehouse:add:warehouse']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:warehouse:remove']"
|
||||
@@ -53,7 +53,7 @@
|
||||
<el-table-column label="备注" width="80" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:warehouse:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['warehouse:edit:warehouse']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:warehouse:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -64,13 +64,13 @@
|
||||
<!-- 添加或修改仓库对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="warehouseFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="仓库名称*" prop="warehouseName">
|
||||
<el-form-item label="仓库名称" prop="warehouseName">
|
||||
<el-input v-model="form.warehouseName" placeholder="请输入仓库名称*" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库归属id*" prop="villageId">
|
||||
<el-form-item label="仓库归属id" prop="villageId">
|
||||
<el-input v-model="form.villageId" placeholder="请输入仓库归属id*" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人*" prop="contactPerson">
|
||||
<el-form-item label="联系人" prop="contactPerson">
|
||||
<el-input v-model="form.contactPerson" placeholder="请输入联系人*" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话*" prop="contactPhone">
|
||||
|
||||
@@ -207,7 +207,7 @@ const villageinfo = ref({
|
||||
});
|
||||
// 获取小区
|
||||
function getVillageinfo() {
|
||||
const id = Number(localStorage.getItem('villageid'));
|
||||
const id = localStorage.getItem('villageid');
|
||||
getVillageByIdAPI(id).then((res) => {
|
||||
villageinfo.value = res.data;
|
||||
houseStore.updateVilageinfo(res.data);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user