<!-- saved from url=(0500)http://localhost:8081/crm-api/html/pay/pricePolicyBestNew?param=eyJzaWduYXR1cmVUaW1lIjoiMjAyMjA0MTUxNTQ5NTYiLCJub25jZSI6IjgzODgwOCIsInBhdGll%0D%0AbnRJZCI6IjExOTE5MiIsImVtcGlJZCI6IjExOTE5MiIsImhvc3BpdGFsSWQiOiJBTUNBUkVCSkxE%0D%0AIiwiZGVwYXJ0Q29kZSI6IjEyX0wwMDQiLCJhbW91bnQiOiI0NzE1IiwiYmlsbFRpbWUiOiIyMDIy%0D%0AMDQxNTE1NDk0OSIsImVwaXNvZGUiOiJPMDAwMzk5TEQtMjAyMiIsIk9wZXJhdG9yIjoi5a6L5LiB%0D%0AIiwiT3BlcmF0b3JJZCI6IkFHMTUwIiwicGFja2FnZSI6IjAifQ%3D%3D&signinfo=A8O5ZsOlfX7CtjTChBYJw4Irw6jDoz8RX8Kpw7A%3D -->
<html lang="en" xmlns="http://www.w3.org/1999/html"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./确认账单政策_files/bootstrap.min.css">
<script src="./确认账单政策_files/jquery-1.11.3.min.js.下载"></script>
<script src="./确认账单政策_files/bootstrap.min.js.下载"></script>
<title>确认账单政策</title>
<style>
*{
margin: 0;
padding: 0;
}
body {
background-color: #F1F4F6;
font-size: 12px;
}
.continer{
width: 100%;
height:auto;
color: #333534;
}
.header {
width: 100%;
height: 58px;
line-height: 58px;
position: fixed;
min-width: 1200px;
top: 0;
margin: 0 auto;
background-color: #ffffff;
box-shadow: 0 0 14px rgba(0, 0, 0, 0.2);
z-index: 1;
}
.head-logo{
width: 70%;
margin: 0 auto;
}
.head-logo img{
width:140px;
height: 46px;
}
.title{
width: 100%;
margin: 0 auto;
font-size: 16px;
color: #343434;
}
.weaper{
width: 100%;
height:auto;
margin: 20px auto;
padding: 34px 24px;
background-color: #ffffff;
box-shadow: 0 0 10px #ccc;
border-radius: 5px;
position: relative;
}
.textCon{
margin-bottom: 30px;
}
.textCon li{
margin-right: 150px;
list-style-type: none;
display: inline-block;
color: #9A9A9A;
}
.textCards{
width: 100% !important;
margin-top: 15px;
margin-right: 0px !important;
}
.textCard{
width: 100% !important;
}
.textCard li{
min-width: 32% !important;
margin-right: 0px !important;
margin-top: 20px !important;
}
.textVouchers li{
min-width: 100% !important;
margin-right: 0px !important;
margin-top: 20px !important;
color: #343434;
/*font-weight: 700;*/
}
.textEm{
color: #343434 !important;
font-weight: 700 !important;
}
.textWeak{
color: #9A9A9A; !important;
}
.textNum{
margin-bottom: 52px;
}
.textNum .costPrice{
color: #343434;
font-size: 16px;
font-weight:600;
}
.textNum img{
width: 12px;
height:14px;
margin-right: 5px;
margin-top: -3px;
}
.viewCard{
color: #00A4ED;
border-bottom: 1px solid #00A4ED;
cursor: pointer;
/*margin-left: 40px;*/
padding-bottom: 5px;
}
.conLr{
display: inline-block;
position: relative;
}
.conLr .leftTab div{
width: 185px;
height: 36px;
line-height: 36px;
border: 1px solid #00A6EE;
border-radius: 5px;
color: #00A5EE;
font-size: 12px;
text-align: center;
margin-bottom: 40px;
cursor: pointer;
margin-right: 118px;
position: relative;
}
.conLr .leftTab img{
width: 49px;
height: 21px;
position: absolute;
right: -47px;
top: -21px;
display: block !important;
}
.topActiveParent{
background-color: #00A6EE;
color: #ffffff !important;
}
.conLr .leftTab{
position: relative;
display: flex;
flex-wrap: wrap;
}
.leftTab div .rightTab{
position: absolute;
top: 40px;
left: -25px;
}
.conLr .rightTab {
width: 505px !important;
height: auto !important;
background-color: #FFFFFF;
padding: 37px 28px !important;
border-radius: 10px;
box-shadow: 0 0 10px #84BBFF;
margin-left: 25px;
display: none;
z-index: 1;
}
.conLr .rightTab li{
list-style-type: none;
line-height: 30px;
color: #9A9A9A;
text-align: left;
}
.conLr .rightTab li span{
color: #333534;
}
.textRight{
float: right;
}
.conLr .rightTab .rightTextOne{
color: #333534;
text-align: right;
margin-top: 30px;
}
.conLr .rightTab .rightText{
color: #333534;
text-align: right;
margin-top: 15px;
}
.conLr .rightTab li .actualPayment{
color: red;
font-weight: 600;
font-size: 14px;
}
.billInside{
width: 80%;
height:auto;
background-color: #ffffff;
border-radius: 4px;
border-left: 3px solid #84BBFF;
box-shadow: 0 0 10px #ccc;
margin-bottom: 20px;
padding: 19px;
}
.billInside ul{
margin-bottom: 20px;
}
.textName{
color: #9A9A9A;
}
.textValue{
color: #343434;
display: inline-block;
/*font-weight: 400 !important;*/
}
.billInside li{
display: inline-block;
list-style-type: none;
}
.billInside li:nth-child(1){
width: 45%;
}
.billInside li:nth-child(2){
width: 20%;
}
.billInside li:nth-child(3){
width: 30%;
}
.footer{
width: 100%;
height: 38px;
line-height: 38px;
text-align: center;
background: #EDEDED;
box-shadow: 0 -2px 13px 0 rgba(14, 3, 4, 0.14);
position: fixed;
bottom: 0;
}
.footer span{
font-size: 12px;
color: #666666;
}
.footer span:nth-child(1){
margin-right: 31px;
}
/*弹框*/
.modal-header{
color: #FFFFFF;
font-size: 12px;
background-color: #00A6EE;
padding: 10px 17px;
}
.modal-dialog{
margin: 230px auto;
}
.close{
color: #FFFFFF;
opacity: 1;
}
.subBtnClass{
width:92px;
height: 34px;
line-height: 34px;
text-align: center;
/*background: url("../img/btnBg.png") 100% 100% no-repeat;*/
background-color: #00A5EE;
border:1px solid #2FD3ED;
color: #ffffff;
font-size: 14px;
border-radius: 7px;
position: fixed;
right: 17.5%;
bottom: 16.5%;
}
.after_total{
margin-left: 40px;
}
#patient_total{
color: red;
}
.package_pay{
position: absolute;
margin-left: 10px;
color: #999999;
}
.package_pay_data{
color: #0f0f0f;
}
.mask {
position: absolute; top: 0px; background-color: rgba(119,119,119,.5);
z-index: 9999; left: 0px;
opacity:0.5;
width: 100vw;
height: 100vh;
}
.mask img{
width: 100px;
margin: 15% 0 0 48%;
}
.li_button {
width: 185px;
height: 36px;
line-height: 36px;
border: 1px solid #00A6EE;
background: #00A6EE;
border-radius: 5px;
font-size: 12px;
color: #FFFFFF !important;
text-align: center;
margin-bottom: 40px;
cursor: pointer;
margin-right: 118px;
position: relative;
}
.formGroupSpan{
position: relative;
width: 418px;
}
.formGroupSpan >span:nth-child(2),.formGroupSpan >span:nth-child(3){
margin-left: 25px;
}
.formGroupSpan >span:last-child{
position: absolute;
right: 20px;
top: 0;
color: #00A6EE;
}
.radio label span{
vertical-align: sub;
}
#subModel .modal-footer{
padding: 15px;
text-align: right;
}
#subModel2 .modal-footer{
padding: 15px;
text-align: right;
}
.delcolse{
position: absolute;
top: 12px;
right: 12px;
z-index: 9;
font-size: 15px;
cursor: pointer;
}
.options_style {
float: left;
width: auto;
line-height: 25px;
padding-top: 6px;
margin-left: 15px;
}
.options_style dt {
float: left;
width: 90px;
height: 25px;
line-height: 25px;
margin-bottom: 18px;
margin-left: 6px;
}
.options_style dd {
float: left;
width: 200px;
height: 25px;
line-height: 25px;
position: relative;
min-height: 25px;
margin-right: 12px;
margin-bottom: 18px;
}
.options_style dd .text {
width: 160px;
height: 23px;
line-height: 23px;
padding: 0 5px;
border: 1px solid #dedede;
border-radius: 3px;
}
.options_style dd .text:focus {
border-color: #05a7ef;
}
.options_style dd .select {
width: 170px;
height: 23px;
padding: 1px;
border: 1px solid #dedede;
border-radius: 3px;
}
.options_style dd .select:hover {
border-color: #05a7ef;
}
.options_style dd .must {
font-size: 14px;
color: #ff0000;
vertical-align: middle;
}
.btn_1 {
height: 35px;
line-height: 28px;
text-align: center;
color: #05a7ef;
min-width: 80px;
padding: 0 10px;
/**background-color: #ffffff;*/
border: 1px solid #00a6ed;
border-radius: 6px;
display: inline-block;
}
.btn_1:hover {
color: #fff;
background-color: #05a7ef;
}
.btn_1_no {
height: 35px;
line-height: 28px;
text-align: center;
color: #aaaaaa;
min-width: 80px;
padding: 0 10px;
/*background-color: #d2d2d2;*/
border: 1px solid #aaaaaa;
border-radius: 6px;
display: inline-block;
}
.btn_1_no:hover {
color: #aaaaaa;
/*background: url(../images/btn_bg.jpg) repeat-x left top;*/
}
</style>
</head>
<body>
<div id="mask" class="mask" style="display:none;">
<img src="./确认账单政策_files/wait.gif">
</div>
<div class="continer">
<div class="header">
<div class="head-logo">
<img src="./确认账单政策_files/logo.png" alt="">
</div>
</div>
<div style="width: 70%;margin: 78px auto;">
<div class="title">
确认账单政策
</div>
<input id="recommend_param" type="hidden" value="eyJzaWduYXR1cmVUaW1lIjoiMjAyMjA0MTUxNTQ5NTYiLCJub25jZSI6IjgzODgwOCIsInBhdGll
bnRJZCI6IjExOTE5MiIsImVtcGlJZCI6IjExOTE5MiIsImhvc3BpdGFsSWQiOiJBTUNBUkVCSkxE
IiwiZGVwYXJ0Q29kZSI6IjEyX0wwMDQiLCJhbW91bnQiOiI0NzE1IiwiYmlsbFRpbWUiOiIyMDIy
MDQxNTE1NDk0OSIsImVwaXNvZGUiOiJPMDAwMzk5TEQtMjAyMiIsIk9wZXJhdG9yIjoi5a6L5LiB
IiwiT3BlcmF0b3JJZCI6IkFHMTUwIiwicGFja2FnZSI6IjAifQ==">
<input id="recommend_signinfo" type="hidden" value="A8O5ZsOlfX7CtjTChBYJw4Irw6jDoz8RX8Kpw7A=">
<input id="patientId" type="hidden" value="1700100001">
<input id="episode" type="hidden" value="">
<input id="policy_code" type="hidden" value="">
<input id="plan_code" type="hidden" value="">
<input id="hospitalCode" type="hidden" value="">
<input id="operatorId" type="hidden" value="">
<input id="operator" type="hidden" value="">
<input id="recordId" type="hidden" value="">
<input id="to_pay_param" type="hidden" value="">
<input id="to_pay_signinfo" type="hidden" value="">
<input id="billRowId" type="hidden" value="">
<input id="pkgDiscount" type="hidden" value="">
<style type="text/css">
.meal{
}
#pkgInner li{
margin-top: -20px !important;
}
#pkgInner li span a{
color: #00A5EE !important;
}
.textCardsNew p:nth-child(1){
color: #0B74FF !important;
font-size: 16px;
margin-right: 5px;
font-weight: 600 !important;
}
.textCardsNew p:nth-child(2){
color: #0B74FF !important;
font-size: 14px !important;
margin-right: 5px;
font-weight: 600 !important;
}
.textCardsNew{
color: #000 !important;
}
.textCardsNew p{
display: inline-block !important;
color: #0B74FF !important;
}
#pkgOut{
box-shadow: 0 0 6px #F2F2F2;
border-top-left-radius: 1px;
border-bottom-left-radius: 1px;
border-left: 3px #84BBFF solid;
padding:19px 31px 9px 31px;
}
#pkgOut li{
color: #333333 !important;
margin-top: 0px !important;
margin-bottom: 10px;
min-width: 100% !important;
display: flex;
}
#pkgOut li>div{
cursor: pointer;
min-width: 25% !important;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#pkgOut li>div p{
display: inline-block;
color: #999999;
}
</style>
<div class="weaper">
<ul class="textCon">
<li>
客人信息:<span id="user_info" class="textValue">1700100001 这是测试用户</span>
<img src="./确认账单政策_files/shezhi01.png" id="quickSet" style="margin-left: 26px; cursor:pointer;" title="快捷设置">
</li>
<li>就诊科室:<span id="bill_num" class="textValue">O000399LD-2022</span></li>
<li style="width: 100%;">
<div style="display: inline-block;color: #00A5EE;font-size: 14px;margin-top: 24px;">本次使用套餐</div>
<div style="display: inline-block;margin-left: 7px;color: #00A5EE;text-decoration: underline;width: 76%;line-height: 19px;position: relative;/* background: beige; *//* border-bottom: 1px solid yellow; */padding-bottom: -17px;">Package
<p style="width: 100%;height: 1px; margin-top: -4px; background-image: linear-gradient(to right, rgba(205,205,207,1), rgba(255,0,0,0));"></p>
</div>
</li>
<li class="textCards">
<ul class="textCard" id="pkgInner"><li><span class="textValue">2021产前检查(常规型单胎)【孕周12周】_基础 <a href="javascript:void(0);" >详情 ></a></span></li></ul>
</li>
<li style="width: 100%;">
<div style="display: inline-block;color: #00A5EE;font-size: 14px;margin-top: 24px;">本次账单</div>
<div style="display: inline-block;margin-left: 7px;color: #00A5EE;text-decoration: underline;width: 76%;line-height: 19px;position: relative;/* background: beige; *//* border-bottom: 1px solid yellow; */padding-bottom: -17px;">Bill
<p style="width: 100%;height: 1px; margin-top: -4px; background-image: linear-gradient(to right, rgba(205,205,207,1), rgba(255,0,0,0));"></p>
</div>
</li>
<li class="textCards textCardsNew">
<p>¥</p>账单原价:<p id="totalAmount">4715.0</p>元
</li>
<li class="textCards">
<ul class="textCard" id="pkgOut">
<li>
<div title="妇科液基薄层细胞学检查与诊断">
妇科液基薄层细胞学检查与诊断
</div>
<div>
<p>单价:</p><span>352.6</span>
</div>
<div>
<p>数量</p><span>1</span>
</div>
<div>
<p>总计:</p><span>352.6</span>
</div>
</li>
<li>
<div>
妇科液基薄层细胞学检查与诊断
</div>
<div>
<p>单价:</p><span>352.6</span>
</div>
<div>
<p>数量</p><span>1</span>
</div>
<div>
<p>总计:</p><span>352.6</span>
</div>
</li>
</ul>
<div class="textNum">
<img src="./确认账单政策_files/money.png" alt="">
折前总计 <span id="amount_total" class="costPrice"></span> 元
<span class="after_total">折后总计 <span id="patient_total" class="costPrice">0.0</span> 元 </span>
</div>
<div class="conLr">
<div id="policy_list" class="leftTab">
</div>
</div>
<div id="bill_list" class="billInside">
<div style="margin-bottom: 15px;font-size: 14px;color: #343434;">
套内账单
<span class="package_pay">待支付: <span class="package_pay_data">0.0 元</span></span>
</div>
</div>
<div class="billInside">
<div style="display: flex;">
<div style="width: 25%;font-size: 14px;color: #343434;">
套外账单
<span class="package_pay">折后总计: <span class="package_pay_data" id="nopackage_pay"></span></span>
</div>
<div id="no_package" style="width: 75%;padding-top: 35px">
</div>
</div>
</div>
<button type="button" class="subBtnClass" id="subBtn">提交</button>
</div>
</div>
<div class="footer">
<span>j京IPC备09100222号 京威网审[2011]第0130号(京)医广【2016】第07-20--383号</span>
<span>电话:400-10000-16 E-mail;contact@amcare.com.cn 地址:朝阳区安慧北里逸园5号楼</span>
</div>
</div>
<!-- 模态框(Modal) -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content" style="width: 675px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
查看代金券
</div>
<div class="modal-body">
<table id="card_table" class="table table-striped table-bordered">
<tbody><tr>
<th>券名称</th>
<th>状态</th>
<th>操作</th>
</tr>
</tbody></table>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<script src="./确认账单政策_files/jquery-1.11.3.min.js.下载"></script>
<script src="./确认账单政策_files/bootstrap.min.js.下载"></script>
<script>
var trakcarePackageBills;
var trakcareNoPackageBills;
$(function(){
//阻止事件冒泡,
function stopPropagation(e) {
var ev = e || window.event;
if (ev.stopPropagation) {
ev.stopPropagation();
} else if (window.event) {
window.event.cancelBubble = true;//兼容IE
}
}
var pricePolicy =function(){};
//点击隐藏弹出的详情元素
// $(document).bind('click',function(){
// $('.rightTab').css('display','none');
// });
pricePolicy.prototype.allDoc = function(){
$('.rightTab').css('display','none');
};
// 修改tab标签样式
pricePolicy.prototype.policyInfo =function (e) {
var $this = $(this);
if('rightTab' === $this.attr('class')){
return false;
}
// $('.rightTab').css('display','none');
$('.rightTab').hide();
$this.attr("class","topActiveParent");
$this.siblings().attr("class","");
// tab切换
var i = $this.index();
$('.rightTab').eq(i).show().siblings().hide();
stopPropagation(e);
var url= '/crm-api/trakcareBillCreate';
var policy = $this.data('policy');
var plan = $this.data('plan');
var episode = $('#episode').val();
var policyName = $this.data('name');
var operatorId = $('#operatorId').val();
// console.log('policy:'+policy+'---plan:'+plan+'---episode:'+episode);
$('#policy_code').val(policy);
$('#plan_code').val(plan);
$.ajax({
headers: {
channel: 'self'
},
type:'GET', // 规定请求的类型(GET 或 POST)
url:url, // 请求的url地址
async: false,
dataType:'json', //预期的服务器响应的数据类型
data: {episode:episode,policy:policy,plan:plan,operatorId:operatorId, policyName:policyName},
success: function(result){ // 当请求成功时运行的函数
// console.log(result);
var code = result.code;
if(code == 0){
var bills = result.data.Bills;
var bill = bills[0];
var items = $this.children(".rightTab");
$('#patient_total').text(bill.AmountToPay);
$('#amount_total').text(bill.AmountTotal);
var policyContent = '<ul>' +
'<li>政策折扣:<span>'+ policyName+'</span><span class="textRight">-'+bill.Difference+'</span></li>' +
//'<li class="rightTextOne">折扣率:<span>'+bill.PlanDiscount+'</span></li>' +
'<li class="rightTextOne">总共优惠:<span>'+bill.Difference+'</span></li>' +
'<li class="rightText">实付款:<span class="actualPayment">'+bill.PatientTotal+'</span>元</li>' +
'</ul>';
items.html(policyContent);
}else{
alert(result.msg);
}
},
error:function(obj){ //失败的函数
}
});
pricePolicy.prototype.flushTrakcareBills();
};
pricePolicy.prototype.reload =function(){
var url= '/crm-api/pay/toPayDetail';
var param =$('#recommend_param').val();
var signinfo=$('#recommend_signinfo').val();
$.ajax({
headers: {
channel: 'self'
},
type:'POST', // 规定请求的类型(GET 或 POST)
url:url, // 请求的url地址
dataType:'json', //预期的服务器响应的数据类型
async: false,
data: {param:param,signinfo:signinfo},
success: function(result){ // 当请求成功时运行的函数
if(result.code ==0){
var memberInfo = result.data.memberInfo;
var record = result.data.record;
var episode = result.data.episode;
var amount = result.data.amount;
trakcarePackageBills = result.data.trakcarePackageBills;
trakcareNoPackageBills = result.data.trakcareNoPackageBills;
var allCards = result.data.allCards;
var bestPricingPolicyList = result.data.bestPricingPolicyList;
var operatorId = result.data.operatorId;
var operator = result.data.operator;
var hospitalCode = result.data.hospitalCode;
$('#user_info').text(memberInfo.patientId+" "+memberInfo.name);
$('#patientId').val(memberInfo.patientId);
$('#bill_num').text(episode);
$('#totalAmount').text(amount);
//套内账单展示
if(trakcarePackageBills != ''){
var pkgBills = trakcarePackageBills.Bills;
if(pkgBills != '' && pkgBills.length > 0){
var pkgInnerHtml = '';
for(var i = 0; i < pkgBills.length; i++){
pkgInnerHtml += '<li><span class="textValue">' + pkgBills[i].PackageDesc + ' <a href="javascript:void(0);">详情 》</a></span></li>'
}
$("#pkgInner").html(pkgInnerHtml);
}
}
//套外账单展示
if(trakcareNoPackageBills != '' && trakcareNoPackageBills.Bills != ''){
var pkgOutBill = trakcareNoPackageBills.Bills[0];
if(pkgOutBill != ''){
var pkgItems = pkgOutBill.OrdItems;
if(pkgItems != ''){
var pkgOutHtml = '';
for(var i = 0; i < pkgItems.length; i++){
pkgOutHtml += '<li><span>' + pkgItems[i].ItmDesc + '</span><p>单价:</p><span>' + pkgItems[i].UnitPrice + '</span><p>数量</p><span>' + pkgItems[i].Quantity + '</span><p>总计:</p><span>' + pkgItems[i].LineTotal + '</span></li>';
}
$("#pkgOut").html(pkgOutHtml);
}
}
}
}else{
alert(result.msg);
}
},
error:function(obj){ //失败的函数
}
});
};
pricePolicy.prototype.toPay =function(){
//var useDiscount = $('#pkgDiscount').val();
//var hasPkg = $("#pkgInnerDiv").length > 0; // 是否包含套内支付
var payMode = $('input[name="payMode"]:checked').val();
if(payMode == 'cancel'){
$("#subModel").modal('hide');
} /*else if (hasPkg && payMode != 'pkgOut' && useDiscount == ''){
$("#subModel").modal('hide');
$("#subModel2").modal('show');
}*/ else if(payMode != undefined){
var param = $('#to_pay_param').val();
var signinfo =$('#to_pay_signinfo').val();
var policy =$('#policy_code').val();
var recordId =$('#recordId').val();
var billRowId = $("#billRowId").val();
$.ajax({
headers: {
channel: 'self'
},
type:'post',
url:'/crm-api/policySubmitRecord',
// async: false,
dataType:'json',
data: {recordId:recordId,payMode:payMode},
success:function (data) {
if (data.code == -1) {
console.log(data.msg);
}
},
error:function (data) {
console.log("policy submit record error!");
}
});
if(param !='' && signinfo !='' ){
var url ='/crm-ws/intelligentPay/default?param='+param+'&signinfo='+signinfo;
if(policy != ''){
url += '&policy='+policy;
}
if(recordId != ''){
url += '&record='+recordId;
}
if(payMode != undefined){
url += '&payMode=' + payMode;
}
if(billRowId != undefined){
url += '&billRowId=' + billRowId;
}
//url += '&usePkgDiscount=' + useDiscount;
window.location.href = url;
}
$("#subModel").modal('hide');
}
};
pricePolicy.prototype.flushTrakcareBills = function(){
var url = '/crm-api/flushTrakcareBills';
var episode = $('#episode').val();
var billRowId = $("#billRowId").val();
$.ajax({
headers: {
channel: 'self'
},
type:'GET', // 规定请求的类型(GET 或 POST)
url:url, // 请求的url地址
async: false,
dataType:'json', //预期的服务器响应的数据类型
data: {episode:episode, billRowId: billRowId},
success: function(result){ // 当请求成功时运行的函数
// console.log(result);
var trakcarePackageBills = result.data.trakcarePackageBills;
var trakcareNoPackageBills = result.data.trakcareNoPackageBills;
if( null != trakcarePackageBills && null != trakcarePackageBills.Bills && trakcarePackageBills.Bills.length > 0){
$('.package_info').remove();
trakcarePackageBills.Bills.forEach(function (element) {
var packCon ='<div class="package_info" style="display: flex;">' +
' <div style="width: 25%;">' +
' <span class="textName">套餐名称:</span>' +
' <span class="textValue">'+element.PackageDesc+'</span>' +
' </div>' +
' <div style="width: 75%;">';
var orderItems = element.OrdItems;
if(null != orderItems && orderItems.length > 0){
orderItems.forEach(function (item){
// console.log(item);
packCon +='<ul>' +
'<li>' +
'<span class="textName">详情:</span><span class="textValue">'+item.ItmDesc+'</span>' +
'</li>' +
'<li>' +
'<span class="textName">数量:</span><span class="textValue">'+item.Quantity+'</span>' +
'</li>' +
// '<li>' +
// '<span class="textName">折扣前价格:</span><span class="textValue">'+item.NetAmount+'</span>' +
// '</li>' +
// '<li>' +
// '<span class="textName">折扣后价格:</span><span class="textValue">'+item.PatientShare+'</span>' +
// '</li>' +
'</ul>';
});
}
packCon +='</div></div>';
$('#bill_list').append(packCon);
});
};
if( null != trakcareNoPackageBills && null != trakcareNoPackageBills.Bills && trakcareNoPackageBills.Bills.length > 0) {
$('#no_package').html('');
var bill = trakcareNoPackageBills.Bills[trakcareNoPackageBills.Bills.length-1];
$('#nopackage_pay').text(bill.AmountToPay+' 元');
trakcareNoPackageBills.Bills.forEach(function (element) {
$("#billRowId").val(element.BillRowId);
var orderItems = element.OrdItems;
if(null != orderItems && orderItems.length > 0) {
orderItems.forEach(function (item) {
var line = '<ul>' +
'<li><span class="textName">详情:</span><span class="textValue">' + item.ItmDesc + '</span></li>' +
'<li><span class="textName">数量:</span><span class="textValue">' + item.Quantity + '</span></li>' +
'<li><span class="textName">折扣前价格:</span><span class="textValue">' + item.NetAmount + '</span>' +
'<li><span class="textName">折扣后价格:</span><span class="textValue">' + item.PatientShare + '</span>' +
'</li>' +
'' +
'</ul>';
$('#no_package').append(line);
});
}
});
};
},
error:function(obj){ //失败的函数
}
});
};
$(document).on('click','.conLr .leftTab div', pricePolicy.prototype.policyInfo)
.on('click','#confirmBtn', pricePolicy.prototype.toPay)
.on('click', pricePolicy.prototype.allDoc);
pricePolicy.prototype.reload();
$('#usePkgDiscount').on('click', function () {
$('#pkgDiscount').val('1');
pricePolicy.prototype.toPay();
});
$('#notUsePkgDiscount').on('click', function () {
$('#pkgDiscount').val('0');
pricePolicy.prototype.toPay();
});
//个人信息设置弹出框
$('#quickSetModel').on('show.bs.modal', function () {
var url= '/crm-api/quickSetDetail';
var patientId = $('#patientId').val();
$.ajax({
headers: {
channel: 'self'
},
type:'POST', // 规定请求的类型(GET 或 POST)
url:url, // 请求的url地址
dataType:'json', //预期的服务器响应的数据类型
async: false,
data: {patientId:patientId},
success: function(result){ // 当请求成功时运行的函数
if(result.code ==0){
var member = result.data.member;
var ofFamily = result.data.ofFamily;
if(member){
$("#employeeFlag").val(member.employeeFlag);
$("#memberId").val(member.id);
}
var parentOfFamily = result.data.parentOfFamily;
var parentMember = result.data.parentMember;
if(parentOfFamily){
var html = '<span>户主:' + parentMember.name + '</span><span>就诊ID:' + (parentMember.patientId ? parentMember.patientId : "") + '</span><span>家庭角色:' + ofFamily.familyRole
+ '<input type="hidden" name="familyId" id="familyId" value="' + parentOfFamily.familyId + '"/>'
+ '<input type="hidden" name="parentMemberId" id="parentMemberId" value="' + parentMember.id + '"/>'
+ '</span><span style="cursor:pointer" onclick="del();">删除</span>';
$("#familyInfo").html(html);
$('#familyButton').hide();
}
}else{
alert(result.msg);
}
},
error:function(obj){ //失败的函数
}
});
});
//个人设置保存按钮
$("#quickSetSubmit").on("click", function(){
$("#mask").show();
var memberId = $("#memberId").val();
var employeeFlag = $("#employeeFlag").val();
var familyId = $("#familyId").val();
var familyRole = $("#relationRole").val();
var parentMemberId = $("#parentMemberId").val();
$.ajax({
headers: {
channel: 'self'
},
type:'POST', // 规定请求的类型(GET 或 POST)
url:"/crm-api/quickSetSave", // 请求的url地址
dataType:'json', //预期的服务器响应的数据类型
async: true,
data: {memberId:memberId, employeeFlag:employeeFlag, familyId:familyId, familyRole:familyRole, parentMemberId:parentMemberId},
success: function(result){ // 当请求成功时运行的函数
if(result.code ==0){
$("#quickSetModel").modal('hide');
}else{
alert(result.msg);
}
$("#mask").hide();
window.location.reload();
},
error:function(obj){ //失败的函数
}
});
});
//初始化个人信息设置模态框
$("#quickSet").on('click', function(){
$("#quickSetModel").modal('show');
});
//初始化个人信息设置模态框
$("#familyJoin").on('click', function(){
$("#familyJoinModel").modal({remote:"/crm-api/html/pay/toMemberList"});
});
$("#subBtn").on('click', function(){
// $("input[name='payMode']").each(function(){
// $(this).prop('checked', '');
// });
$("#allRadio").prop('checked', 'checked');
$("#subModel").modal('show');
});
//提交按钮事件绑定
$("#subBtn").on('click', function(){
$("#subModel").modal('show');
});
$("#colse").on('click', function(){
$("#subModel").modal('hide');
})
$("#colse2").on('click', function(){
$("#subModel2").modal('hide');
$("#subModel").modal('show');
})
$("#pv_productCode").change(function () {
var p = $("#pv_productCode").val();
var btn_el = $("#write_off_btn");
if (p == "") {
//隐藏
btn_el.removeClass("btn_1");
btn_el.addClass("btn_1_no");
btn_el.attr("onclick", "");
} else {
//显示
btn_el.removeClass("btn_1_no");
btn_el.addClass("btn_1");
btn_el.attr("onclick", "writeOff();");
}
})
});
function del(){
$("#familyInfo").html('');
$('#familyButton').show();
};
function toWriteOff(id){
var btn_el = $("#write_off_btn");
btn_el.removeClass("btn_1");
btn_el.addClass("btn_1_no");
btn_el.attr("onclick", "");
$.ajax({
url:"/crm-api/toWriteOff",
headers: {
channel: 'self'
},
type:'post',
data:{id:id},
dataType:'json',
success:function (rst) {
var memberProduct = rst.data.memberProduct;
var pkgItemList = rst.data.familyProduct.pkgItemList;
$("#pv_memberName").val(memberProduct.useMemberName);
$("#pv_productName").val(memberProduct.productName);
$("#pv_accrualAmount").val(memberProduct.accrualAmount);
$("#pv_activeTime").val(memberProduct.activeTime);
$("#pv_id").val(memberProduct.id);
$("#pv_memberPackageId").val(memberProduct.memberPackageId);
$("#pv_memberId").val(memberProduct.useMemberId);
var selLine = '<option id="" value="">---请选择---</option>';
pkgItemList.forEach(function (element) {
var itemCode = element.code;
var itemName = element.name;
selLine += '<option id="" value="'+itemCode+'">'+itemName+'</option>';
});
$("#pv_productCode").html(selLine);
},
error:function (rst) {
console.log("获取核销信息失败");
}
});
$("#writeOffModel").modal('show');
};
function writeOff(){
$("#write_off_btn").attr("onclick", "");
$("#write_off_btn").html("处理中...");
var useMemberName = $("#pv_memberName").val();
var id = $("#pv_id").val();
var memberPackageId = $("#pv_memberPackageId").val();
var useMemberId = $("#pv_memberId").val();
var productCode = $("#pv_productCode").val();
var operatorId = $("#operatorId").val();
var hospitalCode = $("#hospitalCode").val();
$.ajax({
url:"/crm-api/writeOff",
headers: {
channel: 'self'
},
type:'post',
data:{
id:id,
useMemberId:useMemberId,
useMemberName:useMemberName,
memberPackageId:memberPackageId,
productCode:productCode,
operatorId:operatorId,
hospitalCode:hospitalCode
},
dataType:'json',
success:function (rst) {
var code = rst.data.status;
if (code == 0) {
alert("核销成功");
window.setTimeout(function(){
window.location.reload();
}, 3000);
} else {
alert(rst.msg);
console.log(rst.msg);
window.setTimeout(function(){
window.location.reload();
}, 3000);
}
},
error:function (rst) {
alert("核销失败");
console.log("核销失败");
window.setTimeout(function(){
window.location.reload();
}, 3000);
}
});
};
</script>
<!-- 模态框个人信息设置 -->
<div class="modal fade" id="quickSetModel" tabindex="-1" role="dialog" aria-labelledby="quickSetLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content" style="width: 450px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
个人信息设置
</div>
<div class="modal-body" id="quickSetBody" style="height: 150px;">
<div class="form-group">
<input type="hidden" name="memberId" id="memberId">
<label for="name">是否本院员工或员工家属:</label>
<select name="employeeFlag" id="employeeFlag">
<option value="Y">是</option>
<option value="N">否</option>
</select>
</div>
<div class="form-group">
<label for="name">家庭信息设置:</label>
</div>
<div class="form-group" id="familyButton">
<label style="cursor: pointer; color: #00A4ED" id="familyJoin">+加入家庭</label>
</div>
<div class="form-group formGroupSpan" id="familyInfo">
</div>
</div><div class="modal-footer" style="height: 50px">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-default" id="quickSetSubmit">提交</button>
</div><table class="table table-striped table-bordered">
</table>
</div>
</div>
</div>
<!-- 模态框客户列表 -->
<div class="modal fade" id="familyJoinModel" tabindex="-1" role="dialog" aria-labelledby="familyJoinLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content" style="width: 650px; height: 425px;">
</div>
</div>
</div>
<!-- 客户代金券框 -->
<div class="modal fade" id="writeOffModel" tabindex="-1" role="dialog" aria-labelledby="writeOffLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content" style="width: 650px; height: 270px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<h5 class="modal-title" id="">核销选项</h5>
</div>
<dl class="options_style">
<dt>客人姓名:</dt>
<dd><input name="useMemberName" id="pv_memberName" value="" readonly="readonly" class="text easyui-validatebox textbox" type="text"></dd>
<dt>券名称:</dt>
<dd><input name="" id="pv_productName" value="" readonly="readonly" class="text easyui-validatebox textbox" type="text"></dd>
<dt>券价格:</dt>
<dd><input name="" id="pv_accrualAmount" value="" readonly="readonly" class="text easyui-validatebox textbox" type="text"></dd>
<dt>售卖日期:</dt>
<dd><input name="" id="pv_activeTime" value="0" readonly="readonly" class="text easyui-validatebox textbox" type="text"></dd>
<dt>兑换套餐:</dt>
<dd>
<select class="select" id="pv_productCode" name="productCode" data-options="required:true" style="width: 468px">
</select>
</dd>
<input type="hidden" name="id" id="pv_id" value="">
<input type="hidden" name="memberPackageId" id="pv_memberPackageId" value="">
<input type="hidden" name="useMemberId" id="pv_memberId" value="">
</dl>
<div class="modal-footer" style="height: 50px; text-align: center">
<button type="button" class="btn btn-default btn_1_no" id="write_off_btn">核销</button>
</div>
</div>
</div>
</div>
<!--确认套内剩余金额抹零弹出框 -->
<div class="modal fade" id="subModel2" tabindex="-1" role="dialog" aria-labelledby="subModelLabel" aria-hidden="true">
<div class="modal-dialog" style="width: 280px !important;">
<div class="modal-content" style="width: 280px; position: relative;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" id="colse2">×</button>
<h4 class="modal-title" id="subModel2">提示</h4>
</div>
<div class="modal-body" id="quickSetBody" style="height: 100px;">
套餐余额不足,请确认是否对多余账单金额进行打折处理?
</div><div class="modal-footer" style="height: 50px">
<button type="button" class="btn btn-default" id="usePkgDiscount" style="background: #00A5EE; color:#ffffff; margin:0 auto;">是</button>
<button type="button" class="btn btn-default" id="notUsePkgDiscount" style="background: #00A5EE; color:#ffffff; margin:0 auto;">否</button>
</div><table class="table table-striped table-bordered">
</table>
</div>
</div>
</div>
<!-- 提交弹出框 -->
<div class="modal fade" id="subModel" tabindex="-1" role="dialog" aria-labelledby="subModelLabel" aria-hidden="true">
<div class="modal-dialog" style="width: 280px !important;">
<div class="modal-content" style="width: 280px; position: relative;">
<span class="delcolse" id="colse">X</span><div class="modal-body" id="quickSetBody" style="height: 150px;">
<div class="radio" id="allDiv">
<label>
<input type="radio" name="payMode" value="all" id="allRadio"><span>全部支付</span>
</label>
</div>
<div class="radio" id="pkgInnerDiv">
<label>
<input type="radio" name="payMode" value="pkgInner"><span>仅支付套内账单</span>
</label>
</div>
<div class="radio" id="pkgOutDiv">
<label>
<input type="radio" name="payMode" value="pkgOut"><span>仅支付套外账单</span>
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="payMode" value="cancel"><span>暂不提交支付</span>
</label>
</div>
</div><div class="modal-footer" style="height: 50px; border-top: 0">
<button type="button" class="btn btn-default " id="confirmBtn" style="background: #00A5EE; color:#ffffff; margin:0 auto; display: block">确认</button>
</div><table class="table table-striped table-bordered">
</table>
</div>
</div>
</div>
</body></html>
1111111111
原创
©著作权归作者所有:来自51CTO博客作者姚辉乾51CTO的原创作品,请联系作者获取转载授权,否则将追究法律责任

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
angularjs1-8,cacheFactory,sce
无标题文档 无标题文档 {{name}} 1111111111
html 数据共享 javascript json 自定义