fix: 问题修复
This commit is contained in:
parent
022ed92e38
commit
4e22412ea0
@ -2,7 +2,7 @@
|
||||
<view class="rx-fail-card border shadow-lg rounded" :style="elderVarStyle">
|
||||
<view class="fail-title-row">
|
||||
<view class="warning-icon">!</view>
|
||||
<text class="fail-title">处方开具失败</text>
|
||||
<text class="fail-title">{{ errorSource }}</text>
|
||||
</view>
|
||||
<view class="reason-row">
|
||||
<text class="reason-label">原因:</text>
|
||||
@ -48,6 +48,10 @@ const reason = computed(() => {
|
||||
: '未获取到失败原因,请稍后重试。';
|
||||
});
|
||||
|
||||
const errorSource = computed(() => {
|
||||
return ext.value && ext.value.source === 'HIS' ? '处方开具失败' : '服务暂未响应';
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
uni.$emit('autoRxFail');
|
||||
})
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<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="user-header shadow-lg">
|
||||
就诊人:{{ form.name }} {{ form.sex }} {{ form.age ? `${form.age}岁` : '' }}
|
||||
@ -94,7 +94,6 @@ const { init: initOrder, restoreForEdit } = orderStore();
|
||||
const visible = ref(false);
|
||||
const guessVisible = ref(false);
|
||||
const reachBottom = ref(false);
|
||||
const pageRef = ref(null);
|
||||
let guessCloseTimer = null;
|
||||
// 长辈模式状态
|
||||
const elderMode = ref(false);
|
||||
@ -157,11 +156,6 @@ function nextStep() {
|
||||
toast('请填写病情描述');
|
||||
return;
|
||||
}
|
||||
if (!reachBottom.value) {
|
||||
pageRef.value?.scrollToBottom();
|
||||
reachBottom.value = true;
|
||||
return
|
||||
}
|
||||
for (let item of histories.value) {
|
||||
if (!item.options.includes(form.value[item.prop])) {
|
||||
toast(`请选择${item.label}`);
|
||||
@ -181,7 +175,6 @@ function onDiseaseSelected(disease) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function removeImage(index) {
|
||||
form.value.images.splice(index, 1);
|
||||
}
|
||||
@ -231,10 +224,6 @@ function upload(path) {
|
||||
})
|
||||
}
|
||||
|
||||
function onReachBottom() {
|
||||
reachBottom.value = true;
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
if (options.reEdit === '1') {
|
||||
const record = get('re-edit-consult-order');
|
||||
|
||||
@ -167,7 +167,7 @@ async function getDrugsInfo(drugs) {
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
async function getList(changeTabWhenEmpty = false) {
|
||||
async function getList() {
|
||||
if (loading.value) return;
|
||||
loading.value = true;
|
||||
showLoading()
|
||||
@ -190,9 +190,6 @@ async function getList(changeTabWhenEmpty = false) {
|
||||
toast(message || '未查询到历史处方')
|
||||
}
|
||||
loading.value = false;
|
||||
if (changeTabWhenEmpty && list.value.length === 0) {
|
||||
switchTab('purchase-record')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -218,7 +215,7 @@ async function getNinetyDaysDrugRecord() {
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
getList(true)
|
||||
getList()
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
@ -31,10 +31,12 @@
|
||||
<template v-if="logined" #footer>
|
||||
<view class="footer">
|
||||
<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>
|
||||
</view>
|
||||
<view class="manage-link" @click="toPatientManagement">
|
||||
<view v-if="feeType === 'ZF'" class="manage-link" @click="toPatientManagement">
|
||||
<text>最多添加10位就诊人,点击就诊人管理</text>
|
||||
<uni-icons type="right" :color="themeSecondary" :size="16" />
|
||||
</view>
|
||||
@ -60,9 +62,7 @@ import fullPage from "@/components/full-page.vue";
|
||||
const {
|
||||
logined,
|
||||
getAuthCode,
|
||||
myProfile,
|
||||
familyProfile,
|
||||
getProfileData,
|
||||
userInfo,
|
||||
storeId,
|
||||
patientList: storePatientList,
|
||||
loadPatientList,
|
||||
@ -161,6 +161,10 @@ async function scanInsuranceCode() {
|
||||
toast("医保信息不完整,请重新读卡");
|
||||
return;
|
||||
}
|
||||
if (userInfo.value.certNo === res.data.IDNum) {
|
||||
toast("当前操作仅支持非本人医保码");
|
||||
return;
|
||||
}
|
||||
set("current-scanned-card", res.data, 300);
|
||||
uni.navigateTo({
|
||||
url: `/pages/member/detail?type=ybQrcode&feeType=${feeType.value}`,
|
||||
@ -369,5 +373,4 @@ function toPatientManagement() {
|
||||
font-size: 24rpx;
|
||||
color: #344743;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -119,7 +119,7 @@
|
||||
@close="visible = false" @confirm="changeDrugs($event)" />
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { ref, onMounted, nextTick } from 'vue'
|
||||
import { onLoad, onUnload } from '@dcloudio/uni-app';
|
||||
import { storeToRefs } from "pinia";
|
||||
import BigNumber from "bignumber.js";
|
||||
@ -127,7 +127,7 @@ import useElder from '@/hooks/useElder';
|
||||
import useUser from "@/hooks/useUser";
|
||||
import useDb from "@/store/db";
|
||||
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 { themeColor } from '@/utils/theme-config';
|
||||
import { useIMStore } from "@/store/tim";
|
||||
@ -177,8 +177,10 @@ function changeDrug(drug) {
|
||||
const index = order.value.drugs.findIndex(item => item._id === drug._id)
|
||||
if (index >= 0) {
|
||||
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) {
|
||||
@ -214,6 +216,10 @@ function importHistory() {
|
||||
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) {
|
||||
order.value.drugs.forEach(drug => {
|
||||
if (imagesMap[drug._id]) {
|
||||
@ -241,14 +247,13 @@ function remove(idx) {
|
||||
customConfirmVisible.value = true;
|
||||
}
|
||||
|
||||
function toAddDrug(code ='') {
|
||||
uni.navigateTo({ url: `/pages/consult/select-drug/select-drug?code=${code}` })
|
||||
}
|
||||
|
||||
function scanCode() {
|
||||
uni.scanCode({
|
||||
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) {
|
||||
if (waiting.value) return;
|
||||
const hasDisease = Array.isArray(order.value.diseases)
|
||||
|
||||
@ -106,6 +106,7 @@ const list = ref([]);
|
||||
const loading = ref(false)
|
||||
const more = ref(false)
|
||||
const visible = ref(false)
|
||||
const barcode = ref('')
|
||||
|
||||
// 自定义确认弹窗状态(仅用于本页面)
|
||||
const customConfirmVisible = ref(false);
|
||||
@ -123,6 +124,7 @@ const selectMap = computed(() => drugs.value.reduce((acc, cur) => {
|
||||
acc[cur._id] = true;
|
||||
return acc
|
||||
}, {}))
|
||||
|
||||
useRefChange(keyword, search);
|
||||
|
||||
onLoad((options) => {
|
||||
@ -233,8 +235,12 @@ function search() {
|
||||
async function getList() {
|
||||
if (loading.value) return;
|
||||
loading.value = true;
|
||||
const apiName = order.value.consultType === 'onlineMedicinePurchase' ? getOnlineDrugList : getDrugs;
|
||||
const res = await apiName({ page: page.value, pageSize: 15, keyword: keyword.value });
|
||||
const params = { 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 : [];
|
||||
list.value = page.value === 1 ? res.data : [...list.value, ...listData];
|
||||
const message = res && typeof res.message === 'string' ? res.message : '获取药品失败';
|
||||
@ -243,12 +249,17 @@ async function getList() {
|
||||
}
|
||||
loading.value = false;
|
||||
more.value = res && res.pages > page.value;
|
||||
if (barcode.value) {
|
||||
barcode.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
function scanCode() {
|
||||
uni.scanCode({
|
||||
success: (res) => {
|
||||
keyword.value = res.result
|
||||
barcode.value = res.result;
|
||||
search()
|
||||
// keyword.value = res.result
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<view class="info-row">
|
||||
<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: 28%">费别:</view>
|
||||
<view class="info-item" style="width: 28%">费别:{{ data.feeType === 'YB' ? '医保' : '自费' }}</view>
|
||||
<view class="info-item" style="width: 24%">年龄:{{ data.age }}</view>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user