123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- var Request = GetRequest();
- var checktype=false;
- (function() {
- new Vue({
- el: "#app",
- data: {
- dataList:[],
- cardId:Request.id,
- code:"",
- data:{
- "id": "",
- "patient": "",
- "hisId": "",
- "cardNo": "",
- "name": "",
- "idCard": "",
- "mobile": "",
- "inpCardNo": "",
- "isDefault": 0,
- "createDate": "",
- "cardMoney": "",
- "cardInpMoney": null
- },
- BtnClass:"p-fix-bottom-0",
- length:1,
- },
- mounted:function(){
- var vm = this
- checkUserAgent();
- vm.code=JSON.parse(localStorage.getItem("wlyyAgent")).uid
- vm.checkType()
- },
- methods: {
- //获取列表数据
- getData:function(){
- var vm=this
- var loading = dialog({
- contentType: 'load',
- skin: 'bk-popup'
- });
- loading.showModal();
- sendPost("patient/card/getCardInfo", {id:vm.cardId}, "json", "get",function(){
- loading.close();
- dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
- }, function(res){
- loading.close();
- if(res.status == 200){
- vm.data=res.data
- if(vm.length>0){
- vm.$nextTick(function(){
- vm.setBtnClass()
- });
- }
- }else{
- dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
- }
- })
- },
- //解绑就诊卡
- untieCard:function(){
- var vm=this
- dialog({title:'解绑提示', content:'是否确定解绑就诊卡?',okValue: '确定', ok: function (){vm.setuntieCard();}, cancelValue: '取消',cancel: function () {} }).showModal();
- },
- setuntieCard:function(){
- var vm=this
- sendPost("patient/card/unBindCard", {_method:"DELETE",id:vm.cardId}, "json", "post",function(){
- dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
- }, function(res){
- if(res.status == 200){
- dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
- vm.backtoCards()
- }else{
- dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:res.msg}).show();
- }
- })
- },
- //跳转去支付
- gotoPay:function(paytype){ //paytype 1为门诊缴费 2为住院缴费
- var vm=this
- window.location.href='../../payment/html/payment.html?id='+vm.cardId+'&paytype='+paytype;
- },
- //跳转去缴费查询列表
- gotoList:function(){
- var vm=this
- window.location.href='../../payment/html/paymentList.html?id='+vm.cardId;
- },
- //返回我的卡包页面
- backtoCards:function(){
- setTimeout(function(){
- window.location.href='../../payment/html/patientIDCards.html';
- },500)
- },
- //屏幕高度太矮,下方按钮随页面滚动,反之固定底部
- setBtnClass:function(){
- var vm = this
- var screemH=window.screen.availHeight;
- var bodyH=document.body.clientHeight;
- if(screemH-bodyH<160){
- vm.BtnClass="mt20"
- }
- },
- //判断是否验证登录通过
- checkType:function(){
- var vm=this
- var timer = setInterval(function(){
- if(checktype){
- clearInterval(timer);
- vm.getData()
- }
- },10);
- },
- },
- })
- })()
- function queryInit(){
- checktype=true
- }
|