diff --git a/api/reception.js b/api/reception.js index b48a165..36bc112 100644 --- a/api/reception.js +++ b/api/reception.js @@ -20,7 +20,7 @@ export function getAcceptingPatientList(data) { }) } -// 获取患者详情 +// 获取患者详情(挂号维度的就诊信息,不含处方列表) export function getPatientItem(id) { return req.request({ url: '/newApi/doctor-reception-wx/patient-item', @@ -29,6 +29,33 @@ export function getPatientItem(id) { }) } +/** 本次挂号处方分页 */ +export function getRegisterPrescriptionList(data) { + return req.request({ + url: '/newApi/doctor-reception-wx/register-prescription-list', + method: 'GET', + data + }) +} + +/** 患者历史处方分页(可排除某次挂号) */ +export function getPatientPrescriptionHistory(data) { + return req.request({ + url: '/newApi/doctor-reception-wx/patient-prescription-history', + method: 'GET', + data + }) +} + +/** 撤回处方(待支付) */ +export function withdrawPrescriptionWx(data) { + return req.request({ + url: '/newApi/doctor-reception-wx/withdraw-prescription', + method: 'POST', + data + }) +} + /** * 根据患者ID获取患者信息 * @param {number} patientId - 患者ID @@ -210,10 +237,10 @@ export function switchStoreApi(data) { }) } -// 获取处方详情 +// 获取处方详情(医生小程序 doctor-reception-wx 路由,与接诊接口同鉴权) export function getPrescriptionInfoApi(id) { return req.request({ - url: '/newApi/prescription/detail', + url: '/newApi/doctor-reception-wx/prescription-detail', method: 'GET', data: { id } }) @@ -273,6 +300,24 @@ export function saveChineseCommonPrescriptionApi(data) { }) } +// 保存颗粒药/保健食品常用方 +export function saveGranularCommonPrescriptionApi(data) { + return req.request({ + url: '/newApi/common-prescription/save-granular', + method: 'POST', + data + }) +} + +// 删除常用方 +export function deleteCommonPrescriptionApi(data) { + return req.request({ + url: '/newApi/common-prescription/delete', + method: 'POST', + data + }) +} + // 获取公共医嘱列表 export function getDoctorOrderCommonList(data) { return req.request({ diff --git a/common/js/index.js b/common/js/index.js index 93b21eb..b08f584 100644 --- a/common/js/index.js +++ b/common/js/index.js @@ -20,10 +20,13 @@ const arr = [ 'password' ] -// 敏感数据 +// 敏感数据(解密后做脱敏;需与下方 switch 分支一致) const sensitiveData = [ 'id_card', - 'idcard' + 'idcard', + 'mobile', + 'express_mobile', + 'patient_mobile' ] /** * 请求拦截器 @@ -53,11 +56,17 @@ const resInterceptor = (response, conf = {}) => { // 响应拦截器 if (statusCode >= 200 && statusCode < 300) { _responseLog(response, conf, "response 200-299") - // 解密 + // 解密(Yii:业务在 data;Laravel jok:业务在 result) let res = response.data + if (res == null || typeof res !== 'object') { + return res + } if (res.data != null) { res.data = getRes(res.data) } + if (res.result != null) { + res.result = getRes(res.result) + } return res } else if (statusCode === 500) { uni.showToast({ @@ -133,11 +142,14 @@ function _responseLog(res, conf = {}, describe = null) { } function getRes(obj, isDecode = true) { + if (obj == null || typeof obj !== 'object') { + return obj + } try { for (const key in obj) { if (Array.isArray(obj[key])) { obj[key] = getRes(obj[key]) - } else if (typeof obj[key] === 'object') { + } else if (typeof obj[key] === 'object' && obj[key] !== null) { obj[key] = getRes(obj[key]) } else { // 判断obj[key]是否在arr中 diff --git a/common/js/timeFormat.js b/common/js/timeFormat.js index 0372f2f..26f1d16 100644 --- a/common/js/timeFormat.js +++ b/common/js/timeFormat.js @@ -21,6 +21,20 @@ if (!String.prototype.padStart) { } } +/** + * iOS(含部分微信小程序环境)下 new Date('yyyy-MM-dd HH:mm:ss') 无效,需转为 ISO 类似格式 + */ +function normalizeDateInputForIOS(dateTime) { + if (dateTime == null || dateTime === '') return dateTime + if (typeof dateTime === 'number') return dateTime + const s = String(dateTime).trim() + // "2025-03-06 17:34:03" / "2025-03-06 17:34:03.000" -> T 分隔 + if (/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}/.test(s)) { + return s.replace(' ', 'T') + } + return dateTime +} + // 其他更多是格式化有如下: // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合 function timeFormat(dateTime = null, fmt = 'yyyy-mm-dd') { @@ -28,7 +42,11 @@ function timeFormat(dateTime = null, fmt = 'yyyy-mm-dd') { if (!dateTime) dateTime = Number(new Date()); // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式 if (dateTime.toString().length == 10) dateTime *= 1000; + dateTime = normalizeDateInputForIOS(dateTime); let date = new Date(dateTime); + if (Number.isNaN(date.getTime())) { + return typeof dateTime === 'string' ? dateTime : '' + } let ret; let opt = { "y+": date.getFullYear().toString(), // 年 diff --git a/main.js b/main.js index 036161b..d81c1cc 100644 --- a/main.js +++ b/main.js @@ -7,10 +7,16 @@ import { } from '@/common/js/util.js' // 引入uView主JS库 import uView from "uview-ui"; +import timeFormatIOSFix from '@/common/js/timeFormat.js' import store from './store'; import share from '@/common/share.js' Vue.mixin(share) Vue.use(uView); +// 覆盖 uView 的 timeFormat / date:修复 iOS 下 `yyyy-MM-dd HH:mm:ss` 无法解析 +if (uni && uni.$u) { + uni.$u.timeFormat = timeFormatIOSFix + uni.$u.date = timeFormatIOSFix +} let systemInfo = uni.getSystemInfoSync(); const $d = { addStyle, diff --git a/pages/login/index.vue b/pages/login/index.vue index fa8f776..ab75e3b 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -40,9 +40,9 @@ 登录 - - 手机号注册 - + + + @@ -79,8 +79,8 @@ }, onLoad(e) { - const accountInfo = uni.getAccountInfoSync(); - console.log(accountInfo.miniProgram.appId); // 小程序 appId + // const accountInfo = uni.getAccountInfoSync(); + // console.log('appid', accountInfo.miniProgram.appId); // 小程序 appId }, mounted() { const token = uni.getStorageSync('token') diff --git a/pages/workbench/index.vue b/pages/workbench/index.vue index 5a6c420..95fed0f 100644 --- a/pages/workbench/index.vue +++ b/pages/workbench/index.vue @@ -521,21 +521,23 @@ }, // 跳转到小程序 toNext() { - uni.navigateToMiniProgram({ - appId: 'wx8e8f04d0cf7831bf', - path: 'pages/login/index?id=', - envVersion: "release", - extraData: { - 'data1': 'test' - }, - success: res => { - // 打开成功 - console.log("打开成功", res); - }, - fail: err => { - console.log(err); - } - }) + + this.$toast('开发中~'); + // uni.navigateToMiniProgram({ + // appId: 'wx8e8f04d0cf7831bf', + // path: 'pages/login/index?id=', + // envVersion: "release", + // extraData: { + // 'data1': 'test' + // }, + // success: res => { + // // 打开成功 + // console.log("打开成功", res); + // }, + // fail: err => { + // console.log(err); + // } + // }) }, // 获取正在接诊的患者列表 getAcceptingPatientList() { diff --git a/subPackages/sub_my/my_diagnose_common.vue b/subPackages/sub_my/my_diagnose_common.vue index 11d75a1..5ccadbb 100644 --- a/subPackages/sub_my/my_diagnose_common.vue +++ b/subPackages/sub_my/my_diagnose_common.vue @@ -24,10 +24,10 @@ 删除医嘱 添加医嘱 - - - - + + 暂不删除 + 删除医嘱 + diff --git a/subPackages/sub_reception/reception_prescription.vue b/subPackages/sub_reception/reception_prescription.vue index ce6035a..e23f893 100644 --- a/subPackages/sub_reception/reception_prescription.vue +++ b/subPackages/sub_reception/reception_prescription.vue @@ -201,14 +201,13 @@ - + - 另存常用方 发送处方 @@ -708,18 +707,6 @@ export default { } }, - /** - * 另存常用方 - */ - async saveAsCommonPrescription() { - if (this.currentDrugs.length === 0) { - uni.showToast({ title: '请先添加药品后再保存为常用方', icon: 'none' }); - return; - } - uni.showToast({ title: '另存常用方功能待实现', icon: 'none' }); - // TODO: 实现另存常用方功能 - }, - /** * 返回 */ diff --git a/subPackages/sub_workbench/prescription_v2/components/ChineseMedicineConfig.vue b/subPackages/sub_workbench/prescription_v2/components/ChineseMedicineConfig.vue index 5c77eb1..9d89cf4 100644 --- a/subPackages/sub_workbench/prescription_v2/components/ChineseMedicineConfig.vue +++ b/subPackages/sub_workbench/prescription_v2/components/ChineseMedicineConfig.vue @@ -1,129 +1,143 @@ + \ No newline at end of file diff --git a/subPackages/sub_workbench/prescription_v2/components/modals/ChineseMedicineModal.vue b/subPackages/sub_workbench/prescription_v2/components/modals/ChineseMedicineModal.vue index 9272730..100bf66 100644 --- a/subPackages/sub_workbench/prescription_v2/components/modals/ChineseMedicineModal.vue +++ b/subPackages/sub_workbench/prescription_v2/components/modals/ChineseMedicineModal.vue @@ -1,138 +1,144 @@ + \ No newline at end of file diff --git a/subPackages/sub_workbench/prescription_v2/components/modals/CommonPrescriptionModal.vue b/subPackages/sub_workbench/prescription_v2/components/modals/CommonPrescriptionModal.vue index b46c8f9..7ce248a 100644 --- a/subPackages/sub_workbench/prescription_v2/components/modals/CommonPrescriptionModal.vue +++ b/subPackages/sub_workbench/prescription_v2/components/modals/CommonPrescriptionModal.vue @@ -1,11 +1,11 @@