123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- var self,
- docInfo,
- prescriptionCode;//续方code
- var strOriginalData;//认证专用
- mui.plusReady(function() {
- docInfo = JSON.parse(plus.storage.getItem("docInfo"));
- self = plus.webview.currentWebview();
- prescriptionCode = self.prescriptionCode;
- bindEvents();
- })
- function bindEvents(){
- function queryData(){
- var params ={
- code:prescriptionCode,
- type:1
- }
- sendPost("doctor/prescriptionInfo/getContinuedPrescriptionAsDoctor",params, function(){
- plus.nativeUI.closeWaiting();
- mui.toast("请求失败");
- }, function(res){
- if(res.status == 200){
- strOriginalData = res.data
- if(strOriginalData.prescription.status == 3){//已完成调整
- $('#startState').hide()
- $('#process').show()
- $('#success').hide()
- $('#fail').hide()
- nextDo()
- }else if(strOriginalData.prescription.status == 0){//未调整
- selectFee()
- selectHome()
- $('#feeCheck').attr('data-id',strOriginalData.prescription.jwGisterTypeCode)
- $('#feeCheck').attr('data-name',strOriginalData.prescription.jwRegisterFee)
- $('#doctorHome').attr('data-id',strOriginalData.prescription.jwDeptCode)
- $('#startState').show()
- $('#process').hide()
- $('#success').hide()
- $('#fail').hide()
- plus.nativeUI.closeWaiting();
- }else if(strOriginalData.prescription.status == 2){
- plus.nativeUI.closeWaiting();
- $('#startState').hide()
- $('#process').show()
- $('#success').hide()
- $('#fail').hide()
- mui.toast('续方处于调整中')
- }else if(strOriginalData.prescription.status == 4){
- plus.nativeUI.closeWaiting();
- $('#startState').hide()
- $('#process').hide()
- $('#success').hide()
- $('#fail').show()
- }else{
- plus.nativeUI.closeWaiting();
- $('#startState').hide()
- $('#process').hide()
- $('#success').show()
- $('#fail').hide()
- }
- }else{
- plus.nativeUI.closeWaiting();
- mui.toast("获取数据失败");
- }
- },'get')
- }
-
- $('#confirm').click(function(){
- var $fee = $('#feeCheck').attr('data-name'),
- $type = $('#feeCheck').attr('data-id'),
- $dept = $('#doctorHome').attr('data-id');
- if($fee && $type && $dept){
- plus.nativeUI.showWaiting();
- var params = {
- code:prescriptionCode,
- dept:$dept,
- registerFee:$fee,
- rateTypeCode:$type
- }
- sendPost("doctor/prescriptionAdjust/adjustPrescription",params, function(){
- plus.nativeUI.closeWaiting();
- mui.toast("请求失败");
- }, function(res){
- plus.nativeUI.closeWaiting();
- if(res.status == 200){
- $('#startState').hide()
- $('#process').show()
- refreshHz()
- }else{
- mui.toast(res.msg)
- }
- },'post',30000)
- }else{
- mui.toast('请选择诊查费用和开方科室')
- }
- })
- $('#caConfirm').click(function(){
- queryData()
- })
-
- function nextDo(){
- sendPost("doctor/isAuthentication",{}, function(){
- plus.nativeUI.closeWaiting();
- mui.toast("请求失败");
- }, function(res){
- if(res.status == 200){
- plus.nativeUI.closeWaiting();
- if(res.data.type != 4){
- dialog({
- content: '您暂未安装CA证书,无法进行续方审核,点击前往安装',
- okValue: '前往安装',
- cancelValue: '取消',
- cancel: function () {
- return;
- },
- ok: function() {
- mui.openWindow({
- id: "cazhengshu",
- url: "cazhengshu.html",
- waiting:{autoShow:false},
- extras: {
- code:res.data.type
- }
- })
- }
- }).showModal();
- }else{
- $('#doctorName').html(docInfo.name)
- $('.layer-bg').show();
- }
- }else{
- plus.nativeUI.closeWaiting();
- mui.toast("请求证书信息失败");
- }
- },'get')
- }
- //输入密码
- var psw = 0;
- var $li = $('#password').find('li');
- $('.number-pad').on('tap','li',function(){
- var $this = $(this)
- if(!$this.hasClass('no')){
- if(!$this.hasClass('del')){
- if(psw <=5){
- var $one = $li.eq(psw);
- $one.addClass('active');
- $one.attr('data-val',$this.text().trim());
- psw++;
- }else{
- mui.toast('请点击确定')
- }
- }else{
- if(psw >=1){
- psw--;
- var $one = $li.eq(psw);
- $one.removeClass('active');
- $one.attr('data-val','');
- }
- }
- }else{
- if(psw ==6){
- submitContent()
- }
- }
- })
- //提取密码
- function takePassword(){
- var str = '';
- $li.each(function(){
- str += $(this).attr('data-val');
- })
- return str
- }
- //忘记密码
- $('#forget').click(function(){
- mui.openWindow({
- id: "shenfenrenzheng",
- url: "shenfenrenzheng.html",
- waiting:{autoShow:false}
- })
- })
- //取消
- $('.layer-bg').click(function(){
- cancel();
- })
- $('.xufang-num').click(function(e){ e.stopPropagation() })
- $('#cancel').click(function(){
- cancel();
- })
- function cancel(){
- $('.layer-bg').hide();
- psw = 0;
- $li.removeClass('active');
- $li.attr('data-val','');
- }
- function submitContent(){
- plus.nativeUI.showWaiting();
- var imporMsg = {};
- imporMsg.prescription = {};
- imporMsg.prescription.jwCode = strOriginalData.prescription.jwCode;
- imporMsg.prescription.patientName = strOriginalData.prescription.patientName;
- imporMsg.prescription.doctorName = strOriginalData.prescription.doctorName;
- imporMsg.prescription.diagnosis = strOriginalData.diagnosis;
- var arr=[]
- _.map(strOriginalData.prescriptionInfo,function(item){
- var obj = _.pick(item, 'drugCode','drugName','jwSubCode','physicAmount','physicAmountUnit','physicAmountUnitName');
- arr.push(obj)
- })
- imporMsg.prescription.prescriptionInfo = arr;
- var params ={
- strRealNameSoftCertCalledPasswd:takePassword(),
- strOriginalData:JSON.stringify(imporMsg),
- prescriptionCode:prescriptionCode
- }
- sendPost("doctor/requestRealNameSoftCertAndSign",params, function(){
- plus.nativeUI.closeWaiting();
- mui.toast("请求失败");
- }, function(res){
- if(res.status==200){
- if(res.data){
- cancel()
- passingReview()
- }else{
- plus.nativeUI.closeWaiting();
- mui.toast(res.msg)
- }
- }else{
- plus.nativeUI.closeWaiting();
- mui.toast("用户不存在或密码错误")
- psw = 0;
- $li.removeClass('active');
- $li.attr('data-val','');
- }
- })
- }
- function passingReview(){
- plus.nativeUI.showWaiting();
- sendPost("doctor/prescriptionAdjust/uploadCaDigital",{code:prescriptionCode}, function(){
- plus.nativeUI.closeWaiting();
- mui.toast("请求失败")
- },function(res){
- plus.nativeUI.closeWaiting();
- if(res.status == 200){
- refreshHz()
- dialog({
- content: '提交成功,记得去完成该居民的随访哦',
- okValue: '好的',
- ok: function() {
- var page = plus.webview.getWebviewById("xufangxiangqing");
- var page1 = plus.webview.getWebviewById("juminxufangxiangqing");
- if(page1){
- page1.close('none')
- }
- if(page && !page1){
- page.close('none')
- }
- mui.back()
- }
- }).showModal();
- }else{
- mui.toast(res.msg)
- }
- },'post',60000)
- }
- plus.nativeUI.showWaiting();
- queryData()
- }
- //费用下拉
- function selectFee(){
- var data={
- jwHospital:strOriginalData.prescription.jwHospital,
- jwDoctorCode:strOriginalData.prescription.jwDoctorCode
- }
- sendPost("doctor/prescriptionInfo/getRegisterRee",data, function(){
- mui.toast("请求失败");
- }, function(res){
- if(res.status == 200){
- var result = res.data;
- var html = '<option disabled selected></option>';
- $.map(result,function(item,index){
- if(item.registerType == strOriginalData.prescription.jwGisterTypeCode){
- html += '<option selected value="'+item.registerType+'">'+item.registerTypeName+' '+item.registerFee+' 元'+'</option>';
- }else{
- html += '<option value="'+item.registerType+'">'+item.registerTypeName+' '+item.registerFee+' 元'+'</option>';
- }
- })
- $('#feeCheck').html(html);
- $('#feeCheck').mobiscroll().select({
- theme: 'ios',
- lang: 'zh',
- display: 'bottom',
- placeholder:'请按医生级别选择诊查费用',
- rows:4,
- onSelect: function ( valueText, inst) {
- $('#feeCheck').attr('data-id',inst._tempValue)
- $('#feeCheck').attr('data-name',valueText.split(' ')[1])
- }
- })
- }
- },'get')
- }
- // 科室下拉
- function selectHome(){
- var data={
- jwHospital:strOriginalData.prescription.jwHospital,
- jwDoctorCode:strOriginalData.prescription.jwDoctorCode
- }
- sendPost("doctor/prescriptionInfo/getDeptList",data, function(){
- mui.toast("请求失败");
- }, function(res){
- if(res.status == 200){
- var result = res.data;
- var html = '<option disabled selected></option>';
- $.map(result,function(item,index){
- if(item.deptCode == strOriginalData.prescription.jwDeptCode){
- html += '<option selected value="'+item.deptCode+'">'+item.deptName+'</option>';
- }else{
- html += '<option value="'+item.deptCode+'">'+item.deptName+'</option>';
- }
- })
- $('#doctorHome').html(html);
- $('#doctorHome').mobiscroll().select({
- theme: 'ios',
- lang: 'zh',
- display: 'bottom',
- placeholder:'请选择您所在科室',
- rows:4,
- onSelect: function ( valueText, inst) {
- $('#doctorHome').attr('data-id',inst._tempValue)
- }
- })
- }
- },'get')
- }
- function refreshHz(){
- var page = plus.webview.getWebviewById("xufangguanli");
- if(page){
- mui.fire(page, "refreshXufang");
- }
- var page1 = plus.webview.getWebviewById("juminxufangjilu");
- if(page1){
- mui.fire(page1, "refreshXufang");
- }
- var page2 = plus.webview.getWebviewById("xufangxiangqing");
- if(page2){
- mui.fire(page2, "refreshXufang");
- }
- var page3 = plus.webview.getWebviewById("juminxufangxiangqing");
- if(page3){
- mui.fire(page3, "refreshXufang");
- }
- }
|