优化
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// Pages/home.js
|
||||
import { API } from './../../../utils/network/api'
|
||||
const api = new API()
|
||||
const app = getApp()
|
||||
Page({
|
||||
/**
|
||||
@@ -12,7 +13,13 @@ Page({
|
||||
title: '药师端', //导航栏 中间的标题
|
||||
},
|
||||
// 此页面 页面内容距最顶部的距离
|
||||
height: app.globalData.height
|
||||
height: app.globalData.height,
|
||||
pharmacist: {},
|
||||
audit_number: 0,
|
||||
data_list_0: [],
|
||||
data_list_1: [],
|
||||
data_list_2: [],
|
||||
data_list_3: [],
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
@@ -28,5 +35,74 @@ Page({
|
||||
active: 0, //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
|
||||
})
|
||||
}
|
||||
api.getPharmacistIndex().then(response => {
|
||||
this.setData({
|
||||
pharmacist: response.data.pharmacist,
|
||||
audit_number: response.data.audit_number
|
||||
})
|
||||
}).catch(errors => {
|
||||
console.error(errors);
|
||||
})
|
||||
|
||||
this.getPharmacistPrescription();
|
||||
},
|
||||
getPharmacistPrescription(){
|
||||
let params = {};
|
||||
let active = this.data.active;
|
||||
let pharmacist_audit_status = 0;
|
||||
let platform_audit_status = 1;
|
||||
|
||||
if(active == 0){
|
||||
pharmacist_audit_status = 0;
|
||||
platform_audit_status = 0;
|
||||
}
|
||||
if(active == 1){
|
||||
pharmacist_audit_status = 1;
|
||||
platform_audit_status = 1;
|
||||
}
|
||||
if(active == 2){
|
||||
pharmacist_audit_status = 2;
|
||||
platform_audit_status = 0;
|
||||
}
|
||||
if(active == 3){
|
||||
pharmacist_audit_status = 1;
|
||||
platform_audit_status = 2;
|
||||
}
|
||||
params.pharmacist_audit_status = pharmacist_audit_status;
|
||||
params.platform_audit_status = platform_audit_status;
|
||||
let data_name = "data_list_"+active;
|
||||
api.getPharmacistPrescription(params).then(response => {
|
||||
this.setData({
|
||||
[data_name]: response.data.data
|
||||
})
|
||||
}).catch(errors => {
|
||||
console.error(errors);
|
||||
})
|
||||
},
|
||||
onChange(e){
|
||||
console.log(e)
|
||||
this.setData({
|
||||
active: e.detail.index
|
||||
})
|
||||
this.getPharmacistPrescription();
|
||||
},
|
||||
go(e){
|
||||
let url = e.currentTarget.dataset.url;
|
||||
app.go(url)
|
||||
},
|
||||
switchStatus(){
|
||||
let is_online = this.data.pharmacist.is_online;
|
||||
if(is_online == 0){
|
||||
is_online = 1
|
||||
}else if(is_online == 1){
|
||||
is_online = 0
|
||||
}
|
||||
api.putPharmacistOnOff({is_online: is_online}).then(response => {
|
||||
this.setData({
|
||||
"pharmacist.is_online": is_online
|
||||
})
|
||||
}).catch(errors => {console.error(errors);})
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
+65
-51
@@ -2,100 +2,114 @@
|
||||
<view class="container">
|
||||
<view class="main title">
|
||||
<view class="photo">
|
||||
<t-avatar class="avatar-example" width="20" image="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/default_photo.png" />
|
||||
<t-avatar class="avatar-example" width="20" image="{{pharmacist.avatar}}" />
|
||||
</view>
|
||||
<view class="name">
|
||||
<view class="realname">李四</view>
|
||||
<view class="today_num">今日审方 9</view>
|
||||
<view class="realname">{{pharmacist.user_name}}</view>
|
||||
<view class="today_num">今日审方 {{audit_number}}</view>
|
||||
</view>
|
||||
<view class="status">
|
||||
<view class="status_text status_offline">离线</view>
|
||||
<view class="status" bindtap="switchStatus">
|
||||
<view class="status_text {{pharmacist.is_online==1?'status_online':'status_offline'}}">{{pharmacist.is_online==1?'在线':'离线'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="main content">
|
||||
<van-tabs active="{{ active }}" color="{{ active_color }}" bind:change="onChange">
|
||||
<van-tab title="待审核处方">
|
||||
<view class="item">
|
||||
<view class="item" wx:for="{{data_list_0}}">
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">处方订单号:2023010510324649</view>
|
||||
<view class="pre_content">处方订单号:{{item.prescription_code}}</view>
|
||||
<view class="end_content">
|
||||
<navigator url="/Pages/yaoshi/medicalrecord/medicalrecord" open-type="navigate" hover-class="other-navigator-hover">
|
||||
<!-- <navigator url="/Pages/yaoshi/medicalrecord/medicalrecord" open-type="navigate" hover-class="other-navigator-hover">
|
||||
<van-button type="primary" size="small">查看病例</van-button>
|
||||
</navigator>
|
||||
</navigator> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">开方时间:2023-01-16 08:52</view>
|
||||
<view class="end_content">
|
||||
<navigator url="/Pages/yaoshi/medicalrecord/medicalrecord" open-type="navigate" hover-class="other-navigator-hover">
|
||||
<van-button type="primary" size="small">查看病例</van-button>
|
||||
</navigator>
|
||||
<view class="pre_content">开方时间:{{item.created_at}}</view>
|
||||
<view class="end_content" bindtap="go" data-url="/Pages/yaoshi/medicalrecord/medicalrecord?order_inquiry_id={{item.order_inquiry_id }}&order_prescription_id={{item.order_prescription_id}}">
|
||||
<van-button type="primary" color="#ec871e" size="small">查看病例</van-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">张三/男/45岁</view>
|
||||
<view class="end_content">
|
||||
<view class="pre_content">{{item.patient_name}}/{{item.patient_sex==1?'男':'女'}}/{{item.patient_age}}岁</view>
|
||||
<view class="end_content" bindtap="go" data-url="/Pages/yaoshi/prescription/prescription?order_prescription_id={{item.order_prescription_id}}">
|
||||
<van-button type="primary" color="linear-gradient(to bottom, #5EA8D5, #63CFEA)" size="small">去审方</van-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item">
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">处方订单号:2023010510324649</view>
|
||||
<view class="end_content">
|
||||
<van-button type="primary" size="small">查看病例</van-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">开方时间:2023-01-16 08:52</view>
|
||||
<view class="end_content">
|
||||
<van-button type="primary" size="small">查看病例</van-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">张三/男/45岁</view>
|
||||
<view class="end_content">
|
||||
<van-button type="primary" color="linear-gradient(to bottom, #5EA8D5, #63CFEA)" size="small">去审方</van-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</van-tab>
|
||||
<van-tab title="已审核处方">
|
||||
<view class="item">
|
||||
<view class="pre_content">
|
||||
处方订单号 2023010510324649
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">处方订单号:2023010510324649</view>
|
||||
<view class="end_content">
|
||||
<van-button type="primary" size="small">查看病例</van-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="end_content">
|
||||
<van-button type="primary" size="mini">迷你按钮</van-button>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">开方时间:2023-01-16 08:52</view>
|
||||
<view class="end_content" style="color: #2196f3;">通过</view>
|
||||
</view>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">张三/男/45岁</view>
|
||||
<view class="end_content">
|
||||
<!-- <van-button type="primary" color="linear-gradient(to bottom, #5EA8D5, #63CFEA)" size="small">去审方</van-button> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-tab>
|
||||
<van-tab title="驳回处方">
|
||||
<view class="item">
|
||||
<view class="pre_content">
|
||||
处方订单号 2023010510324649
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">处方订单号:2023010510324649</view>
|
||||
<view class="end_content">
|
||||
<van-button type="primary" size="small">查看病例</van-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="end_content">
|
||||
<van-button type="primary" size="mini">迷你按钮</van-button>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">开方时间:2023-01-16 08:52</view>
|
||||
<view class="end_content" style="color: red;">驳回</view>
|
||||
</view>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">张三/男/45岁</view>
|
||||
<view class="end_content">
|
||||
<!-- <van-button type="primary" color="linear-gradient(to bottom, #5EA8D5, #63CFEA)" size="small">去审方</van-button> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-tab>
|
||||
<van-tab title="不通过">
|
||||
<view class="item">
|
||||
<view class="pre_content">
|
||||
处方订单号 2023010510324649
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">处方订单号:2023010510324649</view>
|
||||
<view class="end_content">
|
||||
<van-button type="primary" size="small">查看病例</van-button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="end_content">
|
||||
<van-button type="primary" size="mini">迷你按钮</van-button>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">开方时间:2023-01-16 08:52</view>
|
||||
<view class="end_content" style="color: red;">驳回</view>
|
||||
</view>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">张三/男/45岁</view>
|
||||
<view class="end_content">
|
||||
<!-- <van-button type="primary" color="linear-gradient(to bottom, #5EA8D5, #63CFEA)" size="small">去审方</van-button> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
</view>
|
||||
<view style="height: 60px;">
|
||||
<!-- 适配底部tabbar -->
|
||||
</view>
|
||||
</view>
|
||||
@@ -40,15 +40,18 @@ page{
|
||||
.status_offline{
|
||||
background-color: #BFBFBF;
|
||||
}
|
||||
.status_online{
|
||||
background-color: rgb(124, 231, 124);
|
||||
}
|
||||
.status_text{
|
||||
display: inline-block;
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
word-spacing: 10rpx;
|
||||
letter-spacing: 10rpx;
|
||||
float: right;
|
||||
margin-right: 25rpx;
|
||||
font-size: 20rpx;
|
||||
display: flex;
|
||||
width: 50rpx;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
.custom-tabs {
|
||||
margin-bottom: 32rpx;
|
||||
|
||||
Reference in New Issue
Block a user