appoint-commit.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. var Request = new Object()
  2. Request = GetRequest()
  3. var param = JSON.parse(decodeURIComponent(Request.paramStr)),
  4. backToSynergy = Request.backToSynergy
  5. param.key = ''
  6. param.text = ''
  7. $(function () {
  8. // document.getElementById('referenceInformation').bsSuggest({
  9. // data: [{
  10. // code: '',
  11. // name: '全部'
  12. // }],
  13. // getDataMethod: 'data',
  14. // effectiveFields: ['name'],
  15. // idField: 'code',
  16. // keyField: 'name'
  17. // })
  18. $('#closeBtn').click(function () {
  19. closeLayer()
  20. })
  21. $('input:radio').click(function () {
  22. console.log($('input:radio:checked').val(), 'aaaaaaaaaaaaaaaaaaa')
  23. })
  24. $('input:checkbox').click(function () {
  25. var checkList = new Array()
  26. $('input[name="referInfo"]:checked').each(function () {
  27. checkList.push($(this).val()) //向数组中添加元素
  28. console.log('asxxsxsxs', checkList)
  29. })
  30. })
  31. })
  32. function closeLayer() {
  33. var index = top.layer.getFrameIndex(window.name)
  34. top.layer.close(index)
  35. }
  36. new Vue({
  37. el: '#app',
  38. data: function () {
  39. return {
  40. param: param,
  41. imgCodeImg: '',
  42. radio: 0,
  43. referenceInfo: '已选0',
  44. EDUCATE_CONTENT:'',
  45. referenceShow:false,
  46. tablelist:[],
  47. pageNo:1,
  48. pagesize:10,
  49. pagetotal:'',
  50. checkList:[],
  51. placeholder:"请选择参考信息",
  52. }
  53. },
  54. mounted: function () {
  55. var vm = this
  56. this.getResultList()
  57. document.addEventListener('click',function(){
  58. // if(vm.referenceShow){
  59. // vm.referenceShow = false
  60. // }
  61. })
  62. },
  63. watch:{
  64. checkList() {
  65. this.placeholder = this.checkList.length!=0?"已选"+this.checkList.length+"项":"请选择参考信息"
  66. },
  67. },
  68. methods: {
  69. submitBtn:function() {
  70. var vm = this
  71. var loadingid = top.layer.load(1, {
  72. shade: [0.1, '#fff'] //0.1透明度的白色背景
  73. })
  74. if (!param.patientPhone) {
  75. top.showErrorMessage('请填写病人手机号码')
  76. top.layer.close(loadingid)
  77. return
  78. }
  79. if (!param.text) {
  80. top.showErrorMessage('请填写验证码')
  81. top.layer.close(loadingid)
  82. return
  83. }
  84. var p = JSON.parse(JSON.stringify(param))
  85. var user = JSON.parse(sessionStorage.getItem('LoginUser'))
  86. p.dcode = user.code
  87. p.dname = user.name
  88. p.relationCode = ''
  89. p.reservationType = $('input:radio:checked').val()
  90. p.incidentalMsgType = '11' //筛查报告11
  91. p.incidentalMsg = '筛查报告' //参考信息
  92. p.reservationReason = vm.EDUCATE_CONTENT // 转诊原因
  93. var content = []
  94. vm.checkList.forEach(function(s){
  95. content.push({
  96. addinfoText:s.czrq+s.templateTitle,
  97. code:s.code,
  98. patient:s.patientCode,
  99. patientName:s.patientName,
  100. })
  101. })
  102. var para = {
  103. type:"11",
  104. content:content,
  105. }
  106. p.paramJson = encodeURIComponent(encodeURIComponent(JSON.stringify([para])))
  107. var arrangeDate = JSON.parse(p.arrangeDate)
  108. arrangeDate.sectionType = 'a'
  109. arrangeDate.clazz = 'div-time-enable'
  110. p.arrangeDate = JSON.stringify(arrangeDate)
  111. // "sectionType":"a","clazz":"div-time-enable"
  112. // p.arrangeDate = JSON.stringify(p.arrangeDate)
  113. // {"max":"1","startTime":"2020/4/17 8:00:00","used":"0","endTime":"2020/4/17 8:07:00","sectionType":"a","clazz":"div-time-enable"}
  114. APIService.createOrderByDoctor(p)
  115. .then(function (res) {
  116. top.layer.close(loadingid)
  117. if (res.status == 200) {
  118. top.showSuccessMessage('提交预约挂号成功!')
  119. if (backToSynergy) {
  120. top.setSynergyData(param)
  121. }
  122. closeLayer()
  123. } else {
  124. top.showErrorMessage(res.msg || '预约挂号提交失败!请稍后重试')
  125. }
  126. })
  127. .catch(function (e) {
  128. top.layer.close(loadingid)
  129. console && console.error(e)
  130. })
  131. },
  132. more:function() {
  133. this.pageNo++
  134. this.getResultList()
  135. },
  136. getResultList:function() {
  137. var vm = this
  138. var params = {
  139. diseaseType: '', //疾病类型
  140. dealType: '', //处理方式(全部为空 1已预约 2已跟踪 3已接诊4待处理)
  141. patientName:vm.param.patientName, //搜索居民的姓名
  142. isDanger: 1, //是否高危预警(0否 1是)
  143. pageNo: this.pageNo,
  144. pageSize: vm.pagesize
  145. }
  146. jbscAPI.getResultList(params).then(function (res) {
  147. if (res.status == 200) {
  148. if(this.pageNo==1) {
  149. vm.tablelist = res.data.data
  150. }else{
  151. vm.tablelist = vm.tablelist.concat(res.data.data)
  152. }
  153. vm.pagetotal = Math.ceil(res.data.num / vm.pagesize)
  154. } else {
  155. showErrorMessage(res.msg)
  156. }
  157. })
  158. },
  159. }
  160. })