123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388 |
- var Request = GetRequest();
- var checktype = false;
- var loading = dialog({
- contentType: 'load',
- skin: 'bk-popup',
- });
- var iscrollState = ''; //判断滑动方向
- (function() {
- var myVue = new Vue({
- el: "#app",
- data: {
- data: {},
- waitPayList: [],
- waitPayDetailList: [],
- waitPayTotal: "",
- paidList: [],
- paidDetailList: [],
- length: 1,
- cardlenght: 0,
- cardId: "",
- hisId: "",
- tabType: "1",
- code: "",
- tabTypeTxt: ["", "待缴费帐单", "已缴费帐单"],
- },
- mounted: function() {
- var vm = this
- checkUserAgent();
- vm.checkType()
- vm.code = JSON.parse(localStorage.getItem("wlyyAgent")).uid
- },
- methods: {
- //获取就诊卡
- getData: function() {
- var vm = this
- loading.showModal();
- 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
- })[0]
- if(!vm.data) {
- vm.data = res.data.filter(function(item) {
- return item.isDefault == 1
- })[0]
- }
- } else {
- vm.data = res.data.filter(function(item) {
- return item.isDefault == 1
- })[0]
- }
- if(!vm.data) {
- vm.data = res.data[0]
- }
- if(vm.data.type=="2"){
- vm.data.cardNo=vm.data.cardNo.substr(0,1)+"*******"+vm.data.cardNo.substr(vm.data.cardNo.length-4,4)
- }
- vm.cardId = vm.data.id
- vm.hisId = vm.data.hisId
- if(Request.tabType=="2"){
- vm.paid()
- }else{
- vm.getrepayList()
- }
- } else {
- dialog({
- content: "请先绑定就诊卡,再查看就诊缴费帐单!",
- okValue: '确定',
- ok: function() {
- if(Request.origin){
- if(Request.origin == "hesuanYuyue"){
- window.location.href = '../../hesuanYuyue/html/selPatient.html';
- }
- }else{
- window.location.href = '../../payment/html/patientIDCards.html';
- }
- },
- // cancelValue: '我再看看',
- // cancel: function(){}
- }).showModal()
- }
- } else {
- loading.close();
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: '数据获取失败'
- }).show();
- }
- })
- },
- //获取待缴费帐单
- getrepayList: function() {
- var vm = this
- vm.tabType = 1
- vm.waitPay()
- vm.waitPayDetail()
- },
- waitPay: function() {
- var vm = this
- sendPost("/third/hy/paySettle/waitPay", {
- hisId: this.hisId // "3c83266e-3fd4-4032-83f9-169d07145947"
- }, "json", "get", function() {
- loading.close();
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: '请求失败'
- }).show();
- }, function(res) {
- loading.close();
- if(res.status == 200) {
- if(res.data.code == 0) {
- vm.waitPayList = res.data.data
- vm.waitPayTotal = parseFloat(res.data.total).toFixed(2)
- vm.$nextTick(function() {
- vm.eventClick()
- })
- } else {
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: res.data.message || '数据查询失败'
- }).show();
- }
- } else {
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: res.msg || '数据查询失败'
- }).show();
- }
- })
- },
- waitPayDetail: function() {
- var vm = this
- sendPost("/third/hy/paySettle/waitPayDetail", {
- hisId: this.hisId
- }, "json", "get", function() {
- loading.close();
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: '请求失败'
- }).show();
- }, function(res) {
- loading.close();
- if(res.status == 200) {
- if(res.data.code == 0) {
- vm.waitPayDetailList = res.data.data
- } else {
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: res.data.message || '数据查询失败'
- }).show();
- }
- } else {
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: res.msg || '数据查询失败'
- }).show();
- }
- })
- },
- //获取已缴费帐单
- paid: function() {
- var vm = this
- vm.tabType = 2
- vm.getpaidList()
- // vm.getpaidDetailList()
- },
- getpaidList: function() {
- var vm = this
- sendPost("/third/hy/paySettle/paid", {
- hisId: vm.hisId
- }, "json", "get", function() {
- loading.close();
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: '请求失败'
- }).show();
- }, function(res) {
- loading.close();
- if(res.status == 200) {
- if(res.data.code == 0) {
- vm.paidList = _.each(res.data.data, function(item, index) {
- item.child = vm.getpaidDetailList(item.JsCode, item.JieSuanRiqi.replace(/-/g, ""), index)
- })
- vm.$nextTick(function() {
- vm.eventClick()
- })
- } else {
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: res.data.message || '数据查询失败'
- }).show();
- }
- } else {
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: res.msg || '数据查询失败'
- }).show();
- }
- })
- },
- //获取已缴费帐单
- getpaidDetailList: function(JsCode, JieSuanRiqi, index) {
- var vm = this
- var params = {
- hisId: vm.hisId,
- jsCode: JsCode,
- jsDate: JieSuanRiqi
- }
- sendPost("/third/hy/paySettle/paidDetail", params, "json", "get", function() {
- loading.close();
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: '请求失败'
- }).show();
- }, function(res) {
- loading.close();
- if(res.status == 200) {
- if(res.data.code == 0) {
- vm.paidList[index].child = res.data.data
- } else {
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: res.data.message || '数据查询失败'
- }).show();
- }
- } else {
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: res.msg || '数据查询失败'
- }).show();
- }
- })
- },
- //门诊结算
- preToPay: function() {
- var vm = this
- if(vm.hisId){
- dialog({
- content: "您的缴费金额为"+vm.waitPayTotal+"元,从就诊卡余额中扣除,是否继续?",
- okValue: '继续缴费',
- ok: function() {
- vm.toPay()
- },
- cancelValue: '再等一下',
- cancel: function() {}
- }).showModal()
- }else{
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: '医院码不存在'
- }).show();
- }
- },
- toPay: function() {
- var vm = this
- sendPost("/third/hy/paySettle/outpSettle", {
- hisId: vm.hisId
- }, "json", "get", function() {
- loading.close();
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: '请求失败'
- }).show();
- }, function(res) {
- loading.close();
- if(res.status == 200) {
- if(res.data.code == 0) {
- window.location.href = "../../payment/html/repaymentResult.html?patientName=" + vm.data.name + "&healthNo=" + vm.data.cardNo + "&payAmount=" + vm.waitPayTotal + "&createDate=" + getNowFormatDate() + "&cardId=" + vm.cardId + "&origin=" + Request.origin;
- } else {
- dialog({
- content:"您的就诊卡余额不足,请充值。充值后自动完成未结账单缴费~",
- okValue: '去充值',
- ok: function() {
- window.location.href = '../../payment/html/payment.html?id=' + vm.cardId + '&paytype=1&repayAmout=' + vm.waitPayTotal+'&origin='+Request.origin;
- },
- cancelValue: '再等一下',
- cancel: function() {}
- }).showModal()
- }
- } else {
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: res.msg || '数据查询失败'
- }).show();
- }
- })
- },
- //跳转切换就诊卡
- changeCards: function() {
- window.location.href = '../../payment/html/changeCards.html?pre=repayment&origin='+Request.origin;
- },
- //跳转我的就诊卡页面
- gotoCards: function() {
- window.location.href = '../../payment/html/patientIDCards.html';
- },
- eventClick: function() {
- $(".c-list-link").unbind("click")
- $(".c-list-link").click(function() {
- $(this).parent().siblings().toggle();
- if($(this).hasClass("list-arrow-u")) {
- $(this).addClass("list-arrow-d").removeClass("list-arrow-u");
- } else {
- $(this).addClass("list-arrow-u").removeClass("list-arrow-d");
- }
- })
- },
- //判断是否验证登录通过
- checkType: function() {
- var vm = this
- var timer = setInterval(function() {
- if(checktype) {
- clearInterval(timer);
- vm.getData()
- }
- }, 10);
- },
- },
- })
- })()
- function queryInit() {
- checktype = true
- }
- function getNowFormatDate() {
- var date = new Date();
- var seperator1 = "-";
- var year = date.getFullYear();
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if(month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if(strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- var hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
- var minute = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
- var second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
- var currentdate = year + seperator1 + month + seperator1 + strDate + " " + hour + ":" + minute + ":" + second;
- return currentdate;
- }
|