|
@ -16,6 +16,8 @@ var loading = dialog({
|
|
|
surplusMoney:"",
|
|
|
data:{},
|
|
|
code:"",
|
|
|
cardlenght:0,
|
|
|
ischangeCard:false,
|
|
|
},
|
|
|
mounted: function() {
|
|
|
var vm = this
|
|
@ -28,6 +30,59 @@ var loading = dialog({
|
|
|
methods: {
|
|
|
//获取列表数据
|
|
|
getData:function(){
|
|
|
var vm=this
|
|
|
sendPost("patient/card/getCardList", {patient:vm.code}, "json", "get",function(){
|
|
|
loading.close();
|
|
|
dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请求失败'}).show();
|
|
|
}, function(res){
|
|
|
if(res.status == 200){
|
|
|
if(res.data.length>0){
|
|
|
vm.cardlenght=res.data.length
|
|
|
if(Request.id){
|
|
|
vm.data=res.data.filter(function(item){
|
|
|
return item.id==Request.id && vm.hasInpCardNo(item)
|
|
|
})[0]
|
|
|
if(!vm.data){
|
|
|
vm.data=res.data.filter(function(item){
|
|
|
return item.isDefault==1 && vm.hasInpCardNo(item)
|
|
|
})[0]
|
|
|
}
|
|
|
}else{
|
|
|
vm.data=res.data.filter(function(item){
|
|
|
return item.isDefault==1 && vm.hasInpCardNo(item)
|
|
|
})[0]
|
|
|
}
|
|
|
if(!vm.data){
|
|
|
vm.data=res.data[0]
|
|
|
if(!vm.hasInpCardNo(vm.data)){
|
|
|
dialog({
|
|
|
content: "请先绑定住院就诊卡!",
|
|
|
okValue: '确定',
|
|
|
ok: function(){
|
|
|
window.location.href='../../payment/html/patientIDCards.html';
|
|
|
},
|
|
|
}).showModal()
|
|
|
}
|
|
|
}
|
|
|
vm.cardId=vm.data.id
|
|
|
vm.getCardInfo()
|
|
|
}else{
|
|
|
dialog({
|
|
|
content: "请先绑定就诊卡!",
|
|
|
okValue: '确定',
|
|
|
ok: function(){
|
|
|
window.location.href='../../payment/html/patientIDCards.html';
|
|
|
},
|
|
|
}).showModal()
|
|
|
}
|
|
|
}else{
|
|
|
loading.close();
|
|
|
dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'数据获取失败'}).show();
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
//获取列表数据
|
|
|
getCardInfo:function(){
|
|
|
var vm=this
|
|
|
sendPost("patient/card/getCardInfo", {id:vm.cardId}, "json", "get",function(){
|
|
|
loading.close();
|
|
@ -36,12 +91,12 @@ var loading = dialog({
|
|
|
if(res.status == 200){
|
|
|
loading.close();
|
|
|
vm.data=res.data
|
|
|
if(vm.paytype=="1"){
|
|
|
vm.surplusMoney=vm.data.cardMoney?vm.data.cardMoney:0
|
|
|
vm.cardNo=vm.data.cardNo
|
|
|
}else{
|
|
|
if(vm.paytype=="2"){
|
|
|
vm.surplusMoney=vm.data.cardInpMoney?vm.data.cardInpMoney:0
|
|
|
vm.cardNo=vm.data.inpCardNo
|
|
|
}else{
|
|
|
vm.surplusMoney=vm.data.cardMoney?vm.data.cardMoney:0
|
|
|
vm.cardNo=vm.data.cardNo
|
|
|
}
|
|
|
}else{
|
|
|
loading.close();
|
|
@ -103,7 +158,7 @@ var loading = dialog({
|
|
|
healthType:vm.paytype,
|
|
|
payAmount:parseFloat(vm.payMoney).toFixed(2),
|
|
|
spbillCreateIp:returnCitySN["cip"],
|
|
|
code:getUrlParam("code"),
|
|
|
// code:getUrlParam("code"),
|
|
|
openid:JSON.parse(localStorage.getItem("wlyyAgent")).openid
|
|
|
};
|
|
|
sendPost("third/hy/pay/createPayOrder", params, "json", "post",function(){
|
|
@ -151,11 +206,22 @@ var loading = dialog({
|
|
|
payMoney="0"
|
|
|
}
|
|
|
this.payMoney= (payMoney.match(/^\d*(\.?\d{0,2})/g)[0]) || null
|
|
|
if(this.payMoney>50000){
|
|
|
dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:"微信支付金额不得超过50000"}).show();
|
|
|
this.payMoney=50000
|
|
|
if(this.payMoney>20000){
|
|
|
dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:"支付金额不得超过20000"}).show();
|
|
|
this.payMoney=20000
|
|
|
}
|
|
|
},
|
|
|
hasInpCardNo:function(item){
|
|
|
var ispass=true
|
|
|
if(Request.paytype==2){
|
|
|
ispass=item.inpCardNo?true:false
|
|
|
}
|
|
|
return ispass
|
|
|
},
|
|
|
//跳转切换就诊卡
|
|
|
changeCards:function(){
|
|
|
window.location.href='../../payment/html/changeCards.html?pre=payment&paytype='+Request.paytype;
|
|
|
},
|
|
|
//判断是否验证登录通过
|
|
|
checkType:function(){
|
|
|
var vm=this
|