123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- ///管理端调用
- mui.plusReady(function(){
- var self = plus.webview.currentWebview(),
- prescriptionCode = self.prescriptionCode;
-
- var $patiInfo = $('#patient-info');
-
- var strOriginalData;
-
- queryData();
- bindEvent();
-
- function queryData(){
- plus.nativeUI.showWaiting();
- var params ={
- code:prescriptionCode,
- type: 0 //非团队长权限查看信息
- }
- sendPost("doctor/prescriptionInfo/getContinuedPrescriptionAsDoctor",params, function(){
- plus.nativeUI.closeWaiting();
- mui.toast("请求失败");
- }, function(res){
- plus.nativeUI.closeWaiting();
- if(res.status == 200){
- strOriginalData = res.data;
- var html = template('pati_tmp',{data:res.data,isLeader:0})
- $patiInfo.html(html);
- }else{
- mui.toast("获取数据失败");
- }
- },'get')
- }
- function bindEvent(){
- $patiInfo.on('click','#old-data',function(){
- mui.openWindow({
- id: "chufangxiangqing",
- url: "chufangxiangqing.html",
- extras: {
- code:strOriginalData.prescription.jwCode,
- patient:strOriginalData.prescription.patient
- }
-
- })
- })
- }
- template.helper('setStatus',function(o){
- if(o == -5){return '<span style="color: #999">线下取消</span>'}
- if(o == -4){return '<span style="color: #999">线下退费</span>'}
- if(o == -3){ return '<span style="color:#999">续方取消(24小时未支付)</span>' }
- if(o == -2){ return '<span style="color:#999">续方取消(居民主动取消)</span>' }
- if(o == -1){ return '<span style="color:#ff4c4c">审核未通过</span>' }
- if(o == 0 || o == 10){ return '<span style="color:#ffa54b">审核中</span>' }
- if(o == 2){ return '<span style="color:#ffa54b">调整中</span>' }
- if(o == 3){ return '<span style="color:#ffa54b">调整成功/待ca认证</span>' }
- if(o == 4){ return '<span style="color:#ffa54b">调整失败</span>' }
- if(o == 20){ return '<span style="color:#ffa54b">药师审核中</span>' }
- if(o == 21){ return '<span style="color:#ff4c4c">药师审核失败</span>' }
- if(o == 30){ return '<span style="color:#ffa54b">开方中</span>' }
- if(o == 31){ return '<span style="color:#ff4c4c">开方失败</span>' }
- if(o == 40 || o == 41){ return '<span style="color:#db6bbd">待支付</span>' }
- if(o == 50){ return '<span style="color:#ffa54b">配药中</span>' }
- if(o == 60){ return '<span style="color:#db6bbd">等待领药</span>' }
- if(o == 61 || o == 62 || o == 65 || o == 69){ return '<span style="color:#06bf04">配送中</span>' }
- if(o == 100){ return '<span style="color:#17b3ec">已完成</span>' }
- })
- template.helper('setReview',function(o){
- if(o == 0){ return '<span style="color:#ffa54b">审核中</span>' }
- if(o == 1){ return '<span style="color:#17b3ec">审核通过</span>' }
- if(o == -1){ return '<span style="color:#ff4c4c">审核未通过</span>' }
- if(o == -2){ return '<span style="color:#ff4c4c">审核无效</span>' }
- })
-
- template.helper('setPrescription',function(array){
- var arr=[];
- $.map(array,function(item,index){
- arr.push(item.name)
- })
- return arr.join(',')
- })
-
- template.helper('setRestTime',function(minDate,sDate){
- var now = getNowDate();
- var createDate = sDate.split(' ');
- var diff = getDays(createDate[0],now);
- if(diff<minDate){
- return '<span style="color:#17b3ec">'+(minDate-diff)+'天</span>'
- }else{
- return '<span style="color:#ff4c4c">已用完</span>'
- }
- })
- //相隔几天
- function getDays(sDate,eDate){
- var oDate1;
- var oDate2;
- var iDays;
- oDate1= sDate.split("-");
- oDate2= eDate.split("-");
- var strDateS = new Date(oDate1[0], oDate1[1]-1, oDate1[2]);
- var strDateE = new Date(oDate2[0], oDate2[1]-1, oDate2[2]);
- iDays = parseInt(Math.abs(strDateE - strDateS ) / 1000 / 60 / 60 /24)
- return iDays ;
- }
- //现在时间
- function getNowDate() {
- var date = new Date();
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var day = date.getDate();
- var hour = date.getHours();
- var minute = date.getMinutes();
- var second = date.getSeconds();
- return year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day);
- }
-
- function reloadPageData(){
- queryData()
- }
- window.addEventListener("refreshXufang", function(){
- reloadPageData()
- })
- })
|