api-service.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. ;(function ($) {
  2. $.support.cors = true
  3. var platform = 4
  4. var agentName = 'userAgent'
  5. var isProduction = false // 是否是正式环境
  6. var imgUrlDomain, server, serverWlyy, healthRecordServer
  7. healthRecordServer = 'http://ijk.xmsmjk.com/wlyy/profileweb/#/' //健康档案服务
  8. healthRecordServer = 'https://ijk.xmsmjk.com/wlyytest/profileweb/#/' //健康档案服务wlyytest
  9. if (isProduction) {
  10. server = 'http://ijk.xmsmjk.com/wlyy' //正式环境
  11. imgUrlDomain = 'http://ijk.xmsmjk.com/' //正式环境
  12. serverWlyy = 'http://ijk.xmsmjk.com/wlyy'
  13. } else {
  14. server = 'https://ijk.xmsmjk.com/wlyytest' //测试
  15. // server = "http://172.26.0.118:8081/wlyy/"; //ip
  16. // server = "http://192.168.131.243:8180"//培强
  17. // server = "http://192.168.131.123:8180/wlyy_manager" // 文杰
  18. // server = "http://192.168.131.144:8180/wlyy_manager" // 冬梅
  19. // server = "http://192.168.131.112:8180/wlyy_manager" // 志南
  20. serverWlyy = 'https://ijk.xmsmjk.com/wlyytest' //测试
  21. // serverWlyy = "http://192.168.131.105:8080"//兴旺
  22. // serverWlyy = "http://192.168.131.243:8180"//培强
  23. // serverWlyy = "http://192.168.131.144:8080"//冬梅
  24. // serverWlyy = "http://192.168.131.143:8080"//冬梅
  25. imgUrlDomain = 'http://ijk.xmsmjk.com/' // 测试环境
  26. // healthRecordServer="http://192.168.131.29:8080/#/" //泽华
  27. }
  28. function httpGet(url, options) {
  29. //发送ajax请求
  30. return new Promise(function (resolve, reject) {
  31. $.ajax(
  32. server + url,
  33. $.extend(
  34. {},
  35. {
  36. type: 'GET',
  37. dataType: 'JSON',
  38. beforeSend: function (request) {
  39. var storage = window.localStorage.getItem('app_storage')
  40. if (storage) {
  41. storage = JSON.parse(storage)
  42. }
  43. if (storage) {
  44. loginDoctorCache = storage.api_login_doctor || {}
  45. let userAgentObj = {
  46. 'id': loginDoctorCache.id,
  47. 'uid': loginDoctorCache.uid,
  48. 'imei': storage.IMEI,
  49. 'token': loginDoctorCache.token,
  50. 'platform': platform
  51. }
  52. request.setRequestHeader(agentName, JSON.stringify(userAgentObj))
  53. }
  54. // var userAgent = window.sessionStorage.getItem("LoginUser");
  55. // if(userAgent) {
  56. // userAgent = JSON.parse(userAgent)
  57. // request.setRequestHeader(agentName, JSON.stringify({
  58. // "id":userAgent.id,"uid":userAgent.code,"mobile":userAgent.mobile
  59. // }));
  60. // }
  61. },
  62. error: function (res) {
  63. reject(res)
  64. },
  65. success: function (res) {
  66. if (res.status && res.status == -200) {
  67. toastr && toastr.warning('登录失效,请重新登录!')
  68. setTimeout(function () {
  69. window.location.replace('login_v2.html')
  70. }, 2000)
  71. return
  72. } else {
  73. resolve(res)
  74. }
  75. }
  76. },
  77. options
  78. )
  79. )
  80. })
  81. }
  82. function httpPost(url, options) {
  83. //发送ajax请求
  84. return new Promise(function (resolve, reject) {
  85. $.ajax(
  86. server + url,
  87. $.extend(
  88. {},
  89. {
  90. type: 'POST',
  91. dataType: 'JSON',
  92. beforeSend: function (request) {
  93. var storage = window.localStorage.getItem('app_storage')
  94. if (storage) {
  95. storage = JSON.parse(storage)
  96. }
  97. if (storage) {
  98. loginDoctorCache = storage.api_login_doctor || {}
  99. let userAgentObj = {
  100. 'id': loginDoctorCache.id,
  101. 'uid': loginDoctorCache.uid,
  102. 'imei': storage.IMEI,
  103. 'token': loginDoctorCache.token,
  104. 'platform': platform
  105. }
  106. request.setRequestHeader(agentName, JSON.stringify(userAgentObj))
  107. }
  108. // var userAgent = window.sessionStorage.getItem("LoginUser");
  109. // if(userAgent) {
  110. // userAgent = JSON.parse(userAgent)
  111. // request.setRequestHeader(agentName, JSON.stringify({
  112. // "id":userAgent.id,"uid":userAgent.code,"mobile":userAgent.mobile
  113. // }));
  114. // }
  115. },
  116. error: function (res) {
  117. reject(res)
  118. },
  119. success: function (res) {
  120. if (res.status && res.status == -200) {
  121. toastr && toastr.warning('登录失效,请重新登录!')
  122. setTimeout(function () {
  123. window.location.replace('login_v2.html')
  124. }, 2000)
  125. return
  126. } else {
  127. resolve(res)
  128. }
  129. }
  130. },
  131. options
  132. )
  133. )
  134. })
  135. }
  136. function httpGetWlyy(url, options) {
  137. //发送ajax请求
  138. var newserver = serverWlyy ? serverWlyy : server
  139. return new Promise(function (resolve, reject) {
  140. $.ajax(
  141. newserver + url,
  142. $.extend(
  143. {},
  144. {
  145. type: 'GET',
  146. dataType: 'JSON',
  147. beforeSend: function (request) {
  148. var userAgent = window.sessionStorage.getItem('LoginUser')
  149. if (userAgent) {
  150. userAgent = JSON.parse(userAgent)
  151. request.setRequestHeader(
  152. agentName,
  153. JSON.stringify({
  154. 'id': userAgent.id,
  155. 'uid': userAgent.code,
  156. 'mobile': userAgent.mobile
  157. })
  158. )
  159. }
  160. },
  161. error: function (res) {
  162. reject(res)
  163. },
  164. success: function (res) {
  165. if (res.status && res.status == -200) {
  166. toastr && toastr.warning('登录失效,请重新登录!')
  167. setTimeout(function () {
  168. window.location.replace('login_v2.html')
  169. }, 2000)
  170. return
  171. } else {
  172. resolve(res)
  173. }
  174. }
  175. },
  176. options
  177. )
  178. )
  179. })
  180. }
  181. APIService = {
  182. server: server,
  183. serverWlyy: serverWlyy,
  184. imgUrlDomain: imgUrlDomain,
  185. agentName: agentName,
  186. httpGet: httpGet,
  187. httpPost: httpPost,
  188. httpGetWlyy: httpGetWlyy,
  189. healthRecordServer: healthRecordServer,
  190. login: function (data) {
  191. return httpPost('/customer/login', { data: data })
  192. },
  193. logout: function () {
  194. return httpGet('/customer/logout')
  195. },
  196. findServerInfo: function (data) {
  197. return httpGet('/customer/findServerInfo', { data: data })
  198. },
  199. findByMobile: function (data) {
  200. return httpGet('/customer/findByMobile', { data: data })
  201. },
  202. // findByPatient: function(data) {
  203. // return httpGet('/customer/findByPatient',{data: data})
  204. // },
  205. findByPatient: function (data) {
  206. return httpPost('/doctor/patient_label_info/patient', { data: data })
  207. },
  208. captchaWithDoctor: function (doctorCode, data) {
  209. return httpPost('/doctor/captcha/withDoctorCode/' + doctorCode, { data: data })
  210. },
  211. sendMsgAndWx: function (data) {
  212. return httpPost('/customer/sendMsg', { data: data })
  213. },
  214. addCallRecord: function (data) {
  215. return httpPost('/customer/addCallRecord', { data: data })
  216. },
  217. updateCallRecordService: function (data) {
  218. return httpPost('/customer/updateCallRecordService', { data: data })
  219. },
  220. updateCallRecordEndTime: function (data) {
  221. return httpPost('/customer/updateCallRecordEndTime', { data: data })
  222. },
  223. getCallRecords: function (data) {
  224. return httpPost('/customer/getCallRecords', { data: data })
  225. },
  226. getCallServiceCode: function (data) {
  227. return httpPost('/customer/getCallServiceCode', { data: data })
  228. },
  229. saveCallService: function (data) {
  230. return httpPost('/customer/saveCallService', { data: data })
  231. },
  232. getCallRecordInfo: function (data) {
  233. return httpPost('/customer/getCallRecordInfo', { data: data })
  234. },
  235. getCallServices: function (data) {
  236. return httpPost('/customer/getCallServices', { data: data })
  237. },
  238. getCallServiceInfo: function (data) {
  239. return httpPost('/customer/getCallServiceInfo', { data: data })
  240. },
  241. updateCallService: function (data) {
  242. return httpPost('/customer/updateCallService', { data: data })
  243. },
  244. delCallService: function (data) {
  245. return httpPost('/customer/delCallService', { data: data })
  246. },
  247. getOrgList: function (data) {
  248. return httpPost('/doctor/guahao/GetOrgListToMysql', { data: data })
  249. },
  250. getOrgDeptList: function (data) {
  251. return httpPost('/doctor/guahao/GetOrgDepListToMysql', { data: data })
  252. },
  253. cancelOrder: function (data) {
  254. return httpPost('/doctor/guahao/CancelOrder', { data: data })
  255. },
  256. createOrderByDoctor: function (data) {
  257. return httpPost('/doctor/guahao/CreateOrderByDoctor', { data: data })
  258. },
  259. regDeptSpeDoctorList: function (data) {
  260. return httpPost('/doctor/guahao/GetDoctorList', { data: data })
  261. },
  262. createPicCaptcha: function (data) {
  263. return httpGet('/open/captcha/createPicCaptcha', { data: data })
  264. },
  265. // regDeptSpeDoctorList: function(data) {
  266. // return httpGet('/doctor/guahao/RegDeptSpeDoctorList', {data: data})
  267. // },
  268. getDoctorInfo: function (data) {
  269. return httpPost('/doctor/guahao/GetDoctorInfo', { data: data })
  270. },
  271. // getDoctorArrange: function(data) {
  272. // return httpGet('/doctor/guahao/GetDoctorArrange', {data: data})
  273. // },
  274. getDoctorArrange: function (data) {
  275. return httpPost('/doctor/guahao/smjk/RegDeptSpeDoctorSectionList', { data: data })
  276. },
  277. doPostReturn: function (data) {
  278. return httpGet('/doctor/guahao/doPostReturn', { data: data })
  279. },
  280. getRegList: function (data) {
  281. return httpGet('/doctor/guahao/GetRegList', { data: data })
  282. },
  283. getPatientReservation: function (data) {
  284. return httpGet('/doctor/guahao/GetPatientReservation', { data: data })
  285. },
  286. //获取通话服务详情
  287. getCallInfo: function (data) {
  288. return httpGet('/synergy/customer/getCallInfo', { data: data })
  289. },
  290. //获取通话统计详情
  291. total: function (data) {
  292. return httpPost('/callRecordStatics/total', { data: data })
  293. },
  294. //保存通话服务记录详情
  295. saveCallServiceInfo: function (data) {
  296. return httpPost('/synergy/customer/saveCallInfo', { data: data })
  297. },
  298. //保存详情里面的跟进状态
  299. saveFollowUp: function (data) {
  300. return httpPost('/customer/updateFollowUpById', { data: data })
  301. },
  302. //获取电话服务标签
  303. getCallLables: function () {
  304. return httpGet('/synergy/customer/getCallLabelList')
  305. },
  306. //保存通话标签
  307. saveCallLabels: function (data) {
  308. return httpPost('/synergy/customer/saveCallLabel', { data: data })
  309. },
  310. //获取通话详情里的代办事项
  311. getDealList: function (data) {
  312. return httpGet('/synergy/customer/getDealList', { data: data })
  313. },
  314. getWorkOrderInfo: function (data) {
  315. return httpGet('/synergy/customer/getWorkOrderInfo', { data: data })
  316. },
  317. unitLabels: function (data) {
  318. return httpGet('/synergy/customer/unitLabels', { data: data })
  319. },
  320. getQuestionnaireDetail: function (data) {
  321. return httpGet('/customer/question/getQuestionnaireDetail', { data: data })
  322. },
  323. getQuestions: function (data) {
  324. return httpGet('/customer/screen/getQuestions', { data: data })
  325. },
  326. labels: function (data) {
  327. return httpGet('/synergy/customer/labels', { data: data })
  328. },
  329. loadingInfo: function (data) {
  330. return httpGet('/customer/question/loadingInfo', { data: data })
  331. },
  332. workorderRate: function (data) {
  333. return httpGet('/synergy/customer/workorderRate', { data: data })
  334. },
  335. takeWorkorderNum: function (data) {
  336. return httpGet('/synergy/customer/takeWorkorderNum', { data: data })
  337. },
  338. createServicerLog: function (data) {
  339. return httpPost('/synergy/customer/createServicerLog', { data: data })
  340. },
  341. addFollowup: function (data) {
  342. return httpPost('/synergy/customer/addFollowup', { data: data })
  343. },
  344. saveFollowupProjectData: function (data) {
  345. return httpPost('/synergy/customer/saveFollowupProjectData', { data: data })
  346. },
  347. saveFollowupDrugs: function (data) {
  348. return httpPost('/synergy/customer/saveFollowupDrugs', { data: data })
  349. },
  350. reminderList: function (data) {
  351. return httpGet('/synergy/customer/reminderList', { data: data })
  352. },
  353. findByPatient2: function (data) {
  354. return httpPost('/synergy/customer/findByPatient', { data: data })
  355. },
  356. getFollowupProjectData: function (data) {
  357. return httpGet('/synergy/customer/getFollowupProjectData', { data: data })
  358. },
  359. //获取客服人员列表
  360. getCustomerList: function () {
  361. return httpGet('/synergy/customer/getCustomers')
  362. },
  363. //接收和退回协同服务任务
  364. dealWorkOrder: function (data) {
  365. return httpPost('/synergy/customer/dealWorkOrder', { data: data })
  366. },
  367. // 批量接收协同服务任务
  368. batchDealWorkOrder: function (data) {
  369. return httpPost('/synergy/customer/batchDealWorkOrder', { data: data })
  370. },
  371. //上传文件
  372. uploadFile: function (data) {
  373. return httpPost('/synergy/customer/uploadAccessory', { data: data, contentType: false, cache: false, processData: false })
  374. },
  375. //删除文件
  376. deleteFile: function (data) {
  377. return httpPost('/synergy/customer/deleteFile', { data: data })
  378. },
  379. //提交任务
  380. taskSubmit: function (data) {
  381. return httpPost('/synergy/customer/taskSubmit', { data: data })
  382. },
  383. getScreenResultDetail: function (data) {
  384. return httpGet('/customer/screen/getScreenResultDetail', { data: data })
  385. },
  386. saveAnswer: function (data) {
  387. return httpPost('/customer/question/saveAnswer', { data: data })
  388. },
  389. getResult: function (data) {
  390. return httpGet('/customer/question/getResult', { data: data })
  391. },
  392. getArticalById: function (data) {
  393. //之前的健康教育 代码1
  394. return httpGet('/synergy/customer/getArticalById', { data: data })
  395. },
  396. findManageSynergyWorkorderArticleById: function (data) {
  397. //1.5.7健康教育 代码6
  398. return httpGet('/synergy/customer/findManageSynergyWorkorderArticleById', { data: data })
  399. },
  400. findTestInstructionsByOrgCode: function (data) {
  401. //体检 代码7
  402. return httpGet('/synergy/customer/findTestInstructionsByOrgCode', { data: data })
  403. },
  404. healthIndexList: function (data) {
  405. //体征 代码8
  406. return httpGet('/synergy/customer/healthIndexList', { data: data })
  407. },
  408. standard: function (data) {
  409. //体征 预警值
  410. return httpGet('/synergy/customer/standard', { data: data })
  411. },
  412. // 客服首页接口
  413. customerIndex: function (data) {
  414. return httpGet('/synergy/customer/customerIndex', { data: data })
  415. },
  416. // 管理员首页接口
  417. adminIndex: function (data) {
  418. return httpGet('/synergy/customer/adminIndex', { data: data })
  419. },
  420. intervalOnLine: function (data) {
  421. return httpGet('/synergy/customer/intervalOnLine', { data: data })
  422. },
  423. todayCustomerActivy: function (data) {
  424. return httpGet('/synergy/customer/TodayCustomerActivy', { data: data })
  425. },
  426. workorderList: function (data) {
  427. return httpGet('/synergy/customer/workorderList', { data: data })
  428. },
  429. getAnswers: function (data) {
  430. return httpGet('/customer/question/getAnswers', { data: data })
  431. },
  432. // 导出
  433. exportWorkorder: function (data) {
  434. return httpGet('/synergy/customer/exportWorkorder', { data: data })
  435. },
  436. // 处理居民调查
  437. getTaskByIdcard: function (data) {
  438. return httpGet('/synergy/customer/getTaskByIdcard', { data: data })
  439. },
  440. // 获取居民服务数据
  441. getWorkorderNum: function (data) {
  442. return httpGet('/synergy/customer/getWorkorderNum', { data: data })
  443. },
  444. getAskdetail: function (data) {
  445. return httpGet('/customer/question/getOptionsComment', { data: data })
  446. },
  447. //知识库
  448. //知识库文章列表
  449. getArticleList: function (data) {
  450. return httpGet('/customer/article/searchPageList', { data: data })
  451. },
  452. //我的文章列表
  453. getMyArticleList: function (data) {
  454. return httpGet('/customer/article/searchMyPageList', { data: data })
  455. },
  456. //根据id删除文章
  457. deleteArticleById: function (data) {
  458. return httpGet('/customer/article/deleteById', { data: data })
  459. },
  460. //获取一级分类列表(无分页)
  461. searchArticleCategoryList: function (data) {
  462. return httpGet('/customer/category/searchCategoryList', { data: data })
  463. },
  464. //根据code适用范围
  465. hospitalsByCity: function (data) {
  466. return httpGet('/customer/article/hospitalsByCity', { data: data })
  467. },
  468. //根据code获取分类
  469. queryArticleCategoryByCode: function (data) {
  470. return httpGet('/customer/category/queryByCode', { data: data })
  471. },
  472. //根据code删除分类
  473. deleteArticleCategoryByCode: function (data) {
  474. return httpGet('/customer/category/updateDel', { data: data })
  475. },
  476. //获取分类列
  477. searchArticleCategoryPageList: function (data) {
  478. return httpGet('/customer/category/searchCategoryPageList', { data: data })
  479. },
  480. //新增、修改分类
  481. saveArticleCategory: function (data) {
  482. return httpPost('/customer/category/saveCategory', { data: data })
  483. },
  484. //分类code是否存在
  485. hasExistArticleCategoryCode: function (data) {
  486. return httpGet('/customer/category/hasExistCode', { data: data })
  487. },
  488. // 添加、修改文章
  489. updateArticle: function (data) {
  490. return httpPost('/customer/article/updateArticle', { data: data })
  491. },
  492. // 根据id获取文章
  493. queryArticleById: function (data) {
  494. return httpGet('/customer/article/queryById', { data: data })
  495. },
  496. //获取适用范围
  497. hospitalsTree: function (data) {
  498. return httpGet('/customer/article/hospitalsTree', { data: data })
  499. },
  500. // 根据id获取文章
  501. getCategoryLevelList: function (data) {
  502. return httpGetWlyy('/third/jkEdu/Article/getCategoryList', { data: data })
  503. },
  504. // 是否有上一次随访的信息
  505. getLastFollowup: function (data) {
  506. return httpPost('/doctor/followup/getLastFollowup', { data: data })
  507. },
  508. // 复制随访信息
  509. copyFollowup: function (data) {
  510. return httpPost('/doctor/followup/copyFollowup', { data: data })
  511. },
  512. // 获取随访信息
  513. getFollowup: function (data) {
  514. return httpGet('/doctor/followup/getFollowup', { data: data })
  515. },
  516. //获得协同服务未完成和未读工单的信息
  517. getWorkorderUnfinished: function (data) {
  518. return httpGet('/synergy/customer/workorderListTotal', { data: data })
  519. },
  520. //协同工单获取上一次分配的负责人和参与人列表
  521. getSelectedOrderCollaborates: function (data) {
  522. return httpGet('/synergy/customer/selectByWorkorder', { data: data })
  523. },
  524. // 知识库右侧结果搜索接口
  525. searchKnowledgePageList: function (data) {
  526. return httpGet('/customer/article/searchKnowledgePageList', { data: data })
  527. },
  528. // 意见反馈
  529. saveFeedback: function (data) {
  530. return httpPost('/customer/saveFeedback', { data: data })
  531. },
  532. //导出通话记录
  533. exportCall: function () {
  534. window.open(server + '/synergy/customer/callrecordOutExcel')
  535. },
  536. // 通过社保卡号或身份证筛选居民列表
  537. findPatientInfo: function (data) {
  538. return httpPost('/customer/findPatientInfo', { data: data })
  539. },
  540. // 通过id获取知识库文章详情
  541. queryOneById: function (data) {
  542. return httpGet('/customer/article/queryOneById', { data: data })
  543. },
  544. //通过身份证号获取未就诊预约记录
  545. getRegListCall: function (data) {
  546. return httpGet('/doctor/guahao/GetRegListCall', { data: data })
  547. },
  548. //协同任务关闭工单
  549. closeWorkorder: function (data) {
  550. return httpGet('/synergy/customer/closeWorkorder', { data: data })
  551. },
  552. // 根据身份证号换取居民CODE
  553. getPatientAccetokenByIdcard: function (data) {
  554. return httpPost('/customer/getPatientAccetokenByIdcard', {
  555. data: data
  556. })
  557. },
  558. // 查询跟进记录
  559. selectByCode: function (data) {
  560. return httpPost('/customer/selectByCode', {
  561. data: data
  562. })
  563. },
  564. // 获取后续处理人
  565. selectUser: function (data) {
  566. return httpPost('/customer/selectUser', {
  567. data: data
  568. })
  569. },
  570. // 更新通话记录和跟进记录
  571. updateCallRecordAndFollowupRecord: function (data) {
  572. return httpPost('/customer/updateCallRecordAndFollowupRecord', {
  573. data: data
  574. })
  575. }
  576. }
  577. window.APIService = APIService
  578. })(jQuery)