Browse Source

修改域名

hd 1 week ago
parent
commit
a262d2ac73
3 changed files with 1001 additions and 943 deletions
  1. 413 379
      api/http-request.js
  2. 586 562
      app/jbsc/js/api-service.js
  3. 2 2
      component/statistics/CopdPatientRecord/index.js

+ 413 - 379
api/http-request.js

@ -1,411 +1,445 @@
(function($) {
    window.ajaxInsArr = {}
	window.eventBuss = new Vue();
    var publish_version = false;
    var isInner = false; //发布线上后有内外网的配置
    var docInfo = "app_storage";
    var agentName = "wlyyAgentForDoc";
    var docAgentName = "wlyyAgent";
    var server, userAgent, loginUrl, imserver, socketUrl, imgServer,teamworkService;
    var IMEI = localStorage.getItem('WLYY_IMEI') || uuid(16, 16)
    localStorage.setItem('WLYY_IMEI', IMEI)
    $.support.cors = true;
    if(publish_version) { // 生产环境配置
        server = "//www.xmtyw.cn/wlyy/"
        imserver = "//www.xmtyw.cn/api/v2";
        socketUrl = "//www.xmtyw.cn";
        articleServer = "//www.xmtyw.cn/wlyy/"
        loginUrl = "../../login/login.html";
        imgServer = "//www.xmtyw.cn/";
        teamworkService="//hlwyy.xmzsh.com/hlwyy/ims-web";
        videoChatIntranetFlag = false;
        if(isInner){
            server = "http://10.95.22.10:8011/wlyy/"
            imserver = "http://10.95.22.138:3000/api/v2";
            socketUrl = "http://10.95.22.138:3000";
            articleServer = "http://10.95.22.10:8011/wlyy/"
            loginUrl = "../../login/login.html";
            imgServer = "http://10.95.22.10:8011/";
        }
    } else { // 测试环境配置
        // server = "https://ehr.yihu.com/wlyy/"  //测试环境
		server = "http://172.26.0.118:8081/wlyy/";   //ip
        imserver = "http://172.26.0.118:3000/api/v2";
        socketUrl = "https://172.26.0.118:3000";
;(function ($) {
  window.ajaxInsArr = {}
  window.eventBuss = new Vue()
  var publish_version = false
  var isInner = false //发布线上后有内外网的配置
  var docInfo = 'app_storage'
  var agentName = 'wlyyAgentForDoc'
  var docAgentName = 'wlyyAgent'
  var server, userAgent, loginUrl, imserver, socketUrl, imgServer, teamworkService
  var IMEI = localStorage.getItem('WLYY_IMEI') || uuid(16, 16)
  localStorage.setItem('WLYY_IMEI', IMEI)
  $.support.cors = true
  if (publish_version) {
    // 生产环境配置
    server = '//ijk.xmsmjk.com/wlyy/'
    imserver = '//ijk.xmsmjk.com/api/v2'
    socketUrl = '//ijk.xmsmjk.com'
    articleServer = '//ijk.xmsmjk.com/wlyy/'
    loginUrl = '../../login/login.html'
    imgServer = '//ijk.xmsmjk.com/'
    teamworkService = '//hlwyy.xmzsh.com/hlwyy/ims-web'
    videoChatIntranetFlag = false
    if (isInner) {
      server = 'http://10.95.22.10:8011/wlyy/'
      imserver = 'http://10.95.22.138:3000/api/v2'
      socketUrl = 'http://10.95.22.138:3000'
      articleServer = 'http://10.95.22.10:8011/wlyy/'
      loginUrl = '../../login/login.html'
      imgServer = 'http://10.95.22.10:8011/'
    }
  } else {
    // 测试环境配置
    // server = "https://ehr.yihu.com/wlyy/"  //测试环境
    server = 'http://172.26.0.118:8081/wlyy/' //ip
    imserver = 'http://172.26.0.118:3000/api/v2'
    socketUrl = 'https://172.26.0.118:3000'
        loginUrl = "../../login/login.html";
        // loginUrl = "/PC-prescription/login.html"; //自己本地测试时的路径
        imgServer = "http://172.26.0.110:8888/";
        teamworkService="//ehr.yihu.com/hlwyy/ims-web";
        videoChatIntranetFlag = false;
    loginUrl = '../../login/login.html'
    // loginUrl = "/PC-prescription/login.html"; //自己本地测试时的路径
    imgServer = 'http://172.26.0.110:8888/'
    teamworkService = '//ehr.yihu.com/hlwyy/ims-web'
    videoChatIntranetFlag = false
//         server = "http://172.26.0.118:8081/wlyy/"  //测试环境
//         imserver = "https://172.26.0.118:3000/api/v2";
//         socketUrl = "https://172.26.0.118:3000";
    //         server = "http://172.26.0.118:8081/wlyy/"  //测试环境
    //         imserver = "https://172.26.0.118:3000/api/v2";
    //         socketUrl = "https://172.26.0.118:3000";
//         loginUrl = "../../login/login.html";
// //      loginUrl = "/PC-prescription/login.html"; //自己本地测试时的路径
//         imgServer = "http://172.26.0.110:8888/";
//         teamworkService="//ehr.yihu.com/hlwyy/ims-web";
//         videoChatIntranetFlag = false;
    }
    //         loginUrl = "../../login/login.html";
    // //      loginUrl = "/PC-prescription/login.html"; //自己本地测试时的路径
    //         imgServer = "http://172.26.0.110:8888/";
    //         teamworkService="//ehr.yihu.com/hlwyy/ims-web";
    //         videoChatIntranetFlag = false;
  }
    var baseInfo = window.localStorage.getItem(docInfo);
    
    userAgent = window.localStorage.getItem(agentName)
  var baseInfo = window.localStorage.getItem(docInfo)
  userAgent = window.localStorage.getItem(agentName)
    if(userAgent || baseInfo) {
        try {
            if(baseInfo){
                baseInfo = JSON.parse(baseInfo);
                window.localStorage.setItem(docAgentName, JSON.stringify(baseInfo.api_login_doctor));
                userAgent = {
                    'id': baseInfo.api_login_doctor.id,
                    'uid': baseInfo.api_login_doctor.uid,
                    'imei': baseInfo.IMEI,
                    'token': baseInfo.api_login_doctor.token,
                    'platform': '4'
                };
                window.localStorage.setItem(agentName, JSON.stringify(userAgent));
                localStorage.setItem('WLYY_IMEI', baseInfo.IMEI)
            }else{
                userAgent = JSON.parse(userAgent)
            }
        } catch(e) {
            toastr && toastr.warning("登录失效,请关闭当前弹窗前往PC IM重新登录")
//          toLoginPage()
  if (userAgent || baseInfo) {
    try {
      if (baseInfo) {
        baseInfo = JSON.parse(baseInfo)
        window.localStorage.setItem(docAgentName, JSON.stringify(baseInfo.api_login_doctor))
        userAgent = {
          'id': baseInfo.api_login_doctor.id,
          'uid': baseInfo.api_login_doctor.uid,
          'imei': baseInfo.IMEI,
          'token': baseInfo.api_login_doctor.token,
          'platform': '4'
        }
    } else {
        toLoginPage()
        window.localStorage.setItem(agentName, JSON.stringify(userAgent))
        localStorage.setItem('WLYY_IMEI', baseInfo.IMEI)
      } else {
        userAgent = JSON.parse(userAgent)
      }
    } catch (e) {
      toastr && toastr.warning('登录失效,请关闭当前弹窗前往PC IM重新登录')
      //          toLoginPage()
    }
  } else {
    toLoginPage()
  }
    var isRelogined = sessionStorage.getItem('wlyy_relogin')
    if(isRelogined && location.href.indexOf("login.html") < 0){
        sessionStorage.removeItem('wlyy_relogin')
    }
	
    function httpGet(url, options) {
        //发送ajax请求
        return new Promise(function(resolve, reject) {
            window.ajaxInsArr[url] = $.ajax(server + url,
                $.extend({}, {
                    type: 'GET',
                    dataType: 'JSON',
                    beforeSend: function(request) {
                        var agent = userAgent || {
                            imei: localStorage.getItem('WLYY_IMEI'),
                            platform: 4
                        }
                        request.setRequestHeader("userAgent", JSON.stringify(agent));
                    },
                    error: function(res) {
                        if(res.statusText == "abort"){
  var isRelogined = sessionStorage.getItem('wlyy_relogin')
  if (isRelogined && location.href.indexOf('login.html') < 0) {
    sessionStorage.removeItem('wlyy_relogin')
  }
                        }
                        reject(res)
                    },
                    success: function(res) {
                        failCodeHandle(res)
                        resolve(res)
                    }
                }, options));
        })
    }
	function articleGet(url, options) {
        //发送ajax请求
        return new Promise(function(resolve, reject) {
            $.ajax(articleServer + url,
                $.extend({}, {
                    type: 'GET',
                    dataType: 'JSON',
                    beforeSend: function(request) {
                        var agent = userAgent || {
                            imei: localStorage.getItem('WLYY_IMEI'),
                            platform: 4
                        }
                        request.setRequestHeader("userAgent", JSON.stringify(agent));
                    },
                    error: function(res) {
                        reject(res)
                    },
                    success: function(res) {
                        failCodeHandle(res)
                        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 agent = userAgent || {
                            imei: localStorage.getItem('WLYY_IMEI')
                        }
                        request.setRequestHeader("userAgent", JSON.stringify(agent));
                    },
                    error: function(res) {
                        reject(res)
                    },
                    success: function(res) {
                        failCodeHandle(res)
                        resolve(res)
                    }
                }, options));
        })
    }
    function articlePost(url, options) {
        //发送ajax请求
        return new Promise(function(resolve, reject) {
            $.ajax(articleServer + url,
                $.extend({}, {
                    type: 'POST',
                    dataType: 'JSON',
                    beforeSend: function(request) {
                        var agent = userAgent || {
                            imei: localStorage.getItem('WLYY_IMEI')
                        }
                        request.setRequestHeader("userAgent", JSON.stringify(agent));
                    },
                    error: function(res) {
                        reject(res)
                    },
                    success: function(res) {
                        failCodeHandle(res)
                        resolve(res)
                    }
                }, options));
        })
    }
  function httpGet(url, options) {
    //发送ajax请求
    return new Promise(function (resolve, reject) {
      window.ajaxInsArr[url] = $.ajax(
        server + url,
        $.extend(
          {},
          {
            type: 'GET',
            dataType: 'JSON',
            beforeSend: function (request) {
              var agent = userAgent || {
                imei: localStorage.getItem('WLYY_IMEI'),
                platform: 4
              }
              request.setRequestHeader('userAgent', JSON.stringify(agent))
            },
            error: function (res) {
              if (res.statusText == 'abort') {
              }
              reject(res)
            },
            success: function (res) {
              failCodeHandle(res)
              resolve(res)
            }
          },
          options
        )
      )
    })
  }
  function articleGet(url, options) {
    //发送ajax请求
    return new Promise(function (resolve, reject) {
      $.ajax(
        articleServer + url,
        $.extend(
          {},
          {
            type: 'GET',
            dataType: 'JSON',
            beforeSend: function (request) {
              var agent = userAgent || {
                imei: localStorage.getItem('WLYY_IMEI'),
                platform: 4
              }
              request.setRequestHeader('userAgent', JSON.stringify(agent))
            },
            error: function (res) {
              reject(res)
            },
            success: function (res) {
              failCodeHandle(res)
              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 agent = userAgent || {
                imei: localStorage.getItem('WLYY_IMEI')
              }
              request.setRequestHeader('userAgent', JSON.stringify(agent))
            },
            error: function (res) {
              reject(res)
            },
            success: function (res) {
              failCodeHandle(res)
              resolve(res)
            }
          },
          options
        )
      )
    })
  }
  function articlePost(url, options) {
    //发送ajax请求
    return new Promise(function (resolve, reject) {
      $.ajax(
        articleServer + url,
        $.extend(
          {},
          {
            type: 'POST',
            dataType: 'JSON',
            beforeSend: function (request) {
              var agent = userAgent || {
                imei: localStorage.getItem('WLYY_IMEI')
              }
              request.setRequestHeader('userAgent', JSON.stringify(agent))
            },
            error: function (res) {
              reject(res)
            },
            success: function (res) {
              failCodeHandle(res)
              resolve(res)
            }
          },
          options
        )
      )
    })
  }
    function imHttpGet(url, options) {
        //发送ajax请求
        return new Promise(function(resolve, reject) {
            $.ajax(imserver + url,
                $.extend({}, {
                    type: 'GET',
                    dataType: 'JSON',
                    beforeSend: function(request) {
                        request.setRequestHeader("userAgent", JSON.stringify(userAgent));
                    },
                    error: function(res) {
                        reject(res)
                    },
                    success: function(res) {
                        failCodeHandle(res)
                        resolve(res)
                    }
                }, options));
        })
    }
  function imHttpGet(url, options) {
    //发送ajax请求
    return new Promise(function (resolve, reject) {
      $.ajax(
        imserver + url,
        $.extend(
          {},
          {
            type: 'GET',
            dataType: 'JSON',
            beforeSend: function (request) {
              request.setRequestHeader('userAgent', JSON.stringify(userAgent))
            },
            error: function (res) {
              reject(res)
            },
            success: function (res) {
              failCodeHandle(res)
              resolve(res)
            }
          },
          options
        )
      )
    })
  }
    function imHttpPost(url, options) {
        //发送ajax请求
        return new Promise(function(resolve, reject) {
            $.ajax(imserver + url,
                $.extend({}, {
                    type: 'POST',
                    dataType: 'JSON',
                    beforeSend: function(request) {
                        request.setRequestHeader("userAgent", JSON.stringify(userAgent));
                    },
                    error: function(res) {
                        reject(res)
                    },
                    success: function(res) {
                        failCodeHandle(res)
                        resolve(res)
                    }
                }, options));
        })
    }
  function imHttpPost(url, options) {
    //发送ajax请求
    return new Promise(function (resolve, reject) {
      $.ajax(
        imserver + url,
        $.extend(
          {},
          {
            type: 'POST',
            dataType: 'JSON',
            beforeSend: function (request) {
              request.setRequestHeader('userAgent', JSON.stringify(userAgent))
            },
            error: function (res) {
              reject(res)
            },
            success: function (res) {
              failCodeHandle(res)
              resolve(res)
            }
          },
          options
        )
      )
    })
  }
	function videoChatPost(url, options) {
		if(options && options.data){
			options.data.intranetFlag = videoChatIntranetFlag
		}
		return httpPost(url, options);
  function videoChatPost(url, options) {
    if (options && options.data) {
      options.data.intranetFlag = videoChatIntranetFlag
    }
    return httpPost(url, options)
  }
    function toLoginPage() {
        if(location.href.indexOf('login.html') > -1) {
            return;
        }
        setTimeout(function() {
            sessionStorage.setItem("wlyy_relogin", 1)
//          var path = top.location.pathname,
//              rootPath = path.split("/")[1];
            top.location.replace(loginUrl + '?redirect_url=' + encodeURIComponent(top.location.href))
        }, 2000)
  function toLoginPage() {
    if (location.href.indexOf('login.html') > -1) {
      return
    }
    setTimeout(function () {
      sessionStorage.setItem('wlyy_relogin', 1)
      //          var path = top.location.pathname,
      //              rootPath = path.split("/")[1];
      top.location.replace(loginUrl + '?redirect_url=' + encodeURIComponent(top.location.href))
    }, 2000)
  }
    var count = 0;
    function failCodeHandle(res) {
        var tip = "";
        if(res.status == 999) {
            tip = "此账号已在别处登录,请关闭当前弹窗前往PC IM重新登录";
        } else if(res.status == 998) {
            tip = "登录超时,请关闭当前弹窗前往PC IM重新登录";
        } else if(res.status == 997) {
            tip = "此账号未登录,请先登录"
        }
        if(tip) {
            count ++;
            if(count == 1){
//          	console.log(tip)
				toastr && toastr.warning(tip)
//          	toLoginPage()
            }
        }
  var count = 0
  function failCodeHandle(res) {
    var tip = ''
    if (res.status == 999) {
      tip = '此账号已在别处登录,请关闭当前弹窗前往PC IM重新登录'
    } else if (res.status == 998) {
      tip = '登录超时,请关闭当前弹窗前往PC IM重新登录'
    } else if (res.status == 997) {
      tip = '此账号未登录,请先登录'
    }
    if (tip) {
      count++
      if (count == 1) {
        //          	console.log(tip)
        toastr && toastr.warning(tip)
        //          	toLoginPage()
      }
    }
  }
    function uuid(len, radix) {
        var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
        var uuid = [],
            i;
        radix = radix || chars.length;
  function uuid(len, radix) {
    var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('')
    var uuid = [],
      i
    radix = radix || chars.length
        if(len) {
            // Compact form  
            for(i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
        } else {
            // rfc4122, version 4 form  
            var r;
    if (len) {
      // Compact form
      for (i = 0; i < len; i++) uuid[i] = chars[0 | (Math.random() * radix)]
    } else {
      // rfc4122, version 4 form
      var r
            // rfc4122 requires these characters  
            uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
            uuid[14] = '4';
      // rfc4122 requires these characters
      uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-'
      uuid[14] = '4'
            // Fill in random data.  At i==19 set the high bits of clock sequence as  
            // per rfc4122, sec. 4.1.5  
            for(i = 0; i < 36; i++) {
                if(!uuid[i]) {
                    r = 0 | Math.random() * 16;
                    uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
                }
            }
      // Fill in random data.  At i==19 set the high bits of clock sequence as
      // per rfc4122, sec. 4.1.5
      for (i = 0; i < 36; i++) {
        if (!uuid[i]) {
          r = 0 | (Math.random() * 16)
          uuid[i] = chars[i == 19 ? (r & 0x3) | 0x8 : r]
        }
      }
    }
    return uuid.join('')
  }
        return uuid.join('');
  /*
   * 获取图片路径方法修改
   */
  function getImgUrl(str) {
    if (typeof str != 'string') {
      return ''
    }
    if (str.length == 0) {
      return ''
    } else {
      if (str.indexOf('../') > -1) {
        //访问本地路径
        return str
      } else if (str.indexOf('http://') > -1 || str.indexOf('https://') > -1) {
        return str
      } else {
        //服务器上的图片路径
        return imgServer + str
      }
    }
  }
    /*
     * 获取图片路径方法修改
     */
    function getImgUrl(str) {
        if(typeof str != 'string') {
            return "";
        }
        if(str.length == 0) {
            return "";
        } else {
            if(str.indexOf("../") > -1) {
                //访问本地路径
                return str;
            } else if((str.indexOf("http://") > -1) || (str.indexOf("https://") > -1)) {
                return str;
  // 导出xls
  function downLoadFileForAjax(url, fileName, data) {
    // 判断内网走url
    if (publish_version && isInner) {
      var p = []
      for (var k in data) {
        p.push(k + '=' + data[k])
      }
      var ps = p.join('&')
      var str = server + url + '?' + ps
      setTimeout(function () {
        window.location.href = str
      }, 1000)
      return Promise.resolve()
    } else {
      // 外网做ajax
      return new Promise(function (resolve, reject) {
        if (window.URL) {
          const xhr = new XMLHttpRequest()
          if (data) {
            var p = []
            for (var k in data) {
              p.push(k + '=' + data[k])
            }
            url += (url.indexOf('?') != -1 ? '&' : '?') + p.join('&')
          }
          xhr.open('GET', server + url, true)
          xhr.responseType = 'blob'
          xhr.onload = function () {
            if (xhr.readyState == 4 && xhr.status == 200) {
              const blob = xhr.response
              const blobUrl = window.URL.createObjectURL(blob)
              const a = document.createElement('a')
              a.style.display = 'none'
              a.download = fileName
              a.href = blobUrl
              a.target = '_blank'
              a.click()
              resolve()
            } else {
                //服务器上的图片路径
                return imgServer + str;
              reject(xhr)
            }
          }
          xhr.onerror = function (err) {
            console.error(err)
            reject(xhr)
          }
          xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8')
          var agent = userAgent || {
            imei: localStorage.getItem('WLYY_IMEI'),
            platform: 4
          }
          xhr.setRequestHeader('userAgent', JSON.stringify(agent))
          xhr.send()
        } else {
          window.toastr && window.toastr.warning('您正使用外网访问系统,浏览器版本低,请更新浏览器后再操作!')
          reject()
        }
      })
    }
	
	// 导出xls
	function downLoadFileForAjax(url, fileName, data){
		// 判断内网走url
		if(publish_version&&isInner) {
			var p = []
			for(var k in data){
				p.push(k + "=" + data[k])
			}
			var ps = p.join("&")
			var str = server + url+'?'+ps
			setTimeout(function(){
				window.location.href = str
			},1000)
			return Promise.resolve()
		}else{
			// 外网做ajax
			return new Promise(function(resolve, reject){
				if(window.URL) {
					const xhr = new XMLHttpRequest();
					if(data){
						var p = []
						for(var k in data){
							p.push(k + "=" + data[k])
						}
						url += (url.indexOf("?")!=-1? "&" : "?") + p.join("&")
					}
					xhr.open('GET', server + url, true);
			      	xhr.responseType = "blob";  
			      	xhr.onload = function() {
						if(xhr.readyState == 4 && xhr.status==200){
					        const blob = xhr.response;
					        const blobUrl = window.URL.createObjectURL(blob);
					        const a = document.createElement('a');
					        a.style.display = 'none';
					        a.download = fileName
					        a.href = blobUrl;
					        a.target = '_blank';
					        a.click();
							resolve()
						} else {
							reject(xhr)
						}
			      	}   
					xhr.onerror = function(err){
						console.error(err)
						reject(xhr)
					}           
			      
			      	xhr.setRequestHeader("Content-Type","application/json;charset=UTF-8");
					var agent = userAgent || {
						imei: localStorage.getItem('WLYY_IMEI'),
						platform: 4
					}
			      	xhr.setRequestHeader("userAgent", JSON.stringify(agent));  
			      	xhr.send();
				}else{
					window.toastr && window.toastr.warning('您正使用外网访问系统,浏览器版本低,请更新浏览器后再操作!')
					reject()
				}
				
			})
		}
	}
	
    httpRequest = {
		downLoadFileForAjax: downLoadFileForAjax,
        agentName: agentName,
        server: server,
        imserver: imserver,
        socketUrl: socketUrl,
        userAgent: userAgent,
        get: httpGet,
        post: httpPost,
        imHttpGet: imHttpGet,
        imHttpPost: imHttpPost,
        getImgUrl: getImgUrl,
        imgServer:imgServer,
        teamworkService:teamworkService,
        articleGet:articleGet,
        articlePost:articlePost,
        failCodeHandle: failCodeHandle,
        uuid: uuid,
        videoChatPost: videoChatPost,
        loginIm: function(data){
            return imHttpPost('/users/login', data);
        },
        getDoctorInfo: function() {
            return httpGet('doctor/baseinfo');
        }
  }
  httpRequest = {
    downLoadFileForAjax: downLoadFileForAjax,
    agentName: agentName,
    server: server,
    imserver: imserver,
    socketUrl: socketUrl,
    userAgent: userAgent,
    get: httpGet,
    post: httpPost,
    imHttpGet: imHttpGet,
    imHttpPost: imHttpPost,
    getImgUrl: getImgUrl,
    imgServer: imgServer,
    teamworkService: teamworkService,
    articleGet: articleGet,
    articlePost: articlePost,
    failCodeHandle: failCodeHandle,
    uuid: uuid,
    videoChatPost: videoChatPost,
    loginIm: function (data) {
      return imHttpPost('/users/login', data)
    },
    getDoctorInfo: function () {
      return httpGet('doctor/baseinfo')
    }
  }
    window.httpRequest = httpRequest;
})(jQuery)
  window.httpRequest = httpRequest
})(jQuery)

+ 586 - 562
app/jbsc/js/api-service.js

@ -1,567 +1,591 @@
(function($){
	$.support.cors = true
	var platform = 4
	var agentName = "userAgent"
	
	var isProduction = false// 是否是正式环境
	var imgUrlDomain, server, serverWlyy,healthRecordServer
	
    healthRecordServer="http://www.xmtyw.cn/wlyy/profileweb/#/"  //健康档案服务
    healthRecordServer="https://www.xmtyw.cn/wlyytest/profileweb/#/"  //健康档案服务wlyytest
	  
	if(isProduction)  {
		server = "http://www.xmtyw.cn/wlyy"; //正式环境
		imgUrlDomain = "http://www.xmtyw.cn/"; //正式环境
		serverWlyy = "http://www.xmtyw.cn/wlyy"
	} else {
		 server = "https://www.xmtyw.cn/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" // 冬梅
;(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://www.xmtyw.cn/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://www.xmtyw.cn/"; // 测试环境
//		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));
					}
    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 })
    },
					// 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));
					}
					
    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 })
    },
					// 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
      })
    }
  }
		
		// 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;
  window.APIService = APIService
})(jQuery)

+ 2 - 2
component/statistics/CopdPatientRecord/index.js

@ -545,8 +545,8 @@ Vue.component('copd-patient-record', {
      statisticAPI.getPatientAccetokenByIdcard({ idcard: idcard }).then(function (res) {
        if (res.status == 200) {
          vm.patientCode = res.data.patientCode
          var healthRecordServer = 'http://www.xmtyw.cn/wlyy/profileweb/#/menzhen' //健康档案服务
          //var healthRecordServer="https://www.xmtyw.cn/wlyytest/profileweb/#/menzhen"  //健康档案服务wlyytest
          var healthRecordServer = 'http://ijk.xmsmjk.com/wlyy/profileweb/#/menzhen' //健康档案服务
          //var healthRecordServer="https://ijk.xmsmjk.com/wlyytest/profileweb/#/menzhen"  //健康档案服务wlyytest
          window.open(healthRecordServer + '?patientCode=' + res.data.patientCode)
        } else {
          vm.patientCode = ''