mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-23 21:36:37 +08:00
v1.9 巡检功能修复一些显示的bug
This commit is contained in:
parent
57c370b2dd
commit
cbeb361bfd
@ -3,102 +3,167 @@ import { getCommunityId } from '@/api/community/communityApi'
|
||||
|
||||
// 获取字典数据
|
||||
export function getDict(dictType, state) {
|
||||
return request({
|
||||
url: '/dict.listDict',
|
||||
method: 'get',
|
||||
params: { dictType, state }
|
||||
}).then(res => res.data)
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: '/dict.listDict',
|
||||
method: 'get',
|
||||
params: { dictType, state }
|
||||
}).then(response => {
|
||||
const res = response.data
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 查询巡检计划列表
|
||||
export function listInspectionPlans(params) {
|
||||
return request({
|
||||
url: '/inspectionPlan.listInspectionPlans',
|
||||
method: 'get',
|
||||
params: {
|
||||
communityId: getCommunityId(),
|
||||
...params
|
||||
}
|
||||
}).then(res => res.data)
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: '/inspectionPlan.listInspectionPlans',
|
||||
method: 'get',
|
||||
params: {
|
||||
...params,
|
||||
communityId: getCommunityId()
|
||||
}
|
||||
}).then(response => {
|
||||
const res = response.data
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 更新巡检计划状态
|
||||
export function updateInspectionPlanState(data) {
|
||||
return request({
|
||||
url: '/inspectionPlan.updateInspectionPlanState',
|
||||
method: 'post',
|
||||
data: {
|
||||
communityId: getCommunityId(),
|
||||
...data
|
||||
}
|
||||
}).then(res => res.data)
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: '/inspectionPlan.updateInspectionPlanState',
|
||||
method: 'post',
|
||||
data: {
|
||||
...data,
|
||||
communityId: getCommunityId()
|
||||
}
|
||||
}).then(response => {
|
||||
const res = response.data
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 删除巡检计划
|
||||
export function deleteInspectionPlan(data) {
|
||||
return request({
|
||||
url: '/inspectionPlan.deleteInspectionPlan',
|
||||
method: 'post',
|
||||
data: {
|
||||
communityId: getCommunityId(),
|
||||
...data
|
||||
}
|
||||
}).then(res => res.data)
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: '/inspectionPlan.deleteInspectionPlan',
|
||||
method: 'post',
|
||||
data: {
|
||||
...data,
|
||||
communityId: getCommunityId()
|
||||
}
|
||||
}).then(response => {
|
||||
const res = response.data
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 更新巡检计划
|
||||
export function updateInspectionPlan(data) {
|
||||
return request({
|
||||
url: '/inspectionPlan.updateInspectionPlan',
|
||||
method: 'post',
|
||||
data: {
|
||||
communityId: getCommunityId(),
|
||||
...data
|
||||
}
|
||||
}).then(res => res.data)
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: '/inspectionPlan.updateInspectionPlan',
|
||||
method: 'post',
|
||||
data: {
|
||||
...data,
|
||||
communityId: getCommunityId()
|
||||
}
|
||||
}).then(response => {
|
||||
const res = response.data
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 查询巡检路线列表
|
||||
export function listInspectionRoutes(params) {
|
||||
return request({
|
||||
url: '/inspectionRoute.listInspectionRoutes',
|
||||
method: 'get',
|
||||
params: {
|
||||
communityId: getCommunityId(),
|
||||
...params
|
||||
}
|
||||
}).then(res => res.data)
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: '/inspectionRoute.listInspectionRoutes',
|
||||
method: 'get',
|
||||
params: {
|
||||
...params,
|
||||
communityId: getCommunityId()
|
||||
}
|
||||
}).then(response => {
|
||||
const res = response.data
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 查询巡检计划员工
|
||||
export function listInspectionPlanStaffs(params) {
|
||||
return request({
|
||||
url: '/inspection.listInspectionPlanStaffs',
|
||||
method: 'get',
|
||||
params: {
|
||||
communityId: getCommunityId(),
|
||||
...params
|
||||
}
|
||||
}).then(res => res.data)
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: '/inspection.listInspectionPlanStaffs',
|
||||
method: 'get',
|
||||
params: {
|
||||
...params,
|
||||
communityId: getCommunityId()
|
||||
}
|
||||
}).then(response => {
|
||||
const res = response.data
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 查询组织树
|
||||
export function listOrgTree() {
|
||||
return request({
|
||||
url: '/org.listOrgTree',
|
||||
method: 'get',
|
||||
params: { communityId: getCommunityId() }
|
||||
}).then(res => res.data)
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: '/org.listOrgTree',
|
||||
method: 'get',
|
||||
params: {
|
||||
communityId: getCommunityId()
|
||||
}
|
||||
}).then(response => {
|
||||
const res = response.data
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 根据组织ID查询员工
|
||||
export function listStaffsByOrgId(params) {
|
||||
return request({
|
||||
url: '/query.staff.infos',
|
||||
method: 'get',
|
||||
params: {
|
||||
communityId: getCommunityId(),
|
||||
...params
|
||||
}
|
||||
}).then(res => res.data)
|
||||
return new Promise((resolve, reject) => {
|
||||
request({
|
||||
url: '/query.staff.infos',
|
||||
method: 'get',
|
||||
params: {
|
||||
...params,
|
||||
communityId: getCommunityId()
|
||||
}
|
||||
}).then(response => {
|
||||
const res = response.data
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="$t('common.confirmOperation')"
|
||||
:title="$t('common.delete')"
|
||||
:visible.sync="visible"
|
||||
width="30%"
|
||||
@close="handleClose"
|
||||
|
||||
@ -132,7 +132,7 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.inspection-route-point-container {
|
||||
padding: 20px;
|
||||
padding: 10px;
|
||||
|
||||
.margin-bottom {
|
||||
margin-bottom: 20px;
|
||||
|
||||
@ -109,7 +109,6 @@ export default {
|
||||
li {
|
||||
padding: 10px;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid #eee;
|
||||
transition: all 0.3s;
|
||||
|
||||
&:hover {
|
||||
@ -122,7 +121,6 @@ export default {
|
||||
}
|
||||
|
||||
.task-user {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.task-time {
|
||||
|
||||
@ -33,12 +33,16 @@ export default {
|
||||
|
||||
async confirmDelete() {
|
||||
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.visible = false
|
||||
this.$emit('success')
|
||||
} catch (error) {
|
||||
this.$message.error(this.$t('inspectionPlan.deleteError'))
|
||||
this.$message.error(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,6 +230,6 @@ export default {
|
||||
}
|
||||
|
||||
.card-content {
|
||||
padding: 20px;
|
||||
padding: 0px;
|
||||
}
|
||||
</style>
|
||||
@ -175,7 +175,7 @@ export default {
|
||||
this.$refs.deleteInspectionRoute.open(route)
|
||||
},
|
||||
_queryInspectionRouteMethod() {
|
||||
this._listInspectionRoutes(1, 10)
|
||||
this._listInspectionRoutes(1, 100)
|
||||
},
|
||||
_switchInspectionRoute(route) {
|
||||
this.inspectionRouteInfo.route = route
|
||||
@ -190,7 +190,7 @@ export default {
|
||||
}, 500)
|
||||
},
|
||||
handleSuccess() {
|
||||
this._listInspectionRoutes(1, 10)
|
||||
this._listInspectionRoutes(1, 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user