daily_collect.js 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895
  1. //@ sourceURL=daily_collect.js
  2. var LODOP; //声明为全局变量
  3. //默认打印机下标
  4. var printIndex = -1;
  5. var canPrint = false;
  6. $(function () {
  7. //init_daterangepicker();
  8. daterangepicker(initFeeTable);
  9. // initFeeTable();
  10. //重置查询参数
  11. $('#btn_clean').click(function () {
  12. cleanParams();
  13. });
  14. //初始化页面上面的按钮事件
  15. $("#btn_daily").click(function (t) {
  16. print();
  17. });
  18. setTimeout(function () {
  19. getLodop();
  20. }, 400);
  21. $(".selectpicker").selectpicker({
  22. dropuAuto: false
  23. });
  24. });
  25. /**
  26. * 列表类型按钮切换事件
  27. * @param object
  28. */
  29. function reportButtonChange(object) {
  30. $("#pay_mark_group").find("button").each(function (index, element) {
  31. if ($(element).hasClass("btn-primary")) {
  32. $(element).removeClass("btn-primary").addClass("btn-default");
  33. }
  34. });
  35. $(object).removeClass("btn-default").addClass("btn-primary");
  36. initFeeTable();
  37. }
  38. /**
  39. * 初始化收费表格
  40. */
  41. function initFeeTable() {
  42. $('#tb_table').bootstrapTable("destroy");
  43. $("#report_table").removeClass("in").addClass("hide");
  44. var payMarkGroup = getIndex("pay_mark_group");
  45. if (payMarkGroup == 0) {
  46. getRjbb();
  47. } else if (payMarkGroup == 1) {
  48. getsfqd();
  49. } else if (payMarkGroup == 2) {
  50. getGhqd();
  51. }
  52. canPrint = true;
  53. }
  54. /**
  55. * 获取日结报表
  56. */
  57. function getRjbb() {
  58. $("#report_table").removeClass("hide").addClass("in");
  59. var rePortRangeArr = getRePortRangeArr();
  60. $.ajax({
  61. type: "POST",
  62. url: '/thmz/getFullChargeCollect',
  63. contentType: "application/json;charset=UTF-8",
  64. dataType: "json",
  65. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  66. data: JSON.stringify({
  67. beginDate: rePortRangeArr[0],
  68. endDate: rePortRangeArr[1],
  69. hisData: $('#hisData').is(':checked') ? 0 : 1
  70. }),
  71. success: function (res) {
  72. if (res == '401' || res == 401) {
  73. window.location.href = '/thmz/login/view'
  74. return;
  75. }
  76. if (res.code == 0) {
  77. $("#dcountDate").html($('#reportrange span').html());
  78. $("#charge1").html(res.mzReceiptSerial.charge1.toFixed(2));
  79. $("#charge2").html(res.mzReceiptSerial.charge2.toFixed(2));
  80. $("#charge3").html(res.mzReceiptSerial.charge3.toFixed(2));
  81. $("#charge4").html(res.mzReceiptSerial.charge4.toFixed(2));
  82. $("#charge5").html(res.mzReceiptSerial.charge5.toFixed(2));
  83. $("#charge6").html(res.mzReceiptSerial.charge6.toFixed(2));
  84. $("#charge7").html(res.mzReceiptSerial.charge7.toFixed(2));
  85. $("#charge8").html(res.mzReceiptSerial.charge8.toFixed(2));
  86. $("#charge9").html(res.mzReceiptSerial.charge9.toFixed(2));
  87. $("#charge10").html(res.mzReceiptSerial.charge10.toFixed(2));
  88. $("#charge11").html(res.mzReceiptSerial.charge11.toFixed(2));
  89. $("#charge12").html(res.mzReceiptSerial.charge12.toFixed(2));
  90. $("#charge13").html(res.mzReceiptSerial.charge13.toFixed(2));
  91. $("#charge14").html(res.mzReceiptSerial.charge14.toFixed(2));
  92. $("#charge15").html(res.mzReceiptSerial.charge15.toFixed(2));
  93. $("#charge16").html(res.mzReceiptSerial.charge16.toFixed(2));
  94. $("#charge17").html(res.mzReceiptSerial.charge17.toFixed(2));
  95. $("#charge18").html(res.mzReceiptSerial.charge18.toFixed(2));
  96. $("#charge19").html(res.mzReceiptSerial.charge19.toFixed(2));
  97. $("#charge20").html(res.mzReceiptSerial.charge20.toFixed(2));
  98. $("#totalCharge").html(res.mzReceiptSerial.totalCharge.toFixed(2));
  99. $("#dcountDate_p").html($('#reportrange span').html());
  100. $("#charge1_p").html(res.mzReceiptSerial.charge1.toFixed(2));
  101. $("#charge2_p").html(res.mzReceiptSerial.charge2.toFixed(2));
  102. $("#charge3_p").html(res.mzReceiptSerial.charge3.toFixed(2));
  103. $("#charge4_p").html(res.mzReceiptSerial.charge4.toFixed(2));
  104. $("#charge5_p").html(res.mzReceiptSerial.charge5.toFixed(2));
  105. $("#charge6_p").html(res.mzReceiptSerial.charge6.toFixed(2));
  106. $("#charge7_p").html(res.mzReceiptSerial.charge7.toFixed(2));
  107. $("#charge8_p").html(res.mzReceiptSerial.charge8.toFixed(2));
  108. $("#charge9_p").html(res.mzReceiptSerial.charge9.toFixed(2));
  109. $("#charge10_p").html(res.mzReceiptSerial.charge10.toFixed(2));
  110. $("#charge11_p").html(res.mzReceiptSerial.charge11.toFixed(2));
  111. $("#charge12_p").html(res.mzReceiptSerial.charge12.toFixed(2));
  112. $("#charge13_p").html(res.mzReceiptSerial.charge13.toFixed(2));
  113. $("#charge14_p").html(res.mzReceiptSerial.charge14.toFixed(2));
  114. $("#charge15_p").html(res.mzReceiptSerial.charge15.toFixed(2));
  115. $("#charge16_p").html(res.mzReceiptSerial.charge16.toFixed(2));
  116. $("#charge17_p").html(res.mzReceiptSerial.charge17.toFixed(2));
  117. $("#charge18_p").html(res.mzReceiptSerial.charge18.toFixed(2));
  118. $("#charge19_p").html(res.mzReceiptSerial.charge19.toFixed(2));
  119. $("#charge20_p").html(res.mzReceiptSerial.charge20.toFixed(2));
  120. $("#totalCharge_p").html(res.mzReceiptSerial.totalCharge.toFixed(2));
  121. //现金收款
  122. $("#xjbs").html(res.chargeCountVo.xjbs);
  123. $("#xjbs_p").html(res.chargeCountVo.xjbs);
  124. if (res.chargeCountVo.xjsk != null) {
  125. $("#xjsk").html(res.chargeCountVo.xjsk.toFixed(2));
  126. $("#xjsk_p").html(res.chargeCountVo.xjsk.toFixed(2));
  127. }
  128. $("#xjtfbs").html(res.chargeCountVo.xjtfbs);
  129. $("#xjtfbs_p").html(res.chargeCountVo.xjtfbs);
  130. if (res.chargeCountVo.xjtf != null) {
  131. $("#xjtf").html(res.chargeCountVo.xjtf.toFixed(2));
  132. $("#xjtf_p").html(res.chargeCountVo.xjtf.toFixed(2));
  133. }
  134. $("#xjssbs").html(res.chargeCountVo.xjssbs);
  135. $("#xjssbs_p").html(res.chargeCountVo.xjssbs);
  136. if (res.chargeCountVo.xjss != null) {
  137. $("#xjss").html(res.chargeCountVo.xjss.toFixed(2));
  138. $("#xjss_p").html(res.chargeCountVo.xjss.toFixed(2));
  139. }
  140. //银行卡收款
  141. $("#yhsbs").html(res.chargeCountVo.yhsbs);
  142. $("#yhsbs_p").html(res.chargeCountVo.yhsbs);
  143. if (res.chargeCountVo.yhksk != null) {
  144. $("#yhksk").html(res.chargeCountVo.yhksk.toFixed(2));
  145. $("#yhksk_p").html(res.chargeCountVo.yhksk.toFixed(2));
  146. }
  147. $("#yhktfbs").html(res.chargeCountVo.yhktfbs);
  148. $("#yhktfbs_p").html(res.chargeCountVo.yhktfbs);
  149. if (res.chargeCountVo.yhktf != null) {
  150. $("#yhktf").html(res.chargeCountVo.yhktf.toFixed(2));
  151. $("#yhktf_p").html(res.chargeCountVo.yhktf.toFixed(2));
  152. }
  153. $("#yhkssbs").html(res.chargeCountVo.yhkssbs);
  154. $("#yhkssbs_p").html(res.chargeCountVo.yhkssbs);
  155. if (res.chargeCountVo.yhkss != null) {
  156. $("#yhkss").html(res.chargeCountVo.yhkss.toFixed(2));
  157. $("#yhkss_p").html(res.chargeCountVo.yhkss.toFixed(2));
  158. }
  159. //支付宝收款
  160. $("#zfbbs").html(res.chargeCountVo.zfbbs);
  161. $("#zfbbs_p").html(res.chargeCountVo.zfbbs);
  162. if (res.chargeCountVo.zfbsk != null) {
  163. $("#zfbsk").html(res.chargeCountVo.zfbsk.toFixed(2));
  164. $("#zfbsk_p").html(res.chargeCountVo.zfbsk.toFixed(2));
  165. }
  166. $("#zfbtfbs").html(res.chargeCountVo.zfbtfbs);
  167. $("#zfbtfbs_p").html(res.chargeCountVo.zfbtfbs);
  168. if (res.chargeCountVo.zfbtf != null) {
  169. $("#zfbtf").html(res.chargeCountVo.zfbtf.toFixed(2));
  170. $("#zfbtf_p").html(res.chargeCountVo.zfbtf.toFixed(2));
  171. }
  172. $("#zfbssbs").html(res.chargeCountVo.zfbssbs);
  173. $("#zfbssbs_p").html(res.chargeCountVo.zfbssbs);
  174. if (res.chargeCountVo.zfbss != null) {
  175. $("#zfbss").html(res.chargeCountVo.zfbss.toFixed(2));
  176. $("#zfbss_p").html(res.chargeCountVo.zfbss.toFixed(2));
  177. }
  178. //微信收款
  179. $("#wxbs").html(res.chargeCountVo.wxbs);
  180. $("#wxbs_p").html(res.chargeCountVo.wxbs);
  181. if (res.chargeCountVo.wxsk != null) {
  182. $("#wxsk").html(res.chargeCountVo.wxsk.toFixed(2));
  183. $("#wxsk_p").html(res.chargeCountVo.wxsk.toFixed(2));
  184. }
  185. $("#wxtfbs").html(res.chargeCountVo.wxtfbs);
  186. $("#wxtfbs_p").html(res.chargeCountVo.wxtfbs);
  187. if (res.chargeCountVo.wxtf != null) {
  188. $("#wxtf").html(res.chargeCountVo.wxtf.toFixed(2));
  189. }
  190. $("#wxssbs").html(res.chargeCountVo.wxssbs);
  191. $("#wxssbs_p").html(res.chargeCountVo.wxssbs);
  192. if (res.chargeCountVo.wxss != null) {
  193. $("#wxss").html(res.chargeCountVo.wxss.toFixed(2));
  194. $("#wxss_p").html(res.chargeCountVo.wxss.toFixed(2));
  195. }
  196. //记账绿色通道收款
  197. $("#zfbs").html(res.chargeCountVo.zfbs);
  198. $("#zfbs_p").html(res.chargeCountVo.zfbs);
  199. if (res.chargeCountVo.zfsk != null) {
  200. $("#zfsk").html(res.chargeCountVo.zfsk.toFixed(2));
  201. $("#zfsk_p").html(res.chargeCountVo.zfsk.toFixed(2));
  202. }
  203. $("#zftfbs").html(res.chargeCountVo.zftfbs);
  204. $("#zftfbs_p").html(res.chargeCountVo.zftfbs);
  205. if (res.chargeCountVo.zftf != null) {
  206. $("#zftf").html(res.chargeCountVo.zftf.toFixed(2));
  207. $("#zftf_p").html(res.chargeCountVo.zftf.toFixed(2));
  208. }
  209. $("#zfssbs").html(res.chargeCountVo.zfssbs);
  210. $("#zfssbs_p").html(res.chargeCountVo.zfssbs);
  211. if (res.chargeCountVo.zfss != null) {
  212. $("#zfss").html(res.chargeCountVo.zfss.toFixed(2));
  213. $("#zfss_p").html(res.chargeCountVo.zfss.toFixed(2));
  214. }
  215. //医保卡收款
  216. $("#sybbs").html(res.chargeCountVo.sybbs);
  217. $("#sybbs_p").html(res.chargeCountVo.sybbs);
  218. if (res.chargeCountVo.sybksk != null) {
  219. $("#sybksk").html(res.chargeCountVo.sybksk.toFixed(2));
  220. $("#sybksk_p").html(res.chargeCountVo.sybksk.toFixed(2));
  221. }
  222. $("#sybtfbs").html(res.chargeCountVo.sybtfbs);
  223. $("#sybtfbs_p").html(res.chargeCountVo.sybtfbs);
  224. if (res.chargeCountVo.sybtf != null) {
  225. $("#sybtf").html(res.chargeCountVo.sybtf.toFixed(2));
  226. $("#sybtf_p").html(res.chargeCountVo.sybtf.toFixed(2));
  227. }
  228. $("#sybssbs").html(res.chargeCountVo.sybssbs);
  229. $("#sybssbs_p").html(res.chargeCountVo.sybssbs);
  230. if (res.chargeCountVo.sybkss != null) {
  231. $("#sybkss").html(res.chargeCountVo.sybkss.toFixed(2));
  232. $("#sybkss_p").html(res.chargeCountVo.sybkss.toFixed(2));
  233. }
  234. //总计收款
  235. $("#zjbs").html(res.chargeCountVo.zjbs);
  236. $("#zjbs_p").html(res.chargeCountVo.zjbs);
  237. if (res.chargeCountVo.zjsk != null) {
  238. $("#zjsk").html(res.chargeCountVo.zjsk.toFixed(2));
  239. $("#zjsk_p").html(res.chargeCountVo.zjsk.toFixed(2));
  240. }
  241. $("#ztfbs").html(res.chargeCountVo.ztfbs);
  242. $("#ztfbs_p").html(res.chargeCountVo.ztfbs);
  243. if (res.chargeCountVo.zjtk != null) {
  244. $("#zjtk").html(res.chargeCountVo.zjtk.toFixed(2));
  245. $("#zjtk_p").html(res.chargeCountVo.zjtk.toFixed(2));
  246. }
  247. $("#zjssbs").html(res.chargeCountVo.zjssbs);
  248. $("#zjssbs_p").html(res.chargeCountVo.zjssbs);
  249. if (res.chargeCountVo.zjss != null) {
  250. $("#zjss").html(res.chargeCountVo.zjss.toFixed(2));
  251. $("#zjss_p").html(res.chargeCountVo.zjss.toFixed(2));
  252. }
  253. if (res.chargeCountVo.sjhj != null) {
  254. $("#sjhj").html(res.chargeCountVo.sjhj.toFixed(2));
  255. $("#sjhj_p").html(res.chargeCountVo.sjhj.toFixed(2));
  256. }
  257. $("#sjhjdx").html(res.chargeCountVo.sjhjdx);
  258. $("#sjhjdx_p").html(res.chargeCountVo.sjhjdx);
  259. if (res.chargeCountVo.zfss != null) {
  260. $("#zfsshj").html(res.chargeCountVo.zfss.toFixed(2));
  261. $("#zfsshj_p").html(res.chargeCountVo.zfss.toFixed(2));
  262. }
  263. $("#zfdx").html(res.chargeCountVo.zfdx);
  264. $("#zfdx_p").html(res.chargeCountVo.zfdx);
  265. if (res.chargeCountVo.zj != null) {
  266. $("#zj").html(res.chargeCountVo.zj.toFixed(2));
  267. $("#zj_p").html(res.chargeCountVo.zj.toFixed(2));
  268. }
  269. $("#zjdx").html(res.chargeCountVo.zjdx);
  270. $("#zjdx_p").html(res.chargeCountVo.zjdx);
  271. $("#sffps").html(res.sffps);
  272. $("#tpzs").html(res.tpzs);
  273. $("#zffps").html(res.zffps);
  274. $("#sffps_p").html(res.sffps);
  275. $("#tpzs_p").html(res.tpzs);
  276. $("#zffps_p").html(res.zffps);
  277. $("#dcountDate_gh").html($('#reportrange span').html());
  278. $("#dcountDate_gh_p").html($('#reportrange span').html());
  279. if (res.ghsrgcmx.ghje != null) {
  280. $("#ghje").html(res.ghsrgcmx.ghje.toFixed(2));
  281. $("#ghje_p").html(res.ghsrgcmx.ghje.toFixed(2));
  282. }
  283. $("#ghfps").html("所用票数:" + res.ghfps);
  284. $("#qmhs").html("全免号数:" + res.ghsrgcmx.qmhs);
  285. $("#ghfps_p").html("所用票数:" + res.ghfps);
  286. $("#qmhs_p").html("全免号数:" + res.ghsrgcmx.qmhs);
  287. if (res.ghsrgcmx.jzhs != null) {
  288. $("#jzhs").html("记账号数:" + res.ghsrgcmx.jzhs);
  289. $("#jzhs_p").html("记账号数:" + res.ghsrgcmx.jzhs);
  290. }
  291. if (res.ghsrgcmx.jzje != null) {
  292. $("#jzje").html("记账金额:" + res.ghsrgcmx.jzje);
  293. $("#jzje_p").html("记账金额:" + res.ghsrgcmx.jzje);
  294. }
  295. if (res.ghsrgcmx.zcsr != null) {
  296. $("#zcsr").html("诊察收入:" + res.ghsrgcmx.zcsr.toFixed(2));
  297. $("#zcsr_p").html("诊察收入:" + res.ghsrgcmx.zcsr.toFixed(2));
  298. }
  299. if (res.ghsrgcmx.jcsr != null) {
  300. $("#jcsr").html("检查收入:" + res.ghsrgcmx.jcsr.toFixed(2));
  301. $("#jcsr_p").html("检查收入:" + res.ghsrgcmx.jcsr.toFixed(2));
  302. }
  303. if (res.ghsrgcmx.ghsr != null) {
  304. $("#ghsr").html("挂号费(门诊):" + res.ghsrgcmx.ghsr.toFixed(2));
  305. $("#ghsr_p").html("挂号费(门诊):" + res.ghsrgcmx.ghsr.toFixed(2));
  306. }
  307. if (res.ghsrgcmx.thje != null) {
  308. $("#thje").html(res.ghsrgcmx.thje.toFixed(2));
  309. $("#thje_p").html(res.ghsrgcmx.thje.toFixed(2));
  310. }
  311. $("#ghtpzs").html("退票数:" + res.ghtpzs);
  312. $("#ghtpzs_p").html("退票数:" + res.ghtpzs);
  313. if (res.ghsrgcmx.ghhj != null) {
  314. $("#ghhj").html(res.ghsrgcmx.ghhj.toFixed(2));
  315. $("#ghhj_p").html(res.ghsrgcmx.ghhj.toFixed(2));
  316. }
  317. if (res.ghsrgcmx.ghjebhjz != null) {
  318. $("#ghjebhjz").html("合计(不含记账) " + res.ghsrgcmx.ghjebhjz.toFixed(2));
  319. $("#ghjebhjz_p").html("合计(不含记账) " + res.ghsrgcmx.ghjebhjz.toFixed(2));
  320. }
  321. $("#ghhjdx").html(res.ghsrgcmx.ghhjdx);
  322. $("#ghjebhjzdx").html("合计(不含记账) " + res.ghsrgcmx.ghjebhjzdx);
  323. $("#ghhjdx_p").html(res.ghsrgcmx.ghhjdx);
  324. $("#ghjebhjzdx_p").html("合计(不含记账) " + res.ghsrgcmx.ghjebhjzdx);
  325. if (res.ghWorkloadVos.length == 0) {
  326. $("#ghgzlhzb_parent").css("display", "none");
  327. $("#ghgzlhzb_parent_p").css("display", "none");
  328. } else if (res.ghWorkloadVos.length > 0) {
  329. $("#ghgzlhzb_parent").css("display", "block");
  330. $("#ghgzlhzb_parent_p").css("display", "block");
  331. var html = '';
  332. for (var i = 0; i < res.ghWorkloadVos.length - 1; i++) {
  333. var temp = res.ghWorkloadVos[i];
  334. html += '<tr><td>' + temp.opId + '</td>';
  335. html += '<td>' + format(temp.closingDate, "yyyy-MM-dd HH:mm:ss") + '</td>';
  336. html += '<td>' + temp.ptCount + '</td>';
  337. html += '<td>' + temp.ptAmount.toFixed(2) + '</td>';
  338. html += '<td>' + temp.thCount + '</td>';
  339. html += '<td>' + temp.thAmount.toFixed(2) + '</td>';
  340. html += '<td>' + temp.totalAmount.toFixed(2) + '</td></tr>';
  341. }
  342. var temp = res.ghWorkloadVos[res.ghWorkloadVos.length - 1];
  343. html += '<tr><td colspan="2">总计</td>';
  344. html += '<td>' + temp.ptCount + '</td>';
  345. html += '<td>' + temp.ptAmount.toFixed(2) + '</td>';
  346. html += '<td>' + temp.thCount + '</td>';
  347. html += '<td>' + temp.thAmount.toFixed(2) + '</td>';
  348. html += '<td>' + temp.totalAmount.toFixed(2) + '</td></tr>';
  349. $("#ghgzlhzb").html(html);
  350. $("#ghgzlhzb_p").html(html);
  351. }
  352. if (res.sfWorkloadVos.length == 0) {
  353. $("#sfgzlhzb_parent").css("display", "none");
  354. $("#sfgzlhzb_parent_p").css("display", "none");
  355. } else if (res.sfWorkloadVos.length > 0) {
  356. $("#sfgzlhzb_parent").css("display", "block");
  357. $("#sfgzlhzb_parent_p").css("display", "block");
  358. var html = '';
  359. for (var i = 0; i < res.sfWorkloadVos.length-1; i++) {
  360. var temp = res.sfWorkloadVos[i];
  361. html += '<tr><td>' + temp.opId + '</td>';
  362. html += '<td>' + format(temp.closingDate, "yyyy-MM-dd HH:mm:ss") + '</td>';
  363. html += '<td>' + temp.ptCount + '</td>';
  364. html += '<td>' + temp.ptAmount.toFixed(2) + '</td>';
  365. html += '<td>' + temp.thCount + '</td>';
  366. html += '<td>' + temp.thAmount.toFixed(2) + '</td>';
  367. html += '<td>' + temp.totalAmount.toFixed(2) + '</td></tr>';
  368. }
  369. var temp = res.sfWorkloadVos[res.sfWorkloadVos.length - 1];
  370. html += '<tr><td colspan="2">总计</td>';
  371. html += '<td>' + temp.ptCount + '</td>';
  372. html += '<td>' + temp.ptAmount.toFixed(2) + '</td>';
  373. html += '<td>' + temp.thCount + '</td>';
  374. html += '<td>' + temp.thAmount.toFixed(2) + '</td>';
  375. html += '<td>' + temp.totalAmount.toFixed(2) + '</td></tr>';
  376. $("#sfgzlhzb").html(html);
  377. $("#sfgzlhzb_p").html(html);
  378. }
  379. if (res.chargeDetailVos.length == 0) {
  380. $("#mzskylb_parent").css("display", "none");
  381. $("#mzskylb_parent_p").css("display", "none");
  382. } else if (res.chargeDetailVos.length > 0) {
  383. $("#mzskylb_parent").css("display", "block");
  384. $("#mzskylb_parent_p").css("display", "block");
  385. var html = '';
  386. for (var i = 0; i < res.chargeDetailVos.length-1; i++) {
  387. var temp = res.chargeDetailVos[i];
  388. if (i % 3 == 0) {
  389. html += '<tr>';
  390. }
  391. html += '<td>' + temp.auditCode + '</td>';
  392. html += '<td>' + temp.amount + '</td>';
  393. html += '<td>' + temp.totalCharge.toFixed(2) + '</td>';
  394. if (i % 3 == 2 ) {
  395. html += '</tr>';
  396. }
  397. }
  398. var temp = res.chargeDetailVos[res.chargeDetailVos.length-1];
  399. if (i % 3 == 0) {
  400. html += '<tr>';
  401. }
  402. html += '<td colspan="2">合计</td>';
  403. html += '<td colspan="4">' + temp.totalCharge.toFixed(2) + '</td>';
  404. if (i % 3 == 2 || i == res.chargeDetailVos.length - 1) {
  405. html += '</tr>';
  406. }
  407. $("#mzskylb").html(html);
  408. $("#mzskylb_p").html(html);
  409. }
  410. $("#username_zbr").html(res.user.userName);
  411. $("#username_zbr_p").html(res.user.userName);
  412. } else if (res.code == -1) {
  413. new PNotify({
  414. title: '错误提示',
  415. text: res.message,
  416. type: 'error',
  417. hide: true,
  418. styling: 'bootstrap3'
  419. });
  420. }
  421. }
  422. });
  423. }
  424. /**
  425. * 挂号清单
  426. */
  427. function getGhqd() {
  428. $('#tb_table').bootstrapTable({
  429. url: '/thmz/getReqrecVoCollect', //请求后台的URL(*)
  430. method: 'post', //请求方式(*)
  431. toolbar: '#toolbar', //工具按钮用哪个容器
  432. striped: true, //是否显示行间隔色
  433. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  434. pagination: true, //是否显示分页(*)
  435. sortable: true, //是否启用排序
  436. sortOrder: "asc", //排序方式
  437. queryParams: queryParams, //传递参数(*)
  438. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  439. pageNumber: 1, //初始化加载第一页,默认第一页
  440. pageSize: 10, //每页的记录行数(*)
  441. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  442. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  443. strictSearch: true,
  444. showColumns: false, //是否显示所有的列
  445. showRefresh: false, //是否显示刷新按钮
  446. minimumCountColumns: 2, //最少允许的列数
  447. clickToSelect: true, //是否启用点击选中行
  448. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  449. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  450. cardView: false, //是否显示详细视图
  451. detailView: false,
  452. //rowStyle:rowStyle,//通过自定义函数设置行样式
  453. ajaxOptions: {
  454. headers: {
  455. 'Accept': 'application/json',
  456. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  457. }
  458. },
  459. columns: [
  460. {
  461. field: 'receiptBill',
  462. title: '收据号',
  463. align: "center",
  464. valign: 'middle'
  465. }, {
  466. field: 'serialNo',
  467. title: '机制号',
  468. align: "center",
  469. valign: 'middle',
  470. }, {
  471. field: 'patientId',
  472. title: '病人ID',
  473. align: "center",
  474. valign: 'middle',
  475. }, {
  476. field: 'name',
  477. title: '病人姓名',
  478. align: "center",
  479. valign: 'middle',
  480. }, {
  481. field: 'unitCode',
  482. title: '科别',
  483. align: "center",
  484. valign: 'middle'
  485. }, {
  486. field: 'chargeType',
  487. title: '号别',
  488. align: "center",
  489. valign: 'middle'
  490. }, {
  491. field: 'cancelMark',
  492. title: '状态',
  493. align: "center",
  494. valign: 'middle',
  495. }, {
  496. field: 'chargeFee',
  497. title: '金额',
  498. align: "center",
  499. valign: 'middle',
  500. formatter: function (value, row, index) {
  501. return value.toFixed(2);
  502. }
  503. }, {
  504. field: 'opId',
  505. title: '收费员',
  506. align: "center",
  507. valign: 'middle'
  508. }, {
  509. field: 'opDay',
  510. title: '挂号日期',
  511. align: "center",
  512. valign: 'middle',
  513. formatter: function (value, row, index) {
  514. return format(value, "yyyy-MM-dd HH:mm:ss");
  515. }
  516. }
  517. ],
  518. responseHandler: function (res) {
  519. if (res == '401' || res == 401) {
  520. window.location.href = '/thmz/login/view'
  521. return;
  522. }
  523. var ress = eval(res);
  524. if (ress.code == -1) {
  525. if (ress.message != null && ress.message != '') {
  526. new PNotify({
  527. title: '错误提示',
  528. text: ress.message,
  529. type: 'error',
  530. hide: true,
  531. styling: 'bootstrap3'
  532. });
  533. }
  534. return {
  535. "total": 0,//总页数
  536. "rows": {} //数据
  537. };
  538. }
  539. return {
  540. "total": ress.data.length,//总页数
  541. "rows": ress.data //数据
  542. };
  543. },
  544. });
  545. }
  546. /**
  547. * 收费请单
  548. */
  549. function getsfqd() {
  550. $('#tb_table').bootstrapTable({
  551. url: '/thmz/getChargeFeeVoCollect', //请求后台的URL(*)
  552. method: 'post', //请求方式(*)
  553. toolbar: '#toolbar', //工具按钮用哪个容器
  554. striped: true, //是否显示行间隔色
  555. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  556. pagination: true, //是否显示分页(*)
  557. sortable: true, //是否启用排序
  558. sortOrder: "asc", //排序方式
  559. queryParams: queryParams, //传递参数(*)
  560. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  561. pageNumber: 1, //初始化加载第一页,默认第一页
  562. pageSize: 10, //每页的记录行数(*)
  563. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  564. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  565. strictSearch: true,
  566. showColumns: false, //是否显示所有的列
  567. showRefresh: false, //是否显示刷新按钮
  568. minimumCountColumns: 2, //最少允许的列数
  569. clickToSelect: true, //是否启用点击选中行
  570. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  571. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  572. cardView: false, //是否显示详细视图
  573. detailView: false,
  574. //rowStyle:rowStyle,//通过自定义函数设置行样式
  575. ajaxOptions: {
  576. headers: {
  577. 'Accept': 'application/json',
  578. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  579. }
  580. },
  581. columns: [
  582. {
  583. field: 'patientId',
  584. title: '病人ID',
  585. align: "center",
  586. valign: 'middle'
  587. }, {
  588. field: 'serialNo',
  589. title: '机制号',
  590. align: "center",
  591. valign: 'middle',
  592. }, {
  593. field: 'payMark',
  594. title: '退欠标识',
  595. align: "center",
  596. valign: 'middle',
  597. }, {
  598. field: 'totalCharge',
  599. title: '金额',
  600. align: "center",
  601. valign: 'middle',
  602. formatter: function (value, row, index) {
  603. return value.toFixed(2);
  604. }
  605. }, {
  606. field: 'receiptBill',
  607. title: '发票号',
  608. align: "center",
  609. valign: 'middle'
  610. }, {
  611. field: 'chequeType',
  612. title: '付款方式',
  613. align: "center",
  614. valign: 'middle'
  615. }, {
  616. field: 'opId',
  617. title: '收费员',
  618. align: "center",
  619. valign: 'middle'
  620. }, {
  621. field: 'chargeDate',
  622. title: '收费日期',
  623. align: "center",
  624. valign: 'middle',
  625. formatter: function (value, row, index) {
  626. return format(value, "yyyy-MM-dd HH:mm:ss");
  627. }
  628. }
  629. ],
  630. responseHandler: function (res) {
  631. if (res == '401' || res == 401) {
  632. window.location.href = '/thmz/login/view'
  633. return;
  634. }
  635. var ress = eval(res);
  636. if (ress.code == -1) {
  637. if (ress.message != null && ress.message != '') {
  638. new PNotify({
  639. title: '错误提示',
  640. text: ress.message,
  641. type: 'error',
  642. hide: true,
  643. styling: 'bootstrap3'
  644. });
  645. }
  646. return {
  647. "total": 0,//总页数
  648. "rows": {} //数据
  649. };
  650. }
  651. return {
  652. "total": ress.data.length,//总页数
  653. "rows": ress.data //数据
  654. };
  655. },
  656. });
  657. }
  658. /**
  659. * 构建列表查询参数
  660. * @param params
  661. * @returns {{mzChargeDetail: {patientId: string | number | string[] | undefined | jQuery, warnDept: string | number | string[] | undefined | jQuery, doctorCode: string | number | string[] | undefined | jQuery, name: string | number | string[] | undefined | jQuery, payMark: number}, beginTime: Date, endTime: Date, pageSize: *, pageIndex: number}}
  662. */
  663. function queryParams(params) {
  664. var rePortRangeArr = getRePortRangeArr();
  665. var temp = {
  666. beginDate: rePortRangeArr[0],
  667. endDate: rePortRangeArr[1],
  668. hisData: $('#hisData').is(':checked') ? 0 : 1
  669. };
  670. return temp;
  671. };
  672. /**
  673. * 获取按钮组选择的下标
  674. * @param id
  675. * @returns {number}
  676. */
  677. function getIndex(id) {
  678. var index = 0;
  679. var item = $("#" + id).find("button");
  680. for (var i = 0; i <= item.length; i++) {
  681. if ($(item[i]).hasClass("btn-primary")) {
  682. index = i;
  683. break;
  684. }
  685. }
  686. return index;
  687. }
  688. /**
  689. * 获取时间选择器的时间数组
  690. * @returns {string[]}
  691. */
  692. function getRePortRangeArr() {
  693. var rePortRange = $('#reportrange span').html();
  694. var rePortRangeArr = rePortRange.split(" - ");
  695. rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
  696. rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
  697. return rePortRangeArr;
  698. }
  699. /**
  700. * 查询默认打印机
  701. */
  702. function setPrint() {
  703. if (printIndex >= 0) {
  704. return;
  705. }
  706. $.ajax({
  707. type: "GET",
  708. url: '/thmz/getLastWindowsByCurrentUser',
  709. contentType: "application/json;charset=UTF-8",
  710. dataType: "json",
  711. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  712. success: function (res) {
  713. if (res == '401' || res == 401) {
  714. window.location.href = '/thmz/login/view'
  715. return;
  716. }
  717. if (res.code == 0) {
  718. printIndex = res.data.cgPrintIndex;
  719. } else {
  720. printIndex = -1;
  721. }
  722. }
  723. });
  724. }
  725. /**
  726. * 清空查询条件
  727. */
  728. function cleanParams() {
  729. $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
  730. $("#hisData").removeAttr("checked");
  731. canPrint = false;
  732. }
  733. /**
  734. * 打印报表
  735. */
  736. function print() {
  737. if (!canPrint) {
  738. new PNotify({
  739. title: '警告提示',
  740. text: '没有选择合适的报表,无需打印',
  741. hide: false,
  742. styling: 'bootstrap3'
  743. });
  744. return;
  745. }
  746. setPrint();
  747. LODOP = getLodop();
  748. LODOP.PRINT_INITA(6, 0, "210mm", "297mm", "门诊收费收入日报表");
  749. var strStyle="<style> table,td,th {border-width: 1px;border-style: solid;border-collapse: collapse}</style>"
  750. //设置默认打印机
  751. LODOP.SET_PRINTER_INDEX(printIndex);
  752. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "297mm");
  753. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  754. LODOP.ADD_PRINT_HTM("0mm", "0mm", "210mm", "297mm", document.getElementById("printDiv").innerHTML);
  755. LODOP.NewPageA();
  756. //LODOP.ADD_PRINT_HTM("0mm", "0mm", "210mm", "297mm", document.getElementById("ghgzlhzb_parent_p").innerHTML);
  757. LODOP.ADD_PRINT_TABLE(70,"5%","90%",1000,strStyle+document.getElementById("ghgzlhzb_parent_p").innerHTML);
  758. LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
  759. LODOP.ADD_PRINT_HTM(26,"5%","90%",109,document.getElementById("ghgzlhzb_p_title").innerHTML);
  760. LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
  761. LODOP.SET_PRINT_STYLEA(0,"LinkedItem",2);
  762. LODOP.NewPageA();
  763. // LODOP.ADD_PRINT_HTM("0mm", "0mm", "210mm", "297mm", document.getElementById("sfgzlhzb_parent_p").innerHTML);
  764. LODOP.ADD_PRINT_TABLE(70,"5%","90%",1000,strStyle+document.getElementById("sfgzlhzb_parent_p").innerHTML);
  765. LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
  766. LODOP.ADD_PRINT_HTM(26,"5%","90%",109,document.getElementById("sfgzlhzb_parent_p_title").innerHTML);
  767. LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
  768. LODOP.SET_PRINT_STYLEA(0,"LinkedItem",4);
  769. LODOP.NewPageA();
  770. // LODOP.ADD_PRINT_HTM("0mm", "0mm", "210mm", "297mm", document.getElementById("mzskylb_parent_p").innerHTML);
  771. LODOP.ADD_PRINT_TABLE(128,"5%","90%",1000,strStyle+document.getElementById("mzskylb_parent_p").innerHTML);
  772. LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
  773. LODOP.ADD_PRINT_HTM(26,"5%","90%",109,document.getElementById("mzskylb_parent_p_title").innerHTML);
  774. LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
  775. LODOP.SET_PRINT_STYLEA(0,"LinkedItem",6);
  776. LODOP.PRINT();
  777. //LODOP.PREVIEW();
  778. }
  779. /**
  780. * 日期改变事件
  781. * @param callback 回调函数
  782. */
  783. function daterangepicker(callback) {
  784. if (typeof ($.fn.daterangepicker) === 'undefined') {
  785. return;
  786. }
  787. console.log('init_daterangepicker');
  788. var cb = function (start, end, label) {
  789. console.log(start.toISOString(), end.toISOString(), label);
  790. $('#reportrange span').html(start.format('YYYY-MM-DD') + ' - ' + end.format('YYYY-MM-DD'));
  791. callback();
  792. };
  793. var optionSet1 = {
  794. //startDate: moment().subtract(29, 'days'),
  795. startDate: moment(),
  796. endDate: moment(),
  797. minDate: '2012-01-01',
  798. maxDate: nowString(),
  799. dateLimit: {
  800. days: 60
  801. },
  802. showDropdowns: true,
  803. showWeekNumbers: true,
  804. timePicker: false,
  805. timePickerIncrement: 1,
  806. timePicker12Hour: true,
  807. ranges: {
  808. '今天': [moment(), moment()],
  809. '昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  810. '最近7天': [moment().subtract(6, 'days'), moment()],
  811. '最近30天': [moment().subtract(29, 'days'), moment()],
  812. '当月': [moment().startOf('month'), moment().endOf('month')],
  813. '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  814. },
  815. opens: 'left',
  816. buttonClasses: ['btn btn-default'],
  817. applyClass: 'btn-small btn-primary',
  818. cancelClass: 'btn-small',
  819. format: 'YYYY-MM-DD',
  820. separator: ' to ',
  821. locale: {
  822. applyLabel: '确定',
  823. cancelLabel: '取消',
  824. fromLabel: 'From',
  825. toLabel: 'To',
  826. customRangeLabel: '自定义',
  827. daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
  828. monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  829. firstDay: 1
  830. }
  831. };
  832. //$('#reportrange span').html(moment().subtract(29, 'days').format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
  833. $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
  834. $('#reportrange').daterangepicker(optionSet1, cb);
  835. $('#reportrange').on('show.daterangepicker', function () {
  836. console.log("show event fired");
  837. });
  838. $('#reportrange').on('hide.daterangepicker', function () {
  839. console.log("hide event fired");
  840. });
  841. $('#reportrange').on('apply.daterangepicker', function (ev, picker) {
  842. console.log("apply event fired, start/end dates are " + picker.startDate.format('YYYY-MM-DD') + " to " + picker.endDate.format('YYYY-MM-DD'));
  843. });
  844. $('#reportrange').on('cancel.daterangepicker', function (ev, picker) {
  845. console.log("cancel event fired");
  846. });
  847. $('#options1').click(function () {
  848. $('#reportrange').data('daterangepicker').setOptions(optionSet1, cb);
  849. });
  850. $('#options2').click(function () {
  851. $('#reportrange').data('daterangepicker').setOptions(optionSet2, cb);
  852. });
  853. $('#destroy').click(function () {
  854. $('#reportrange').data('daterangepicker').remove();
  855. });
  856. }