diff --git a/pages/attendanceStatus/attendanceStatistics.vue b/pages/attendanceStatus/attendanceStatistics.vue index 888877a..db6c26c 100644 --- a/pages/attendanceStatus/attendanceStatistics.vue +++ b/pages/attendanceStatus/attendanceStatistics.vue @@ -12,11 +12,11 @@ - {{ serviceInfo.SERVERPART_NAME ? serviceInfo.SERVERPART_NAME : + {{ serviceInfo.SAName ? serviceInfo.SAName : '请选择服务区' }} -

{{ serviceInfo.SPREGIONTYPE_NAME ? serviceInfo.SPREGIONTYPE_NAME : '' }} -

+
@@ -40,7 +40,7 @@ {{ selectDate ? $util.cutDate(new Date(selectDate), 'YYYY-MM') : "" - }} + }} @@ -220,7 +220,7 @@ {{ getCurrentValue(item) }}{{ getCurrentUnit() - }} + }}
@@ -262,14 +262,15 @@ export default { this.menu = uni.getMenuButtonBoundingClientRect() let currentService = uni.getStorageSync('currentService') this.serviceInfo = currentService - this.handleGetServerpartDetail(currentService.Serverpart_ID || currentService.SERVERPART_ID) - this.handleGetData(currentService.SERVERPART_NAME) + // this.handleGetServerpartDetail(currentService.Serverpart_ID || currentService.SERVERPART_ID) + this.handleGetData(currentService.SAName) }, async onShow() { let currentService = uni.getStorageSync('currentService') - if (currentService.Serverpart_ID !== this.serviceInfo.SERVERPART_ID && !this.isFirst) { - this.handleGetServerpartDetail(currentService.Serverpart_ID) - this.handleGetData(currentService.SERVERPART_NAME) + if (currentService.SACode !== this.serviceInfo.SACode && !this.isFirst) { + // this.handleGetServerpartDetail(currentService.Serverpart_ID) + this.serviceInfo = currentService + this.handleGetData(currentService.SAName) } this.isFirst = false }, @@ -283,7 +284,7 @@ export default { retryLoad() { if (this.retryCount < 3) { this.retryCount++ - this.handleGetData(this.serviceInfo.SERVERPART_NAME) + this.handleGetData(this.serviceInfo.SAName) } else { uni.showToast({ title: '多次重试失败,请检查网络连接', @@ -391,7 +392,7 @@ export default { onCalendarConfirm(e) { console.log('选择日期:', e) this.selectDate = e.fulldate - this.handleGetData(this.serviceInfo.SERVERPART_NAME) + this.handleGetData(this.serviceInfo.SAName) }, // 日历关闭 @@ -518,7 +519,7 @@ export default { this.selectDate = `${y}-${m}-${d}`; this.retryCount = 0 // 重置重试次数 - await this.handleGetData(this.serviceInfo.SERVERPART_NAME) + await this.handleGetData(this.serviceInfo.SAName) }, } } diff --git a/pages/attendanceStatus/emergencyEvents.vue b/pages/attendanceStatus/emergencyEvents.vue index 48f0e04..fced8e9 100644 --- a/pages/attendanceStatus/emergencyEvents.vue +++ b/pages/attendanceStatus/emergencyEvents.vue @@ -339,7 +339,7 @@ export default { this.showList = [] const req = { bsessionKey: "EA65F66FA29B47FD8072A4AFC66967B3", - saName: this.serviceInfo.SERVERPART_NAME + saName: this.serviceInfo.SAName } const data = await new Promise((resolve, reject) => { uni.request({ @@ -368,7 +368,7 @@ export default { this.showList = [] const req = { bsessionKey: "0DAF3A5982D54A619D4B63A34CA20C55", - saName: this.serviceInfo.SERVERPART_NAME + saName: this.serviceInfo.SAName } const data = await new Promise((resolve, reject) => { uni.request({ diff --git a/pages/attendanceStatus/index.vue b/pages/attendanceStatus/index.vue index 3fef38c..21d7790 100644 --- a/pages/attendanceStatus/index.vue +++ b/pages/attendanceStatus/index.vue @@ -11,11 +11,11 @@ - {{ serviceInfo.SERVERPART_NAME ? serviceInfo.SERVERPART_NAME : + {{ serviceInfo.SAName ? serviceInfo.SAName : '' }} -

{{ serviceInfo.SPREGIONTYPE_NAME ? serviceInfo.SPREGIONTYPE_NAME : '' }} -

+ +
@@ -28,14 +28,13 @@ - + @@ -504,12 +503,15 @@ export default { onLoad() { this.menu = uni.getMenuButtonBoundingClientRect() let currentService = uni.getStorageSync('currentService') + console.log('currentServicecurrentServicecurrentService', currentService); // 防护:确保 currentService 存在 - if (currentService && (currentService.Serverpart_ID || currentService.SERVERPART_ID)) { - this.handleGetServerpartDetail(currentService.Serverpart_ID || currentService.SERVERPART_ID) - this.handleGetCurrentServiceAttendanceData(currentService.SERVERPART_NAME) - this.handleGetEventsData(currentService.SERVERPART_NAME) + if (currentService && (currentService.SAName || currentService.SACode)) { + this.serviceInfo = { + ...currentService, + } + this.handleGetCurrentServiceAttendanceData(currentService.SAName) + this.handleGetEventsData(currentService.SAName) } else { console.warn('onLoad: currentService 为空或无效') // 可以考虑跳转回服务区选择页面或显示错误提示 @@ -517,24 +519,28 @@ export default { }, onShow() { let currentService = uni.getStorageSync('currentService') - console.log('currentService', currentService); + console.log('onShowonShowonShowonShow', currentService); // 防护:检查 currentService 是否有效 - if (!currentService || (!currentService.Serverpart_ID && !currentService.SERVERPART_ID)) { + if (!currentService || (!currentService.SACode)) { console.warn('currentService 为空或无效,跳过更新'); this.isFirst = false; return; } // 获取统一的服务区ID - const currentServiceId = currentService.Serverpart_ID || currentService.SERVERPART_ID; - const currentServiceName = currentService.SERVERPART_NAME; + const currentServiceId = currentService.SACode; + const currentServiceName = currentService.SAName; // 只有当服务区真正发生变化且不是首次加载时才更新 - if (currentServiceId && currentServiceId !== this.serviceInfo.SERVERPART_ID && !this.isFirst) { + if (currentServiceId && currentServiceId !== this.serviceInfo.SACode && !this.isFirst) { + console.log('111111', currentService); this.emergencyListLength = 0 this.dailyListLength = 0 - this.handleGetServerpartDetail(currentServiceId); + this.serviceInfo = { + ...currentService, + } + // this.handleGetServerpartDetail(currentServiceId); this.handleGetCurrentServiceAttendanceData(currentServiceName); this.handleGetEventsData(currentServiceName) } else { @@ -546,7 +552,7 @@ export default { async handleGetEventsData(saName) { const req = { bsessionKey: "EA65F66FA29B47FD8072A4AFC66967B3", - saName: saName || this.serviceInfo.SERVERPART_NAME + saName: saName || this.serviceInfo.SAName } console.log('reqreq', req); @@ -568,7 +574,7 @@ export default { const req2 = { bsessionKey: "0DAF3A5982D54A619D4B63A34CA20C55", - saName: saName || this.serviceInfo.SERVERPART_NAME + saName: saName || this.serviceInfo.SAName } const data2 = await new Promise((resolve, reject) => { uni.request({ @@ -672,7 +678,7 @@ export default { this.selectDate = `${year}-${month}-${day}`; console.log('serviceInfo', this.serviceInfo); - await this.handleGetCurrentServiceAttendanceData(this.serviceInfo.SERVERPART_NAME) + await this.handleGetCurrentServiceAttendanceData(this.serviceInfo.SAName) }, // 查询服务区详情 async handleGetServerpartDetail(id) { @@ -716,7 +722,7 @@ export default { latitude: obj.latitude ? obj.latitude * 1 : obj.SERVERPART_Y * 1, longitude: obj.longitude ? obj.longitude * 1 : obj.SERVERPART_X * 1, scale: 16, // 缩放比例 - name: obj.SERVERPART_NAME, + name: obj.SAName, // address: "", // 这个可能会影响地图的定位,所以可以选择不填 success(data) { }, @@ -748,7 +754,7 @@ export default { // this.selectDate = e.detail.value this.selectDate = e.fulldate - await this.handleGetCurrentServiceAttendanceData(this.serviceInfo.SERVERPART_NAME) + await this.handleGetCurrentServiceAttendanceData(this.serviceInfo.SAName) }, // 切换tab handleChangeTab(e) { diff --git a/pages/attendanceStatus/roster.vue b/pages/attendanceStatus/roster.vue index 4156dc6..df6ba8c 100644 --- a/pages/attendanceStatus/roster.vue +++ b/pages/attendanceStatus/roster.vue @@ -10,11 +10,11 @@ - {{ serviceInfo.SERVERPART_NAME ? serviceInfo.SERVERPART_NAME : + {{ serviceInfo.SAName ? serviceInfo.SAName : '' }} -

{{ serviceInfo.SPREGIONTYPE_NAME ? serviceInfo.SPREGIONTYPE_NAME : '' }} -

+
@@ -35,7 +35,7 @@ {{ selectDate ? $util.cutDate(new Date(selectDate), 'YYYY-MM') : "" - }} + }} @@ -175,25 +175,25 @@ export default { this.serviceInfo = currentService this.handleGetNewMonthData() // 加载排班数据 - this.loadRosterData(currentService.SERVERPART_NAME) + this.loadRosterData(currentService.SAName) }, onShow() { let currentService = uni.getStorageSync('currentService') console.log('currentService', currentService); // 防护:检查 currentService 是否有效 - if (!currentService || (!currentService.Serverpart_ID && !currentService.SERVERPART_ID)) { + if (!currentService || (!currentService.SACode)) { console.warn('currentService 为空或无效,跳过更新'); this.isFirst = false; return; } // 获取统一的服务区ID - const currentServiceId = currentService.Serverpart_ID || currentService.SERVERPART_ID; - const currentServiceName = currentService.SERVERPART_NAME; + const currentServiceId = currentService.SACode; + const currentServiceName = currentService.SAName; // 只有当服务区真正发生变化且不是首次加载时才更新 - if (currentServiceId && currentServiceId !== this.serviceInfo.SERVERPART_ID && !this.isFirst) { + if (currentServiceId && currentServiceId !== this.serviceInfo.SACode && !this.isFirst) { this.serviceInfo = currentService this.rosterData = [] this.userList = [] @@ -213,7 +213,7 @@ export default { retryLoad() { if (this.retryCount < 3) { this.retryCount++ - this.loadRosterData(this.serviceInfo.SERVERPART_NAME) + this.loadRosterData(this.serviceInfo.SAName) } else { uni.showToast({ title: '多次重试失败,请检查网络连接', diff --git a/pages/everdayRenven/AnhuiIndex.vue b/pages/everdayRenven/AnhuiIndex.vue index 0d68a5c..847827a 100644 --- a/pages/everdayRenven/AnhuiIndex.vue +++ b/pages/everdayRenven/AnhuiIndex.vue @@ -1,215 +1,264 @@ - diff --git a/pages/everdayRenven/AnhuiServerpart.vue b/pages/everdayRenven/AnhuiServerpart.vue index e75ea2e..1b11b2d 100644 --- a/pages/everdayRenven/AnhuiServerpart.vue +++ b/pages/everdayRenven/AnhuiServerpart.vue @@ -1,12 +1,12 @@