This commit is contained in:
haomingming
2023-03-06 17:57:39 +08:00
parent 3794faceae
commit 1066e37c96
4230 changed files with 193453 additions and 0 deletions
+257
View File
@@ -0,0 +1,257 @@
import Toast from '@vant/weapp/toast/toast';
import { API } from './../../../utils/network/api'
const api = new API()
const app = getApp()
Page({
data: {
navbarData: {
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '在线开方', //导航栏 中间的标题
},
height: app.globalData.height,
zhenduan_popshow: false,
drugs_popshow: false,
note_popshow: false,
disease_class_name: "",
zhenduan_search_list: [],
zhenduan_list: [],
note_columns: ['杭州', '宁波', '温州', '嘉兴', '湖州'],
drugs_box_item_list:[],
drug_content_show: false,
search_drug_list_empty: true,
search_drug_list: [],
select_drug_name: "",
select_drug_id: "",
save_durg_product_id: "",
save_durg_prescription_product_num: "",
save_durg_single_unit: "",
save_durg_single_use: "",
save_durg_packaging_unit: "",
save_durg_frequency_use: "",
save_durg_available_days: ""
},
select_drug(e){
this.setData({
drug_content_show: true,
select_drug_name: e.currentTarget.dataset.product_name,
select_drug_id: e.currentTarget.dataset.product_id,
save_durg_product_id: e.currentTarget.dataset.product_id
});
},
showPopup() {
this.setData({ drugs_popshow: true });
},
onClose() {
var _this = this;
this.setData({
drugs_popshow: false,
});
setTimeout(function(){
_this.setData({
drug_content_show: false,
search_value: ""
});
},1000)
},
showNotePopup() {
this.setData({ note_popshow: true });
},
onCloseNote() {
this.setData({ note_popshow: false });
},
onConfirmNote(event) {
const { picker, value, index } = event.detail;
Toast(`当前值:${value}, 当前索引:${index}`);
this.setData({ note_popshow: false });
},
onCancelNote(event) {
const { picker, value, index } = event.detail;
Toast(`当前值:${value}, 当前索引:${index}`);
this.setData({ note_popshow: false });
},
onChangeNote(event) {
const { picker, value, index } = event.detail;
Toast(`当前值:${value}, 当前索引:${index}`);
},
saveDrugs(){
console.log("saveDrugs");
let product_id = this.data.save_durg_product_id;
this.delDrugBox(product_id);
let save_durg = {};
save_durg.select_drug_name = this.data.select_drug_name;
save_durg.product_id = this.data.save_durg_product_id;
save_durg.prescription_product_num = this.data.save_durg_prescription_product_num;
save_durg.single_unit = this.data.save_durg_single_unit;
save_durg.single_use = this.data.save_durg_single_use;
save_durg.packaging_unit = this.data.save_durg_packaging_unit;
save_durg.frequency_use = this.data.save_durg_frequency_use;
save_durg.available_days = this.data.save_durg_available_days;
let list = this.data.drugs_box_item_list;
list.push(save_durg);
this.setData({
drugs_box_item_list: list,
drugs_popshow: false,
select_drug_name: "",
drug_content_show: false,
search_drug_list: [],
save_durg_product_id: "",
save_durg_prescription_product_num: "",
save_durg_single_unit: "",
save_durg_single_use: "",
save_durg_packaging_unit: "",
save_durg_frequency_use: "",
save_durg_available_days: ""
})
},
showZhenDuan(){
this.setData({
zhenduan_popshow: true
})
},
onZhenDuanChange(e){
console.log(e)
let name = e.detail;
this.setData({
zhenduan_search_list: []
})
if(name){
this.search();
}
},
search(){
//搜索诊断
let params = {};
params.disease_class_name = this.data.disease_class_name;
api.getBasicDiseaseSearch(params).then(response => {
console.log(response);
this.setData({
zhenduan_search_list: response.data
})
}).catch(errors => {
console.error(errors);
})
},
searchDrug(){
//搜索药品
let params = {};
params.product_keyword = this.data.select_drug_name;
api.getBasicProductSearch(params).then(response => {
console.log(response);
if(response.data.length > 0){
this.setData({
search_drug_list_empty: false,
search_drug_list: response.data,
})
}
}).catch(errors => {
console.error(errors);
})
},
onDrugChange(e){
console.log(e.detail);
let name = e.detail;
this.setData({
search_drug_list_empty: true,
search_drug_list: []
})
if(name){
this.searchDrug();
}
},
onZhenduanClose(){
this.setData({
zhenduan_popshow: false
})
},
addZhenDuan(e){
let disease_class_name = e.currentTarget.dataset.disease_class_name;
let disease_class_id = e.currentTarget.dataset.disease_class_id;
console.log("disease_class_name: ", disease_class_name);
console.log("disease_class_id: ", disease_class_id);
let disease_obj = {};
disease_obj.disease_class_name = disease_class_name;
disease_obj.disease_class_id = disease_class_id;
let list = this.data.zhenduan_list;
let find_index = list.findIndex(item => {
return item.disease_class_id == disease_class_id
});
if(find_index == -1){
list.push(disease_obj);
}
this.setData({
zhenduan_list: list,
zhenduan_popshow: false
})
},
delZhenDuan(e){
let disease_class_id = e.currentTarget.dataset.disease_class_id;
console.log("disease_class_id: ", disease_class_id);
let list = this.data.zhenduan_list;
let find_index = list.findIndex(item => {
return item.disease_class_id == disease_class_id
});
console.log("find_idex: ", find_index)
list.splice(find_index, 1);
this.setData({
zhenduan_list: list
})
},
go(e){
let url = e.currentTarget.dataset.url;
console.log(url);
app.go(url);
},
editDrug(e){
let product_id = e.currentTarget.dataset.product_id;
console.log(product_id);
let list = this.data.drugs_box_item_list;
let drug = list.find(item => {
return item.product_id == product_id;
})
console.log(drug);
this.setData({
drugs_popshow: true,
select_drug_name: drug.select_drug_name,
drug_content_show: true,
save_durg_product_id: drug.product_id,
save_durg_prescription_product_num: drug.prescription_product_num,
save_durg_single_unit: drug.single_unit,
save_durg_single_use: drug.single_use,
save_durg_packaging_unit: drug.packaging_unit,
save_durg_frequency_use: drug.frequency_use,
save_durg_available_days: drug.available_days
})
},
delDrug(e){
let product_id = e.currentTarget.dataset.product_id;
console.log(product_id);
this.delDrugBox(product_id);
},
delDrugBox(product_id){
let list = this.data.drugs_box_item_list;
let drug_index = list.findIndex(item => {
return item.product_id == product_id;
})
console.log(drug_index);
if(drug_index > -1){
list.splice(drug_index, 1);
this.setData({
drugs_box_item_list: list
})
}
}
})
+16
View File
@@ -0,0 +1,16 @@
{
"component": true,
"usingComponents": {
"te-nav-bar": "/commpents/te_navbar",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-button": "@vant/weapp/button/index",
"van-popup": "@vant/weapp/popup/index",
"van-field": "@vant/weapp/field/index",
"van-picker": "@vant/weapp/picker/index",
"van-search": "@vant/weapp/search/index",
"van-image": "@vant/weapp/image/index",
"van-toast": "@vant/weapp/toast/index",
"van-icon": "@vant/weapp/icon/index"
}
}
+209
View File
@@ -0,0 +1,209 @@
<te-nav-bar navbar-data='{{navbarData}}' ></te-nav-bar>
<view class="container" style="height: calc(100vh - 96rpx - {{height}}px);">
<view class="item">
<!-- 头部 -->
<view class="item_top">
<view class="item_top_name">张三三</view>
<view class="item_top_sex">男 | 30岁</view>
<view class="check">查看病历</view>
</view>
<!-- 中间内容部分 -->
<view class="item_content">
<view class="item_content_li">
<view class="item_content_li_title">病情主诉:</view>
<view class="item_content_li_txt">头疼,腰疼、肩膀酸、等症状已经困,头疼,腰疼、肩膀酸、等症状已经困</view>
</view>
<view class="item_content_li">
<view class="item_content_li_title">用药意向:</view>
<view class="item_content_li_txt">肝功能异常</view>
</view>
<!-- <view class="item_content_li">
<view class="item_content_li_title">处方时间:</view>
<view class="item_content_li_txt">2022年12月23日 12:45</view>
</view>
<view class="item_content_li">
<view class="item_content_li_title">驳回原因:</view>
<view class="item_content_li_txt">图片不清晰</view>
</view> -->
</view>
</view>
<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 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.disease_class_id}}" /><text style="margin-left: 10rpx;">{{item.disease_class_name}}</text>
</view>
</view>
</van-cell>
</van-cell-group>
<view class="txt_title">开方药品</view>
<view class="drugs_box">
<view class="drugs_box_item" wx:for="{{ drugs_box_item_list }}" wx:for-item="drugs">
<view class="drugs_name">{{ drugs.select_drug_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">
<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">
<van-button bind:click="showPopup" color="rgba(35,209,215,0.28); font-size:30rpx; border-radius: 10rpx;" type="primary" block>+添加药品</van-button>
</view>
<view class="txt_title">医嘱</view>
<view class="doctors_advice">
<textarea maxlength="1000" style="width: 100%;" placeholder-style="font-size:24rpx; color:#999" placeholder="请选择常用于"></textarea>
</view>
<view class="sub_btn">
<van-button color="#3CC7C0; font-size:30rpx; border-radius: 10rpx;" type="primary" block>提交审核</van-button>
</view>
<van-popup
show="{{ drugs_popshow }}"
closeable
round
position="bottom"
custom-style=""
bind:close="onClose"
>
<view class="pop_title">添加药品</view>
<view class="search_drug">
<view class="search_drug_btn">
<text class="search_drug_btn_title">药品名称</text>
<van-search model:value="{{ select_drug_name }}"
class="search_drug_btn_input"
clearable shape="round"
placeholder="请输入药品名称或拼音码搜索"
bind:change="onDrugChange"
/>
</view>
<view class="search_drug_list" wx:if="{{ !drug_content_show }}">
<view class="search_drug_list_empty" wx:if="{{ search_drug_list_empty }}">
<van-image
width="300rpx"
height="300rpx"
fit="contain"
src="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/search_drugs.png"
/>
</view>
<view class="search_drug_list_noempty" wx:if="{{ !search_drug_list_empty }}">
<view class="search_drug_list_item"
data-product_name="{{item.product_name}}"
data-product_id="{{item.product_id}}"
bindtap="select_drug"
wx:for="{{search_drug_list}}">
<view>{{item.product_name}}</view>
<view style="font-size: 26rpx;color: #3CC7C0;">{{item.manufacturer}}</view>
</view>
<!-- <view class="search_drug_list_item" data-search_value="恩替卡韦分散片" bindtap="select_drug">恩替卡韦分散片 0.5mg*7粒*3版</view>
<view class="search_drug_list_item" data-search_value="恩替卡韦片" bindtap="select_drug">恩替卡韦片 0.5mg*7粒*3版</view> -->
</view>
</view>
</view>
<van-cell-group wx:if="{{ drug_content_show }}">
<van-field
label="用法"
model:value="{{save_durg_single_use}}"
input-align="left"
placeholder="请输入用法(口服)"
custom-style="font-size: 30rpx;"
border="{{ true }}"
/>
<van-field
label="用次"
model:value="{{save_durg_frequency_use}}"
input-align="left"
placeholder="请输入服用次(一日1次)"
custom-style="font-size: 30rpx;"
border="{{ true }}"
/>
<van-field
label="用量"
model:value="{{save_durg_single_unit}}"
input-align="left"
placeholder="请输入用量(一次3粒)"
custom-style="font-size: 30rpx;"
border="{{ true }}"
/>
<van-field
label="用药天数"
model:value="{{save_durg_available_days}}"
input-align="left"
placeholder="请输入时长"
custom-style="font-size: 30rpx;"
border="{{ true }}"
/>
<van-field
label="药品数量"
model:value="{{save_durg_prescription_product_num}}"
input-align="left"
placeholder="请输入数量"
custom-style="font-size: 30rpx;"
border="{{ true }}"
/>
<van-field
label="单位"
model:value="{{save_durg_packaging_unit}}"
input-align="left"
placeholder="盒/袋"
custom-style="font-size: 30rpx;"
border="{{ true }}"
/>
<!-- <van-cell title="备注" bind:click="showNotePopup" is-link value="请选择" /> -->
<van-button bind:click="saveDrugs" custom-style="width: 90%;border-radius: 10rpx; margin: 20rpx auto;" type="primary" color="#3CC7C0" block>保存</van-button>
</van-cell-group>
</van-popup>
<van-popup
show="{{ note_popshow }}"
round
position="bottom"
custom-style=""
bind:close="onCloseNote"
>
<van-picker
show-toolbar
columns="{{ note_columns }}"
title="选择备注"
bind:cancel="onCancelNote"
bind:confirm="onConfirmNote"
bind:change="onChangeNote" />
</van-popup>
<van-popup
show="{{ zhenduan_popshow }}"
closeable
position="bottom"
custom-style="height: calc(100vh - {{height*2 + 20}}px);"
bind:close="onZhenduanClose"
>
<view style="padding-left: 20rpx;font-size: 30rpx;color: #999999;margin: 20rpx 0;">诊断</view>
<van-field
model:value="{{ disease_class_name }}"
placeholder="请输入疾病名称"
bind:change="onZhenDuanChange"
/>
<view class="zhenduan_data_list">
<view bindtap="addZhenDuan" class="zhenduan_item" data-disease_class_name="{{item.disease_class_name}}" data-disease_class_id="{{item.disease_class_id}}" wx:for="{{zhenduan_search_list}}">
{{item.disease_class_name}}
</view>
</view>
</van-popup>
<van-toast id="van-toast" />
</view>
+204
View File
@@ -0,0 +1,204 @@
page{
background-color: #F6F6F6;
}
.container{
width: 100vw;
height: 100vh;
background-color: #F6F6F6;
letter-spacing: 3rpx;
}
.item{
width: 92vw;
border-radius: 20rpx;
background-color: rgb(255, 255, 255);
margin: 20rpx auto;
}
.item_top{
position: relative;
height: 100rpx;
display: flex;
align-items: center;
padding: 0 32rpx;
}
.item_top::after {
position: absolute;
box-sizing: border-box;
content: ' ';
pointer-events: none;
right: 32rpx;
left: 32rpx;
bottom: 0;
border-bottom: 1px dashed var(--td-cell-border-color, var(--td-gray-color-3, #999));
transform: scaleY(0.5);
}
.item_top_name{
flex: 1;
color: #3CC7C0;
font-size: 34rpx;
}
.item_top_sex{
flex: 3;
font-size: 34rpx;
color: #666;
}
.check{
border-radius: 10rpx;
border: 1rpx solid #3CC7C0;
font-size: 26rpx;
color: #3CC7C0;
padding: 10rpx 20rpx;
}
.item_content{
padding: 20rpx 32rpx 0rpx 32rpx;
}
.item_content_li{
display: flex;
padding-bottom: 20rpx;
}
.item_content_li_title{
font-size: 30rpx;
color: #333333;
}
.item_content_li_txt{
margin-left: 10rpx;
flex: 1;
color: #666666;
font-size: 28rpx;
}
.txt_title{
font-size: 30rpx;
margin: 20rpx 0;
position: relative;
left: 4vw;
}
.drugs_box{
width: 92vw;
margin: 0 auto;
background-color: #fff;
border-radius: 20rpx;
}
.drugs_box_item{
border-bottom: 1px solid red;
padding: 20rpx 20rpx 20rpx 20rpx;
}
.drugs_name{
color: #333333;
font-size: 32rpx;
margin-bottom: 20rpx;
}
.drugs_guige, .drugs_dosage{
color: #666;
margin-bottom: 20rpx;
font-size: 32rpx;
}
.btn{
text-align: right;
}
.adddrugs_btn{
width: 92vw;
margin: 20rpx auto;
}
.doctors_advice{
position: relative;
width: calc(92vw - 40rpx);
height: 100rpx;
margin: 20rpx auto;
background-color: rgb(255, 255, 255);
border-radius: 20rpx;
padding: 20rpx;
}
.doctors_advice::after{
border-radius: 5rpx;
position: absolute;
width: 0px;
height: 0px;
border-width: 16rpx;
border-style: solid;
border-color: transparent transparent #ffffff transparent;
content: ' ';
left: 40rpx;
top: -30rpx;
}
.sub_btn{
width: 92vw;
margin: 20rpx auto;
}
.pop_title{
text-align: center;
font-size: 34rpx;
margin-top: 16px;
}
.search_drug_btn{
position: relative;
display: flex;
align-items: center;
padding-left: 32rpx;
}
.search_drug_btn::after{
position: absolute;
box-sizing: border-box;
content: ' ';
pointer-events: none;
right: 32rpx;
left: 32rpx;
bottom: 0;
border-bottom: 1px solid var(--td-cell-border-color, var(--td-gray-color-3, #E7E7E7));
transform: scaleY(0.5);
}
.search_drug_btn_input{
flex: 1;
}
.search_drug_list{
height: 50vh;
}
.search_drug_list_empty{
display: flex;
justify-content: center;
align-items: center;
height: 100%;
}
.search_drug_list_item{
padding-left: 32rpx;
position: relative;
height: 150rpx;
display: flex;
flex-direction: column;
justify-content: space-evenly;
font-size: 34rpx;
color: #333333;
}
.search_drug_list_item::after{
position: absolute;
box-sizing: border-box;
content: ' ';
pointer-events: none;
right: 32rpx;
left: 32rpx;
bottom: 0;
border-bottom: 1px solid var(--td-cell-border-color, var(--td-gray-color-3, #E7E7E7));
transform: scaleY(0.5);
}
.addzhenduan{
font-size: 30rpx !important;
color: #3CC7C0 !important;
}
.zhenduan_data_list{
font-size: 30rpx;
color: #999999;
margin: 0 20rpx;
padding: 0 20rpx;
}
.zhenduan_item{
height: 100rpx;
line-height: 100rpx;
border-bottom: 1px solid #E7E7E7;
}
.label_item{
display: flex;
font-size: 30rpx;
color: #333333;
}