优化聊天

This commit is contained in:
haomingming
2023-03-30 11:33:45 +08:00
parent 9859b0cbea
commit 75c9d6cae2
18 changed files with 140 additions and 72 deletions
+9 -1
View File
@@ -35,6 +35,7 @@ Page({
doctors_advice_focus: false,
case_detail: {},
sub_disabled: false,
from: ""
},
onDoctorsAdviceFocus(){
this.setData({
@@ -42,6 +43,7 @@ Page({
})
},
onLoad(options){
let from = options.from;
let order_inquiry_id = options.order_inquiry_id;
let order_prescription_id = options.order_prescription_id ;
//获取患者问诊病例
@@ -59,6 +61,7 @@ Page({
this.setData({
order_inquiry_id: order_inquiry_id,
order_prescription_id: order_prescription_id,
from: from
})
},
select_drug(e){
@@ -360,6 +363,9 @@ Page({
title: '提交成功',
icon: "success"
})
setTimeout(() => {
wx.navigateBack();
}, 1000);
}).catch(errors => {
console.error(errors);
this.setData({
@@ -430,13 +436,15 @@ Page({
return;
}
api.putDoctorPrescription(params).then(response => {
console.log(response);
wx.showToast({
title: '提交成功',
icon: "success"
})
setTimeout(() => {
wx.navigateBack();
}, 1000);
}).catch(errors => {
console.error(errors);
this.setData({
+5 -4
View File
@@ -30,7 +30,7 @@
<van-cell-group inset>
<van-cell use-label-slot bind:click="showZhenDuan" custom-style="font-size:30rpx;color: #333;" title="诊断" >
<view class="addzhenduan">+添加诊断</view>
<view class="addzhenduan" wx:if="{{from != 'chat'}}">+添加诊断</view>
<view slot="label">
<view style="margin-top: 20rpx;" class="label_item" wx:for="{{zhenduan_list}}">
<van-icon name="delete" catchtap="delZhenDuan" color="red" data-disease_class_id="{{item.icd_id}}" /><text style="margin-left: 10rpx;">{{item.icd_name}}</text>
@@ -48,14 +48,14 @@
<view class="drugs_name">{{ drugs.product_name }}(数量{{ drugs.prescription_product_num}})</view>
<view class="drugs_guige">用法用量:{{ drugs.single_use }};{{ drugs.frequency_use }};{{ drugs.single_unit }}</view>
<!-- <view class="drugs_dosage">备注:{{ drugs.drugs_dosage }}</view> -->
<view class="btn">
<view class="btn" wx:if="{{from != 'chat'}}">
<van-button bind:click="editDrug" size="small" custom-style="font-size:28rpx;" data-product_id="{{drugs.product_id}}" color="#666" plain round type="info">编辑</van-button>
<van-button bind:click="delDrug" custom-style="margin-left: 20rpx;font-size:28rpx;" data-product_id="{{drugs.product_id}}" size="small" color="#666" plain round type="info">删除</van-button>
</view>
</view>
</view>
<view class="adddrugs_btn">
<view class="adddrugs_btn" wx:if="{{from != 'chat'}}">
<van-button bind:click="showPopup" color="rgba(44,241,248,0.28);" custom-style="color:#3CC7C0; font-size:30rpx; border-radius: 10rpx;" type="primary" block>+添加药品</van-button>
</view>
<form bindsubmit="{{ order_prescription_id == ''?'postDoctorPrescription':'putDoctorPrescription' }}">
@@ -63,7 +63,8 @@
<view class="doctors_advice" bindtap="onDoctorsAdviceFocus">
<textarea auto-height focus="{{doctors_advice_focus}}" maxlength="1000" bindblur="getAdvice" style="width: 100%;" placeholder-style="font-size:24rpx; color:#999" placeholder="请输入医嘱(5-200字)" name="doctors_advice" value="{{doctor_advice}}"></textarea>
</view>
<view class="sub_btn">
<!-- 从聊天页面过来的不显示按钮 -->
<view class="sub_btn" wx:if="{{from != 'chat'}}">
<van-button disabled="{{sub_disabled}}" form-type="submit" color="#3CC7C0; font-size:30rpx; border-radius: 10rpx;" type="primary" block>{{ order_prescription_id == ''?'提交审核':'重开处方' }}</van-button>
</view>