From c62007ceacef9c690718f87990116249378c9a08 Mon Sep 17 00:00:00 2001 From: tianyongbao Date: Wed, 17 Jun 2026 20:45:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=B0=E8=B4=A6=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=81=A5=E5=BA=B7=E6=A1=A3=E6=A1=88=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/health/chronicDisease.js | 70 -- src/api/health/medicationAdherence.js | 46 -- src/api/health/medicationPlan.js | 86 --- src/api/health/medicationRecord.js | 45 -- src/api/health/medicationTask.js | 28 - src/manifest.json | 8 + src/pages.json | 42 -- .../accounts/accountDealRecord/addEdit.vue | 133 +++- .../accounts/accountDealRecord/details.vue | 72 +- .../work/accounts/accountDealRecord/list.vue | 26 +- .../work/health/chronicDisease/addEdit.vue | 262 ------- .../work/health/chronicDisease/details.vue | 325 --------- src/pages/work/health/chronicDisease/list.vue | 522 -------------- .../work/health/medicationPlan/addEdit.vue | 398 ----------- .../work/health/medicationPlan/details.vue | 354 ---------- src/pages/work/health/medicationPlan/list.vue | 569 --------------- .../work/health/medicationRecord/index.vue | 663 ------------------ 17 files changed, 234 insertions(+), 3415 deletions(-) delete mode 100644 src/api/health/chronicDisease.js delete mode 100644 src/api/health/medicationAdherence.js delete mode 100644 src/api/health/medicationPlan.js delete mode 100644 src/api/health/medicationRecord.js delete mode 100644 src/api/health/medicationTask.js delete mode 100644 src/pages/work/health/chronicDisease/addEdit.vue delete mode 100644 src/pages/work/health/chronicDisease/details.vue delete mode 100644 src/pages/work/health/chronicDisease/list.vue delete mode 100644 src/pages/work/health/medicationPlan/addEdit.vue delete mode 100644 src/pages/work/health/medicationPlan/details.vue delete mode 100644 src/pages/work/health/medicationPlan/list.vue delete mode 100644 src/pages/work/health/medicationRecord/index.vue diff --git a/src/api/health/chronicDisease.js b/src/api/health/chronicDisease.js deleted file mode 100644 index a6cb05f..0000000 --- a/src/api/health/chronicDisease.js +++ /dev/null @@ -1,70 +0,0 @@ -import request from '@/utils/request' - -// 查询慢性疾病档案列表 -export function listChronicDisease(query) { - return request({ - url: '/health/chronicDisease/list', - method: 'get', - params: query - }) -} - -// 查询慢性疾病档案详细 -export function getChronicDisease(id) { - return request({ - url: '/health/chronicDisease/' + id, - method: 'get' - }) -} - -// 新增慢性疾病档案 -export function addChronicDisease(data) { - return request({ - url: '/health/chronicDisease', - method: 'post', - data - }) -} - -// 修改慢性疾病档案 -export function updateChronicDisease(data) { - return request({ - url: '/health/chronicDisease', - method: 'put', - data - }) -} - -// 删除慢性疾病档案 -export function delChronicDisease(id) { - return request({ - url: '/health/chronicDisease/' + id, - method: 'delete' - }) -} - -// 根据成员ID查询慢性疾病档案列表 -export function listChronicDiseaseByMember(memberId) { - return request({ - url: '/health/chronicDisease/listByMember/' + memberId, - method: 'get' - }) -} - -// 查询成员列表 -export function listPerson(query) { - return request({ - url: '/health/person/list', - method: 'get', - params: query - }) -} - -// 查询疾病列表 -export function listHealthDiseases(query) { - return request({ - url: '/health/HealthDiseases/list', - method: 'get', - params: query - }) -} \ No newline at end of file diff --git a/src/api/health/medicationAdherence.js b/src/api/health/medicationAdherence.js deleted file mode 100644 index e0ae9c0..0000000 --- a/src/api/health/medicationAdherence.js +++ /dev/null @@ -1,46 +0,0 @@ -import request from '@/utils/request' - -// 获取总体依从性统计 -export function getOverallAdherence(query) { - return request({ - url: '/health/adherence/overall', - method: 'get', - params: query - }) -} - -// 获取每日依从性统计列表 -export function getDailyAdherence(query) { - return request({ - url: '/health/adherence/daily', - method: 'get', - params: query - }) -} - -// 获取日历视图数据 -export function getCalendarData(memberId, yearMonth) { - return request({ - url: '/health/adherence/calendar', - method: 'get', - params: { memberId, yearMonth } - }) -} - -// 获取各时段服药统计 -export function getTimeSlotAdherence(query) { - return request({ - url: '/health/adherence/timeSlot', - method: 'get', - params: query - }) -} - -// 获取仪表盘概览数据 -export function getDashboard(memberId) { - return request({ - url: '/health/adherence/dashboard', - method: 'get', - params: { memberId } - }) -} \ No newline at end of file diff --git a/src/api/health/medicationPlan.js b/src/api/health/medicationPlan.js deleted file mode 100644 index 455b3dc..0000000 --- a/src/api/health/medicationPlan.js +++ /dev/null @@ -1,86 +0,0 @@ -import request from '@/utils/request' - -// 查询用药计划列表 -export function listMedicationPlan(query) { - return request({ - url: '/health/medicationPlan/list', - method: 'get', - params: query - }) -} - -// 查询用药计划详细 -export function getMedicationPlan(id) { - return request({ - url: '/health/medicationPlan/' + id, - method: 'get' - }) -} - -// 新增用药计划 -export function addMedicationPlan(data) { - return request({ - url: '/health/medicationPlan', - method: 'post', - data - }) -} - -// 修改用药计划 -export function updateMedicationPlan(data) { - return request({ - url: '/health/medicationPlan', - method: 'put', - data - }) -} - -// 删除用药计划 -export function delMedicationPlan(id) { - return request({ - url: '/health/medicationPlan/' + id, - method: 'delete' - }) -} - -// 暂停用药计划 -export function pauseMedicationPlan(id) { - return request({ - url: '/health/medicationPlan/pause/' + id, - method: 'put' - }) -} - -// 恢复用药计划 -export function resumeMedicationPlan(id) { - return request({ - url: '/health/medicationPlan/resume/' + id, - method: 'put' - }) -} - -// 结束用药计划 -export function endMedicationPlan(id) { - return request({ - url: '/health/medicationPlan/end/' + id, - method: 'put' - }) -} - -// 查询成员列表 -export function listPerson(query) { - return request({ - url: '/health/person/list', - method: 'get', - params: query - }) -} - -// 查询药品列表 -export function listMedicineBasic(query) { - return request({ - url: '/health/medicineBasic/list', - method: 'get', - params: query - }) -} \ No newline at end of file diff --git a/src/api/health/medicationRecord.js b/src/api/health/medicationRecord.js deleted file mode 100644 index 36af2f2..0000000 --- a/src/api/health/medicationRecord.js +++ /dev/null @@ -1,45 +0,0 @@ -import request from '@/utils/request' - -// 查询服药记录列表 -export function listMedicationRecord(query) { - return request({ - url: '/health/medicationRecord/list', - method: 'get', - params: query - }) -} - -// 查询今日待服药记录 -export function getTodayRecords() { - return request({ - url: '/health/medicationRecord/today', - method: 'get' - }) -} - -// 根据计划ID和日期查询服药记录 -export function getRecordsByPlanAndDate(planId, recordDate) { - return request({ - url: '/health/medicationRecord/byPlanDate', - method: 'get', - params: { planId, recordDate } - }) -} - -// 确认服药 -export function takeMedication(id, dosage, actualTime) { - return request({ - url: '/health/medicationRecord/take/' + id, - method: 'put', - params: { dosage, actualTime } - }) -} - -// 跳过服药 -export function skipMedication(id, reason) { - return request({ - url: '/health/medicationRecord/skip/' + id, - method: 'put', - params: { reason } - }) -} diff --git a/src/api/health/medicationTask.js b/src/api/health/medicationTask.js deleted file mode 100644 index 1e9ad3e..0000000 --- a/src/api/health/medicationTask.js +++ /dev/null @@ -1,28 +0,0 @@ -import request from '@/utils/request' - -// 查询服药任务列表 -export function listMedicationTask(query) { - return request({ - url: '/health/medicationTask/list', - method: 'get', - params: query - }) -} - -// 确认服药 -export function confirmMedication(id, confirmType) { - return request({ - url: '/health/medicationTask/confirm/' + id, - method: 'put', - params: { confirmType } - }) -} - -// 跳过服药 -export function skipMedication(id, notes) { - return request({ - url: '/health/medicationTask/skip/' + id, - method: 'put', - params: { notes } - }) -} \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index 7736cf7..5d03493 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -28,6 +28,8 @@ "", "", "", + "", + "", "", "", "", @@ -54,6 +56,12 @@ "setting" : { "urlCheck" : false }, + "permission" : { + "scope.userLocation" : { + "desc" : "用于在账户交易记录中按需记录交易地点" + } + }, + "requiredPrivateInfos" : [ "getLocation", "chooseLocation" ], "usingComponents" : true }, "mp-alipay" : { diff --git a/src/pages.json b/src/pages.json index fa6dbda..acc762e 100644 --- a/src/pages.json +++ b/src/pages.json @@ -806,48 +806,6 @@ "style": { "navigationBarTitleText": "投资交易记录" } - }, - { - "path": "pages/work/health/chronicDisease/list", - "style": { - "navigationBarTitleText": "慢性疾病档案" - } - }, - { - "path": "pages/work/health/chronicDisease/details", - "style": { - "navigationBarTitleText": "慢性疾病详情" - } - }, - { - "path": "pages/work/health/chronicDisease/addEdit", - "style": { - "navigationBarTitleText": "慢性疾病档案" - } - }, - { - "path": "pages/work/health/medicationPlan/list", - "style": { - "navigationBarTitleText": "用药计划" - } - }, - { - "path": "pages/work/health/medicationPlan/details", - "style": { - "navigationBarTitleText": "用药计划详情" - } - }, - { - "path": "pages/work/health/medicationPlan/addEdit", - "style": { - "navigationBarTitleText": "用药计划" - } - }, - { - "path": "pages/work/health/medicationRecord/index", - "style": { - "navigationBarTitleText": "用药记录" - } } ], "subPackages": [ diff --git a/src/pages/work/accounts/accountDealRecord/addEdit.vue b/src/pages/work/accounts/accountDealRecord/addEdit.vue index 2d5c6e4..fa82ef3 100644 --- a/src/pages/work/accounts/accountDealRecord/addEdit.vue +++ b/src/pages/work/accounts/accountDealRecord/addEdit.vue @@ -49,6 +49,20 @@ inputAlign="right" border="none"> + + + + + {{ form.locationName }} + 经纬度:{{ form.longitude }},{{ form.latitude }} + + + + + + + @@ -111,6 +125,7 @@ const childCategoryShow = ref(true) const debitTypeShow = ref(false) const flag = ref('add') const dealTypeList = ref([]) +const locationLoading = ref(false) // 临时变量,仅用于前端筛选,不保存到数据库 const tempDebitType = ref(null) const tempDebitTypeName = ref(null) @@ -130,7 +145,11 @@ const data = reactive({ remark: null, currentBalance: null, dealCategory: '1', - childCategory: null + childCategory: null, + locationName: null, + locationAddress: null, + longitude: null, + latitude: null }, queryAccountParams: { pageNum: 1, @@ -151,6 +170,13 @@ const data = reactive({ } }) const { form, queryAccountParams, rules} = toRefs(data) +const hasLocation = computed(() => { + return !!(form.value.locationName || form.value.locationAddress || hasCoordinate.value) +}) +const hasCoordinate = computed(() => { + return form.value.longitude !== null && form.value.longitude !== undefined + && form.value.latitude !== null && form.value.latitude !== undefined +}) onLoad((option) => { @@ -502,6 +528,81 @@ onLoad((option) => { form.value.createTime = dayjs(e.value).format("YYYY-MM-DD HH:mm:ss") datePickShow.value = false } + function normalizeCoordinate(value) { + const coordinate = Number(value) + return Number.isFinite(coordinate) ? Number(coordinate.toFixed(8)) : null + } + + function applyLocationResult(res) { + form.value.locationName = res.name || null + form.value.locationAddress = res.address || res.name || null + form.value.longitude = normalizeCoordinate(res.longitude) + form.value.latitude = normalizeCoordinate(res.latitude) + } + + function clearLocation() { + form.value.locationName = null + form.value.locationAddress = null + form.value.longitude = null + form.value.latitude = null + } + + function loadCurrentCoordinate() { + if (typeof uni.getLocation !== 'function') { + locationLoading.value = false + proxy.$refs['uToast'].show({ + message: '当前端暂不支持定位', type: 'warning' + }) + return + } + uni.getLocation({ + type: 'gcj02', + isHighAccuracy: true, + success(res) { + applyLocationResult(res) + proxy.$refs['uToast'].show({ + message: '已获取当前位置坐标,可补充地点名称', type: 'success' + }) + }, + fail() { + proxy.$refs['uToast'].show({ + message: '定位失败,请检查定位权限后重试', type: 'warning' + }) + }, + complete() { + locationLoading.value = false + } + }) + } + + function loadCurrentLocation() { + if (locationLoading.value) { + return + } + locationLoading.value = true + if (typeof uni.chooseLocation !== 'function') { + loadCurrentCoordinate() + return + } + uni.chooseLocation({ + success(res) { + applyLocationResult(res) + proxy.$refs['uToast'].show({ + message: '定位成功', type: 'success' + }) + locationLoading.value = false + }, + fail(err) { + const errMsg = err && err.errMsg ? err.errMsg : '' + if (errMsg.indexOf('cancel') !== -1) { + locationLoading.value = false + return + } + loadCurrentCoordinate() + } + }) + } + function submit() { if (!form.value.dealCategory === '1') { form.value.childCategory = form.value.dealCategory @@ -572,6 +673,36 @@ onLoad((option) => { .form-view { padding: 24rpx; + .location-field { + width: 100%; + display: flex; + align-items: flex-start; + gap: 16rpx; + padding: 8rpx 0 18rpx; + + .location-main { + flex: 1; + min-width: 0; + } + + .location-name, + .location-coord { + display: block; + margin-top: 8rpx; + color: #909399; + font-size: 24rpx; + line-height: 1.4; + word-break: break-all; + } + + .location-actions { + display: flex; + flex-shrink: 0; + gap: 12rpx; + padding-top: 4rpx; + } + } + .form-btn { padding-top: 16rpx; } diff --git a/src/pages/work/accounts/accountDealRecord/details.vue b/src/pages/work/accounts/accountDealRecord/details.vue index 0ea0ecf..95000b8 100644 --- a/src/pages/work/accounts/accountDealRecord/details.vue +++ b/src/pages/work/accounts/accountDealRecord/details.vue @@ -50,11 +50,23 @@ 余额 {{ detailInfo.currentBalance }}元 - - + + + + 地点 + + + {{ detailInfo.locationName }} + {{ detailInfo.locationAddress || detailInfo.locationName }} + + + 查看地图 + + + @@ -82,6 +94,10 @@ const data = reactive({ detailInfo: {} }) const {detailInfo} = toRefs(data) +const hasCoordinate = computed(() => { + return detailInfo.value.longitude !== null && detailInfo.value.longitude !== undefined + && detailInfo.value.latitude !== null && detailInfo.value.latitude !== undefined +}) onLoad((option) => { id.value = option.id getInfo() @@ -118,6 +134,19 @@ onLoad((option) => { }) return str } + function openLocation() { + const latitude = Number(detailInfo.value.latitude) + const longitude = Number(detailInfo.value.longitude) + if (!Number.isFinite(latitude) || !Number.isFinite(longitude)) { + return + } + uni.openLocation({ + latitude, + longitude, + name: detailInfo.value.locationName || '', + address: detailInfo.value.locationAddress || detailInfo.value.locationName || '' + }) + } diff --git a/src/pages/work/accounts/accountDealRecord/list.vue b/src/pages/work/accounts/accountDealRecord/list.vue index 4042b52..9ca9f72 100644 --- a/src/pages/work/accounts/accountDealRecord/list.vue +++ b/src/pages/work/accounts/accountDealRecord/list.vue @@ -110,7 +110,13 @@ 余额 {{ item.currentBalance }}元 - + + 地点 + {{ item.locationAddress || item.locationName }} + + + + 备注 {{ item.remark }} @@ -763,6 +769,10 @@ page { flex-wrap: nowrap; gap: 24rpx; margin-bottom: 0; + + &.info-row-extra { + margin-top: 16rpx; + } .info-item { display: flex; @@ -779,6 +789,10 @@ page { flex: 1; } + &.info-item-location { + flex: 1; + } + .info-label { font-size: 24rpx; color: #667eea; @@ -812,6 +826,14 @@ page { flex: 1; word-break: break-all; } + + .info-location { + font-size: 24rpx; + color: #606266; + line-height: 1.4; + flex: 1; + word-break: break-all; + } } } } @@ -861,4 +883,4 @@ page { } } } - \ No newline at end of file + diff --git a/src/pages/work/health/chronicDisease/addEdit.vue b/src/pages/work/health/chronicDisease/addEdit.vue deleted file mode 100644 index 9d04fcb..0000000 --- a/src/pages/work/health/chronicDisease/addEdit.vue +++ /dev/null @@ -1,262 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/pages/work/health/chronicDisease/details.vue b/src/pages/work/health/chronicDisease/details.vue deleted file mode 100644 index 79c3f94..0000000 --- a/src/pages/work/health/chronicDisease/details.vue +++ /dev/null @@ -1,325 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/pages/work/health/chronicDisease/list.vue b/src/pages/work/health/chronicDisease/list.vue deleted file mode 100644 index 9affbd3..0000000 --- a/src/pages/work/health/chronicDisease/list.vue +++ /dev/null @@ -1,522 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/pages/work/health/medicationPlan/addEdit.vue b/src/pages/work/health/medicationPlan/addEdit.vue deleted file mode 100644 index 7bc8e33..0000000 --- a/src/pages/work/health/medicationPlan/addEdit.vue +++ /dev/null @@ -1,398 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/pages/work/health/medicationPlan/details.vue b/src/pages/work/health/medicationPlan/details.vue deleted file mode 100644 index 122daa9..0000000 --- a/src/pages/work/health/medicationPlan/details.vue +++ /dev/null @@ -1,354 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/pages/work/health/medicationPlan/list.vue b/src/pages/work/health/medicationPlan/list.vue deleted file mode 100644 index c6f9f51..0000000 --- a/src/pages/work/health/medicationPlan/list.vue +++ /dev/null @@ -1,569 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/pages/work/health/medicationRecord/index.vue b/src/pages/work/health/medicationRecord/index.vue deleted file mode 100644 index 568bc11..0000000 --- a/src/pages/work/health/medicationRecord/index.vue +++ /dev/null @@ -1,663 +0,0 @@ - - - - - \ No newline at end of file