修复添加商品的bug、到店接诊-患者详情、开处方、添加商品解决底部按钮遮住内容的bug、解决开方表单重复提交的bug

This commit is contained in:
2024-09-26 16:52:45 +08:00
parent ddac24aa35
commit f507b3da98
12 changed files with 772 additions and 629 deletions

View File

@@ -85,7 +85,7 @@
if (req.errcode == 0) {
console.log(req, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
// 未完善信息
if (req.data.user.status == 3) {
if (req.data.user?.status == 3) {
// this.$toast('您还没有完善信息,请先完善信息')
// this.$go('../../subPackages/sub_workbench/workbench_upInfo/index')
uni.navigateTo({
@@ -94,7 +94,7 @@
return
}
if (role == 2 && req.data.user.status == 2) {
if (role == 2 && req.data.user?.status == 2) {
let logInfo = uni.getStorageSync('logInfo') || {}
let userInfo = {
...logInfo,
@@ -113,14 +113,14 @@
}, 100)
}
if (role == 1 && req.data.DoctorInfo.user.status == 2) {
if (role == 1 && req.data.DoctorInfo.user?.status == 2) {
let logInfo = uni.getStorageSync('logInfo') || {}
let userInfo = {
...logInfo,
...(uni.getStorageSync('userInfo') || {}),
...req.data
}
userInfo.status = userInfo.user && userInfo.user.status != '' ? userInfo.user.status : userInfo
userInfo.status = userInfo.user && userInfo.user?.status != '' ? userInfo.user.status : userInfo
.status
uni.setStorageSync('identity', userInfo['role'])

View File

@@ -972,7 +972,7 @@ export function chinRefuse(data) {
*/
export function recordList(data) {
return req.request({
url: 'patient/record-list',
url: 'patient/record-list-by-doctor',
method: 'post',
data
})
@@ -998,7 +998,7 @@ export function prescripDetailList(data) {
*/
export function prescripRecord(data) {
return req.request({
url: 'examine/list',
url: 'examine/list-by-doctor',
method: 'get',
data
})

View File

@@ -1,7 +1,9 @@
import Request from './request.js';
import errorCode from './errorCode.js';
let protocol = 'https'; //协议
let baseUrl = 'app.xiaokang88.com/service/v1/'; // 域名
let baseUrl = 'app.xiaokang88.com/service/v1/'; // 域名
// let protocol = 'http'; //协议
// let baseUrl = 'www.xk888.com/service/v1/'; // 域名
export const config = {
baseUrl: `${protocol}://${baseUrl}`
}

View File

@@ -1,6 +1,6 @@
{
"name" : "xiaokang_doctor",
"appid" : "__UNI__2465184",
"appid" : "__UNI__8971029",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",

View File

@@ -1,6 +1,6 @@
{
"id": "cu-editor",
"name": "微信小程序富文本编辑器(仿腾讯文档)",
"name": "xk-doctor-wx",
"version": "1.0.4",
"description": "照着腾讯文档小程序开发了微信小程序富文本编辑器组件这几天做个整理如果有这个需求可以前往腾讯文档小程序操作看看实际效果。腾讯文档小程序用的不是原生的组件当前项目按现有开放api尽可能实现。",
"keywords": [

View File

@@ -44,7 +44,7 @@
</view> -->
</view>
<view v-for="(item, index) in list" :key="index" class="flex-row flex-ali-center m-t-50"
@click="toDetail(item.id)">
@click="toDetail(item.patient_id)">
<u-image width="80rpx" height="80rpx" shape="circle"
:src="item.avatar || require(`../../static/image/${item.sex%2==0?'nv':'nan'}.png`)">
<u-loading slot="loading"></u-loading>

View File

@@ -77,7 +77,7 @@
<!-- height:calc(100vh - 282rpx) -->
<scroll-view scroll-y="true" style="padding: 20rpx 0rpx;" @scrolltolower="scrolltolower"
@refresherrefresh="page=1;status = 'loading';loading = true;infoList=[];$store.dispatch('getDocSession')"
:refresher-triggered="loading" :refresher-enabled="true" v-if="!loading">
:refresher-triggered="loading" :refresher-enabled="false" v-if="!loading">
<!-- <view class="news_item flex-row flex-jus-sp flex-ali-center" v-for="(item) in infoList"
:key="item.id"

View File

@@ -1,3 +1,29 @@
<style>
.card {
background-color: #fff;
border-radius: 8px;
box-shadow: 5px 6px 14px 4px rgba(0, 0, 0, 0.19);
padding: 20px;
background-image: linear-gradient(to bottom, rgba(106, 205, 187, 0.61), rgb(255, 255, 255), rgb(255, 255, 255), rgb(255, 255, 255));
}
.card .flex-row {
//justify-content: space-between;
}
.card .content-c {
font-size: 28rpx;
color: #333;
}
.card .d-text {
font-weight: normal;
}
.card u-gap {
margin-top: 20px;
}
</style>
<template>
<view>
<view class="white p-32" v-if="info&&!loading">
@@ -8,12 +34,12 @@
<view class="flex-col flex-jus-sp m-l-32">
<view class="flex-row flex-ali-center m-b-16">
<!-- <d-text :text="info.patient.name" className="content-c fs-32"></d-text> -->
<d-text :text="'zzz'" className="tips-c m-l-2"></d-text>
<d-text :text="info.patient.name" className="tips-c m-l-2"></d-text>
</view>
<view class="flex-row flex-ali-center">
<d-text :text="info.patient.sex==1?'男':'女'" className="tips-c m-l-2"></d-text>
<!-- info.age+ -->
<d-text :text="'11岁'" className="tips-c m-l-2"></d-text>
<d-text :text="info.age" className="tips-c m-l-2"></d-text>
</view>
</view>
</view>
@@ -24,53 +50,71 @@
bar-width="20" inactive-color="#6C7380" active-color="#6ACDBB"></u-tabs>
<view class="p-32" v-if="list[current].length>0&&!loading2">
<block v-if="current==0">
<view class="flex-col" :class="{'m-b-32':(i+1)!=list[current].length}"
v-for="(item,i) in list[current]" :key="i">
<d-text text="2022-11-16"></d-text>
<view class="flex-row flex-ali-center m-t-16">
<d-text text="主诉:"></d-text>
<d-text :text="item.main_suit" className="content-c"></d-text>
<view class="flex-col card" :class="{'m-b-32':(i+1)!=list[current].length}"
v-for="(item,i) in list[current]" :key="i" @click="toNext(2, item.id, item.user_patient_id, item.status)">
<view class="flex-row flex-ali-center">
<d-text text="订单号:"></d-text>
<d-text :text="item.order_no" className="content-c"></d-text>
</view>
<view class="flex-row flex-ali-center flex-jus-sp m-t08">
<d-text width="85rpx" text="诊断:" className=""></d-text>
<d-text :text="item.diagnose" className="flex-1 content-c" :lines="1">
</d-text>
<view class="flex-row flex-ali-center m-t-24">
<d-text text="科室:"></d-text>
<d-text :text="item.depart" className="content-c"></d-text>
</view>
<view class="flex-row flex-ali-center m-t-16">
<d-text text="医生:"></d-text>
<d-text :text="item.doctor" className="content-c"></d-text>
</view>
<view class="flex-row flex-jus-sp flex-ali-centerc">
<d-text text=" "></d-text>
<u-tag :text="item.status_text" :type="item.status_type" />
</view>
<view class="flex-row flex-jus-sp flex-ali-center m-t-16">
<d-text text=" " color="#6C7380">
</d-text>
<d-text :text="item.created_at"></d-text>
</view>
<!-- <view class="flex-row flex-ali-center m-t-16">-->
<!-- <d-text text="主诉:"></d-text>-->
<!-- <d-text :text="item.main_suit" className="content-c"></d-text>-->
<!-- </view>-->
<!-- <view class="flex-row flex-ali-center flex-jus-sp m-t08">-->
<!-- <d-text width="85rpx" text="诊断:" className=""></d-text>-->
<!-- <d-text :text="item.diagnose" className="flex-1 content-c" :lines="1">-->
<!-- </d-text>-->
<!-- </view>-->
<!-- <u-gap height="1" bg-color="#cacfd8" margin-top="20"></u-gap>-->
</view>
</block>
<block v-else>
<view class="flex-col" v-for="(item,i) in list[current]" :key="i">
<view class="flex-row flex-jus-sp flex-ali-center">
<d-text :text="$u.timeFormat(item.created_at, 'yyyy-mm-dd hh:MM:ss')" color="#6C7380">
<block v-if="current==1">
<view class="flex-col card" :class="{'m-b-32':(i+1)!=list[current].length}" v-for="(item,i) in list[current]" :key="i"
@click="toNext(5, item.id, 0)">
<view class="flex-row flex-ali-center">
<d-text text="编号:"></d-text>
<d-text style="font-size: 25rpx;" className="content-c" :text="item.prescription_no"></d-text>
</view>
<view class="flex-row flex-ali-center m-t-16">
<d-text text="类别:"></d-text>
<d-text :text="item.p_category" className="content-c"></d-text>
</view>
<view class="flex-row flex-ali-center m-t-16">
<d-text text="诊断:"></d-text>
<d-text :text="item.clinical_diagnose" className="content-c"></d-text>
</view>
<view class="m-t-16">
<d-text text="药品:"></d-text>
<u-tag v-for="(value,key) in item.p_drugs" v-if="key < 5" :text="value.toString()" style="margin: 10rpx; display: inline-block" type="info" />
<d-text v-if="item.drugs_count >= 5" style="margin: 10rpx; display: inline-block" :text="'等,共:' + item.drugs_count+' 个'"></d-text>
</view>
<view class="flex-row flex-jus-sp flex-ali-centerc m-t-16">
<d-text text=" "></d-text>
<u-tag v-if="item.cancel_remark !== ''" :text="item.cancel_remark" :type="item.cancel_remark === '主动取消订单'? 'error': 'info'" />
</view>
<view class="flex-row flex-jus-sp flex-ali-center m-t-16">
<d-text text=" " color="#6C7380">
</d-text>
<d-text :text="states[item.status].label" :color="states[item.status].color"></d-text>
</view>
<view class="m-t-32 flex-col">
<view class="flex-row m-b-16">
<d-text text="医生" align="justify" width="112"></d-text>
<d-text :text="item.doctor_name" className="content-c m-l-48"></d-text>
</view>
<view class="flex-row m-b-16">
<d-text text="诊断" width="112" align="justify"></d-text>
<d-text :text="item.clinical_diagnose" className="content-c m-l-48 flex-1" :lines="1">
</d-text>
</view>
<view class="flex-row m-b-16">
<d-text text="药品" width="112" align="justify"></d-text>
<d-text :text="getDrug(item.drug_name)" className="content-c m-l-48 flex-1"
:lines="1"></d-text>
</view>
<!-- <view class="flex-row">
<d-text text="问诊记录" width="112" align="justify"></d-text>
<d-text text="点击查看" :color="states[0].color" className="m-l-48"></d-text>
</view> -->
<!-- <view class="m-t-16 flex-row flex-jus-end">
<u-button :throttle-time="0" shape="circle" size="mini"
:custom-style="{backgroundColor: 'transparent !important'}" plain :ripple="true">
查看详情
</u-button>
</view> -->
<d-text :text="item.created_at"></d-text>
</view>
<!-- <u-gap height="1" bg-color="#cacfd8" margin-top="20"></u-gap>-->
</view>
</block>
</view>
@@ -125,6 +169,9 @@
computed: {
getAvatar() {
// this.info.patient.sex
if (this.info.avatar != '') {
return this.info.avatar
}
return require(`@/static/image/${1%2==0?'nv':'nan'}.png`)
}
},
@@ -159,6 +206,24 @@
getMobile(v) {
return v.replace(/^(\d{3})\d{4}(\d+)/, "$1****$2")
},
// 跳转
toNext(base_type, id, patient_id, status = 0) {
if (base_type == 2 && id && patient_id) {
switch (status) {
case null:
this.$toast('状态非法')
return
case 0:
this.$toast('该订单还未支付')
break
case 4:
return this.$toast('该订单已取消')
}
this.$go('../../subPackages/sub_workbench/workbench_infoPatient?id=' + patient_id + '&re_id=' + id)
} else if (base_type == 5 && id) {
this.$go('/pages/my/prescriptionDetail?id=' + id)
}
},
patientInfo() {
patientInfo({
up_id: this.id,
@@ -177,23 +242,23 @@
},
async getList() {
let res = {}
// this.current == 0 && (res = await recordList({
// up_id: this.id,
// store_id: uni.getStorageSync('store_id') || '11001',
// }))
// this.current == 1 && (res = await prescripRecord({
// up_id: this.id,
// store_id: uni.getStorageSync('store_id') || '11001',
// }))
// if (res.errcode == 0) {
// this.list[this.current] = res.data && res.data.list ? res.data.list : res.data || []
// this.$nextTick(() => {
// this.loading2 = false
// })
// } else {
// this.$toast(res.msg);
// this.loading2 = false
// }
this.current == 0 && (res = await recordList({
up_id: this.id,
store_id: uni.getStorageSync('store_id') || '11001',
}))
this.current == 1 && (res = await prescripRecord({
up_id: this.id,
store_id: uni.getStorageSync('store_id') || '11001',
}))
if (res.errcode == 0) {
this.list[this.current] = res.data && res.data.list ? res.data.list : res.data || []
this.$nextTick(() => {
this.loading2 = false
})
} else {
this.$toast(res.msg);
this.loading2 = false
}
this.$nextTick(() => {

View File

@@ -105,7 +105,7 @@
return {
loading: false,
loading2: true,
info: '',
info: {},
tabs: [{
name: '就诊记录'
}, {

View File

@@ -1,5 +1,5 @@
<template>
<view class="safe-area-inset-bottom">
<view style="padding-bottom: 300rpx">
<!-- 状态 -->
<view class="states_"
:class="infoList.status==1&&'bg_blue'||infoList.status==2&&'bg_green'||infoList.status==3&&'bg_plus'||infoList.status==7&&'bg_red'">
@@ -419,14 +419,15 @@
.fun {
position: fixed;
left: 0;
bottom: 0;
z-index: 99;
width: 750rpx;
background-color: #fff;
padding: 12rpx 32rpx;
padding: 46rpx 32rpx;
display: flex;
flex-direction: row;
justify-content: flex-end;
text-align: center;
bottom: env(safe-area-inset-bottom);
//bottom: env(safe-area-inset-bottom);
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -36,7 +36,7 @@
</view>
</view>
<!-- :style="[scrollStyle]"-->
<scroll-view scroll-y="true" :style="[scrollStyle]">
<!-- 西药 -->
<view class="m-t-2 b-r-8 white p-32 flex-col" v-if="tabsActive==0">
@@ -247,8 +247,8 @@
<view v-if="!is_common" @click="add(1)" class="btnText">另存常用方</view>
<!-- <d-text text="请确认患者已在实体医院就诊,并有明确诊断" className="tips-c fs-24"></d-text> -->
<u-button :throttle-time="0" @click="add(0)" shape="circle"
:custom-style="{backgroundColor:is_add?'#A5DCD2':'#6ACDBB',color:'#fff',heigth:'86rpx', width: is_common ? '686rpx' : '448rpx'}"
:disabled="is_add">{{is_common?'保存常用方':'发送处方'}}
:custom-style="{backgroundColor:buttonLodging?'#A5DCD2':'#6ACDBB',color:'#fff',heigth:'86rpx', width: is_common ? '686rpx' : '448rpx'}"
:disabled="buttonLodging">{{is_common?'保存常用方':'发送处方'}}
</u-button>
</view>
@@ -369,6 +369,7 @@
commentList: [],
selectComment: [],
showComment: false,
buttonLodging: false,
see_rate: uni.getStorageSync('see_rate'),
isOpen: false, // 是否展开常用诊断
comDiagnoseList: [],
@@ -532,7 +533,7 @@
},
scrollStyle() {
let style = {}
style.height = `calc(100vh - env(safe-area-inset-bottom) - 288rpx - ${this.height}px)`
style.height = `calc(100vh - env(safe-area-inset-bottom) - 450rpx - ${this.height}px)`
return style
},
// 常用诊断
@@ -551,7 +552,7 @@
},
is_add() {
return (this.tabsActive == 0 && this.wests.length == 0) || ((this.tabsActive == 1) && (this.mInfo.length ==
0)) || ((this.tabsActive == 2) && (this.mInfoG.length == 0))
0)) || ((this.tabsActive == 2) && (this.mInfoG.length == 0) && (this.buttonLodging === true))
}
},
beforeDestroy() {
@@ -750,6 +751,12 @@
},
// 发送处方
async add(type) {
let that = this;
if (this.buttonLodging == true) {
this.$toast('正在处理中,请勿重复提交');
return;
}
this.buttonLodging = true;
let res = {}
let list = this.tabsActive == 0 ? this.wests : this.tabsActive == 1 ? this.chineses : this.granular
let ids = list.reduce((total, item) => {
@@ -770,14 +777,17 @@
if (!clinical_diagnose && !this.is_common && !type) {
this.$toast('请添加诊断')
that.buttonLodging = false
return
}
if (!ids) {
this.$toast('请添加商品')
that.buttonLodging = false
return
}
if (!this.entrust && !this.is_common && !type) {
this.$toast('请输入医嘱')
that.buttonLodging = false
return
}
@@ -791,6 +801,7 @@
// 发送处方
} else if (type == 0) {
// console.log('addd');
try {
let res = {}
let list = this.tabsActive == 0 ? this.wests : this.tabsActive == 1 ? this.chineses : this
@@ -906,7 +917,8 @@
}))
this.loading = false
// this.loading = false
if (res.errcode == 0) {
uni.showToast({
title: '发送成功',
@@ -914,11 +926,10 @@
mask: true
})
setTimeout(() => {
uni.navigateBack({
delta: 2
})
}, 2000)
uni.navigateBack({
delta: 2
})
this.prescription_id = res.data.id
} else {