From cbeb361bfddf428708fdfdac8e585f7936061b97 Mon Sep 17 00:00:00 2001 From: wuxw <928255095@qq.com> Date: Fri, 31 Oct 2025 10:09:33 +0800 Subject: [PATCH] =?UTF-8?q?v1.9=20=E5=B7=A1=E6=A3=80=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=BA=9B=E6=98=BE=E7=A4=BA=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/inspection/inspectionPlanApi.js | 197 ++++++++++++------ .../inspection/DeleteInspectionRoutePoint.vue | 2 +- .../inspection/InspectionRoutePoint.vue | 2 +- src/components/inspection/RouteTask.vue | 2 - .../inspection/deleteInspectionPlan.vue | 8 +- src/views/inspection/inspectionPlanList.vue | 2 +- src/views/inspection/inspectionRouteList.vue | 4 +- 7 files changed, 142 insertions(+), 75 deletions(-) diff --git a/src/api/inspection/inspectionPlanApi.js b/src/api/inspection/inspectionPlanApi.js index 01b63493d..b126384bb 100644 --- a/src/api/inspection/inspectionPlanApi.js +++ b/src/api/inspection/inspectionPlanApi.js @@ -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) + }) + }) } \ No newline at end of file diff --git a/src/components/inspection/DeleteInspectionRoutePoint.vue b/src/components/inspection/DeleteInspectionRoutePoint.vue index ac100ae0f..02dd509e1 100644 --- a/src/components/inspection/DeleteInspectionRoutePoint.vue +++ b/src/components/inspection/DeleteInspectionRoutePoint.vue @@ -1,6 +1,6 @@