123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959 |
- var self; //当前页面对象
- var patiCode; //居民标识
- var currDays = 7; //默认日期类型
- var indexType = "1"; //指标类型
- var currIndexCode = "" //当前要显示的指标类型
- var docType=""//医生类别
- var signType = "";
- var date_begin = getDateBefore(6);
- var date_end = getNowDate();
- var oPatiInfo =null;
- var iscroller = null;
- var doctorCode = null;
- var qyRelation;
- var overdue; //判断患者与医生的签约状态是否已过期
- var currService;
- var jtServerCode=[];//服务类型名称
- var jtAdminTeamId; // 标记患者的签约团队id
- mui.plusReady(function() {
- self = plus.webview.currentWebview();
- patiCode = self.patiCode;
- console.log(patiCode)
- doctorCode = JSON.parse(plus.storage.getItem("docInfo")).code;
- overdue = self.overdue;
- var docType = plus.storage.getItem("docType");
- if(docType!=3){//健康医生不查看家庭成员
- $(".jtcyli").show()
- }
- $("#pati_info").attr("code",patiCode);
- localStorage.removeItem('updateService');
- getPatiInfo();
- initScroller();
- });
- mui.back = function(){
- // self.opener().reload(true);
- //如果父窗口为im, 更新im
- if(self.opener().id=='p2dzixun'){
- mui.fire(self.opener(), 'update');
- }
- self.close();
- }
- //获取病人信息
- function getPatiInfo(){
- sendPost("/doctor/patient_label_info/patient",
- {patient: patiCode}, null,
- function(res){
- if(res.status == 200){
- oPatiInfo = res.data;
- oPatiInfo.signType = 0;
-
- jtAdminTeamId = res.data.jtAdminTeam;
-
- //判断居民类型 如果是慢病病人 则续方管理模块出现否则隐藏
- for(var i in oPatiInfo.serverTypes){
- if(oPatiInfo.serverTypes[i].server_type==4||oPatiInfo.serverTypes[i].server_type==5){
- $("#mbda").show();
- }
- }
- //判断居民是否为女性 则产检模块出现否则隐藏
- if(oPatiInfo.sex == 2){
- $("#fybj").show();
- }
-
- if(oPatiInfo.ssDoctor==doctorCode || oPatiInfo.ssDoctorHealth==doctorCode){
- oPatiInfo.signType = 1;
- }
- if(oPatiInfo.jtDoctor==doctorCode || oPatiInfo.jtDoctorHealth==doctorCode){
- oPatiInfo.signType = oPatiInfo.signType == 1 ? 3 : 2;
- oPatiInfo.expensesStatus1 = oPatiInfo.expensesStatus;
- }
- //服务类型
- if(oPatiInfo.serverTypes){
- $.map(oPatiInfo.serverTypes,function(item,index){
- jtServerCode.push(item.server_type)
- })
- }
- bindEvents();
- dealPatiInfoTmpl(oPatiInfo);
- $(".div-dianhua").attr("data-mobile",oPatiInfo.mobile).attr("data-phone",oPatiInfo.phone);
- } else {
- mui.toast("获取病人信息失败");
- }
- },'POST','',true);
- }
- function sendWeixinRemind() {
- sendPost("doctor/family_contract/wechat_focus_remind",
- {patient: patiCode,isAll:0}, null,
- function(res){
- if(res.status == 200){
- oPatiInfo.wechatFocusRemind = 1;
- showRemindBtn(true);
- } else {
- oPatiInfo.wechatFocusRemind = 1;
- showRemindBtn(true);
- mui.toast(res.msg);
- }
- },'POST','',true);
- }
- function showRemindBtn(isReminded) {
- var $remind = $("#remind_gz");
- $remind.show();
- if(isReminded) {
- $remind.addClass("ytx");
- $remind.find("a").text("已提醒关注");
- } else {
- $remind.removeClass("ytx");
- $remind.find("a").text("提醒关注微信");
- }
- }
- function checkWeixinRemind(data) {
- return new Promise(function(resolve, reject) {
- sendPost("doctor/family_contract/is_patient_remind_focus",
- {patient: patiCode}, null,
- function(res){
- if(res.status == 200){
- if(res.data==0) { // 0: 当日未提醒
- isWeiXinRemind(data);
- }
-
- } else {
- mui.toast(res.msg);
- }
- },'POST','',true)
- });
- }
- function isWeiXinRemind (data) {
-
- if(data) {
- var isReminded = data.wechatFocusRemind=="1"? true: false,
- // 签约类型: 1-->三师 2-->家庭 3-->三师 、家庭两者都有
- signType = data.signType,
- // 缴费状态: 2-->已退费 1-->已缴费 0-->未交费
- expensesStatus = data.expensesStatus,
- openid = data.openid;
- if(!openid) {
- // 有签约家庭医生,但未交费,则有该悬浮按钮
- if((signType=="2" || signType=="3") && expensesStatus=="1") {
- showRemindBtn(isReminded);
- }
- // 2、如只有三师签约,但无openid,则有该悬浮按钮
- else if(signType == "1") {
- showRemindBtn(isReminded);
- }
- }
- }
-
- }
- //查询某个患者今天是否已提醒
- function isYitixing(){
- sendPost("/doctor/family_contract/is_patient_remind_expenses",{patient:patiCode},null,function(res){
- if(res.status==200){
- if(res.data==1){//data为1已提醒 为0未提醒
- $("#remindPay").addClass("ytx");
- //则显示“已提醒缴费"
- $("#remindPay a").text("已提醒缴费");
- }else{
- $("#remindPay").removeClass("ytx");
- $("#remindPay a").text("提醒缴费");
- }
- }
- })
- }
- //缴费提醒
- function jiaofeitixing(){
- sendPost("/doctor/family_contract/expenses_remind",{patient:patiCode,isAll:"0"},null,function(res){
- mui.toast(res.msg);
- if(res.status==200){
- isYitixing();//查询某个患者今天是否已提醒
- }
- })
- }
- //提醒缴费
- $("#remindPay").on("tap",function(){
- mui("#sheet1").popover('toggle');
- if($(this).hasClass("ytx")){//今日已提醒
- mui.toast("居民今天已经收到过缴费提醒了哦,不可再次提醒");
- }else{//今日未提醒,则缴费提醒
- jiaofeitixing();
- }
- })
- /*提醒续签*/
- function sendRenewRemind(){
- var url = "/doctor/sign/remindPatientRenew",
- params = {patient: oPatiInfo.code};
- sendPost(url, params, null, function(res){
- if(res.status == 200){
- if(res.data == 1 || res.data == 2){
- $("#remindXQ").find("a").text("已提醒续签");
- $("#remindXQ").addClass("ytx");
- }
- mui.toast(res.msg);
- }else{
- mui.toast(res.msg)
- }
- }, "post", "", true);
- }
- ////获取服务类型
- function getServiceDropdown(){
- sendPost("/doctor/sign/getSigndict",{}, null, function(res){
- if(res.status == 200){
- fillServiceDropdown(res);
- }else{
- mui.toast(res.msg)
- }
- }, "get", "", true);
- }
- //普通 老年 高血 糖尿 孕妇 儿童 贫困 计生 重性 残疾 结核
- function filterSer(name){
- var $li = $('.dw-bf').find('div.dw-li');
- $li.addClass('dw-v');
- var nameArr = name.split(',');
- $.map(nameArr,function(item,index){
- if(item.trim() == '普通人群'){
- var arr = [2,3,6,7,8,9,10]
- $.map(arr,function(it,index){
- $li.eq(it).removeClass('dw-v')
- })
- }
- if(item.trim() == '老年人'){
- var arr = [4,5]
- $.map(arr,function(it,index){
- $li.eq(it).removeClass('dw-v')
- })
- }
- if(item.trim() == '高血压' ||item.trim() == '糖尿病'||item.trim() == '贫困人口'||item.trim() == '计生特殊人群'||item.trim() == '重性精神疾病'||item.trim() == '残疾人'||item.trim() == '结核病' ){
- var arr = [0]
- $.map(arr,function(it,index){
- $li.eq(it).removeClass('dw-v')
- })
- }
- if(item.trim() == '0-6岁儿童'){
- var arr = [1,4]
- $.map(arr,function(it,index){
- $li.eq(it).removeClass('dw-v')
- })
- }
- if(item.trim() == '孕产妇'){
- var arr = [1,5]
- $.map(arr,function(it,index){
- $li.eq(it).removeClass('dw-v')
- })
- }
- })
- }
- ////设置服务类型下拉
- function fillServiceDropdown(data){
- var $serviceSel = $('#selFuwu'),
- data = data.data,
- has = false,
- saveOldData ='',
- html="";
- for(i=0; i<data.length; i++){
- has = false;
- for(j=0;j<jtServerCode.length;j++){
- if(jtServerCode[j] == data[i].code){
- html += '<option selected value="'+data[i].code+'">'+data[i].name+'</option>';
- has = true;
- }
- }
- if(!has){
- html += '<option value="'+data[i].code+'">'+data[i].name+'</option>'
- }
- }
- $serviceSel.html(html);
- $serviceSel.mobiscroll().select({
- theme: 'ios',
- lang: 'zh',
- display: 'bottom',
- rows:6,
- placeholder: '请选择服务类型',
- onSelect: function ( valueText, inst) {
- if(valueText != saveOldData){
- currService = inst._tempValue?inst._tempValue.join(','):'';
- localStorage.setItem('updateService',currService);
- $('#smallTipSev').show();
- $("#diseases").html("无");
- }
- },
- onChange: function (event, inst){
- filterSer(event)
- },
- onShow: function (event, inst) {
- saveOldData = inst;
- filterSer(inst)
- }
- })
- }
- // 滚动条实例初始化
- function initScroller() {
- //阻尼系数
- var deceleration = mui.os.ios?0.003:0.0009;
- mui('.mui-scroll-wrapper').scroll({
- bounce: false,
- indicators: true, //是否显示滚动条
- deceleration:deceleration
- });
-
- iscroller = mui(".mui-scroll").pullToRefresh({
- down: {
- callback: function() {
- var self = this;
- setTimeout(function() {
- refreshPage();
- self.endPullDownToRefresh();
- }, 1000);
- }
- }
- });
- }
- /*
- * 拼接居民信息模板
- */
- function dealPatiInfoTmpl(patiInfoObj) {
- signType = patiInfoObj.signType;
- $("#pati_info_wrap").html(template("pati_info_tmpl", patiInfoObj));
- $('#view_wrap').show();
- initPatientData(3);
- getServiceDropdown();
- }
- /*
- * 获取患者续签状态
- */
- function getPatientRenewInfo(patiInfo){
- var url = "/doctor/sign/checkCanRenew",
- params = {patient: patiInfo.code};
-
- sendGet(url, params, null, function(res){
- if(res.status == 200){
- var state = res.data.code;
- if(state != "1" && state != "2"){
- oPatiInfo.isRenewable = 0;
- }else{
- oPatiInfo.isRenewable = 1;
- }
- //增加判断说是否显示右上角”更多”的图片
- if(oPatiInfo.expensesStatus == "1" && oPatiInfo.openid && !oPatiInfo.isRenewable){
- $(".header-link").hide();
- }else{
- $(".header-link").show();
- isWeiXinRemind(oPatiInfo);
- if(oPatiInfo && oPatiInfo.expensesStatus!=1 && oPatiInfo.expensesStatus!=2){
- if(oPatiInfo.signType!=1) {
- $("#remindPay").show();
- isYitixing();//查询某个患者今天是否已提醒
- }
- }
- if(oPatiInfo.isRenewable){
- $("#remindXQ").show();
- if(oPatiInfo.isRemindRenew == "1"){
- $("#remindXQ").find("a").text("已提醒续签");
- $("#remindXQ").addClass("ytx");
- }
- }
- }
- }else{
- mui.toast(res.msg);
- }
- }, true);
- }
- /*
- * 查看居民资料
- */
- function toInfo() {
- var $el = $(this);
- mui.openWindow("huanzeziliao.html", "huanzeziliao", {
- extras: {
- patiPhoto: $el.find('.doc-avatar img').attr('src'),
- patiCode: patiCode,
- signType: signType,
- teamCode: self.teamCode,
- //添加续签状态值
- qyRelation: qyRelation,
- renewable: oPatiInfo.isRenewable
- }
- })
- }
- function openwdsb(){
- // var params={};
- // params.patient = patiCode;
- // openWebviewExtras("../../wdsb/html/my-equipments.html",params);
- mui.openWindow('../../jkjl/html/health-record.html', 'health-record', {
- extras: {
- patientCode: patiCode,
- patientName: oPatiInfo.name,
- qyRelation: qyRelation
- }
- })
- }
- /*
- * 服务记录
- */
- function fwjl() {
- mui.openWindow('fuwujilu.html', 'fuwujilu', {
- extras: {
- patientCode: patiCode,
- patientName: oPatiInfo.name,
- qyRelation: qyRelation
- }
- });
- }
- /*
- * 健康指导
- */
- function jkzd() {
- // diaAdd.close();
- mui.openWindow('../../hzzd/html/guidance_list.html', 'jkzd', {
- extras: {
- code: patiCode
- }
- });
- }
- /*
- * 体征预警
- */
- function tzyj() {
- // diaAdd.close();
- mui.openWindow('tzyj.html', 'tzyj', {
- extras: {
- code: patiCode
- }
- });
- }
- /*
- * 健康记录点击事件
- */
- /*
- * 药物记录
- */
- function ywjl(dom) {
- var text = $(dom).find("p").eq(0).text();
- if(text == "-") {
- mui.toast("暂无健康记录");
- return;
- }
- mui.openWindow('../../hzgl/html/health-record-drug.html', 'health-record-drug', {
- extras: {
- pCode: patiCode
- }
- });
- }
- /*
- * 饮食记录
- */
- function ysjl(dom) {
- var text = $(dom).find("p").eq(0).text();
- if(text == "-") {
- mui.toast("暂无健康记录");
- return;
- }
- mui.openWindow('../../hzgl/html/health-record-diet.html', 'health-record-diet', {
- extras: {
- pCode: patiCode
- }
- });
- }
- /*
- * 运动记录
- */
- function ydjl(dom) {
- var text = $(dom).find("p").eq(0).text();
- if(text == "-") {
- mui.toast("暂无健康记录");
- return;
- }
- mui.openWindow('../../hzgl/html/health-record-sport.html', 'health-record-sport', {
- extras: {
- pCode: patiCode
- }
- });
- }
- /*
- * 分组
- */
- function fz() {
- mui.openWindow('../../zxyy/html/xuanzeyiyuan.html', 'xuanzeyiyuan', {
- extras: {
- pCode: patiCode
- }
- });
- }
- function toSelectJb(){
- var self = plus.webview.currentWebview();
- var update = localStorage.getItem('updateService');
- var oldData = jtServerCode.join(',');
- mui.openWindow({
- url: 'disease-label-edit.html',
- id: 'disease-label-edit',
- extras: {
- patientCode: patiCode,
- viewId: self.id,
- signCode:oPatiInfo.signCode,//变更服务类型用
- serviceCode: update?update:oldData,
- isChange:$("#smallTipSev").is(":hidden")?false:true//判断是否处于变更
- }
- });
- }
- var labelName =[];
- function initPatientData(){
- sendPost("doctor/family_contract/doctor_patient_sign_exist", {doctor: doctorCode, patient: patiCode}, null, function(res){
- if(res.status==200){
- if(res.data.status==-1 || res.data.status==0){
- qyRelation = 0;
- //没有签约关系
- //判断医生是否是该患者所在的团队的团队长
- var teamInfo = JSON.parse(plus.storage.getItem('teamInfo')),
- isTeamLeader = false;
- for(var i=0; i<teamInfo.data.length; i++){
- var item = teamInfo.data[i];
- if(item.id == jtAdminTeamId){
- isTeamLeader = true;
- break;
- }
- }
- if(isTeamLeader){
- $('#diseasesWrap').show();
- $('#serviceTypes').show();
- }else{
- $('#diseasesWrap').hide();
- $('#serviceTypes').hide();
- }
-
- if(overdue){
- //获取患者是否可续签的状态
- getPatientRenewInfo(oPatiInfo);
- }
- } else {
- qyRelation = 1;
- //获取患者是否可续签的状态
- getPatientRenewInfo(oPatiInfo);
- $('#footer').show();
- $('#diseasesWrap').show();
- $('#serviceTypes').show();
- initPatiLabels();//修复bug#【医生端】居民信息:居民标签经常显示为无。
- }
- } else {
- $('#diseasesWrap').hide();
- queryFailed(res);
- }
- },'POST','',true);
-
- getReqPromise("doctor/family_contract/patient_doctor_teams",{patient:patiCode},'POST', true)
- .then(function(res) {
- if(res.status==200) {
- var data = res.data;
- // 当当前医生与用户无签约关系(不包括签约团队的团队长),则不显示服务记录
- if(data.hasSign=="1") {
- $('#fwjl').show();
- } else {
- $('#fwjl').hide();
- }
- } else {
- mui.toast(res.msg);
- }
- }).catch(function(e){
- console && console.error(e);
- })
-
- }
- function initPatiLabels(){
- sendPostNoAsync("/doctor/patient_label_info/patient_label",{labelType:"",patient:patiCode},queryFailed,function(res){
- if(res.status==200){
- for(var j in res.data){
- if(res.data[j].labelType==3||res.data[j].labelType==4){
- labelName.push(res.data[j].labelName);
- }
- }
- if(labelName.length>0){
- $("#diseases").html(_.uniq(labelName).join(","));
- }else{
- $("#diseases").html("无");
- }
- }else{
- queryFailed(res);
- }
- });
- }
- function queryFailed(res){
- if(res.msg){
- if (res.msg != '查询失败') {
- mui.toast(res.msg);
- }
- }else{
- mui.toast("标签加载失败!");
- }
- }
- function loadRecentEvents() {
- template.helper("toJson", function(v, i) {
-
- return JSON.stringify(v);
- });
- // strSSID: "B09036263193"
- getReqPromise(healthProfileServer+"wlyy_service/record/outpatient",{
- strSSID: oPatiInfo.ssc,
- startNum: 0,
- endNum: 50
- },'GET',true).then(function(res){
- if(res.status == 200) {
- var list = JSON.parse(res.data);
- if(list && list.length) {
- $('#no_result_wrap').hide();
- $('#recent_events').show();
- $('#recent_events').append(template('recent_event_tmpl',{list: list.slice(0,4)}));
- $('#more_event').show();
- iscroller.refresh();
- } else {
- $('#recent_events').hide();
- $('#more_event').hide();
- $('#no_result_wrap').show();
- }
- } else {
- mui.toast(res.msg);
- }
- }).catch(function(e) { console && console.error(e)});
- }
- $('#more_event').on('tap',function() {
- openWebview("jiuzhenjilu.html",{patiInfo: oPatiInfo})
- });
- $('.fix-adds').on('tap', function() {
- $(".div-dialog-content").show();
- $(".modal-overlay").addClass("modal-overlay-visible");
- });
- $('.div-dialog-content').on('tap',"div", function() {
- if(!$(this).hasClass("quxiao")){
- hideBing();
- if($(this).hasClass("addjkzd")){//健康指导
- jkzd();
- }else if($(this).hasClass("addfzgl")){//分组管理
- fz();
- }else if($(this).hasClass("addtzyj")){//体征预警
- tzyj();
- }else if($(this).hasClass("addtzsb")){//体征设备
- openwdsb();
- }else if($(this).hasClass("addjtcy")){//家庭成员
- jtcy();
- }
- }else if($(this).hasClass("quxiao")){//取消
- $('.fix-adds').show();
- $(".div-dialog-content").hide();
- $(".modal-overlay").removeClass("modal-overlay-visible");
- }
-
- });
- function hideBing(){
- $('.fix-adds').show();
- $(".div-dialog-content").hide();
- $(".modal-overlay").removeClass("modal-overlay-visible");
- }
- $(".modal-overlay").on('tap', function() {
- hideBing();
- });
- $('#recent_events').on('tap','li',function() {
- var data = JSON.parse($(this).attr("data-json"));
- openWebview("health-profile.html",{eventInfo: data,patiInfo: oPatiInfo});
- });
- /*
- * 家庭成员
- */
- function jtcy() {
- mui.openWindow('jiatingchengyuan.html', 'jiatingchengyuan', {
- extras: {
- code: patiCode,
- patiInfo: oPatiInfo,
- qyRelation: qyRelation
- }
- });
- }
- /*
- * 咨询记录
- */
- function zxjl() {
- mui.openWindow('zixunjilu.html', 'zixunjilu', {
- extras: {
- code: patiCode,
- qyRelation: qyRelation
- }
- });
- }
- /*
- * 指导记录
- */
- function zdjl() {
- mui.openWindow('zhidaojilu.html', 'zhidaojilu', {
- extras: {
- code: patiCode,
- qyRelation: qyRelation
- }
- });
- }
- /*
- * 代预约记录
- */
- function dyyjl(){
- mui.openWindow('../../wdyy/html/my-appointment.html', 'my-appointment', {
- extras: {
- patient: patiCode,
- qyRelation: qyRelation
- }
- });
- }
- /*
- * 代预约
- */
- function dyy() {
- mui.openWindow('../../wdyy/html/appointment-register.html', 'appointment-register', {
- extras: {
- patient: patiCode
- }
- });
- }
- //拨打电话
- $(".div-dianhua").on("tap",function(){
- var moblie = $(this).attr("data-mobile");
- var phone = $(this).attr("data-phone");
- //观察者模式下,不可以拨打被观察者患者的电话
- var userAgent = plus.navigator.getUserAgent(),
- index = userAgent.indexOf("}"),
- s = userAgent.substr(0, index+1),
- item = JSON.parse(s);
- if(item.observer){
- mui.toast("观察者模式无法拨打患者电话");
- }else{
- if(moblie){
- dialog({
- content: moblie,
- okValue:'立即拨号',
- ok: function (){
- window.location.href = "tel:"+moblie;
- },
- cancelValue: '不了,谢谢',
- cancel: function () {
- return;
- }
- }).showModal();
- }else{
- if(phone){
- dialog({
- content: "对不起,"+$(".patient-name").html()+"未绑定手机号码,是否拨打联系人电话?",
- okValue:'立即拨号',
- ok: function (){
- window.location.href = "tel:"+phone;
- },
- cancelValue: '不了,谢谢',
- cancel: function () {
- return;
- }
- }).showModal();
- }else{
- dialog({
- content: "对不起,"+$(".patient-name").html()+"未绑定手机号码,无法电话联系",
- okValue:'我知道了',
- ok: function (){
- return;
- },
- }).showModal();
- }
- }
- }
- })
- function refreshPage () {
- labelName =[];
- jtServerCode = [];
- localStorage.removeItem('updateService');
- getPatiInfo();
- }
- window.addEventListener("refresh1", function(){
- refreshPage();
- var xxWv = plus.webview.getWebviewById("huanzhe-by-type");
- // 如果有打开分组列表也要刷新列表
- if(xxWv){
- mui.fire(xxWv, "refresh");
- }
- var xxindex = plus.webview.getWebviewById("huanzhe.html");
- // 如果有打开分组列表也要刷新列表
- if(xxindex){
- mui.fire(xxindex, "refresh");
- }
- })
- window.addEventListener("setDiseaseTypes", function(e){
- $('#diseases').html(e.detail.names);
- oPatiInfo.diseases = e.detail.diseases;
- })
- //门诊记录
- $(".div-menzhen-btn").on("tap",function(){
- openWebview("menzhenjilu.html",{patiInfo: oPatiInfo})
- })
- //住院记录
- $(".div-zhuyuan-btn").on("tap",function(){
- openWebview("zhuyuanjilu.html",{patiInfo: oPatiInfo})
- })
- //检查检验记录
- $(".div-jianche-btn").on("tap",function(){
- openWebview("jianchajianyan.html",{patiInfo: oPatiInfo})
- })
- //用药记录
- $(".div-yongyao-btn").on("tap",function(){
- openWebview("yongyaojilu.html",{patiInfo: oPatiInfo})
- })
- //健康体检
- $(".div-jiankangtijian-btn").on("tap",function(){
- openWebview("jiankangtijian.html",{patiInfo: JSON.parse(self.patiInfo)})
- })
-
- /*
- * 健康教育
- */
- function jkjy() {
- // mui.openWindow('../../jkjy/html/jiankangjiaoyu.html', 'jiankangjiaoyu', {
- mui.openWindow('../../jkjy/html/article-store.html', 'jiankangjiaoyu', {
- extras: {
- patient: patiCode,
- patientName: oPatiInfo.name,
- teamCode: jtAdminTeamId
- }
- });
- }
- function xfjl() {
- mui.openWindow('../../prescription/html/juminxufangjilu.html', 'juminxufangjilu', {
- extras: {
- teamCode:oPatiInfo.jtAdminTeam,
- patiCode: patiCode,
- patiName: oPatiInfo.name
- }
- })
- }
- function fybj() {
- mui.openWindow('../../fybj/html/yunjianjihua.html', 'yunjianjihua', {
- extras: {
- patiCode: patiCode,
- doctorCode:doctorCode
- }
- })
- }
- function myjl() {
- mui.openWindow('../../fybj/html/mianyijihua.html', 'mianyijihua', {
- extras: {
- patiCode: patiCode
- }
- })
- }
- /* 事件绑定*/
- function bindEvents(){
- //服务记录
- $("#fwjl").on('tap', fwjl);
- //健康记录
- $("#tzsb").on('tap', openwdsb);
- //家庭成员
- $("#family").on('tap', jtcy);
- //提醒关注
- $("#remind_gz").on('tap', function(){
- mui("#sheet1").popover('toggle');
- if($(this).hasClass("ytx")){//今日已提醒
- mui.toast("居民今天已经收到过提醒了哦,不可再次提醒");
- }else{//今日未提醒
- sendWeixinRemind();
- }
- });
- //健康指导
- $("#jkzd").on('tap', jkzd);
- //体征预警
- $("#tzyj").on('tap', tzyj);
- //分组
- $("#fz").on('tap', fz);
- //干预
- $("#gy").on('tap', gy);
- //转慢病
- // $("#zmbicon").on('tap', adddoc);
- //体征设备2
- $("#tzsbicon").on('tap', openwdsb);
-
- $("#pati_info_wrap").on('tap', '#pati_info', toInfo);
- $("#pati_info_wrap").on('tap', "#diseasesWrap", toSelectJb);
-
- //健康教育
- $(".div-jkjy-btn").on('tap', jkjy);
- //代预约
- $(".div-dyy-btn").on('tap', dyy);
- //续方记录
- // $(".div-xufangjilu-btn").on('tap', xfjl);
- //慢病管理
- $(".div-manbing-btn").on('tap', function(){
- openWebview("../../mbgl/html/jumin-manbingdangan.html", {patient: oPatiInfo.code});
- })
- //产检计划
- $('.div-fybj-btn').on('tap', fybj)
- //免疫记录
- $('.div-myjl-btn').on('tap', myjl)
- //新增指导
- $(".div-add-guide-btn").on('tap', jkzd);
- //随访
- $(".div-suifang-btn").on('tap',function(){
- // openWebview("../../suifang/html/choose_suifang.html", {patiCode: oPatiInfo.code});
- openWebview("../../suifang/html/suifang_list.html", {patientCode: oPatiInfo.code});
- });
-
-
- //显示更过操作
- $(".header-link").on('tap', function(){
- mui('#sheet1').popover('toggle');
- });
-
- /*提醒续签*/
- $("#remindXQ").on('tap', function(){
- mui("#sheet1").popover('toggle');
- if($(this).hasClass("ytx")){//今日已提醒
- mui.toast("居民今天已经收到过提醒了哦,不可再次提醒");
- }else{//今日未提醒
- sendRenewRemind();
- }
- });
- }
|