Compare commits

..

5 Commits

Author SHA1 Message Date
XiuYun CHEN
1e99ff4dfa 出诊计划相关 2025-07-30 16:22:38 +08:00
XiuYun CHEN
0d7ddb5854 Merge branch 'master' of https://gitea.igandanyiyuan.com/gdxz/harmony 2025-07-30 09:15:51 +08:00
XiuYun CHEN
431758516a 出诊计划相关 2025-07-30 09:15:41 +08:00
XiuYun CHEN
f73ed8ccad 出诊计划相关 2025-07-30 09:15:14 +08:00
XiuYun CHEN
b8a894d47d 出诊计划相关 2025-07-30 09:14:13 +08:00
23 changed files with 1442 additions and 179 deletions

View File

@ -94,11 +94,11 @@ export function setupMoreOperationData() {
shopOperationData.imageSource = "app.media.ytx_chattingfooter_shopping";
operationMoreDataList.push(shopOperationData);
//互联网医院
const hospatilOperationData = new NEChatMoreOperationData();
hospatilOperationData.operationTitle = $r("app.string.hospital");
hospatilOperationData.type = NEChatMoreOperationType.Hospital;
hospatilOperationData.imageSource = "app.media.ytx_chatting_hospital";
operationMoreDataList.push(hospatilOperationData);
// const hospatilOperationData = new NEChatMoreOperationData();
// hospatilOperationData.operationTitle = $r("app.string.hospital");
// hospatilOperationData.type = NEChatMoreOperationType.Hospital;
// hospatilOperationData.imageSource = "app.media.ytx_chatting_hospital";
// operationMoreDataList.push(hospatilOperationData);
// // 位置功能
// const locationOperationData = new NEChatMoreOperationData();
// locationOperationData.operationTitle = $r("app.string.chat_send_location");

View File

@ -643,7 +643,7 @@ export struct ChatP2PPage {
this.closeConsult()
}
else {
this.goToSettingPage(this.pathStack)
this.goToSettingPage()
}
},
@ -663,16 +663,17 @@ export struct ChatP2PPage {
showSelect: this.showMultiSelect,
onMessageClick: {
onAvatarClick: ((msg: NIMMessageInfo | undefined) => {
if (this.showMultiSelect) {
return
}
// if (this.showMultiSelect) {
// return
// }
if (msg != null) {
if (msg?.message.senderId == ChatKitClient.getLoginUserId()) {
this.pathStack.pushPath({
name: 'MineInfoPage'
})
// this.pathStack.pushPath({
// name: 'MineInfoPage'
// })
} else {
this.pathStack.pushPath({ name: 'PersonInfoPage', param: msg?.message.senderId })
HMRouterMgr.push({pageUrl:'PatientDetailsComp',param:{"patient_uuid":this.patientUuid}})
// this.pathStack.pushPath({ name: 'PersonInfoPage', param: msg?.message.senderId })
}
}
}),
@ -1510,17 +1511,21 @@ export struct ChatP2PPage {
)
}
goToSettingPage(pathStack: NavPathStack) {
if (this.showMultiSelect) {
this.chatViewModel.clearSelectMessage()
this.showMultiSelect = false
} else {
pathStack.pushPath({
name: 'UserSettingPage',
param: this.chatViewModel.conversationId
})
}
this.controller.stopEditing()
// goToSettingPage(pathStack: NavPathStack) {
// if (this.showMultiSelect) {
// this.chatViewModel.clearSelectMessage()
// this.showMultiSelect = false
// } else {
// pathStack.pushPath({
// name: 'UserSettingPage',
// param: this.chatViewModel.conversationId
// })
// }
// this.controller.stopEditing()
// }
goToSettingPage()
{
HMRouterMgr.push({pageUrl: 'PatientCommonSettingComp',param:{"title":"","patient_uuid":this.patientUuid}})
}
onPageHide(): void {

View File

@ -93,4 +93,6 @@ export { PatientListModel,PatientsData } from './src/main/ets/models/PatientList
export { applyListCallBacl, applyListModel, applyHistoryCallBacl , historyObjectModel, historyModel } from './src/main/ets/models/ApplyModel'
export { TripleOptionDialog } from './src/main//ets/Views/TripleOptionDialog'
export { TripleOptionDialog } from './src/main//ets/Views/TripleOptionDialog'
export { HdTwoNav } from './src/main/ets/components/HdTwoNav'

View File

@ -0,0 +1,135 @@
import { router } from '@kit.ArkUI'
@Builder
function defaultBuilder(): void {
}
@Component
export struct HdTwoNav {
@StorageProp('topHeight')
topHeight: number = 0
@Prop
title: string = ''
@Prop
textColor: ResourceStr = $r('app.color.top_title')
@Prop
bgColor: ResourceStr = $r('app.color.top_bg')
@Prop
hasBorder: boolean = false
@Prop
leftIcon: ResourceStr = $r('app.media.top_back')
@Prop
rightIcon: ResourceStr = $r('sys.media.ohos_ic_public_more')
@Prop
rightIcon2: ResourceStr = $r('sys.media.ohos_ic_public_more')
@Prop
showRightIcon: boolean = true
@Prop
showRightIcon2: boolean = true
@Prop
showLeftIcon: boolean = true
@Prop
showRightText: boolean = false
@Prop
rightText: string = ''
@Prop
rightBackColor:ResourceColor = this.bgColor
@Prop
rightTextColor:ResourceColor = this.textColor
@BuilderParam
titleBuilder: () => void = defaultBuilder
@BuilderParam
menuBuilder: () => void = defaultBuilder
@Prop
isLeftAction: boolean = false
// 添加右侧点击函数
private rightItemAction:()=> void = () => {};
// 添加右侧点击函数
private rightItemAction2:()=> void = () => {};
// 添加左侧点击函数
private leftItemAction:()=> void = () => {};
build() {
Row() {
if (this.showLeftIcon) {
Row()
{
Image(this.leftIcon)
.size({ width: 24, height: 24 })
.onClick(() => this.isLeftAction? this.leftItemAction():router.back())
.fillColor($r('app.color.black'))
}
.size({ width: 50, height: 50 })
Blank()
.width(50)
} else {
Blank()
.width(50)
}
Row() {
if (this.title) {
Text(this.title)
.layoutWeight(1)
.textAlign(TextAlign.Center)
.fontSize(20)
.fontColor(this.textColor)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else if (this.titleBuilder) {
this.titleBuilder()
}
}
.height(56)
.width(150)
.layoutWeight(1)
if (this.showRightIcon2) {
Row()
{
Image(this.rightIcon2)
.size({ width: 24, height: 24 })
.objectFit(ImageFit.Contain)
.bindMenu(this.menuBuilder)
.onClick(()=>this.rightItemAction2())
}
.size({ width: 50, height: 50 }).justifyContent(FlexAlign.End)
}
if (this.showRightIcon) {
Row()
{
Image(this.rightIcon)
.size({ width: 24, height: 24 })
.objectFit(ImageFit.Contain)
.bindMenu(this.menuBuilder)
.onClick(()=>this.rightItemAction())
}
.size({ width: 50, height: 50 }).justifyContent(FlexAlign.End)
}
else if (this.showRightText) {
Text(this.rightText)
.maxFontSize(16)
.minFontSize(6)
.maxLines(1)
.fontColor(this.rightTextColor)
.onClick(()=>this.rightItemAction())
.width(50)
.textAlign(TextAlign.Center)
.borderRadius(5)
.backgroundColor(this.rightBackColor)
.height(35)
// .margin({right:10})
} else {
Blank()
.width(50)
}
}
.padding({ left: 16, right: 16, top: this.topHeight })
.height(56 + this.topHeight)
.width('100%')
.backgroundColor(this.bgColor)
}
}

View File

@ -23,7 +23,7 @@ export class BasicConstant {
// static readonly wxUrl = "https://wx.igandan.com/";// 微信服务器地址
// static readonly polvId = "21";//保利威视学员id
static readonly getSystemTimeStamp = BasicConstant.urlImage+'manager/getSystemTimeStamp'
static readonly addBonusPoints = BasicConstant.urlExpertApp+'addBonusPoints'
static readonly indexV2 = BasicConstant.urlExpertAPI+'indexV2';//首页轮播
static readonly applyList = BasicConstant.urlExpert+'applyList'
@ -110,6 +110,12 @@ export class BasicConstant {
static readonly addStopOutPatient= BasicConstant.urlExpertApp+"addStopOutPatient";//添加停诊安排
static readonly deleteOutPatient= BasicConstant.urlExpertApp+"deleteOutPatient";//删除门诊安排
static readonly listWorkPlace= BasicConstant.urlExpertApp+"listWorkPlace";//执业地点-列表
static readonly updateOutPatientA= BasicConstant.urlExpertApp+"updateOutPatientA";//修改门诊安排A
static readonly addOutPatient= BasicConstant.urlExpertAPI+"addOutPatient";//添加门诊安排
static readonly deleteWorkPlace= BasicConstant.urlExpertApp+"deleteWorkPlace";//执业地点-删除
static readonly hospitalList= BasicConstant.urlExpertApp+"hospitalList";//添加职业地点-医院列表
static readonly addWorkPlace= BasicConstant.urlExpertApp+"addWorkPlace";//执业地点-增加
static readonly editWorkPlace= BasicConstant.urlExpertApp+"editWorkPlace";//执业地点-修改
static readonly province=['全国','北京市','天津市','河北省','山西省'
,'内蒙古自治区','辽宁省','吉林省','黑龙江省','上海市','江苏省','浙江省'
,'安徽省','福建省','江西省','山东省','河南省','湖北省','湖南省','广东省',

View File

@ -10,6 +10,8 @@ import { i18n } from '@kit.LocalizationKit';
import { connection } from '@kit.NetworkKit';
import http from '@ohos.net.http'
import {BasicConstant} from '../constants/BasicConstant'
import { componentUtils } from '@kit.ArkUI';
export class ChangeUtil {
/**
* 将HashMap转成JsonString
@ -287,4 +289,27 @@ export class ChangeUtil {
const pattern = /\.(jpg|jpeg|png|gif|bmp|webp)$/i;
return pattern.test(path);
}
static getColumnX(id:string):number {
const componentInfo = componentUtils.getRectangleById(id)
const screenX = componentInfo.screenOffset.x//3.38
return screenX
}
static getColumnY(id:string):number {
const componentInfo = componentUtils.getRectangleById(id)
const screenY = componentInfo.screenOffset.y//3.38
return screenY
}
static getColunmWidth(id:string):number {
const componentInfo = componentUtils.getRectangleById(id)
const width = componentInfo.size.width//3.38
return width
}
static getColunmHeight(id:string):number {
const componentInfo = componentUtils.getRectangleById(id)
const height = componentInfo.size.height//3.38
return height
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -13,6 +13,8 @@
"@nimsdk/base": "10.9.10",
"@nimkit/common": "file:../../common",
"@nimkit/localconversationkit_ui": "file:../../localconversationkit_ui",
"refreshlib": "file:../../RefreshLib"
"refreshlib": "file:../../RefreshLib",
"patient": "file:../patient"
}
}

View File

@ -36,9 +36,18 @@ export struct ItemCompArrange {
okText:'确定',
okColor:$r('app.color.top_title'),
inputCallBack:(input: string,title:string)=>{
if(this.inputPlaceholder=='您确定修改此条信息吗')
{
HMRouterMgr.push({ pageUrl: 'AddOutpatient', param: {
item: this.item, isHistory: 'true'
} })
}
else
{
this.deleteUuid=this.item.uuid
this.delete=!this.delete
}
this.deleteUuid=this.item.uuid
this.delete=!this.delete
}
}),
keyboardAvoidDistance: LengthMetrics.vp(0), // 设置弹窗底部与键盘顶部间距单位vp
@ -141,7 +150,10 @@ export struct ItemCompArrange {
.fontSize(14)
}
.margin({right:30})
.onClick(()=>{
this.inputPlaceholder='您确定修改此条信息吗'
this.dialog.open()
})
Row()
{
Image($r('app.media.delete_icon')).width(15).height(15).margin({right:5})
@ -150,6 +162,7 @@ export struct ItemCompArrange {
.fontSize(14)
}
.onClick(()=>{
this.inputPlaceholder='您确定删除此条信息吗'
this.dialog.open()
})

View File

@ -34,8 +34,24 @@ export interface ListOut{
day:string;
hospital_address:string;
hospital_name:string;
hospital_uuid:string
}
export interface HospitalListBean {
code:string;
data:HospitalList[];
message:string;
}
export interface HospitalList{
uuid:string;
name:string;
}

View File

@ -0,0 +1,453 @@
import { HMRouter, HMRouterMgr } from "@hadss/hmrouter";
import { BaseBean, BasicConstant, ChangeUtil, hdHttp, HdLoadingDialog, HdNav, HdResponse } from "@itcast/basic";
import { HospitalList, HospitalListBean, ListOut } from "../model/ListOutPatientModel";
import { HashMap } from "@kit.ArkTS";
import { BusinessError } from "@kit.BasicServicesKit";
import { StringIsEmpty } from "@nimkit/common";
import { LengthMetrics, promptAction } from "@kit.ArkUI";
@HMRouter({ pageUrl: 'AddLocation' })
@Component
export struct AddLocation{
param = HMRouterMgr.getCurrentParam() as HmParam;
@State showDropdown: number = -1 // 当前下拉的index-1为无
@State typeIndex: number = -1
typeOptions: string[] = ['普通门诊', '专家门诊', '特需门诊', '专科/专病门诊']
@State hospitalOptions:HospitalList[]=[]
@State hospital_name:string=''
@State hospital_uuid:string=''
@State office_name:string=''
@State location:string=''
@State select:boolean=false
@State title:string='新增执业地点'
@State buttonTitle:string='确定发布'
@State url:string=BasicConstant.addWorkPlace
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
customStyle: true,
alignment: DialogAlignment.Center
})
hospitalList(name:string) {
const hashMap: HashMap<string, Object> = new HashMap();
hashMap.set('name',name)
hdHttp.httpReqObject<string>(BasicConstant.hospitalList,hashMap).then(async (res: HdResponse<string>) => {
let json:HospitalListBean = JSON.parse(res+'') as HospitalListBean;
if(json.code == '200') {
if(json.data!=null&&json.data.length>0)
{
this.hospitalOptions=[]
this.hospitalOptions=[...json.data]
this.showDropdown=-2
}
} else {
this.showDropdown=-1
}
}).catch((err: BusinessError) => {
console.info(`Response fails: ${err}`);
})
}
addWorkPlace() {
this.dialog.open()
const hashMap: HashMap<string, string> = new HashMap();
hashMap.set('hospital_uuid',this.hospital_uuid)
hashMap.set('office_name',this.hospital_name)
hashMap.set('location',this.location)
hashMap.set('type',(this.typeIndex+1)+'')
if('true'==this.param.isHistory) {
hashMap.set('uuid',this.param.item.uuid)
this.url=BasicConstant.editWorkPlace
}
hdHttp.httpReq<string>(this.url,hashMap).then(async (res: HdResponse<string>) => {
this.dialog.close()
let json:BaseBean = JSON.parse(res+'') as BaseBean;
if(json.code == '200') {
HMRouterMgr.pop()
} else {
promptAction.showToast({ message: json.message })
}
}).catch((err: BusinessError) => {
console.info(`Response fails: ${err}`);
})
}
private dialogPublish!:CustomDialogController;
initDialog() {
this.dialogPublish = new CustomDialogController({
builder:PerfactInputSheets({
controller:this.dialogPublish,
hospital:this.hospital_name,
office:this.office_name,
local:this.location,
type:this.typeOptions[this.typeIndex],
inputCallBack:()=>{
this.addWorkPlace()
}
}),
keyboardAvoidDistance: LengthMetrics.vp(0), // 设置弹窗底部与键盘顶部间距单位vp
alignment: DialogAlignment.Center,
customStyle: true,
autoCancel: false,
backgroundColor: ('rgba(0,0,0,0.5)'),
height: '100%'
})
}
aboutToAppear(): void {
if('true'==this.param.isHistory)
{
this.select=true
this.title='修改执业地点'
this.buttonTitle='确认修改'
this.hospital_uuid=this.param.item.hospital_uuid
this.hospital_name=this.param.item.hospital_name
this.office_name=this.param.item.office_name
this.location=this.param.item.location
this.typeIndex=this.param.item.type-1
}
this. initDialog()
}
build() {
Column()
{
HdNav({
title: this.title,
showRightIcon: false,
hasBorder: true,
isLeftAction: true,
leftItemAction: () => {
HMRouterMgr.pop()
}
})
Column()
{
Row(){
Text()
{
Span('医院').fontColor($r('app.color.common_gray_01'))
Span('*').fontColor(Color.Red)
}
.fontSize(18)
TextInput({ placeholder: '请输入您的医院', text: $$this.hospital_name })
.id('hospitalchoose')
.customStyle()
.onChange((value: string) => {
if(!StringIsEmpty(value))
{
if(this.select)
{
this.select=!this.select
}
else
{
// 文本内容发生变化时触发该回调
this.hospitalList(value)
}
}
else
{
this.hospitalOptions=[]
this.showDropdown=-1
}
})
}
.customStyleR()
Text().customStyleT()
Row(){
Text()
{
Span('科室').fontColor($r('app.color.common_gray_01'))
Span('*').fontColor(Color.Red)
}
.fontSize(18)
TextInput({ placeholder: '请输入您的科室', text: $$this.office_name })
.customStyle()
}
.customStyleR()
Text().customStyleT()
Row(){
Text()
{
Span('地址').fontColor($r('app.color.common_gray_01'))
Span('*').fontColor(Color.Red)
}
.fontSize(18)
TextInput({ placeholder: '如门诊楼东侧502室', text: $$this.location })
.customStyle()
}
.customStyleR()
Text().customStyleT()
Text('门诊类型 *').fontSize(17).fontColor($r('app.color.top_title')).padding(10).width('100%').textAlign(TextAlign.Start)
Row() {
ForEach(this.typeOptions, (item: string, index: number) => {
Row() {
Text(item)
.fontSize(16)
.fontColor(this.typeIndex === index ? $r('app.color.top_title') : $r('app.color.999999'))
.height(42)
.layoutWeight(1)
.textAlign(TextAlign.Center)
.backgroundImageSize(ImageSize.Contain)
.backgroundImagePosition(Alignment.Center)
.backgroundImage(this.typeIndex === index ? $r('app.media.check_true') : undefined)
.borderColor(this.typeIndex === index ? Color.Transparent : $r('app.color.999999') )
.borderWidth(1)
.borderRadius(4)
.margin({ right: 10 })
.onClick(() => {
this.typeIndex = index
})
}.layoutWeight(1)
})
}.padding({ left: 10}).width('100%')
Text().height(20).width('100%')
}
.backgroundColor(Color.White)
.width('100%')
Blank()
Column() {
Text(this.buttonTitle)
.height(42)
.width(168)
.fontSize(17)
.backgroundColor($r('app.color.top_title'))
.fontColor($r('app.color.white'))
.textAlign(TextAlign.Center)
.borderRadius(4)
.margin({ top: 8 })
}
.width('100%')
.height(57)
.backgroundColor(Color.White)
.onClick(() => {
if(this.hospital_uuid=='')
{
promptAction.showToast({ message: '请输入您的医院' });
return
}
if(StringIsEmpty(this.hospital_name))
{
promptAction.showToast({ message: '请输入您的科室' });
return
}
if(StringIsEmpty(this.location))
{
promptAction.showToast({ message: '请填写您的地址' });
return
}
if(this.typeIndex==-1)
{
promptAction.showToast({ message: '请选择门诊类型' });
return
}
this.dialogPublish.open()
})
// 悬浮下拉菜单
Column() {
ForEach(this.hospitalOptions, (hospital: HospitalList, pidx: number) => {
Text(hospital.name)
.width('100%')
.padding({left:14})
.textAlign(TextAlign.Start)
.height(40)
.fontSize(12)
.fontColor($r('app.color.common_gray_03'))
.onClick(() => {
this.hospital_name=hospital.name
this.hospital_uuid=hospital.uuid
this.hospitalOptions=[]
this.showDropdown=-1
this.select=!this.select
})
})
}
.zIndex(999)
.clip(false)
.backgroundColor(Color.White)
.borderColor($r('app.color.999999'))
.borderWidth(1)
.borderRadius(4)
.visibility(this.showDropdown == -1 ? Visibility.None:Visibility.Visible)
.width(px2vp(ChangeUtil.getColunmWidth('hospitalchoose')))
.position({
x: px2vp(ChangeUtil.getColumnX('hospitalchoose')),
y: px2vp(ChangeUtil.getColumnY('hospitalchoose')+ChangeUtil.getColunmHeight('hospitalchoose'))
})
}
.width('100%')
.height('100%')
.backgroundColor($r('app.color.home_gray'))
}
}
@Extend(TextInput)
function customStyle() {
.placeholderColor('#C3C3C5')
.height(45)
.borderRadius(0)
.backgroundColor($r('app.color.white'))
.margin({right:10})
.layoutWeight(1)
.maxLines(1)
}
@Extend(Row)
function customStyleR() {
.margin({right:10,left:10})
.width("95%")
.height(53)
}
@Extend(Text)
function customStyleT() {
.margin({right:10,left:10})
.width("95%")
.height(0.5)
.backgroundColor($r('app.color.home_gray'))
}
@CustomDialog
export struct PerfactInputSheets {
controller:CustomDialogController;
@Prop inputTitle:string = '执业地点';
// 添加回调函数属性
@State okColor:ResourceStr=$r('app.color.top_title')
@State cancelColor:ResourceStr='#333333'
@State okText:ResourceStr='确定发布'
@State cancelText:ResourceStr='返回修改'
@State hospital:string=''
@State local:string=''
@State office:string=''
@State type:string=''
private inputCallBack: () => void = () => {};
@State needcancelCallBack:boolean=false
// 修改构造函数
constructor(controller: CustomDialogController, inputCallBack: () => void) {
super();
this.controller = controller;
this.inputCallBack = inputCallBack;
}
build() {
Row(){
Column() {
Text(this.inputTitle)
.fontSize(18)
.padding(20)
.width('100%')
.textAlign(TextAlign.Center)
.fontColor('#444444')
Row() {
Text('医院:')
.fontColor('#444444')
.fontSize(14)
Text(this.hospital)
.fontColor(Color.Red).padding({ left: 3 })
.fontSize(14)
.layoutWeight(1)
}.margin({ top: 10 }).padding({ left: 10, right: 10 })
.width('79%')
.alignItems(VerticalAlign.Top)
Row() {
Text('科室:')
.fontColor('#444444')
.fontSize(14)
Text(this.office)
.fontColor($r('app.color.common_gray_03')).padding({ left: 3 })
.fontSize(14)
.layoutWeight(1)
}.margin({ top: 10 }).padding({ left: 10, right: 10 })
.width('79%')
.alignItems(VerticalAlign.Top)
Row() {
Text('地址:')
.fontColor('#444444')
.fontSize(14)
Text(this.local)
.fontColor($r('app.color.common_gray_03')).padding({ left: 3 })
.fontSize(14)
.layoutWeight(1)
}.margin({ top: 10 }).padding({ left: 10, right: 10 })
.width('79%')
.alignItems(VerticalAlign.Top)
Row() {
Text('门诊类型:')
.fontColor('#444444')
.fontSize(14)
Text(this.type)
.fontColor($r('app.color.common_gray_03')).padding({ left: 3 })
.fontSize(14)
.layoutWeight(1)
}.margin({ top: 10 }).padding({ left: 10, right: 10 })
.width('79%')
.alignItems(VerticalAlign.Top)
Text().width(20).height(20)
.margin({ top: 10 }).padding({ left: 10, right: 10 })
Text('').height(1).width('100%')
.backgroundColor($r('app.color.home_gray')).margin({ top: 10 })
Row() {
Text(this.cancelText)
.fontSize(15)
.fontColor(this.cancelColor)
.textAlign(TextAlign.Center)
.height(30)
.layoutWeight(1)
.onClick(() => {
this.controller.close()
})
Text('').height(30).width(1)
.backgroundColor($r('app.color.home_gray'))
Text(this.okText)
.textAlign(TextAlign.Center)
.fontColor(this.okColor)
.fontSize(15)
.onClick(() => {
this.controller.close()
this.inputCallBack();
})
.height(30)
.layoutWeight(1)
}.margin({ top: 10, bottom: 10 }).width('100%')
}
.width('80%').backgroundColor(Color.White)
}.borderRadius(24)
}
}
export interface HmParam{
item:ListOut,
isHistory:string
}

View File

@ -17,13 +17,22 @@ import { ListOut, ListWorkPlaceBean } from '../model/ListOutPatientModel';
@HMRouter({ pageUrl: 'AddOutpatient' })
@Component
export struct AddOutpatient {
@State url:string=BasicConstant.addOutPatient
@State title:string='增加门诊安排'
@State buttonTitle:string='确定发布'
@State time:string=''
@State local:string=''
@State lineHeight:Length[]=[]
@State locaIndex: number = -1
@State uuid: string = ''
private listScroller: Scroller = new Scroller()
param = HMRouterMgr.getCurrentParam() as HmParam;
@State data: ListOut[] = [];
weekOptions: string[] = ['周一', '周二', '周三', '周四', '周五', '周六', '周日', '']
controller: TextAreaController = new TextAreaController();
@State timeIndex: number = -1
@State timePeriodOptions: string[] = ['上午', '下午', '晚上', '全天']
@State timePeriod: string[] = ['a', 'b', 'c', 'd']
@State weekIndexList: number[] = [] // 新增多选星期索引
// 新增 weekOptions 多选每行4个自动换行
weekChunks = this.chunkArray(this.weekOptions, 4);
@ -53,7 +62,11 @@ export struct AddOutpatient {
if (json.list != null) {
this.data = json.list;
}
if('true'==this.param.isHistory)
{
this.locaIndex=this.data.findIndex((item) => item.uuid == this.param.item.workplace_uuid)
}
} else {
promptAction.showToast({ message: json.message, duration: 1000 })
@ -67,23 +80,43 @@ export struct AddOutpatient {
}
addStopOutPatient() {
let weeks=''
this.weekIndexList.forEach(item=>{
let tmp=item+1
if('true'==this.param.isHistory)
{
weeks=weeks+tmp
}
else
{
weeks=weeks+tmp+','
}
})
this.dialog.open()
// const hashMap: HashMap<string, Object> = new HashMap();
// hashMap.set('type',this.reasonIndex+1+'')
// hashMap.set('note',this.noteText)
// hashMap.set('date_list', this.reasonIndex === 2 ? this.date_list_temp : this.date_list_normal)
// hdHttp.httpReqObject<string>(BasicConstant.addStopOutPatient,hashMap).then(async (res: HdResponse<string>) => {
// this.dialog.close()
// let json:BaseBean = JSON.parse(res+'') as BaseBean;
// if(json.code == '200') {
// HMRouterMgr.pop()
// } else {
// promptAction.showToast({ message: json.message })
// }
// }).catch((err: BusinessError) => {
//
// console.info(`Response fails: ${err}`);
// })
const hashMap: HashMap<string, string> = new HashMap();
hashMap.set('workplace_uuid',this.data[this.locaIndex].uuid)
hashMap.set('week',weeks)
hashMap.set('day',this.timePeriod[this.timeIndex] )
hashMap.set('type','1')
hashMap.set('note','')
if('true'==this.param.isHistory) {
hashMap.set('uuid',this.param.item.uuid)
this.url=BasicConstant.updateOutPatientA
}
hdHttp.httpReq<string>(this.url,hashMap).then(async (res: HdResponse<string>) => {
this.dialog.close()
let json:BaseBean = JSON.parse(res+'') as BaseBean;
if(json.code == '200') {
HMRouterMgr.pop()
} else {
promptAction.showToast({ message: json.message })
}
}).catch((err: BusinessError) => {
console.info(`Response fails: ${err}`);
})
}
@ -93,9 +126,8 @@ export struct AddOutpatient {
this.dialogPublish = new CustomDialogController({
builder: PerfactInputSheets({
controller: this.dialogPublish,
// reasonOptions:this.reasonOptions[this.reasonIndex],
// noteText:this.noteText,
// date_list:this.reasonIndex === 2 ? this.date_list_temp : this.date_list_normal,
time:this.time,
local:this.local,
inputCallBack: () => {
this.addStopOutPatient()
@ -115,6 +147,14 @@ export struct AddOutpatient {
aboutToAppear(): void {
if('true'==this.param.isHistory)
{
this.title='修改门诊安排'
this.buttonTitle='确认修改'
this.timeIndex=this.timePeriod.indexOf(this.param.item.day)
this.weekIndexList.push(this.param.item.week-1)
// this.locaIndex=this.data.findIndex((item) => item.workplace_uuid === param.item.workplace_uuid)
}
this.initDialog()
this.getList()
@ -123,7 +163,7 @@ export struct AddOutpatient {
build() {
Column() {
HdNav({
title: '增加门诊安排',
title: this.title,
showRightIcon: false,
hasBorder: true,
isLeftAction: true,
@ -167,7 +207,15 @@ export struct AddOutpatient {
if (this.weekIndexList.indexOf(rowIndex * 4 + index) !== -1) {
this.weekIndexList = this.weekIndexList.filter(i => i !== rowIndex * 4 + index)
} else {
this.weekIndexList = [...this.weekIndexList, rowIndex * 4 + index]
if('true'==this.param.isHistory) {
this.weekIndexList =[]
this.weekIndexList = [...this.weekIndexList, rowIndex * 4 + index]
}
else
{
this.weekIndexList = [...this.weekIndexList, rowIndex * 4 + index]
}
}
})
} else {
@ -217,10 +265,10 @@ export struct AddOutpatient {
.padding(10)
.width('100%')
.textAlign(TextAlign.Start)
List() {
List({ scroller: this.listScroller }) {
ForEach(this.data, (item: ListOut, index) => {
ListItem() {
Stack()
RelativeContainer()
{
Column() {
Text(item.hospital_name)
@ -258,6 +306,10 @@ export struct AddOutpatient {
this.locaIndex=index
})
.id('locationlist'+index)
.onAreaChange((oldVal, newVal) => {
this.lineHeight.push(newVal.height)
})
.padding({ left: 10, right: 10, bottom: 10 })
.alignItems(HorizontalAlign.Start)
.borderWidth(1)
@ -267,13 +319,16 @@ export struct AddOutpatient {
Image($r('app.media.addoutpa_true'))
.width(38)
.height(38)
.position({ x: 0, y: '5%' }) // 右下角
// .offset({ x: -10, y: -10 }) // 距离右下角10px
}
.alignRules(
{
right: { anchor: 'locationlist'+index, align: HorizontalAlign.End },
bottom:{ anchor: 'locationlist'+index, align:VerticalAlign.Bottom}
}
)
.visibility(this.locaIndex==index ?Visibility.Visible:Visibility.None)
}.height(this.lineHeight[index])
}
})
}
.layoutWeight(1)
@ -283,15 +338,15 @@ export struct AddOutpatient {
color:Color.White
})
.edgeEffect(EdgeEffect.None)
.layoutWeight(1)
.clip(true)
} .backgroundColor(Color.White)
.width('100%')
// .padding({bottom:57})
.layoutWeight(1)
Blank()
Column() {
Text('确定发布')
Text(this.buttonTitle)
.height(42)
.width(168)
.fontSize(17)
@ -305,7 +360,25 @@ export struct AddOutpatient {
.height(57)
.backgroundColor(Color.White)
.onClick(() => {
this.time=''
this.local=''
if(this.timeIndex==-1|| this.weekIndexList.length<1)
{
promptAction.showToast({ message: '请选择门诊时间' })
return
}
if(this.locaIndex==-1)
{
promptAction.showToast({ message: '请选择门诊地点' })
return
}
this.weekIndexList.forEach(item=>{
this.time=this.time+this.weekOptions[item]+','
})
this.time=this.time.slice(0,-1)
this.time=this.time+' '+this.timePeriodOptions[this.timeIndex]
this.local=this.data[this.locaIndex].hospital_name+';'+this.data[this.locaIndex].office_name+';'
+this.data[this.locaIndex].location+';'+this.getoutpatientType(this.data[this.locaIndex].type)
this.dialogPublish.open()
})
@ -341,18 +414,17 @@ export struct AddOutpatient {
export struct PerfactInputSheets {
controller:CustomDialogController;
@Prop inputTitle:string = '公告内容';
@Prop inputPlaceholder:string = ''
@Prop inputTitle:string = '门诊时间';
// 添加回调函数属性
@State okColor:ResourceStr=$r('app.color.top_title')
@State cancelColor:ResourceStr='#333333'
@State okText:ResourceStr='确定发布'
@State cancelText:ResourceStr='返回修改'
@State reasonOptions:string=''
@State noteText:string=''
@State time:string=''
@State local:string=''
@State date_list: DateListBean[] = []
private inputCallBack: () => void = () => {};
@State needcancelCallBack:boolean=false
// 修改构造函数
@ -372,81 +444,32 @@ export struct PerfactInputSheets {
.width('100%')
.textAlign(TextAlign.Center)
.fontColor('#444444')
Text('停诊原因:' + this.reasonOptions)
.fontSize(14)
.fontColor('#444444')
.backgroundColor(Color.White)
.padding({ left: 10, right: 10 })
.width('79%')
Row() {
Text('诊时间:')
Text('门诊时间:')
.fontColor('#444444')
.fontSize(14)
Text(this.date_list[0].param1 + ' 至 ' + this.date_list[0].param2)
.fontColor($r('app.color.common_gray_03')).padding({ left: 3 })
Text(this.time)
.fontColor(Color.Red).padding({ left: 3 })
.fontSize(14)
.layoutWeight(1)
}.margin({ top: 10 }).padding({ left: 10, right: 10 })
.width('79%')
if (this.date_list.length > 1) {
Row() {
Text('停诊时间:')
.fontColor('#444444')
.fontSize(14)
.visibility(Visibility.Hidden)
Text(this.date_list[1].param1 + " 至 " + this.date_list[1].param2)
.fontColor('#444444').padding({ left: 3 })
.fontSize(14)
}.margin({ top: 10 }).padding({ left: 10, right: 10 })
.width('79%')
}
if (this.date_list.length > 2) {
Row() {
Text('停诊时间:')
.fontColor('#444444')
.fontSize(14)
.visibility(Visibility.Hidden)
Text(this.date_list[2].param1 + " 至 " + this.date_list[2].param2)
.fontColor('#444444').padding({ left: 3 })
.fontSize(14)
}
.width('79%')
.margin({ top: 10 }).padding({ left: 10, right: 10 })
}
Row() {
Text()
{
Span('备').fontColor('#444444')
Span('备注').fontColor(Color.Transparent)
Span('注:').fontColor('#444444')
}
.fontColor('#444444')
.fontSize(14)
Text(this.noteText)
.fontColor('#444444').padding({ left: 3 })
.fontSize(14)
.textAlign(TextAlign.Start)
.layoutWeight(1)
}.margin({ top: 10 }).padding({ left: 10, right: 10 })
.alignItems(VerticalAlign.Top)
.width('79%')
.visibility(this.noteText?Visibility.Visible:Visibility.None)
Text().width(20).height(20)
.alignItems(VerticalAlign.Top)
Row() {
Text('停诊时间')
Text('门诊地点:')
.fontColor('#444444')
.fontSize(14)
.visibility(Visibility.Hidden)
Text(TimestampUtil.getTodayChinese()+'由医生本人发布')
Text(this.local)
.fontColor($r('app.color.common_gray_03')).padding({ left: 3 })
.fontSize(14)
}
.layoutWeight(1)
}.margin({ top: 10 }).padding({ left: 10, right: 10 })
.width('79%')
.alignItems(VerticalAlign.Top)
Text().width(20).height(20)
.margin({ top: 10 }).padding({ left: 10, right: 10 })
Text('').height(1).width('100%')
.backgroundColor($r('app.color.home_gray')).margin({ top: 10 })
@ -486,3 +509,8 @@ export struct PerfactInputSheets {
}
}
export interface HmParam{
item:ListOut,
isHistory:string
}

View File

@ -1,10 +1,12 @@
import { BasicConstant,HdNav } from '@itcast/basic'
import { HMRouterMgr } from '@hadss/hmrouter';
import { BasicConstant, HdTwoNav } from '@itcast/basic'
import { ChatKitClient, ContactRepo, IMKitConfigCenter,
LocalConversationRepo } from '@nimkit/chatkit';
import { ChatKitConfig } from '@nimkit/chatkit_ui/src/main/ets/ChatKitConfig';
import { CommonConstants } from '@nimkit/common';
import { LocalConversationPage } from '@nimkit/localconversationkit_ui';
import { V2NIMFriendAddApplication } from '@nimsdk/base';
import { router } from '@kit.ArkUI';
@ComponentV2
export struct MessageComp {
@ -63,12 +65,15 @@ export struct MessageComp {
build() {
// Navigation(this.pathStack) {
Column() {
HdNav({ title: '患者消息', showRightIcon: true, showLeftIcon: true,showRightText:false,rightIcon:$r('app.media.selected_hospital_ws'),rightItemAction:()=>{
// router.pushUrl({
// url:'pages/SearchPage/VideoSearchPage',
// params:{'pageName':'视频'}
// })
}})
HdTwoNav({ title: '患者消息', showRightIcon: true,showRightIcon2: true, showLeftIcon: true,showRightText:false,
rightIcon2:$r('app.media.selected_hospital_ws'), rightIcon:$r('app.media.icon_group_send'),rightItemAction:()=>{
router.pushUrl({
url:'pages/PatientsPage/GroupSendMessagePage',
})
},rightItemAction2:()=>{
HMRouterMgr.push({pageUrl:'PatientsListSearchComp'})
}})
LocalConversationPage({
onUreadMessageChange: this.onUreadMessageChange,

View File

@ -3,18 +3,20 @@ import {
applyListModel,
authStore, BasicConstant,
ChangeUtil,
hdHttp, HdLoadingDialog,HdNav, HdResponse,
hdHttp, HdLoadingDialog, HdResponse,
HdTwoNav,
PatientData,
patientDbManager,
PatientListModel,
PatientsData,
preferenceStore} from '@itcast/basic'
import { Groups } from '../model/Groups';
import { display, promptAction } from '@kit.ArkUI';
import { display, promptAction, router } from '@kit.ArkUI';
import { StringIsEmpty } from '@nimkit/common';
import I18n from '@ohos.i18n';
import Intl from '@ohos.intl';
import { BusinessError } from '@kit.BasicServicesKit';
import { HMRouterMgr } from '@hadss/hmrouter';
let collator = new Intl.Collator(I18n.System.getSystemLocale(), {
usage: 'sort',
@ -174,7 +176,16 @@ export struct PatientListComp {
build() {
Column() {
HdNav({ title: '患者消息', showRightIcon: true, showLeftIcon: true,showRightText:false,rightIcon:$r('app.media.selected_hospital_ws')})
HdTwoNav({ title: '我的患者', showRightIcon: true,showRightIcon2: true, showLeftIcon: true,showRightText:false,
rightIcon2:$r('app.media.selected_hospital_ws'), rightIcon:$r('app.media.invite'),rightItemAction:()=>{
router.pushUrl({
url:'pages/WebView/WebPage',
params:{"title":'随访二维码',"url":BasicConstant.wxUrl+'expert/expertcodeimg?expert_uuid='+authStore.getUser().uuid}
})
},rightItemAction2:()=>{
HMRouterMgr.push({pageUrl:'PatientsListSearchComp'})
}})
Stack({ }) {
List({ scroller: this.scroller, space: 0, initialIndex: 0 }) {
ListItem() {

View File

@ -0,0 +1,295 @@
import { hdHttp, HdResponse, BasicConstant, ExpertData, authStore, BaseBean, HdLoadingDialog,
TimestampUtil,
preferenceStore,
EmptyViewComp} from '@itcast/basic'
import { BusinessError } from '@kit.BasicServicesKit';
import promptAction from '@ohos.promptAction';
import { HdNav ,DatePickerDialog} from '@itcast/basic';
import { LengthMetrics, router } from '@kit.ArkUI';
import { HMRouter, HMRouterMgr } from '@hadss/hmrouter';
import { HashMap } from '@kit.ArkTS';
import { StringIsEmpty } from '@nimkit/common';
import { DateListBean } from '../model/StopOutPatientListModel';
import { data } from '@kit.TelephonyKit';
import { PerfactInputSheet } from '@itcast/basic/src/main/ets/Views/PerfactInputSheet';
import { ListOut, ListWorkPlaceBean } from '../model/ListOutPatientModel';
@HMRouter({ pageUrl: 'Practicelocation' })
@Component
export struct Practicelocation {
@State data: ListOut[] = [];
@State isEmptyViewVisible: boolean = false; // 控制显隐的状态变量
@State deleteUuid:string=''
@State editIndex:number=-1
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
customStyle: true,
alignment: DialogAlignment.Center
})
getList() {
this.dialog.open()
const hashMap: HashMap<string, string> = new HashMap();
hdHttp.httpReq<string>(BasicConstant.listWorkPlace, hashMap).then(async (res: HdResponse<string>) => {
this.dialog.close();
let json: ListWorkPlaceBean = JSON.parse(res + '') as ListWorkPlaceBean;
if (json.code == '200') {
this.data = []
if (json.list != null) {
this.data = json.list;
}
if (this.data.length > 0) {
this.isEmptyViewVisible = false;
} else {
this.isEmptyViewVisible = true;
}
} else {
promptAction.showToast({ message: json.message, duration: 1000 })
}
}).catch((err: BusinessError) => {
this.dialog.close();
console.info(`Response fails: ${err}`);
})
}
deleteWorkPlace() {
this.dialog.open()
const hashMap: HashMap<string, string> = new HashMap();
hashMap.set('uuid',this.deleteUuid)
hdHttp.httpReq<string>(BasicConstant.deleteWorkPlace,hashMap).then(async (res: HdResponse<string>) => {
this.dialog.close();
let json:BaseBean = JSON.parse(res+'') as BaseBean;
if(json.code == '200') {
this.getList();
} else {
promptAction.showToast({ message: json.message, duration: 1000 })
}
}).catch((err: BusinessError) => {
this.dialog.close();
console.info(`Response fails: ${err}`);
})
}
private dialogs!:CustomDialogController;
@State inputPlaceholder:string='您确定删除此条信息吗'
initDialog() {
this.dialogs = new CustomDialogController({
builder:PerfactInputSheet({
controller:this.dialog,
inputTitle:'删除提示',
inputPlaceholder:this.inputPlaceholder,
style:'2',
okText:'确定',
okColor:$r('app.color.top_title'),
inputCallBack:(input: string,title:string)=>{
if(this.inputPlaceholder=='您确定修改此条信息吗')
{
HMRouterMgr.push({ pageUrl: 'AddLocation', param: {
item: this.data[this.editIndex], isHistory: 'true'
} })
}
else
{
this.deleteWorkPlace()
}
}
}),
keyboardAvoidDistance: LengthMetrics.vp(0), // 设置弹窗底部与键盘顶部间距单位vp
alignment: DialogAlignment.Center,
customStyle: true,
autoCancel: false,
backgroundColor: ('rgba(0,0,0,0.5)'),
height: '100%'
})
}
aboutToAppear(): void {
this.getList()
this.initDialog()
}
build() {
Column() {
HdNav({
title: '执业地点管理',
showRightIcon: false,
hasBorder: true,
isLeftAction: true,
leftItemAction: () => {
HMRouterMgr.pop()
}
})
Text().height(10).width('100%').backgroundColor($r('app.color.home_gray'))
if (this.isEmptyViewVisible){
EmptyViewComp({promptText:'暂无执业地点',isVisibility:this.isEmptyViewVisible}).layoutWeight(1)
}
else {
Column() {
List() {
ForEach(this.data, (item: ListOut, index) => {
ListItem() {
Column()
{
Column() {
Text(item.hospital_name)
.fontColor($r('app.color.common_gray_01'))
.fontSize(18)
.margin({ top: 10 })
Text(item.office_name)
.fontColor($r('app.color.common_gray_03'))
.fontSize(14)
.margin({ top: 10 })
Flex({ direction: FlexDirection.Row, wrap: FlexWrap.Wrap, space: { cross: LengthMetrics.vp(10) } }) {
Text(item.location)
.fontColor($r('app.color.common_gray_03'))
.fontSize(14)
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.ellipsisMode(EllipsisMode.END)
.padding({ right: 3 })
Text(this.getoutpatientType(item.type))
.fontSize(12)
.borderColor($r('app.color.top_title'))
.fontColor($r('app.color.top_title'))
.borderRadius(8)
.borderWidth(1)
.padding({
left: 4,
right: 4,
top: 2,
bottom: 2
})
}
.margin({ top: 10 })
}
.onClick(()=>{
})
.width('95%')
.margin({left:10,right:10})
.padding({ left: 10, right: 10, bottom: 10 })
.alignItems(HorizontalAlign.Start)
.borderRadius(4)
.backgroundColor(Color.White)
Row()
{
Blank()
Row()
{
Image($r('app.media.edit_icon')).width(15).height(15).margin({right:5})
Text('编辑')
.fontColor($r('app.color.common_gray_01'))
.fontSize(14)
}
.margin({right:30})
.onClick(()=>{
this.editIndex=index
this.inputPlaceholder='您确定修改此条信息吗'
this.dialogs.open()
})
Row()
{
Image($r('app.media.delete_icon')).width(15).height(15).margin({right:5})
Text('删除')
.fontColor($r('app.color.common_gray_01'))
.fontSize(14)
}
.onClick(()=>{
this.deleteUuid=item.uuid
this.inputPlaceholder='您确定删除此条信息吗'
this.dialogs.open()
})
}.width('95%')
.margin({left:10,right:10})
.padding(10)
.backgroundColor(Color.White)
.margin({top:2})
.borderRadius(4)
}
}
})
}
.divider({
strokeWidth: 5,
})
.edgeEffect(EdgeEffect.None)
.clip(true)
}
.width('100%')
.layoutWeight(1)
}
Column() {
Text('新增执业地点')
.height(42)
.width(168)
.fontSize(17)
.backgroundColor($r('app.color.top_title'))
.fontColor($r('app.color.white'))
.textAlign(TextAlign.Center)
.borderRadius(4)
.margin({ top: 8 })
}
.width('100%')
.height(57)
.backgroundColor(Color.White)
.onClick(() => {
HMRouterMgr.push({ pageUrl: 'AddLocation', param: {
isHistory: 'false'
} })
})
}
.width('100%')
.height('100%')
.backgroundColor($r('app.color.home_gray'))
}
getoutpatientType(type:number)
{
switch (type)
{
case 1:
return '普通门诊'
break
case 2:
return '专家门诊'
break
case 3:
return '特需门诊'
break
case 4:
return '专科/专病门诊'
break
}
return ''
}
}

View File

@ -1,6 +1,7 @@
import { hdHttp, HdResponse, BasicConstant, BaseBean, HdLoadingDialog,
TimestampUtil,
preferenceStore} from '@itcast/basic'
preferenceStore,
ChangeUtil} from '@itcast/basic'
import { BusinessError } from '@kit.BasicServicesKit';
import promptAction from '@ohos.promptAction';
import { HdNav ,DatePickerDialog} from '@itcast/basic';
@ -96,7 +97,7 @@ export struct ReleaseOutpatient {
if (this.datePickerType === 'start') {
if (date < TimestampUtil.getToday()|| date > this.tmp_list[this.datePickerIndex].param2) {
if (date < TimestampUtil.getToday()|| date > this.tmp_list[this.datePickerIndex].param2&&this.tmp_list[this.datePickerIndex].param2!='') {
if (date < TimestampUtil.getToday())
{
promptAction.showToast({ message: '不能发布过期时间' });
@ -412,15 +413,15 @@ export struct ReleaseOutpatient {
}
.zIndex(999)
.clip(false)
.backgroundColor(Color.Yellow)
.backgroundColor(Color.White)
.borderColor($r('app.color.999999'))
.borderWidth(1)
.borderRadius(4)
.visibility(this.showTimePeriodDropdown == -1 ? Visibility.None:Visibility.Visible)
.width(px2vp(getColunmWidth(`id_${this.showTimePeriodDropdown}`)))
.width(px2vp(ChangeUtil.getColunmWidth(`id_${this.showTimePeriodDropdown}`)))
.position({
x: px2vp(getColumnX(`id_${this.showTimePeriodDropdown}`)),
y: px2vp(getColumnY(`id_${this.showTimePeriodDropdown}`))
x: px2vp(ChangeUtil.getColumnX(`id_${this.showTimePeriodDropdown}`)),
y: px2vp(ChangeUtil.getColumnY(`id_${this.showTimePeriodDropdown}`))
})
}
.width('100%')
@ -431,23 +432,7 @@ export struct ReleaseOutpatient {
}
function getColumnX(id:string):number {
const componentInfo = componentUtils.getRectangleById(id)
const screenX = componentInfo.screenOffset.x//3.38
return screenX
}
function getColumnY(id:string):number {
const componentInfo = componentUtils.getRectangleById(id)
const screenY = componentInfo.screenOffset.y//3.38
return screenY
}
function getColunmWidth(id:string):number {
const componentInfo = componentUtils.getRectangleById(id)
const width = componentInfo.size.width//3.38
return width
}
@CustomDialog
export struct PerfactInputSheets {

View File

@ -3,6 +3,8 @@ import { TabBarItems } from '../components/TabBarItems'
import { BasicConstant } from '@itcast/basic'
import { MessageComp } from '../view/MessageComp'
import { PatientListComp } from './PatientListComp'
import { FollowPlanListComp } from 'patient'
import { HMRouterMgr } from '@hadss/hmrouter'
@Component
export struct TabBarComp {
@ -37,7 +39,7 @@ export struct TabBarComp {
// if (index === 0) MessageComp({ pathStack: this.pathStack })
if (index === 0) MessageComp()
else if (index === 1) PatientListComp()
// else if (index === 2) MyHomePage()
else if (index === 2) FollowPlanListComp()
}
.tabBar(this.TabBarBuilder(item, index))
@ -51,6 +53,15 @@ export struct TabBarComp {
.margin({ bottom: this.bottomHeight })
.onTabBarClick((index) => {
this.activeIndex = index
// if(index==2)
// {
// HMRouterMgr.push({pageUrl:"FollowPlanListComp",
// param:{
// "patient_uuid":'',
// "FollowUpUuid":'',
// "nickname":'',
// "realName":''}})
// }
})
// }.mode(NavigationMode.Auto)
// .hideTitleBar(true)

View File

@ -10,6 +10,7 @@ import { PatientNoticeModel } from '../model/PatientNoticeModel'
import { promptAction } from '@kit.ArkUI'
import { ArrangementsComp } from './ArrangementsComp'
import { StopOutPatientListModel } from '../model/StopOutPatientListModel'
import { ListWorkPlaceBean } from '../model/ListOutPatientModel'
@Component
export struct TabBarOutComp {
@ -21,9 +22,11 @@ export struct TabBarOutComp {
@State uuid:string=''
@State textInfo:string='发布新的停诊'
@State stopnum: number = 0
@State worknum: number = 0
aboutToAppear() {
this.mailanNoticeGet()
this.stopOutPatientList()
this.listWorkPlace()
}
@ -49,7 +52,9 @@ export struct TabBarOutComp {
{
Column()
{
HdNav({ title: '出/停诊公告', showLeftIcon: true, showRightIcon: false})
HdNav({ title: '出/停诊公告', showLeftIcon: true, showRightIcon: true,rightIcon:$r('app.media.zhiyedidian'),rightItemAction:()=> {
HMRouterMgr.push({ pageUrl: 'Practicelocation' })
}})
Tabs({
index: this.activeIndex
}) {
@ -118,7 +123,17 @@ export struct TabBarOutComp {
}
else if(this.activeIndex==1)
{
HMRouterMgr.push({ pageUrl: 'AddOutpatient' })
if(this.worknum<1)
{
promptAction.showToast({ message: "请先点击右上角设置执业地点", duration: 1000 })
}
else
{
HMRouterMgr.push({ pageUrl: 'AddOutpatient', param: {
isHistory: 'false'
} })
}
}
@ -180,8 +195,30 @@ export struct TabBarOutComp {
console.info(`Response fails: ${err}`);
})
}
listWorkPlace() {
const hashMap: HashMap<string, string> = new HashMap();
hdHttp.httpReq<string>(BasicConstant.listWorkPlace, hashMap).then(async (res: HdResponse<string>) => {
let json: ListWorkPlaceBean = JSON.parse(res + '') as ListWorkPlaceBean;
if (json.code == '200') {
if (json.list != null) {
this.worknum = json.list.length;
}
} else {
}
}).catch((err: BusinessError) => {
console.info(`Response fails: ${err}`);
})
}
}
export const TabBarItems: TabBarCompModel[] = [
{

View File

@ -16,4 +16,6 @@ export { PatientDetailsComp } from './src/main/ets/components/PatientDetailsComp
export { GroupManagementComp } from './src/main/ets/components/GroupManagementComp'
export { MassSendingComp } from './src/main/ets/components/MassSendingComp'
export { MassSendingComp } from './src/main/ets/components/MassSendingComp'
export { FollowPlanListComp } from './src/main/ets/components/FollowPlanListComp'

View File

@ -3,7 +3,7 @@ import { HdNav,EmptyViewComp, authStore, HdLoadingDialog, hdHttp, BasicConstant,
HdResponse,
ChangeUtil} from "@itcast/basic";
import { PullToRefreshLayout, RefreshController } from "refreshlib";
import { promptAction } from "@kit.ArkUI";
import { promptAction, router } from "@kit.ArkUI";
import { BusinessError } from "@kit.BasicServicesKit";
import { it } from "@ohos/hypium";
@ -18,6 +18,11 @@ export struct FollowPlanListComp {
public controller:RefreshController = new RefreshController()
@State isShowAddPlan:boolean = false
@State uuid:string=this.params?this.params.FollowUpUuid?this.params.FollowUpUuid:'':''
@State patientUuid:string=this.params?this.params.patient_uuid?this.params.patient_uuid:'':''
@State nickname:string=this.params?this.params.nickname?this.params.nickname:'':''
@State realName:string=this.params?this.params.realName?this.params.realName:'':''
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
customStyle: true,
@ -29,11 +34,21 @@ export struct FollowPlanListComp {
}
getFollowListData() {
const entity = {
let entity = {
"expert_uuid": authStore.getUser().uuid,
"patient_uuid": this.params.patient_uuid,
"page":this.pageNumber.toString()
} as Record<string,string>
if(this.patientUuid!='')
{
entity = {
"expert_uuid": authStore.getUser().uuid,
"patient_uuid": this.params.patient_uuid,
"page":this.pageNumber.toString()
} as Record<string,string>
}
this.dialog.open()
hdHttp.post<string>(BasicConstant.followUpList, entity).then(async (res: HdResponse<string>) => {
this.dialog.close();
@ -88,7 +103,15 @@ export struct FollowPlanListComp {
HdNav({title:'随访计划',isLeftAction:true,rightText:'添加',showRightText:true,showRightIcon:false,rightItemAction:()=>{
this.isShowAddPlan = !this.isShowAddPlan
},leftItemAction:()=>{
HMRouterMgr.pop()
if(this.patientUuid=='')
{
router.back()
}
else
{
HMRouterMgr.pop()
}
}})
PullToRefreshLayout({
@ -230,10 +253,10 @@ export struct FollowPlanListComp {
HMRouterMgr.push({
pageUrl:'AddScheduleFollowComp',
param:{
"uuid":this.params.FollowUpUuid,
"patientUuid":this.params.patient_uuid,
"nickname":this.params.nickname,
"realName":this.params.realName
"uuid":this.uuid,
"patientUuid":this.patientUuid,
"nickname":this.nickname,
"realName":this.realName
}},{
onResult:(popInfo:HMPopInfo)=>{
if (popInfo && popInfo.result && popInfo.result["isRefresh"] !== undefined) {
@ -263,10 +286,10 @@ export struct FollowPlanListComp {
HMRouterMgr.push({
pageUrl:'AddFollowPlanComp',
param:{
"uuid":this.params.FollowUpUuid,
"patientUuid":this.params.patient_uuid,
"nickname":this.params.nickname,
"realName":this.params.realName
"uuid":this.uuid,
"patientUuid":this.patientUuid,
"nickname":this.nickname,
"realName":this.realName
}},{
onResult:(popInfo:HMPopInfo)=>{
if (popInfo && popInfo.result && popInfo.result["isRefresh"] !== undefined) {

View File

@ -0,0 +1,209 @@
import { HdNav, EmptyViewComp,HdLoadingDialog, authStore } from '@itcast/basic';
import { promptAction } from '@kit.ArkUI'
import { BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
import { BusinessError } from '@kit.BasicServicesKit';
import HashMap from '@ohos.util.HashMap'
import { patientListModel } from '../models/PatientsGroupModel'
import { HMPopInfo, HMRouter, HMRouterMgr } from "@hadss/hmrouter"
@HMRouter({ pageUrl: 'PatientsListSearchComp' })
@Component
export struct PatientsListSearchComp {
private params: ESObject = HMRouterMgr.getCurrentParam()
// @State params:Record<string, string | patientListModel[]> = router.getParams() as Record<string, string | patientListModel[]>
@State patientsArray:patientListModel[] = []
@State patientsList:patientListModel[] = []
@State inputString:string = ''
@State naviRightTitle:string = '确定(0)'
@State isEmptyViewVisible: boolean = false; // 控制显隐的状态变量
aboutToAppear(): void {
const groupPatientsList = this.params?.selectedPatients as patientListModel[] | undefined
if (groupPatientsList?.length) {
this.getPatientsListData()
} else {
this.getAllPatientsListData()
}
}
dialog: CustomDialogController = new CustomDialogController({
builder: HdLoadingDialog({ message: '加载中...' }),
customStyle: true,
alignment: DialogAlignment.Center
})
getPatientsListData() {
const hashMap: HashMap<string, string> = new HashMap()
hashMap.set('group_uuid',this.params.group_uuid)
this.dialog.open()
hdHttp.httpReq<string>(BasicConstant.patientListNoInThisGroup,hashMap).then(async (res: HdResponse<string>) => {
this.dialog.close()
logger.info('Response patientListNoInThisGroup'+res)
let json:Record<string,string | patientListModel[]> = JSON.parse(res+'') as Record<string,string | patientListModel[]>
if(json.code == '1') {
const patientsList = this.params?.selectedPatients as patientListModel[] | undefined
if (patientsList?.length) {
const uuidSet = new Set(patientsList.map(item => item.uuid))
const dataArray = json.data as patientListModel[];
for (const model of dataArray) {
if (!uuidSet.has(model.uuid)) {
this.patientsList.push(model)
this.patientsArray.push(model)
}
}
} else {
this.patientsList = json.data as patientListModel[];
this.patientsArray = json.data as patientListModel[];
}
this.isEmptyViewVisible = this.patientsList.length>0?false:true
} else {
console.error('分组患者列表失败:'+json.message)
promptAction.showToast({ message: String(json.message), duration: 1000 })
}
}).catch((err: BusinessError) => {
this.dialog.close();
console.info(`Response fails: ${err}`);
})
}
getAllPatientsListData() {
this.dialog.open()
hdHttp.post<string>(BasicConstant.patientList, {
"expertUuid": authStore.getUser().uuid
} as Record<string,string>).then(async (res: HdResponse<string>) => {
this.dialog.close()
logger.info('Response patientList'+res)
let json:Record<string,string | patientListModel[]> = JSON.parse(res+'') as Record<string,string | patientListModel[]>
if(json.code == '1') {
this.patientsList = json.data as patientListModel[];
this.patientsArray = json.data as patientListModel[];
} else {
console.error('患者列表失败:'+json.message)
promptAction.showToast({ message: String(json.message), duration: 1000 })
}
}).catch((err: BusinessError) => {
this.dialog.close();
console.error(`Response fails: ${err}`);
})
}
searchPatientAction(){
if (this.inputString.length > 0) {
this.patientsList = []
for (const model of this.patientsArray) {
if (model.realname?.includes(this.inputString) || model.mobile?.includes(this.inputString) || model.nickname?.includes(this.inputString)) {
this.patientsList.push(model)
}
}
} else {
this.patientsList = this.patientsArray
}
this.isEmptyViewVisible = this.patientsList.length>0?false:true
}
build() {
Column() {
HdNav({showLeftIcon:true,title:'搜索患者',showRightText:false,rightTextColor:Color.White,rightBackColor:$r('app.color.main_color'),showRightIcon:false,
isLeftAction:true,
leftItemAction:()=>{
HMRouterMgr.pop()
}})
Row(){
Row(){
TextInput({placeholder:'搜索患者的备注名、昵称或手机号'})
.fontSize(15)
.backgroundColor(Color.White)
.layoutWeight(1)
.onChange((value:string)=>{
this.inputString = value
})
.onSubmit(()=>{
this.searchPatientAction()
})
Blank()
.width(0.5)
.height(20)
.backgroundColor($r('app.color.main_color'))
Image($r('app.media.selected_hospital_ws'))
.width(30)
.height(30)
.margin({left:10,right:10})
.onClick(()=>{
this.searchPatientAction()
})
}
.width('95%')
.height(50)
.borderRadius(5)
.borderWidth(1)
.margin({left:10})
.borderColor($r('app.color.main_color'))
}
.backgroundColor(Color.White)
.width('100%')
.height(70)
if (this.isEmptyViewVisible) {
EmptyViewComp({promptText:'无搜索结果',isVisibility:this.isEmptyViewVisible})
.width('100%')
.height('calc(100% - 56vp - 70vp)')
} else {
List(){
ForEach(this.patientsList,(model:patientListModel)=>{
ListItem() {
this.patientListItem(model)
}
})
}
.width('100%')
.height('calc(100% - 56vp - 70vp)')
.backgroundColor('#f4f4f4')
.scrollBar(BarState.Off)
}
}
.width('100%')
.height('calc(100% - 56vp)')
.backgroundColor('#f4f4f4')
.justifyContent(FlexAlign.Start)
}
@Builder
patientListItem(item:patientListModel) {
Column() {
Row() {
Image(BasicConstant.urlImage + item.photo)
.alt($r('app.media.userPhoto_default'))
.borderRadius(6)
.width(50)
.height(50)
.margin({ left: 15 })
Text(item.nickname ? item.nickname : item.realname?item.realname:item.realName)
.fontSize(16)
.fontColor('#333333')
.margin({ left: 15 })
Blank()
// Image(item.isSelected?$r('app.media.patiemts_list_selected'):$r('app.media.patients_list_noSelect'))
// .width(22).height(22)
// .objectFit(ImageFit.Fill)
// .margin({ right: 15 })
}
.width('100%')
.height(80)
.backgroundColor(Color.White)
.onClick(()=>{
HMRouterMgr.push({pageUrl:'PatientDetailsComp',param:{"patient_uuid":item.uuid}})
// item.isSelected = !item.isSelected;
// this.patientsList = [...this.patientsList];
// const selectedNum = this.patientsList.filter(item => item.isSelected == true).length;
// this.naviRightTitle = '确定('+selectedNum+')'
})
Blank()
.width('80%')
.height(1)
.backgroundColor('#f4f4f4')
.margin({left:60})
}
}
}