statistics.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. function showSuccessMessage(msg) {
  2. layer.msg(msg, {
  3. icon: 1
  4. })
  5. }
  6. function showErrorMessage(msg) {
  7. layer.msg(msg, {
  8. icon: 5
  9. })
  10. }
  11. function showWarningMessage(msg) {
  12. layer.msg(msg, {
  13. icon: 2
  14. })
  15. }
  16. function showInfoMessage(msg) {
  17. layer.msg(msg, {
  18. icon: 6
  19. })
  20. }
  21. new Vue({
  22. el: '#app',
  23. data: {
  24. modal: "",
  25. type: "",
  26. status: "",
  27. name: "",
  28. isDanger: "1",
  29. pagesize: 10,
  30. total: 0,
  31. pagetotal: 0, //总页数
  32. currentPage: 1, //当前页数
  33. tablelist: [],
  34. types: [],
  35. Statics: {},
  36. wujilu: false,
  37. datamodelshow: true,
  38. },
  39. mounted: function() {
  40. var vm = this
  41. vm.getModal()
  42. vm.getDatas()
  43. vm.gettypes()
  44. },
  45. methods: {
  46. //获取筛查数据模型
  47. getModal: function() {
  48. var vm = this
  49. jbscAPI.screenStatics().then(function(res) {
  50. if(res.status == 200) {
  51. vm.Statics = res.data;
  52. } else {
  53. showErrorMessage(res.msg);
  54. }
  55. })
  56. },
  57. //获取数据
  58. getDatas: function() {
  59. var vm = this
  60. var params = {
  61. diseaseType: vm.type, //疾病类型
  62. dealType: vm.status, //处理方式(全部为空 1已预约 2已跟踪 3已接诊4待处理)
  63. patientName: vm.name, //搜索居民的姓名
  64. isDanger: vm.isDanger, //是否高危预警(0否 1是)
  65. pageNo: vm.currentPage,
  66. pageSize: vm.pagesize
  67. }
  68. jbscAPI.getResultList(params).then(function(res) {
  69. if(res.status == 200) {
  70. vm.wujilu = false
  71. vm.total = res.data.num
  72. vm.pagetotal = Math.ceil(res.data.num / vm.pagesize)
  73. vm.tablelist = res.data.data;
  74. if(vm.tablelist.length == 0) {
  75. vm.wujilu = true
  76. }
  77. } else {
  78. showErrorMessage(res.msg);
  79. }
  80. })
  81. },
  82. gettypes: function() {
  83. var vm = this
  84. var search = true
  85. $("#Status").bsSuggest({
  86. data: {
  87. value: [{
  88. code: "",
  89. name: "全部"
  90. },
  91. {
  92. code: "1",
  93. name: "已预约"
  94. },
  95. {
  96. code: "2",
  97. name: "已跟踪"
  98. },
  99. {
  100. code: "3",
  101. name: "已接诊"
  102. },
  103. {
  104. code: "4",
  105. name: "待处理"
  106. },
  107. {
  108. code: "5",
  109. name: "日常健康管理"
  110. }
  111. ]
  112. },
  113. getDataMethod: "data",
  114. effectiveFields: ["name"],
  115. idField: "code",
  116. keyField: "name"
  117. });
  118. jbscAPI.getSpecialDisease().then(function(res) {
  119. if(res.status == 200) {
  120. var data = {}
  121. data.value = _.map(res.data, function(v) {
  122. return {
  123. code: v.code,
  124. name: v.name
  125. }
  126. })
  127. if(search) {
  128. data.value = [{
  129. code: "",
  130. name: "全部"
  131. }].concat(data.value)
  132. }
  133. $("#Type").bsSuggest({
  134. data: data,
  135. getDataMethod: "data",
  136. effectiveFields: ["name"],
  137. idField: "code",
  138. keyField: "name"
  139. });
  140. vm.types = res.data;
  141. } else {
  142. showErrorMessage(res.msg);
  143. }
  144. })
  145. },
  146. gettable: function(type) {
  147. var vm = this
  148. if(type == "1") {
  149. if(vm.status == "") {
  150. $("#Status").attr({
  151. "data-id": "",
  152. "value": "全部"
  153. })
  154. $("#Status").val("全部")
  155. }
  156. } else {
  157. if(vm.status != "") {
  158. vm.status = ""
  159. $("#Status").attr({
  160. "data-id": "",
  161. "value": "全部"
  162. })
  163. $("#Status").val("全部")
  164. }
  165. }
  166. vm.isDanger = type
  167. vm.search(1)
  168. },
  169. //页面跳转
  170. search: function(page) {
  171. var vm = this
  172. vm.type = $("#Type").attr("data-id");
  173. var status = $("#Status").attr("data-id");
  174. if(status == "5") {
  175. vm.status = "";
  176. vm.isDanger = "0";
  177. } else if(status == "" || status == undefined) {
  178. if(vm.isDanger == "0") {
  179. vm.isDanger = ""
  180. }
  181. vm.status = status;
  182. } else {
  183. vm.isDanger = "1";
  184. vm.status = status;
  185. }
  186. vm.currentPage = page
  187. vm.getDatas()
  188. },
  189. //转诊
  190. zhuanzhen: function() {
  191. showInfoMessage("PC上暂不支持,请打开手机端疑似高危记录进行转诊预约!")
  192. },
  193. //健康教育
  194. jkjy: function(data) {
  195. // sessionStorage.setItem("jbsc-jkwzreceiver", JSON.stringify(receiver))
  196. // sessionStorage.setItem("jbsc-jkroler", 1)
  197. layer.open({
  198. type: 2,
  199. // offset: ['100px'], //右下角弹出
  200. area: ['80%', '648px'],
  201. shade: 0.5,
  202. title: '健康教育',
  203. fixed: true, //不固定
  204. maxmin: true,
  205. closeBtn: 1,
  206. shift: 5,
  207. shadeClose: false, //点击遮罩关闭层
  208. content: "../../article/html/article.html?code=" + data.patientCode + '&resultCode=' + data.code
  209. });
  210. // location.href="../../../../health-education/login.html?origin=jbsc"
  211. },
  212. view: function(data) {
  213. layer.open({
  214. type: 2,
  215. // offset: ['100px'], //右下角弹出
  216. area: ['568px', '100%'],
  217. shade: 0.5,
  218. title: '查看筛选结果',
  219. fixed: true, //不固定
  220. maxmin: true,
  221. closeBtn: 1,
  222. shift: 5,
  223. shadeClose: false, //点击遮罩关闭层
  224. content: '../../jbsc/html/view_screening_results.html?isView=true&resultCode=' + data.code
  225. });
  226. },
  227. //筛查
  228. shaicha: function(data, isNew) {
  229. var vm = this
  230. if(isNew) {
  231. //再次筛查数+1
  232. layer.open({
  233. type: 2,
  234. area: ['820px', '648px'],
  235. shade: 0.5,
  236. id: "questionnaire",
  237. title: '筛选统计',
  238. fixed: true, //不固定
  239. maxmin: true,
  240. closeBtn: 1,
  241. shift: 5,
  242. shadeClose: false, //点击遮罩关闭层
  243. content: '../../jbsc/html/questionnaire.html?fliter_code=' + data.templateCode + '&fliter_title=' + data.templateTitle + '&resident_code=' + data.patientCode + '&resident_name=' + data.patientName
  244. });
  245. return;
  246. }
  247. layer.open({
  248. type: 2,
  249. offset: 'rb', //右下角弹出
  250. id: "filter_type",
  251. area: ['280px', '100%'],
  252. shade: 0.5,
  253. title: false,
  254. fixed: true, //不固定
  255. maxmin: false,
  256. closeBtn: 0,
  257. shift: 5,
  258. shadeClose: true, //点击遮罩关闭层
  259. content: '../../jbsc/html/filter_type.html'
  260. });
  261. },
  262. //健康跟踪
  263. jkgz: function(data) {
  264. var vm = this
  265. //跳转到筛查结果页面
  266. var index = layer.open({
  267. type: 2,
  268. area: ['500px', '550px'],
  269. shade: 0.5,
  270. title: '家医建议',
  271. fixed: true, //不固定
  272. maxmin: false,
  273. closeBtn: 1,
  274. shift: 5,
  275. shadeClose: false, //点击遮罩关闭层
  276. content: '../../jbsc/html/advice.html?resultCode=' + data.code + '&filter_code=' + data.templateCode
  277. });
  278. console.log(index)
  279. },
  280. datamodeltap: function() {
  281. var vm = this
  282. $("#sc_datamodel").toggle("normal", function() {
  283. if(vm.datamodelshow) {
  284. vm.datamodelshow = false
  285. $("#datamodeltap").removeClass("up_datamodel").addClass("down_datamodel")
  286. $("#datamodeltap span").text("展开")
  287. } else {
  288. vm.datamodelshow = true
  289. $("#datamodeltap").removeClass("down_datamodel").addClass("up_datamodel")
  290. $("#datamodeltap span").text("收起")
  291. }
  292. });
  293. }
  294. }
  295. })