v1.9 巡检功能修复一些显示的bug

This commit is contained in:
wuxw 2025-10-31 10:09:33 +08:00
parent 57c370b2dd
commit cbeb361bfd
7 changed files with 142 additions and 75 deletions

View File

@ -3,102 +3,167 @@ import { getCommunityId } from '@/api/community/communityApi'
// 获取字典数据 // 获取字典数据
export function getDict(dictType, state) { export function getDict(dictType, state) {
return request({ return new Promise((resolve, reject) => {
request({
url: '/dict.listDict', url: '/dict.listDict',
method: 'get', method: 'get',
params: { dictType, state } params: { dictType, state }
}).then(res => res.data) }).then(response => {
const res = response.data
resolve(res)
}).catch(error => {
reject(error)
})
})
} }
// 查询巡检计划列表 // 查询巡检计划列表
export function listInspectionPlans(params) { export function listInspectionPlans(params) {
return request({ return new Promise((resolve, reject) => {
request({
url: '/inspectionPlan.listInspectionPlans', url: '/inspectionPlan.listInspectionPlans',
method: 'get', method: 'get',
params: { params: {
communityId: getCommunityId(), ...params,
...params communityId: getCommunityId()
} }
}).then(res => res.data) }).then(response => {
const res = response.data
resolve(res)
}).catch(error => {
reject(error)
})
})
} }
// 更新巡检计划状态 // 更新巡检计划状态
export function updateInspectionPlanState(data) { export function updateInspectionPlanState(data) {
return request({ return new Promise((resolve, reject) => {
request({
url: '/inspectionPlan.updateInspectionPlanState', url: '/inspectionPlan.updateInspectionPlanState',
method: 'post', method: 'post',
data: { data: {
communityId: getCommunityId(), ...data,
...data communityId: getCommunityId()
} }
}).then(res => res.data) }).then(response => {
const res = response.data
resolve(res)
}).catch(error => {
reject(error)
})
})
} }
// 删除巡检计划 // 删除巡检计划
export function deleteInspectionPlan(data) { export function deleteInspectionPlan(data) {
return request({ return new Promise((resolve, reject) => {
request({
url: '/inspectionPlan.deleteInspectionPlan', url: '/inspectionPlan.deleteInspectionPlan',
method: 'post', method: 'post',
data: { data: {
communityId: getCommunityId(), ...data,
...data communityId: getCommunityId()
} }
}).then(res => res.data) }).then(response => {
const res = response.data
resolve(res)
}).catch(error => {
reject(error)
})
})
} }
// 更新巡检计划 // 更新巡检计划
export function updateInspectionPlan(data) { export function updateInspectionPlan(data) {
return request({ return new Promise((resolve, reject) => {
request({
url: '/inspectionPlan.updateInspectionPlan', url: '/inspectionPlan.updateInspectionPlan',
method: 'post', method: 'post',
data: { data: {
communityId: getCommunityId(), ...data,
...data communityId: getCommunityId()
} }
}).then(res => res.data) }).then(response => {
const res = response.data
resolve(res)
}).catch(error => {
reject(error)
})
})
} }
// 查询巡检路线列表 // 查询巡检路线列表
export function listInspectionRoutes(params) { export function listInspectionRoutes(params) {
return request({ return new Promise((resolve, reject) => {
request({
url: '/inspectionRoute.listInspectionRoutes', url: '/inspectionRoute.listInspectionRoutes',
method: 'get', method: 'get',
params: { params: {
communityId: getCommunityId(), ...params,
...params communityId: getCommunityId()
} }
}).then(res => res.data) }).then(response => {
const res = response.data
resolve(res)
}).catch(error => {
reject(error)
})
})
} }
// 查询巡检计划员工 // 查询巡检计划员工
export function listInspectionPlanStaffs(params) { export function listInspectionPlanStaffs(params) {
return request({ return new Promise((resolve, reject) => {
request({
url: '/inspection.listInspectionPlanStaffs', url: '/inspection.listInspectionPlanStaffs',
method: 'get', method: 'get',
params: { params: {
communityId: getCommunityId(), ...params,
...params communityId: getCommunityId()
} }
}).then(res => res.data) }).then(response => {
const res = response.data
resolve(res)
}).catch(error => {
reject(error)
})
})
} }
// 查询组织树 // 查询组织树
export function listOrgTree() { export function listOrgTree() {
return request({ return new Promise((resolve, reject) => {
request({
url: '/org.listOrgTree', url: '/org.listOrgTree',
method: 'get', method: 'get',
params: { communityId: getCommunityId() } params: {
}).then(res => res.data) communityId: getCommunityId()
}
}).then(response => {
const res = response.data
resolve(res)
}).catch(error => {
reject(error)
})
})
} }
// 根据组织ID查询员工 // 根据组织ID查询员工
export function listStaffsByOrgId(params) { export function listStaffsByOrgId(params) {
return request({ return new Promise((resolve, reject) => {
request({
url: '/query.staff.infos', url: '/query.staff.infos',
method: 'get', method: 'get',
params: { params: {
communityId: getCommunityId(), ...params,
...params communityId: getCommunityId()
} }
}).then(res => res.data) }).then(response => {
const res = response.data
resolve(res)
}).catch(error => {
reject(error)
})
})
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<el-dialog <el-dialog
:title="$t('common.confirmOperation')" :title="$t('common.delete')"
:visible.sync="visible" :visible.sync="visible"
width="30%" width="30%"
@close="handleClose" @close="handleClose"

View File

@ -132,7 +132,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.inspection-route-point-container { .inspection-route-point-container {
padding: 20px; padding: 10px;
.margin-bottom { .margin-bottom {
margin-bottom: 20px; margin-bottom: 20px;

View File

@ -109,7 +109,6 @@ export default {
li { li {
padding: 10px; padding: 10px;
cursor: pointer; cursor: pointer;
border-bottom: 1px solid #eee;
transition: all 0.3s; transition: all 0.3s;
&:hover { &:hover {
@ -122,7 +121,6 @@ export default {
} }
.task-user { .task-user {
font-weight: bold;
} }
.task-time { .task-time {

View File

@ -33,12 +33,16 @@ export default {
async confirmDelete() { async confirmDelete() {
try { try {
await deleteInspectionPlan({ inspectionPlanId: this.currentPlanId }) const {code,msg} = await deleteInspectionPlan({ inspectionPlanId: this.currentPlanId })
if(code != 0){
this.$message.error(msg)
return
}
this.$message.success(this.$t('common.operationSuccess')) this.$message.success(this.$t('common.operationSuccess'))
this.visible = false this.visible = false
this.$emit('success') this.$emit('success')
} catch (error) { } catch (error) {
this.$message.error(this.$t('inspectionPlan.deleteError')) this.$message.error(error)
} }
} }
} }

View File

@ -230,6 +230,6 @@ export default {
} }
.card-content { .card-content {
padding: 20px; padding: 0px;
} }
</style> </style>

View File

@ -175,7 +175,7 @@ export default {
this.$refs.deleteInspectionRoute.open(route) this.$refs.deleteInspectionRoute.open(route)
}, },
_queryInspectionRouteMethod() { _queryInspectionRouteMethod() {
this._listInspectionRoutes(1, 10) this._listInspectionRoutes(1, 100)
}, },
_switchInspectionRoute(route) { _switchInspectionRoute(route) {
this.inspectionRouteInfo.route = route this.inspectionRouteInfo.route = route
@ -190,7 +190,7 @@ export default {
}, 500) }, 500)
}, },
handleSuccess() { handleSuccess() {
this._listInspectionRoutes(1, 10) this._listInspectionRoutes(1, 100)
} }
} }
} }