;(function ($) { $.support.cors = true var platform = 4 var agentName = 'userAgent' var isProduction = false // 是否是正式环境 var imgUrlDomain, server, serverWlyy, healthRecordServer healthRecordServer = 'http://ijk.xmsmjk.com/wlyy/profileweb/#/' //健康档案服务 healthRecordServer = 'https://ijk.xmsmjk.com/wlyytest/profileweb/#/' //健康档案服务wlyytest if (isProduction) { server = 'http://ijk.xmsmjk.com/wlyy' //正式环境 imgUrlDomain = 'http://ijk.xmsmjk.com/' //正式环境 serverWlyy = 'http://ijk.xmsmjk.com/wlyy' } else { server = 'https://ijk.xmsmjk.com/wlyytest' //测试 // server = "http://172.26.0.118:8081/wlyy/"; //ip // server = "http://192.168.131.243:8180"//培强 // server = "http://192.168.131.123:8180/wlyy_manager" // 文杰 // server = "http://192.168.131.144:8180/wlyy_manager" // 冬梅 // server = "http://192.168.131.112:8180/wlyy_manager" // 志南 serverWlyy = 'https://ijk.xmsmjk.com/wlyytest' //测试 // serverWlyy = "http://192.168.131.105:8080"//兴旺 // serverWlyy = "http://192.168.131.243:8180"//培强 // serverWlyy = "http://192.168.131.144:8080"//冬梅 // serverWlyy = "http://192.168.131.143:8080"//冬梅 imgUrlDomain = 'http://ijk.xmsmjk.com/' // 测试环境 // healthRecordServer="http://192.168.131.29:8080/#/" //泽华 } function httpGet(url, options) { //发送ajax请求 return new Promise(function (resolve, reject) { $.ajax( server + url, $.extend( {}, { type: 'GET', dataType: 'JSON', beforeSend: function (request) { var storage = window.localStorage.getItem('app_storage') if (storage) { storage = JSON.parse(storage) } if (storage) { loginDoctorCache = storage.api_login_doctor || {} let userAgentObj = { 'id': loginDoctorCache.id, 'uid': loginDoctorCache.uid, 'imei': storage.IMEI, 'token': loginDoctorCache.token, 'platform': platform } request.setRequestHeader(agentName, JSON.stringify(userAgentObj)) } // var userAgent = window.sessionStorage.getItem("LoginUser"); // if(userAgent) { // userAgent = JSON.parse(userAgent) // request.setRequestHeader(agentName, JSON.stringify({ // "id":userAgent.id,"uid":userAgent.code,"mobile":userAgent.mobile // })); // } }, error: function (res) { reject(res) }, success: function (res) { if (res.status && res.status == -200) { toastr && toastr.warning('登录失效,请重新登录!') setTimeout(function () { window.location.replace('login_v2.html') }, 2000) return } else { resolve(res) } } }, options ) ) }) } function httpPost(url, options) { //发送ajax请求 return new Promise(function (resolve, reject) { $.ajax( server + url, $.extend( {}, { type: 'POST', dataType: 'JSON', beforeSend: function (request) { var storage = window.localStorage.getItem('app_storage') if (storage) { storage = JSON.parse(storage) } if (storage) { loginDoctorCache = storage.api_login_doctor || {} let userAgentObj = { 'id': loginDoctorCache.id, 'uid': loginDoctorCache.uid, 'imei': storage.IMEI, 'token': loginDoctorCache.token, 'platform': platform } request.setRequestHeader(agentName, JSON.stringify(userAgentObj)) } // var userAgent = window.sessionStorage.getItem("LoginUser"); // if(userAgent) { // userAgent = JSON.parse(userAgent) // request.setRequestHeader(agentName, JSON.stringify({ // "id":userAgent.id,"uid":userAgent.code,"mobile":userAgent.mobile // })); // } }, error: function (res) { reject(res) }, success: function (res) { if (res.status && res.status == -200) { toastr && toastr.warning('登录失效,请重新登录!') setTimeout(function () { window.location.replace('login_v2.html') }, 2000) return } else { resolve(res) } } }, options ) ) }) } function httpGetWlyy(url, options) { //发送ajax请求 var newserver = serverWlyy ? serverWlyy : server return new Promise(function (resolve, reject) { $.ajax( newserver + url, $.extend( {}, { type: 'GET', dataType: 'JSON', beforeSend: function (request) { var userAgent = window.sessionStorage.getItem('LoginUser') if (userAgent) { userAgent = JSON.parse(userAgent) request.setRequestHeader( agentName, JSON.stringify({ 'id': userAgent.id, 'uid': userAgent.code, 'mobile': userAgent.mobile }) ) } }, error: function (res) { reject(res) }, success: function (res) { if (res.status && res.status == -200) { toastr && toastr.warning('登录失效,请重新登录!') setTimeout(function () { window.location.replace('login_v2.html') }, 2000) return } else { resolve(res) } } }, options ) ) }) } APIService = { server: server, serverWlyy: serverWlyy, imgUrlDomain: imgUrlDomain, agentName: agentName, httpGet: httpGet, httpPost: httpPost, httpGetWlyy: httpGetWlyy, healthRecordServer: healthRecordServer, login: function (data) { return httpPost('/customer/login', { data: data }) }, logout: function () { return httpGet('/customer/logout') }, findServerInfo: function (data) { return httpGet('/customer/findServerInfo', { data: data }) }, findByMobile: function (data) { return httpGet('/customer/findByMobile', { data: data }) }, // findByPatient: function(data) { // return httpGet('/customer/findByPatient',{data: data}) // }, findByPatient: function (data) { return httpPost('/doctor/patient_label_info/patient', { data: data }) }, captchaWithDoctor: function (doctorCode, data) { return httpPost('/doctor/captcha/withDoctorCode/' + doctorCode, { data: data }) }, sendMsgAndWx: function (data) { return httpPost('/customer/sendMsg', { data: data }) }, addCallRecord: function (data) { return httpPost('/customer/addCallRecord', { data: data }) }, updateCallRecordService: function (data) { return httpPost('/customer/updateCallRecordService', { data: data }) }, updateCallRecordEndTime: function (data) { return httpPost('/customer/updateCallRecordEndTime', { data: data }) }, getCallRecords: function (data) { return httpPost('/customer/getCallRecords', { data: data }) }, getCallServiceCode: function (data) { return httpPost('/customer/getCallServiceCode', { data: data }) }, saveCallService: function (data) { return httpPost('/customer/saveCallService', { data: data }) }, getCallRecordInfo: function (data) { return httpPost('/customer/getCallRecordInfo', { data: data }) }, getCallServices: function (data) { return httpPost('/customer/getCallServices', { data: data }) }, getCallServiceInfo: function (data) { return httpPost('/customer/getCallServiceInfo', { data: data }) }, updateCallService: function (data) { return httpPost('/customer/updateCallService', { data: data }) }, delCallService: function (data) { return httpPost('/customer/delCallService', { data: data }) }, getOrgList: function (data) { return httpPost('/doctor/guahao/GetOrgListToMysql', { data: data }) }, getOrgDeptList: function (data) { return httpPost('/doctor/guahao/GetOrgDepListToMysql', { data: data }) }, cancelOrder: function (data) { return httpPost('/doctor/guahao/CancelOrder', { data: data }) }, createOrderByDoctor: function (data) { return httpPost('/doctor/guahao/CreateOrderByDoctor', { data: data }) }, regDeptSpeDoctorList: function (data) { return httpPost('/doctor/guahao/GetDoctorList', { data: data }) }, createPicCaptcha: function (data) { return httpGet('/open/captcha/createPicCaptcha', { data: data }) }, // regDeptSpeDoctorList: function(data) { // return httpGet('/doctor/guahao/RegDeptSpeDoctorList', {data: data}) // }, getDoctorInfo: function (data) { return httpPost('/doctor/guahao/GetDoctorInfo', { data: data }) }, // getDoctorArrange: function(data) { // return httpGet('/doctor/guahao/GetDoctorArrange', {data: data}) // }, getDoctorArrange: function (data) { return httpPost('/doctor/guahao/smjk/RegDeptSpeDoctorSectionList', { data: data }) }, doPostReturn: function (data) { return httpGet('/doctor/guahao/doPostReturn', { data: data }) }, getRegList: function (data) { return httpGet('/doctor/guahao/GetRegList', { data: data }) }, getPatientReservation: function (data) { return httpGet('/doctor/guahao/GetPatientReservation', { data: data }) }, //获取通话服务详情 getCallInfo: function (data) { return httpGet('/synergy/customer/getCallInfo', { data: data }) }, //获取通话统计详情 total: function (data) { return httpPost('/callRecordStatics/total', { data: data }) }, //保存通话服务记录详情 saveCallServiceInfo: function (data) { return httpPost('/synergy/customer/saveCallInfo', { data: data }) }, //保存详情里面的跟进状态 saveFollowUp: function (data) { return httpPost('/customer/updateFollowUpById', { data: data }) }, //获取电话服务标签 getCallLables: function () { return httpGet('/synergy/customer/getCallLabelList') }, //保存通话标签 saveCallLabels: function (data) { return httpPost('/synergy/customer/saveCallLabel', { data: data }) }, //获取通话详情里的代办事项 getDealList: function (data) { return httpGet('/synergy/customer/getDealList', { data: data }) }, getWorkOrderInfo: function (data) { return httpGet('/synergy/customer/getWorkOrderInfo', { data: data }) }, unitLabels: function (data) { return httpGet('/synergy/customer/unitLabels', { data: data }) }, getQuestionnaireDetail: function (data) { return httpGet('/customer/question/getQuestionnaireDetail', { data: data }) }, getQuestions: function (data) { return httpGet('/customer/screen/getQuestions', { data: data }) }, labels: function (data) { return httpGet('/synergy/customer/labels', { data: data }) }, loadingInfo: function (data) { return httpGet('/customer/question/loadingInfo', { data: data }) }, workorderRate: function (data) { return httpGet('/synergy/customer/workorderRate', { data: data }) }, takeWorkorderNum: function (data) { return httpGet('/synergy/customer/takeWorkorderNum', { data: data }) }, createServicerLog: function (data) { return httpPost('/synergy/customer/createServicerLog', { data: data }) }, addFollowup: function (data) { return httpPost('/synergy/customer/addFollowup', { data: data }) }, saveFollowupProjectData: function (data) { return httpPost('/synergy/customer/saveFollowupProjectData', { data: data }) }, saveFollowupDrugs: function (data) { return httpPost('/synergy/customer/saveFollowupDrugs', { data: data }) }, reminderList: function (data) { return httpGet('/synergy/customer/reminderList', { data: data }) }, findByPatient2: function (data) { return httpPost('/synergy/customer/findByPatient', { data: data }) }, getFollowupProjectData: function (data) { return httpGet('/synergy/customer/getFollowupProjectData', { data: data }) }, //获取客服人员列表 getCustomerList: function () { return httpGet('/synergy/customer/getCustomers') }, //接收和退回协同服务任务 dealWorkOrder: function (data) { return httpPost('/synergy/customer/dealWorkOrder', { data: data }) }, // 批量接收协同服务任务 batchDealWorkOrder: function (data) { return httpPost('/synergy/customer/batchDealWorkOrder', { data: data }) }, //上传文件 uploadFile: function (data) { return httpPost('/synergy/customer/uploadAccessory', { data: data, contentType: false, cache: false, processData: false }) }, //删除文件 deleteFile: function (data) { return httpPost('/synergy/customer/deleteFile', { data: data }) }, //提交任务 taskSubmit: function (data) { return httpPost('/synergy/customer/taskSubmit', { data: data }) }, getScreenResultDetail: function (data) { return httpGet('/customer/screen/getScreenResultDetail', { data: data }) }, saveAnswer: function (data) { return httpPost('/customer/question/saveAnswer', { data: data }) }, getResult: function (data) { return httpGet('/customer/question/getResult', { data: data }) }, getArticalById: function (data) { //之前的健康教育 代码1 return httpGet('/synergy/customer/getArticalById', { data: data }) }, findManageSynergyWorkorderArticleById: function (data) { //1.5.7健康教育 代码6 return httpGet('/synergy/customer/findManageSynergyWorkorderArticleById', { data: data }) }, findTestInstructionsByOrgCode: function (data) { //体检 代码7 return httpGet('/synergy/customer/findTestInstructionsByOrgCode', { data: data }) }, healthIndexList: function (data) { //体征 代码8 return httpGet('/synergy/customer/healthIndexList', { data: data }) }, standard: function (data) { //体征 预警值 return httpGet('/synergy/customer/standard', { data: data }) }, // 客服首页接口 customerIndex: function (data) { return httpGet('/synergy/customer/customerIndex', { data: data }) }, // 管理员首页接口 adminIndex: function (data) { return httpGet('/synergy/customer/adminIndex', { data: data }) }, intervalOnLine: function (data) { return httpGet('/synergy/customer/intervalOnLine', { data: data }) }, todayCustomerActivy: function (data) { return httpGet('/synergy/customer/TodayCustomerActivy', { data: data }) }, workorderList: function (data) { return httpGet('/synergy/customer/workorderList', { data: data }) }, getAnswers: function (data) { return httpGet('/customer/question/getAnswers', { data: data }) }, // 导出 exportWorkorder: function (data) { return httpGet('/synergy/customer/exportWorkorder', { data: data }) }, // 处理居民调查 getTaskByIdcard: function (data) { return httpGet('/synergy/customer/getTaskByIdcard', { data: data }) }, // 获取居民服务数据 getWorkorderNum: function (data) { return httpGet('/synergy/customer/getWorkorderNum', { data: data }) }, getAskdetail: function (data) { return httpGet('/customer/question/getOptionsComment', { data: data }) }, //知识库 //知识库文章列表 getArticleList: function (data) { return httpGet('/customer/article/searchPageList', { data: data }) }, //我的文章列表 getMyArticleList: function (data) { return httpGet('/customer/article/searchMyPageList', { data: data }) }, //根据id删除文章 deleteArticleById: function (data) { return httpGet('/customer/article/deleteById', { data: data }) }, //获取一级分类列表(无分页) searchArticleCategoryList: function (data) { return httpGet('/customer/category/searchCategoryList', { data: data }) }, //根据code适用范围 hospitalsByCity: function (data) { return httpGet('/customer/article/hospitalsByCity', { data: data }) }, //根据code获取分类 queryArticleCategoryByCode: function (data) { return httpGet('/customer/category/queryByCode', { data: data }) }, //根据code删除分类 deleteArticleCategoryByCode: function (data) { return httpGet('/customer/category/updateDel', { data: data }) }, //获取分类列 searchArticleCategoryPageList: function (data) { return httpGet('/customer/category/searchCategoryPageList', { data: data }) }, //新增、修改分类 saveArticleCategory: function (data) { return httpPost('/customer/category/saveCategory', { data: data }) }, //分类code是否存在 hasExistArticleCategoryCode: function (data) { return httpGet('/customer/category/hasExistCode', { data: data }) }, // 添加、修改文章 updateArticle: function (data) { return httpPost('/customer/article/updateArticle', { data: data }) }, // 根据id获取文章 queryArticleById: function (data) { return httpGet('/customer/article/queryById', { data: data }) }, //获取适用范围 hospitalsTree: function (data) { return httpGet('/customer/article/hospitalsTree', { data: data }) }, // 根据id获取文章 getCategoryLevelList: function (data) { return httpGetWlyy('/third/jkEdu/Article/getCategoryList', { data: data }) }, // 是否有上一次随访的信息 getLastFollowup: function (data) { return httpPost('/doctor/followup/getLastFollowup', { data: data }) }, // 复制随访信息 copyFollowup: function (data) { return httpPost('/doctor/followup/copyFollowup', { data: data }) }, // 获取随访信息 getFollowup: function (data) { return httpGet('/doctor/followup/getFollowup', { data: data }) }, //获得协同服务未完成和未读工单的信息 getWorkorderUnfinished: function (data) { return httpGet('/synergy/customer/workorderListTotal', { data: data }) }, //协同工单获取上一次分配的负责人和参与人列表 getSelectedOrderCollaborates: function (data) { return httpGet('/synergy/customer/selectByWorkorder', { data: data }) }, // 知识库右侧结果搜索接口 searchKnowledgePageList: function (data) { return httpGet('/customer/article/searchKnowledgePageList', { data: data }) }, // 意见反馈 saveFeedback: function (data) { return httpPost('/customer/saveFeedback', { data: data }) }, //导出通话记录 exportCall: function () { window.open(server + '/synergy/customer/callrecordOutExcel') }, // 通过社保卡号或身份证筛选居民列表 findPatientInfo: function (data) { return httpPost('/customer/findPatientInfo', { data: data }) }, // 通过id获取知识库文章详情 queryOneById: function (data) { return httpGet('/customer/article/queryOneById', { data: data }) }, //通过身份证号获取未就诊预约记录 getRegListCall: function (data) { return httpGet('/doctor/guahao/GetRegListCall', { data: data }) }, //协同任务关闭工单 closeWorkorder: function (data) { return httpGet('/synergy/customer/closeWorkorder', { data: data }) }, // 根据身份证号换取居民CODE getPatientAccetokenByIdcard: function (data) { return httpPost('/customer/getPatientAccetokenByIdcard', { data: data }) }, // 查询跟进记录 selectByCode: function (data) { return httpPost('/customer/selectByCode', { data: data }) }, // 获取后续处理人 selectUser: function (data) { return httpPost('/customer/selectUser', { data: data }) }, // 更新通话记录和跟进记录 updateCallRecordAndFollowupRecord: function (data) { return httpPost('/customer/updateCallRecordAndFollowupRecord', { data: data }) } } window.APIService = APIService })(jQuery)