123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- var Request = GetRequest();
- var checktype = false;
- var loading = dialog({
- contentType: 'load',
- skin: 'bk-popup',
- });
- (function() {
- new Vue({
- el: "#app",
- data: {
- data: {},
- dataList: [],
- length: 0,
- cardId:"",
- cardNo:"",
- code: "",
- cardlenght: 0,
- TypeList: [{}, {
- type: "jiuzhen",
- text: "门诊",
- pretext: "候诊"
- }, {
- type: "jiancha",
- text: "检查检验",
- pretext: "候检"
- }],
- },
- 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) {
- loading.close();
- 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]
- } else {
- vm.data = res.data.filter(function(item) {
- return item.isDefault == 1
- })[0]
- if(!vm.data) {
- vm.data = res.data[0]
- }
- }
- vm.cardId=vm.data.id
- vm.cardNo=vm.data.cardNo
- 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.getList()
- } else {
- dialog({
- content: "请先绑定就诊卡,再查看候诊信息!",
- okValue: '确定',
- ok: function() {
- window.location.href = '../../payment/html/patientIDCards.html';
- },
- // cancelValue: '我再看看',
- // cancel: function(){}
- }).showModal()
- }
- } else {
- loading.close();
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: '数据获取失败'
- }).show();
- }
- })
- },
- //获取列表数据
- getList: function() {
- var vm = this
- sendPost("patient/diag/it", {
- cardNo: vm.cardNo
- }, "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.dataList = res.data.data
- vm.length = vm.dataList.length
- } else {
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: res.data.message
- }).show();
- }
- } else {
- dialog({
- contentType: 'tipsbox',
- bottom: true,
- skin: 'bk-popup',
- content: '数据获取失败'
- }).show();
- }
- })
- },
- //跳转我的就诊卡页面
- gotoCards: function() {
- window.location.href = '../../payment/html/patientIDCards.html';
- },
- //跳转切换就诊卡
- changeCards: function() {
- window.location.href = '../../payment/html/changeCards.html?pre=waitingDoctorList';
- },
- //判断是否验证登录通过
- checkType: function() {
- var vm = this
- var timer = setInterval(function() {
- if(checktype) {
- clearInterval(timer);
- vm.getData()
- }
- }, 10);
- },
- },
- })
- })()
- function queryInit() {
- checktype = true
- }
|