Compare commits

..

No commits in common. "c54a6f92fb4f2eeb90587e1ce2dbea2cef8cfbf3" and "57c370b2dd54a8c4f65a04ebdf96221c047fe6e8" have entirely different histories.

8 changed files with 78 additions and 149 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,7 +15,7 @@
<el-input :placeholder="$t('staff.phoneNumber')" v-model="searchConditions.tel" clearable />
</el-col>
<el-col :span="6">
<el-button type="primary" @click="searchStaff">
<el-button type="primary" @click="queryStaff">
{{ $t('staff.search') }}
</el-button>
</el-col>
@ -67,7 +67,7 @@
<el-row class="margin-top">
<el-col :span="16">
<div class="tip-text"></div>
<div class="tip-text">{{ $t('staff.tip') }}</div>
</el-col>
<el-col :span="8" class="text-right">
<el-pagination :current-page="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size"
@ -128,10 +128,6 @@ export default {
console.error('获取字典数据失败:', error)
}
},
searchStaff() {
this.pagination.current = 1
this.queryStaff()
},
async queryStaff() {
try {
const params = {
@ -150,7 +146,7 @@ export default {
relCdName: relCdItem ? relCdItem.name : ''
}
})
this.pagination.total = res.total
this.pagination.total = res.data.total
} catch (error) {
console.error('查询员工信息失败:', error)