分包医生
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
import { API } from '../../../../utils/network/api'
|
||||
const api = new API()
|
||||
const app = getApp()
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
active: 0,
|
||||
active_color: "rgb(116,162,250)",
|
||||
navbarData: {
|
||||
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
|
||||
title: '药师端', //导航栏 中间的标题
|
||||
},
|
||||
// 此页面 页面内容距最顶部的距离
|
||||
height: app.globalData.height,
|
||||
pharmacist: {},
|
||||
audit_number: 0,
|
||||
data_list_0: [],
|
||||
data_list_1: [],
|
||||
data_list_2: [],
|
||||
data_list_3: [],
|
||||
current_page: 0,
|
||||
total: 0,
|
||||
per_page: 0,
|
||||
last_page: 0,
|
||||
},
|
||||
|
||||
onShow() {
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
this.getTabBar().setData({
|
||||
active: 0, //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
|
||||
})
|
||||
}
|
||||
|
||||
this.getPharmacistPrescription(this.data.active);
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onLoad: function () {
|
||||
|
||||
api.getPharmacistIndex().then(response => {
|
||||
this.setData({
|
||||
pharmacist: response.data.pharmacist,
|
||||
audit_number: response.data.audit_number
|
||||
})
|
||||
}).catch(errors => {
|
||||
console.error(errors);
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
getPharmacistPrescription(active){
|
||||
let params = {};
|
||||
let page = this.data.current_page + 1;
|
||||
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;
|
||||
params.page = page;
|
||||
let data_name = "data_list_"+active;
|
||||
let list = this.data[data_name];
|
||||
api.getPharmacistPrescription(params).then(response => {
|
||||
this.setData({
|
||||
[data_name]: list.concat(response.data.data),
|
||||
current_page: response.data.current_page,
|
||||
total: response.data.total,
|
||||
per_page: response.data.per_page,
|
||||
last_page: response.data.last_page,
|
||||
})
|
||||
}).catch(errors => {
|
||||
console.error(errors);
|
||||
})
|
||||
},
|
||||
onHide(){
|
||||
this.setData({
|
||||
current_page: 0,
|
||||
total: 0,
|
||||
per_page: 0,
|
||||
last_page: 0,
|
||||
data_list_0: [],
|
||||
data_list_1: [],
|
||||
data_list_2: [],
|
||||
data_list_3: [],
|
||||
})
|
||||
},
|
||||
onChange(e){
|
||||
console.log(e)
|
||||
let data_name = "data_list_"+e.detail.index;
|
||||
this.setData({
|
||||
active: e.detail.index,
|
||||
current_page: 0,
|
||||
total: 0,
|
||||
per_page: 0,
|
||||
last_page: 0,
|
||||
[data_name]: []
|
||||
})
|
||||
this.getPharmacistPrescription(e.detail.index);
|
||||
},
|
||||
onReachBottom() {
|
||||
console.log('===触底了!!===');
|
||||
if(this.data.current_page < this.data.last_page){//最后一页时停止分页
|
||||
this.getPharmacistPrescription(this.data.active)
|
||||
}
|
||||
},
|
||||
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);})
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"te-nav-bar": "../../../../commpents/te_navbar/index",
|
||||
"van-tab": "@vant/weapp/tab/index",
|
||||
"van-tabs": "@vant/weapp/tabs/index",
|
||||
"t-avatar": "tdesign-miniprogram/avatar/avatar",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"van-empty": "@vant/weapp/empty/index",
|
||||
"van-divider": "@vant/weapp/divider/index"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
<te-nav-bar navbar-data='{{navbarData}}' ></te-nav-bar>
|
||||
<view class="container">
|
||||
<view class="main title">
|
||||
<view class="photo">
|
||||
<t-avatar class="avatar-example" width="20" image="{{pharmacist.avatar}}" />
|
||||
</view>
|
||||
<view class="name">
|
||||
<view class="realname">{{pharmacist.user_name}}</view>
|
||||
<view class="today_num">今日审方 {{audit_number}}</view>
|
||||
</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 color="{{ active_color }}" bind:change="onChange">
|
||||
<van-tab title="待审核处方">
|
||||
<view class="item_list" wx:if="{{data_list_0.length>0}}">
|
||||
<view class="item" wx:for="{{data_list_0}}">
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">处方订单号:{{item.prescription_code}}</view>
|
||||
<view class="end_content">
|
||||
<!-- <navigator url="/user/pages/yaoshi/medicalrecord/medicalrecord" open-type="navigate" hover-class="other-navigator-hover">
|
||||
<van-button type="primary" size="small">查看病例</van-button>
|
||||
</navigator> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">开方时间:{{item.created_at}}</view>
|
||||
<view class="end_content" bindtap="go" data-url="/user/pages/yaoshi/medicalrecord/medicalrecord?order_inquiry_id={{item.order_inquiry_id }}&order_prescription_id={{item.order_prescription_id}}&from=1">
|
||||
<van-button type="primary" color="#ec871e" size="small">查看病例</van-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">{{item.patient_name}}/{{item.patient_sex==1?'男':'女'}}/{{item.patient_age}}岁</view>
|
||||
<view class="end_content" bindtap="go" data-url="/user/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>
|
||||
<van-divider contentPosition="center" wx:if="{{data_list_0.length > 0 && current_page == last_page}}">到底了~</van-divider>
|
||||
</view>
|
||||
<van-empty description="暂无数据" wx:if="{{data_list_0.length == 0}}" />
|
||||
</van-tab>
|
||||
<van-tab title="已审核处方">
|
||||
<view class="item_list" wx:if="{{data_list_1.length>0}}">
|
||||
<view class="item" wx:for="{{data_list_1}}">
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">处方订单号:{{item.prescription_code}}</view>
|
||||
<view class="end_content" bindtap="go" data-url="/user/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">开方时间:{{item.created_at}}</view>
|
||||
<view class="end_content" style="color: #2196f3;">通过</view>
|
||||
</view>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">{{item.patient_name}}/{{item.patient_sex==1?'男':'女'}}/{{item.patient_age}}岁</view>
|
||||
<view class="end_content">
|
||||
<!-- <van-button type="primary" color="linear-gradient(to bottom, #5EA8D5, #63CFEA)" size="small">去审方</van-button> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<van-divider contentPosition="center" wx:if="{{data_list_1.length > 0 && current_page == last_page}}">到底了~</van-divider>
|
||||
</view>
|
||||
<van-empty description="暂无数据" wx:if="{{data_list_1.length == 0}}" />
|
||||
</van-tab>
|
||||
<van-tab title="驳回处方">
|
||||
<view class="item_list" wx:if="{{data_list_2.length>0}}">
|
||||
<view class="item" wx:for="{{data_list_2}}">
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">处方订单号:{{item.prescription_code}}</view>
|
||||
<view class="end_content" bindtap="go" data-url="/user/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">开方时间:{{item.created_at}}</view>
|
||||
<view class="end_content" style="color: red;">驳回</view>
|
||||
</view>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">{{item.patient_name}}/{{item.patient_sex==1?'男':'女'}}/{{item.patient_age}}岁</view>
|
||||
<view class="end_content">
|
||||
<!-- <van-button type="primary" color="linear-gradient(to bottom, #5EA8D5, #63CFEA)" size="small">去审方</van-button> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">驳回时间:{{item.pharmacist_verify_time}}</view>
|
||||
</view>
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">驳回理由:{{item.pharmacist_fail_reason}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<van-divider contentPosition="center" wx:if="{{data_list_2.length > 0 && current_page == last_page}}">到底了~</van-divider>
|
||||
</view>
|
||||
<van-empty description="暂无数据" wx:if="{{data_list_2.length == 0}}" />
|
||||
</van-tab>
|
||||
<van-tab title="不通过">
|
||||
<view class="item_list" wx:if="{{data_list_3.length>0}}">
|
||||
<view class="item" wx:for="{{data_list_3}}">
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">处方订单号:{{item.prescription_code}}</view>
|
||||
<view class="end_content" bindtap="go" data-url="/user/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">开方时间:{{item.created_at}}</view>
|
||||
<view class="end_content" style="color: red;">驳回</view>
|
||||
</view>
|
||||
|
||||
<view class="item_txt">
|
||||
<view class="pre_content">{{item.patient_name}}/{{item.patient_sex==1?'男':'女'}}/{{item.patient_age}}岁</view>
|
||||
<view class="end_content">
|
||||
<!-- <van-button type="primary" color="linear-gradient(to bottom, #5EA8D5, #63CFEA)" size="small">去审方</van-button> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<van-divider contentPosition="center" wx:if="{{data_list_3.length > 0 && current_page == last_page}}">到底了~</van-divider>
|
||||
</view>
|
||||
<van-empty description="暂无数据" wx:if="{{data_list_3.length == 0}}" />
|
||||
</van-tab>
|
||||
</van-tabs>
|
||||
</view>
|
||||
<view style="height: 60px;">
|
||||
<!-- 适配底部tabbar -->
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,111 @@
|
||||
page{
|
||||
background-color: #F4F5F7;
|
||||
}
|
||||
.container{
|
||||
width: 100vw;
|
||||
}
|
||||
.main{
|
||||
width: 90vw;
|
||||
margin: 30rpx auto 0 auto;
|
||||
background-color: #ffffff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.title{
|
||||
height: 200rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.photo{
|
||||
flex: 1;
|
||||
/* background-color: cyan; */
|
||||
}
|
||||
.name{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 2;
|
||||
font-size: 30rpx;
|
||||
line-height: 50rpx;
|
||||
/* background-color: burlywood; */
|
||||
}
|
||||
.today_num{
|
||||
font-size: 28rpx;
|
||||
color: rgb(116,162,250);
|
||||
}
|
||||
.status{
|
||||
flex: 1;
|
||||
/* background-color: #ace247; */
|
||||
height: 70%;
|
||||
}
|
||||
.status_offline{
|
||||
background-color: #BFBFBF;
|
||||
}
|
||||
.status_online{
|
||||
background-color: rgb(124, 231, 124);
|
||||
}
|
||||
.status_text{
|
||||
padding: 10rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
float: right;
|
||||
margin-right: 25rpx;
|
||||
font-size: 20rpx;
|
||||
display: flex;
|
||||
width: 50rpx;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
.custom-tabs {
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
.avatar-example {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.external-class-content {
|
||||
color: #fff;
|
||||
background-color: #0052d9;
|
||||
font-weight: 400;
|
||||
}
|
||||
.avatar-example--medium:not(:last-child) {
|
||||
margin-right: 96rpx;
|
||||
}
|
||||
.van-tabs__nav{
|
||||
border-radius: 20rpx !important;
|
||||
}
|
||||
.item_list{
|
||||
padding-bottom: 100rpx;
|
||||
background-color: #F4F5F7;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.item:last-child{
|
||||
border-bottom-left-radius: 20rpx;
|
||||
border-bottom-right-radius: 20rpx;
|
||||
}
|
||||
.item{
|
||||
border-top: solid rgb(187, 185, 185) 1rpx;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
.item_txt{
|
||||
display: flex;
|
||||
/* background-color: #0052d9; */
|
||||
padding: 10rpx 0;
|
||||
}
|
||||
.pre_content{
|
||||
display: flex;
|
||||
flex: 3;
|
||||
/* background-color: chartreuse; */
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.end_content{
|
||||
display: flex;
|
||||
flex: 1;
|
||||
justify-content:center;
|
||||
align-items: center;
|
||||
/* background-color: coral; */
|
||||
}
|
||||
Reference in New Issue
Block a user