fix: 问题修复

This commit is contained in:
huxuejian 2026-08-05 18:39:23 +08:00
parent 022ed92e38
commit 4e22412ea0
7 changed files with 61 additions and 36 deletions

View File

@ -2,7 +2,7 @@
<view class="rx-fail-card border shadow-lg rounded" :style="elderVarStyle"> <view class="rx-fail-card border shadow-lg rounded" :style="elderVarStyle">
<view class="fail-title-row"> <view class="fail-title-row">
<view class="warning-icon">!</view> <view class="warning-icon">!</view>
<text class="fail-title">处方开具失败</text> <text class="fail-title">{{ errorSource }}</text>
</view> </view>
<view class="reason-row"> <view class="reason-row">
<text class="reason-label">原因</text> <text class="reason-label">原因</text>
@ -48,6 +48,10 @@ const reason = computed(() => {
: '未获取到失败原因,请稍后重试。'; : '未获取到失败原因,请稍后重试。';
}); });
const errorSource = computed(() => {
return ext.value && ext.value.source === 'HIS' ? '处方开具失败' : '服务暂未响应';
});
onMounted(() => { onMounted(() => {
uni.$emit('autoRxFail'); uni.$emit('autoRxFail');
}) })

View File

@ -1,5 +1,5 @@
<template> <template>
<full-page :animation="true" ref="pageRef" mainStyle="background:#f0f0f0" @reachBottom="onReachBottom()"> <full-page mainStyle="background:#f0f0f0">
<view class="container" :class="{ 'elder-mode-active': elderMode }"> <view class="container" :class="{ 'elder-mode-active': elderMode }">
<view class="user-header shadow-lg"> <view class="user-header shadow-lg">
就诊人{{ form.name }} {{ form.sex }} {{ form.age ? `${form.age}` : '' }} 就诊人{{ form.name }} {{ form.sex }} {{ form.age ? `${form.age}` : '' }}
@ -94,7 +94,6 @@ const { init: initOrder, restoreForEdit } = orderStore();
const visible = ref(false); const visible = ref(false);
const guessVisible = ref(false); const guessVisible = ref(false);
const reachBottom = ref(false); const reachBottom = ref(false);
const pageRef = ref(null);
let guessCloseTimer = null; let guessCloseTimer = null;
// //
const elderMode = ref(false); const elderMode = ref(false);
@ -157,11 +156,6 @@ function nextStep() {
toast('请填写病情描述'); toast('请填写病情描述');
return; return;
} }
if (!reachBottom.value) {
pageRef.value?.scrollToBottom();
reachBottom.value = true;
return
}
for (let item of histories.value) { for (let item of histories.value) {
if (!item.options.includes(form.value[item.prop])) { if (!item.options.includes(form.value[item.prop])) {
toast(`请选择${item.label}`); toast(`请选择${item.label}`);
@ -181,7 +175,6 @@ function onDiseaseSelected(disease) {
} }
} }
function removeImage(index) { function removeImage(index) {
form.value.images.splice(index, 1); form.value.images.splice(index, 1);
} }
@ -231,10 +224,6 @@ function upload(path) {
}) })
} }
function onReachBottom() {
reachBottom.value = true;
}
onLoad((options) => { onLoad((options) => {
if (options.reEdit === '1') { if (options.reEdit === '1') {
const record = get('re-edit-consult-order'); const record = get('re-edit-consult-order');

View File

@ -167,7 +167,7 @@ async function getDrugsInfo(drugs) {
visible.value = true; visible.value = true;
} }
async function getList(changeTabWhenEmpty = false) { async function getList() {
if (loading.value) return; if (loading.value) return;
loading.value = true; loading.value = true;
showLoading() showLoading()
@ -190,9 +190,6 @@ async function getList(changeTabWhenEmpty = false) {
toast(message || '未查询到历史处方') toast(message || '未查询到历史处方')
} }
loading.value = false; loading.value = false;
if (changeTabWhenEmpty && list.value.length === 0) {
switchTab('purchase-record')
}
} }
@ -218,7 +215,7 @@ async function getNinetyDaysDrugRecord() {
} }
onLoad(() => { onLoad(() => {
getList(true) getList()
}) })
</script> </script>

View File

@ -31,10 +31,12 @@
<template v-if="logined" #footer> <template v-if="logined" #footer>
<view class="footer"> <view class="footer">
<view class="button-group"> <view class="button-group">
<button class="action-button add-button rounded" @click="toAddPatient">+ 新增就诊人</button> <button v-if="feeType === 'ZF'" class="action-button add-button rounded" @click="toAddPatient">
+新增就诊人
</button>
<button class="action-button next-button rounded" @click="nextStep">下一步</button> <button class="action-button next-button rounded" @click="nextStep">下一步</button>
</view> </view>
<view class="manage-link" @click="toPatientManagement"> <view v-if="feeType === 'ZF'" class="manage-link" @click="toPatientManagement">
<text>最多添加10位就诊人点击就诊人管理</text> <text>最多添加10位就诊人点击就诊人管理</text>
<uni-icons type="right" :color="themeSecondary" :size="16" /> <uni-icons type="right" :color="themeSecondary" :size="16" />
</view> </view>
@ -60,9 +62,7 @@ import fullPage from "@/components/full-page.vue";
const { const {
logined, logined,
getAuthCode, getAuthCode,
myProfile, userInfo,
familyProfile,
getProfileData,
storeId, storeId,
patientList: storePatientList, patientList: storePatientList,
loadPatientList, loadPatientList,
@ -161,6 +161,10 @@ async function scanInsuranceCode() {
toast("医保信息不完整,请重新读卡"); toast("医保信息不完整,请重新读卡");
return; return;
} }
if (userInfo.value.certNo === res.data.IDNum) {
toast("当前操作仅支持非本人医保码");
return;
}
set("current-scanned-card", res.data, 300); set("current-scanned-card", res.data, 300);
uni.navigateTo({ uni.navigateTo({
url: `/pages/member/detail?type=ybQrcode&feeType=${feeType.value}`, url: `/pages/member/detail?type=ybQrcode&feeType=${feeType.value}`,
@ -369,5 +373,4 @@ function toPatientManagement() {
font-size: 24rpx; font-size: 24rpx;
color: #344743; color: #344743;
} }
</style> </style>

View File

@ -119,7 +119,7 @@
@close="visible = false" @confirm="changeDrugs($event)" /> @close="visible = false" @confirm="changeDrugs($event)" />
</template> </template>
<script setup> <script setup>
import { ref, onMounted } from 'vue' import { ref, onMounted, nextTick } from 'vue'
import { onLoad, onUnload } from '@dcloudio/uni-app'; import { onLoad, onUnload } from '@dcloudio/uni-app';
import { storeToRefs } from "pinia"; import { storeToRefs } from "pinia";
import BigNumber from "bignumber.js"; import BigNumber from "bignumber.js";
@ -127,7 +127,7 @@ import useElder from '@/hooks/useElder';
import useUser from "@/hooks/useUser"; import useUser from "@/hooks/useUser";
import useDb from "@/store/db"; import useDb from "@/store/db";
import orderStore from '@/store/order'; import orderStore from '@/store/order';
import { addConsultOrder, checkOnlineDrugInfoStock, getOnlineSimilarDrugInfo, startConsultOrder } from "@/utils/api"; import { addConsultOrder, checkOnlineDrugInfoStock, getOnlineSimilarDrugInfo, getDrugs } from "@/utils/api";
import { toast, loading, hideLoading } from "@/utils/widget"; import { toast, loading, hideLoading } from "@/utils/widget";
import { themeColor } from '@/utils/theme-config'; import { themeColor } from '@/utils/theme-config';
import { useIMStore } from "@/store/tim"; import { useIMStore } from "@/store/tim";
@ -177,8 +177,10 @@ function changeDrug(drug) {
const index = order.value.drugs.findIndex(item => item._id === drug._id) const index = order.value.drugs.findIndex(item => item._id === drug._id)
if (index >= 0) { if (index >= 0) {
order.value.drugs.splice(index, 1, drug) order.value.drugs.splice(index, 1, drug)
showEditPopup.value = false } else if (drug && drug._id) {
order.value.drugs.push(drug)
} }
showEditPopup.value = false
} }
function confirmDrug(drugs) { function confirmDrug(drugs) {
@ -214,6 +216,10 @@ function importHistory() {
uni.navigateTo({ url: '/pages/consult/history-drugs/history-drugs' }) uni.navigateTo({ url: '/pages/consult/history-drugs/history-drugs' })
} }
function toAddDrug(code ='') {
uni.navigateTo({ url: `/pages/consult/select-drug/select-drug?code=${code}` })
}
function onProofSaved(imagesMap) { function onProofSaved(imagesMap) {
order.value.drugs.forEach(drug => { order.value.drugs.forEach(drug => {
if (imagesMap[drug._id]) { if (imagesMap[drug._id]) {
@ -241,14 +247,13 @@ function remove(idx) {
customConfirmVisible.value = true; customConfirmVisible.value = true;
} }
function toAddDrug(code ='') {
uni.navigateTo({ url: `/pages/consult/select-drug/select-drug?code=${code}` })
}
function scanCode() { function scanCode() {
uni.scanCode({ uni.scanCode({
success: (res) => { success: (res) => {
toAddDrug(res.result) const code = res && typeof res.result === 'string' ? res.result.trim() : ''
if (code) {
getList(code)
}
} }
}) })
} }
@ -301,6 +306,22 @@ async function checkStock() {
} }
} }
async function getList(barcode) {
const params = { page: 1, pageSize: 15, barcode };
const res = await getDrugs(params);
const [barcodeDrug] = res && Array.isArray(res.data) ? res.data : [];
if (!barcodeDrug) {
toast('未查询到该药品')
return
}
if (order.value.drugs.some(item => item._id === barcodeDrug._id)) {
toast('该药品已添加')
return
}
await nextTick()
edit(barcodeDrug)
}
async function submit(ignoreUnsuit = false, ignoreRepeat = false) { async function submit(ignoreUnsuit = false, ignoreRepeat = false) {
if (waiting.value) return; if (waiting.value) return;
const hasDisease = Array.isArray(order.value.diseases) const hasDisease = Array.isArray(order.value.diseases)

View File

@ -106,6 +106,7 @@ const list = ref([]);
const loading = ref(false) const loading = ref(false)
const more = ref(false) const more = ref(false)
const visible = ref(false) const visible = ref(false)
const barcode = ref('')
// //
const customConfirmVisible = ref(false); const customConfirmVisible = ref(false);
@ -123,6 +124,7 @@ const selectMap = computed(() => drugs.value.reduce((acc, cur) => {
acc[cur._id] = true; acc[cur._id] = true;
return acc return acc
}, {})) }, {}))
useRefChange(keyword, search); useRefChange(keyword, search);
onLoad((options) => { onLoad((options) => {
@ -233,8 +235,12 @@ function search() {
async function getList() { async function getList() {
if (loading.value) return; if (loading.value) return;
loading.value = true; loading.value = true;
const apiName = order.value.consultType === 'onlineMedicinePurchase' ? getOnlineDrugList : getDrugs; const params = { page: page.value, pageSize: 15, keyword: keyword.value };
const res = await apiName({ page: page.value, pageSize: 15, keyword: keyword.value }); if (barcode.value) {
params.barcode = barcode.value;
params.keyword = '';
}
const res = await getDrugs(params);
const listData = res && Array.isArray(res.data) ? res.data : []; const listData = res && Array.isArray(res.data) ? res.data : [];
list.value = page.value === 1 ? res.data : [...list.value, ...listData]; list.value = page.value === 1 ? res.data : [...list.value, ...listData];
const message = res && typeof res.message === 'string' ? res.message : '获取药品失败'; const message = res && typeof res.message === 'string' ? res.message : '获取药品失败';
@ -243,12 +249,17 @@ async function getList() {
} }
loading.value = false; loading.value = false;
more.value = res && res.pages > page.value; more.value = res && res.pages > page.value;
if (barcode.value) {
barcode.value = ''
}
} }
function scanCode() { function scanCode() {
uni.scanCode({ uni.scanCode({
success: (res) => { success: (res) => {
keyword.value = res.result barcode.value = res.result;
search()
// keyword.value = res.result
} }
}) })
} }

View File

@ -18,7 +18,7 @@
<view class="info-row"> <view class="info-row">
<view class="info-item" style="width: 28%">姓名{{ data.name }}</view> <view class="info-item" style="width: 28%">姓名{{ data.name }}</view>
<view class="info-item" style="width: 20%">性别{{ data.sex }}</view> <view class="info-item" style="width: 20%">性别{{ data.sex }}</view>
<view class="info-item" style="width: 28%">费别</view> <view class="info-item" style="width: 28%">费别{{ data.feeType === 'YB' ? '医保' : '自费' }}</view>
<view class="info-item" style="width: 24%">年龄{{ data.age }}</view> <view class="info-item" style="width: 24%">年龄{{ data.age }}</view>
</view> </view>
<view class="info-row"> <view class="info-row">