daily_collect.js 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938
  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. }, 800);
  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. * @param res
  57. */
  58. function extractedSf (res) {
  59. //现金收款
  60. $("#xjbs").html(res.chargeCountVo.xjbs);
  61. if (res.chargeCountVo.xjsk != null) {
  62. $("#xjsk").html(res.chargeCountVo.xjsk.toFixed(2));
  63. }
  64. $("#xjtfbs").html(res.chargeCountVo.xjtfbs);
  65. if (res.chargeCountVo.xjtf != null) {
  66. $("#xjtf").html(res.chargeCountVo.xjtf.toFixed(2));
  67. }
  68. $("#xjssbs").html(res.chargeCountVo.xjssbs);
  69. if (res.chargeCountVo.xjss != null) {
  70. $("#xjss").html(res.chargeCountVo.xjss.toFixed(2));
  71. }
  72. //银行卡收款
  73. $("#yhsbs").html(res.chargeCountVo.yhsbs);
  74. if (res.chargeCountVo.yhksk != null) {
  75. $("#yhksk").html(res.chargeCountVo.yhksk.toFixed(2));
  76. }
  77. $("#yhktfbs").html(res.chargeCountVo.yhktfbs);
  78. if (res.chargeCountVo.yhktf != null) {
  79. $("#yhktf").html(res.chargeCountVo.yhktf.toFixed(2));
  80. }
  81. $("#yhkssbs").html(res.chargeCountVo.yhkssbs);
  82. if (res.chargeCountVo.yhkss != null) {
  83. $("#yhkss").html(res.chargeCountVo.yhkss.toFixed(2));
  84. }
  85. //医保卡卡收款
  86. $("#ybjzbs").html(res.chargeCountVo.ybjzbs);
  87. if (res.chargeCountVo.ybjzsk != null) {
  88. $("#ybjzsk").html(res.chargeCountVo.ybjzsk.toFixed(2));
  89. }
  90. $("#ybjztfbs").html(res.chargeCountVo.ybjztfbs);
  91. if (res.chargeCountVo.ybjztf != null) {
  92. $("#ybjztf").html(res.chargeCountVo.ybjztf.toFixed(2));
  93. }
  94. $("#ybjzssbs").html(res.chargeCountVo.ybjzssbs);
  95. if (res.chargeCountVo.ybjzss != null) {
  96. $("#ybjzss").html(res.chargeCountVo.ybjzss.toFixed(2));
  97. }
  98. //支付宝收款
  99. $("#zfbbs").html(res.chargeCountVo.zfbbs);
  100. if (res.chargeCountVo.zfbsk != null) {
  101. $("#zfbsk").html(res.chargeCountVo.zfbsk.toFixed(2));
  102. }
  103. $("#zfbtfbs").html(res.chargeCountVo.zfbtfbs);
  104. if (res.chargeCountVo.zfbtf != null) {
  105. $("#zfbtf").html(res.chargeCountVo.zfbtf.toFixed(2));
  106. }
  107. $("#zfbssbs").html(res.chargeCountVo.zfbssbs);
  108. if (res.chargeCountVo.zfbss != null) {
  109. $("#zfbss").html(res.chargeCountVo.zfbss.toFixed(2));
  110. }
  111. //微信收款
  112. $("#wxbs").html(res.chargeCountVo.wxbs);
  113. if (res.chargeCountVo.wxsk != null) {
  114. $("#wxsk").html(res.chargeCountVo.wxsk.toFixed(2));
  115. }
  116. $("#wxtfbs").html(res.chargeCountVo.wxtfbs);
  117. if (res.chargeCountVo.wxtf != null) {
  118. $("#wxtf").html(res.chargeCountVo.wxtf.toFixed(2));
  119. }
  120. $("#wxssbs").html(res.chargeCountVo.wxssbs);
  121. if (res.chargeCountVo.wxss != null) {
  122. $("#wxss").html(res.chargeCountVo.wxss.toFixed(2));
  123. }
  124. //支付宝自助收款
  125. $("#zfbzzbs").html(res.chargeCountVo.zfbzzbs);
  126. if (res.chargeCountVo.zfbzzsk != null) {
  127. $("#zfbzzsk").html(res.chargeCountVo.zfbzzsk.toFixed(2));
  128. }
  129. $("#zfbzztfbs").html(res.chargeCountVo.zfbzztfbs);
  130. if (res.chargeCountVo.zfbzztf != null) {
  131. $("#zfbzztf").html(res.chargeCountVo.zfbzztf.toFixed(2));
  132. }
  133. $("#zfbzzssbs").html(res.chargeCountVo.zfbzzssbs);
  134. if (res.chargeCountVo.zfbzzss != null) {
  135. $("#zfbzzss").html(res.chargeCountVo.zfbzzss.toFixed(2));
  136. }
  137. //微信自助收款
  138. $("#wxzzbs").html(res.chargeCountVo.wxzzbs);
  139. if (res.chargeCountVo.wxzzsk != null) {
  140. $("#wxzzsk").html(res.chargeCountVo.wxzzsk.toFixed(2));
  141. }
  142. $("#wxzztfbs").html(res.chargeCountVo.wxzztfbs);
  143. if (res.chargeCountVo.wxzztf != null) {
  144. $("#wxzztf").html(res.chargeCountVo.wxzztf.toFixed(2));
  145. }
  146. $("#wxzzssbs").html(res.chargeCountVo.wxzzssbs);
  147. if (res.chargeCountVo.wxzzss != null) {
  148. $("#wxzzss").html(res.chargeCountVo.wxzzss.toFixed(2));
  149. }
  150. //记账绿色通道收款
  151. $("#zfbs").html(res.chargeCountVo.zfbs);
  152. if (res.chargeCountVo.zfsk != null) {
  153. $("#zfsk").html(res.chargeCountVo.zfsk.toFixed(2));
  154. }
  155. $("#zftfbs").html(res.chargeCountVo.zftfbs);
  156. if (res.chargeCountVo.zftf != null) {
  157. $("#zftf").html(res.chargeCountVo.zftf.toFixed(2));
  158. }
  159. $("#zfssbs").html(res.chargeCountVo.zfssbs);
  160. if (res.chargeCountVo.zfss != null) {
  161. $("#zfss").html(res.chargeCountVo.zfss.toFixed(2));
  162. }
  163. //医保卡收款
  164. $("#sybbs").html(res.chargeCountVo.sybbs);
  165. if (res.chargeCountVo.sybksk != null) {
  166. $("#sybksk").html(res.chargeCountVo.sybksk.toFixed(2));
  167. }
  168. $("#sybtfbs").html(res.chargeCountVo.sybtfbs);
  169. if (res.chargeCountVo.sybtf != null) {
  170. $("#sybtf").html(res.chargeCountVo.sybtf.toFixed(2));
  171. }
  172. $("#sybssbs").html(res.chargeCountVo.sybssbs);
  173. if (res.chargeCountVo.sybkss != null) {
  174. $("#sybkss").html(res.chargeCountVo.sybkss.toFixed(2));
  175. }
  176. //总计收款
  177. $("#zjbs").html(res.chargeCountVo.zjbs);
  178. if (res.chargeCountVo.zjsk != null) {
  179. $("#zjsk").html(res.chargeCountVo.zjsk.toFixed(2));
  180. }
  181. $("#ztfbs").html(res.chargeCountVo.ztfbs);
  182. if (res.chargeCountVo.zjtk != null) {
  183. $("#zjtk").html(res.chargeCountVo.zjtk.toFixed(2));
  184. }
  185. $("#zjssbs").html(res.chargeCountVo.zjssbs);
  186. if (res.chargeCountVo.zjss != null) {
  187. $("#zjss").html(res.chargeCountVo.zjss.toFixed(2));
  188. }
  189. if (res.chargeCountVo.sjhj != null) {
  190. $("#sjhj").html(res.chargeCountVo.sjhj.toFixed(2));
  191. }
  192. $("#sjhjdx").html(res.chargeCountVo.sjhjdx);
  193. if (res.chargeCountVo.zfss != null) {
  194. $("#zfsshj").html(res.chargeCountVo.zfss.toFixed(2));
  195. }
  196. $("#zfdx").html(res.chargeCountVo.zfdx);
  197. if (res.chargeCountVo.ybjzss != null) {
  198. $("#ybkjzhj").html(res.chargeCountVo.ybjzss.toFixed(2));
  199. }
  200. $("#ybkjzhjdx").html(res.chargeCountVo.ybkjzhjdx);
  201. if (res.chargeCountVo.zj != null) {
  202. $("#zj").html(res.chargeCountVo.zj.toFixed(2));
  203. }
  204. $("#zjdx").html(res.chargeCountVo.zjdx);
  205. }
  206. /**
  207. * 设置挂号参数
  208. * @param res
  209. */
  210. function extractedGh (res) {
  211. //现金收款
  212. $("#ghxjbs").html(res.ghsrgcmx.xjhs);
  213. if (res.ghsrgcmx.xjsk != null) {
  214. $("#ghxjsk").html(res.ghsrgcmx.xjsk.toFixed(2));
  215. }
  216. $("#ghxjtfbs").html(res.ghsrgcmx.xjthhs);
  217. if (res.ghsrgcmx.xjth != null) {
  218. $("#ghxjtf").html(res.ghsrgcmx.xjth.toFixed(2));
  219. }
  220. $("#ghxjssbs").html(res.ghsrgcmx.xjsshs);
  221. if (res.ghsrgcmx.xjss != null) {
  222. $("#ghxjss").html(res.ghsrgcmx.xjss.toFixed(2));
  223. }
  224. //银行卡收款
  225. $("#ghyhsbs").html(res.ghsrgcmx.yhkhs);
  226. if (res.ghsrgcmx.yhksk != null) {
  227. $("#ghyhksk").html(res.ghsrgcmx.yhksk.toFixed(2));
  228. }
  229. $("#ghyhktfbs").html(res.ghsrgcmx.yhkthhs);
  230. if (res.ghsrgcmx.yhkth != null) {
  231. $("#ghyhktf").html(res.ghsrgcmx.yhkth.toFixed(2));
  232. }
  233. $("#ghyhkssbs").html(res.ghsrgcmx.yhksshs);
  234. if (res.ghsrgcmx.yhkss != null) {
  235. $("#ghyhkss").html(res.ghsrgcmx.yhkss.toFixed(2));
  236. }
  237. //医保卡卡收款
  238. $("#ghsybbs").html(res.ghsrgcmx.ybkhs);
  239. if (res.ghsrgcmx.ybksk != null) {
  240. $("#ghsybksk").html(res.ghsrgcmx.ybksk.toFixed(2));
  241. }
  242. $("#ghsybtfbs").html(res.ghsrgcmx.ybkthhs);
  243. if (res.ghsrgcmx.ybkth != null) {
  244. $("#ghsybtf").html(res.ghsrgcmx.ybkth.toFixed(2));
  245. }
  246. $("#ghsybssbs").html(res.ghsrgcmx.ybksshs);
  247. if (res.ghsrgcmx.ybkss != null) {
  248. $("#ghsybkss").html(res.ghsrgcmx.ybkss.toFixed(2));
  249. }
  250. //支付宝收款
  251. $("#ghzfbbs").html(res.ghsrgcmx.zfbhs);
  252. if (res.ghsrgcmx.zfbsk != null) {
  253. $("#ghzfbsk").html(res.ghsrgcmx.zfbsk.toFixed(2));
  254. }
  255. $("#ghzfbtfbs").html(res.ghsrgcmx.zfbthhs);
  256. if (res.ghsrgcmx.zfbth != null) {
  257. $("#ghzfbtf").html(res.ghsrgcmx.zfbth.toFixed(2));
  258. }
  259. $("#ghzfbssbs").html(res.ghsrgcmx.zfbsshs);
  260. if (res.ghsrgcmx.zfbss != null) {
  261. $("#ghzfbss").html(res.ghsrgcmx.zfbss.toFixed(2));
  262. }
  263. //微信收款
  264. $("#ghwxbs").html(res.ghsrgcmx.wxhs);
  265. if (res.ghsrgcmx.wxsk != null) {
  266. $("#ghwxsk").html(res.ghsrgcmx.wxsk.toFixed(2));
  267. }
  268. $("#ghwxtfbs").html(res.ghsrgcmx.wxthhs);
  269. if (res.ghsrgcmx.wxth != null) {
  270. $("#ghwxtf").html(res.ghsrgcmx.wxth.toFixed(2));
  271. }
  272. $("#ghwxssbs").html(res.ghsrgcmx.wxsshs);
  273. if (res.ghsrgcmx.wxss != null) {
  274. $("#ghwxss").html(res.ghsrgcmx.wxss.toFixed(2));
  275. }
  276. //支付宝自助收款
  277. $("#ghzfbzzbs").html(res.ghsrgcmx.zfbzzhs);
  278. if (res.ghsrgcmx.zfbzzsk != null) {
  279. $("#ghzfbzzsk").html(res.ghsrgcmx.zfbzzsk.toFixed(2));
  280. }
  281. $("#ghzfbzztfbs").html(res.ghsrgcmx.zfbzzthhs);
  282. if (res.ghsrgcmx.zfbzzth != null) {
  283. $("#ghzfbzztf").html(res.ghsrgcmx.zfbzzth.toFixed(2));
  284. }
  285. $("#ghzfbzzssbs").html(res.ghsrgcmx.zfbzzsshs);
  286. if (res.ghsrgcmx.zfbzzss != null) {
  287. $("#ghzfbzzss").html(res.ghsrgcmx.zfbzzss.toFixed(2));
  288. }
  289. //微信自助收款
  290. $("#ghwxzzbs").html(res.ghsrgcmx.wxzzhs);
  291. if (res.ghsrgcmx.wxzzsk != null) {
  292. $("#ghwxzzsk").html(res.ghsrgcmx.wxzzsk.toFixed(2));
  293. }
  294. $("#ghwxzztfbs").html(res.ghsrgcmx.wxzzthhs);
  295. if (res.ghsrgcmx.wxzzth != null) {
  296. $("#ghwxzztf").html(res.ghsrgcmx.wxzzth.toFixed(2));
  297. }
  298. $("#ghwxzzssbs").html(res.ghsrgcmx.wxzzsshs);
  299. if (res.ghsrgcmx.wxzzss != null) {
  300. $("#ghwxzzss").html(res.ghsrgcmx.wxzzss.toFixed(2));
  301. }
  302. //记账绿色通道收款
  303. $("#ghzfbs").html(res.ghsrgcmx.byjzhs);
  304. if (res.ghsrgcmx.byjzsk != null) {
  305. $("#ghzfsk").html(res.ghsrgcmx.byjzsk.toFixed(2));
  306. }
  307. $("#ghzftfbs").html(res.ghsrgcmx.byjzthhs);
  308. if (res.ghsrgcmx.byjzth != null) {
  309. $("#ghzftf").html(res.ghsrgcmx.byjzth.toFixed(2));
  310. }
  311. $("#ghzfssbs").html(res.ghsrgcmx.byjzsshs);
  312. if (res.ghsrgcmx.byjzss != null) {
  313. $("#ghzfss").html(res.ghsrgcmx.byjzss.toFixed(2));
  314. }
  315. //总计收款
  316. $("#ghzjbs").html(res.ghsrgcmx.hjhs);
  317. if (res.ghsrgcmx.hjsk != null) {
  318. $("#ghzjsk").html(res.ghsrgcmx.hjsk.toFixed(2));
  319. }
  320. $("#ghztfbs").html(res.ghsrgcmx.hjthhs);
  321. if (res.ghsrgcmx.hjth != null) {
  322. $("#ghzjtk").html(res.ghsrgcmx.hjth.toFixed(2));
  323. }
  324. $("#ghzjssbs").html(res.ghsrgcmx.hjsshs);
  325. if (res.ghsrgcmx.hjss != null) {
  326. $("#ghzjss").html(res.ghsrgcmx.hjss.toFixed(2));
  327. }
  328. if (res.ghsrgcmx.ghjebhjz != null) {
  329. $("#ghsjhj").html(res.ghsrgcmx.ghjebhjz.toFixed(2));
  330. }
  331. $("#ghsjhjdx").html(res.ghsrgcmx.ghjebhjzdx);
  332. if (res.ghsrgcmx.byjzss != null) {
  333. $("#ghzfsshj").html(res.ghsrgcmx.byjzss.toFixed(2));
  334. }
  335. $("#ghzfdx").html(res.ghsrgcmx.byjzssdx);
  336. if (res.ghsrgcmx.hjss != null) {
  337. $("#ghzj").html(res.ghsrgcmx.hjss.toFixed(2));
  338. }
  339. $("#ghzjdx").html(res.ghsrgcmx.hjssdx);
  340. if (res.ghsrgcmx.zcsr != null) {
  341. $("#zcsr").html(res.ghsrgcmx.zcsr.toFixed(2));
  342. }
  343. if (res.ghsrgcmx.jcsr != null) {
  344. $("#jcsr").html(res.ghsrgcmx.jcsr.toFixed(2));
  345. }
  346. if (res.ghsrgcmx.ghsr != null) {
  347. $("#ghsr").html(res.ghsrgcmx.ghsr.toFixed(2));
  348. }
  349. }
  350. /**
  351. * 获取日结报表
  352. */
  353. function getRjbb() {
  354. $("#report_table").removeClass("hide").addClass("in");
  355. var rePortRangeArr = getRePortRangeArr();
  356. $.ajax({
  357. type: "POST",
  358. url: '/thmz/getFullChargeCollect',
  359. contentType: "application/json;charset=UTF-8",
  360. dataType: "json",
  361. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  362. data: JSON.stringify({
  363. beginDate: rePortRangeArr[0],
  364. endDate: rePortRangeArr[1],
  365. hisData: $('#hisData').is(':checked') ? 0 : 1
  366. }),
  367. success: function (res) {
  368. if (res == '401' || res == 401) {
  369. window.location.href = '/thmz/login/view'
  370. return;
  371. }
  372. if (res.code == 0) {
  373. $("#dcountDate").html($('#reportrange span').html());
  374. $("#charge1").html(res.mzReceiptSerial.charge1.toFixed(2));
  375. $("#charge2").html(res.mzReceiptSerial.charge2.toFixed(2));
  376. $("#charge3").html(res.mzReceiptSerial.charge3.toFixed(2));
  377. $("#charge4").html(res.mzReceiptSerial.charge4.toFixed(2));
  378. $("#charge5").html(res.mzReceiptSerial.charge5.toFixed(2));
  379. $("#charge6").html(res.mzReceiptSerial.charge6.toFixed(2));
  380. $("#charge7").html(res.mzReceiptSerial.charge7.toFixed(2));
  381. $("#charge8").html(res.mzReceiptSerial.charge8.toFixed(2));
  382. $("#charge9").html(res.mzReceiptSerial.charge9.toFixed(2));
  383. $("#charge10").html(res.mzReceiptSerial.charge10.toFixed(2));
  384. $("#charge11").html(res.mzReceiptSerial.charge11.toFixed(2));
  385. $("#charge12").html(res.mzReceiptSerial.charge12.toFixed(2));
  386. $("#charge13").html(res.mzReceiptSerial.charge13.toFixed(2));
  387. $("#charge14").html(res.mzReceiptSerial.charge14.toFixed(2));
  388. $("#charge15").html(res.mzReceiptSerial.charge15.toFixed(2));
  389. $("#charge16").html(res.mzReceiptSerial.charge16.toFixed(2));
  390. $("#charge17").html(res.mzReceiptSerial.charge17.toFixed(2));
  391. $("#charge18").html(res.mzReceiptSerial.charge18.toFixed(2));
  392. $("#charge19").html(res.mzReceiptSerial.charge19.toFixed(2));
  393. $("#charge20").html(res.mzReceiptSerial.charge20.toFixed(2));
  394. $("#totalCharge").html(res.mzReceiptSerial.totalCharge);
  395. $("#totalChargeStr").html(res.mzReceiptSerial.totalChargeStr);
  396. extractedSf(res);
  397. extractedGh (res);
  398. if (res.ghWorkloadVos.length == 0) {
  399. $("#ghgzlhzb_parent").css("display", "none");
  400. $("#ghgzlhzb_title").css("display", "none");
  401. } else if (res.ghWorkloadVos.length > 0) {
  402. $("#ghgzlhzb_parent").css("display", "block");
  403. $("#ghgzlhzb_title").css("display", "block");
  404. var html = '';
  405. for (var i = 0; i < res.ghWorkloadVos.length - 1; i++) {
  406. var temp = res.ghWorkloadVos[i];
  407. html += '<tr><td>' + temp.opId + '</td>';
  408. html += '<td>' + format(temp.closingDate, "yyyy-MM-dd HH:mm:ss") + '</td>';
  409. html += '<td>' + temp.ptCount + '</td>';
  410. html += '<td>' + temp.ptAmount.toFixed(2) + '</td>';
  411. html += '<td>' + temp.thCount + '</td>';
  412. html += '<td>' + temp.thAmount.toFixed(2) + '</td>';
  413. html += '<td>' + temp.totalAmount.toFixed(2) + '</td></tr>';
  414. }
  415. var temp = res.ghWorkloadVos[res.ghWorkloadVos.length - 1];
  416. html += '<tr><td colspan="2">总计</td>';
  417. html += '<td>' + temp.ptCount + '</td>';
  418. html += '<td>' + temp.ptAmount.toFixed(2) + '</td>';
  419. html += '<td>' + temp.thCount + '</td>';
  420. html += '<td>' + temp.thAmount.toFixed(2) + '</td>';
  421. html += '<td>' + temp.totalAmount.toFixed(2) + '</td></tr>';
  422. $("#ghgzlhzb").html(html);
  423. }
  424. if (res.sfWorkloadVos.length == 0) {
  425. $("#sfgzlhzb_parent").css("display", "none");
  426. $("#sfgzlhzb_parent_title").css("display", "none");
  427. } else if (res.sfWorkloadVos.length > 0) {
  428. $("#sfgzlhzb_parent").css("display", "block");
  429. $("#sfgzlhzb_parent_title").css("display", "block");
  430. var html = '';
  431. for (var i = 0; i < res.sfWorkloadVos.length-1; i++) {
  432. var temp = res.sfWorkloadVos[i];
  433. html += '<tr><td>' + temp.opId + '</td>';
  434. html += '<td>' + format(temp.closingDate, "yyyy-MM-dd HH:mm:ss") + '</td>';
  435. html += '<td>' + temp.ptCount + '</td>';
  436. html += '<td>' + temp.ptAmount.toFixed(2) + '</td>';
  437. html += '<td>' + temp.thCount + '</td>';
  438. html += '<td>' + temp.thAmount.toFixed(2) + '</td>';
  439. html += '<td>' + temp.totalAmount.toFixed(2) + '</td></tr>';
  440. }
  441. var temp = res.sfWorkloadVos[res.sfWorkloadVos.length - 1];
  442. html += '<tr><td colspan="2">总计</td>';
  443. html += '<td>' + temp.ptCount + '</td>';
  444. html += '<td>' + temp.ptAmount.toFixed(2) + '</td>';
  445. html += '<td>' + temp.thCount + '</td>';
  446. html += '<td>' + temp.thAmount.toFixed(2) + '</td>';
  447. html += '<td>' + temp.totalAmount.toFixed(2) + '</td></tr>';
  448. $("#sfgzlhzb").html(html);
  449. }
  450. // $("#username_zbr").html(res.user.userName);
  451. } else if (res.code == -1) {
  452. new PNotify({
  453. title: '错误提示',
  454. text: res.message,
  455. type: 'error',
  456. hide: true,
  457. styling: 'bootstrap3'
  458. });
  459. }
  460. }
  461. });
  462. }
  463. /**
  464. * 挂号清单
  465. */
  466. function getGhqd() {
  467. $('#tb_table').bootstrapTable({
  468. url: '/thmz/getReqrecVoCollect', //请求后台的URL(*)
  469. method: 'post', //请求方式(*)
  470. toolbar: '#toolbar', //工具按钮用哪个容器
  471. striped: true, //是否显示行间隔色
  472. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  473. pagination: true, //是否显示分页(*)
  474. sortable: true, //是否启用排序
  475. sortOrder: "asc", //排序方式
  476. queryParams: queryParams, //传递参数(*)
  477. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  478. pageNumber: 1, //初始化加载第一页,默认第一页
  479. pageSize: 10, //每页的记录行数(*)
  480. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  481. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  482. strictSearch: true,
  483. showColumns: false, //是否显示所有的列
  484. showRefresh: false, //是否显示刷新按钮
  485. minimumCountColumns: 2, //最少允许的列数
  486. clickToSelect: true, //是否启用点击选中行
  487. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  488. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  489. cardView: false, //是否显示详细视图
  490. detailView: false,
  491. //rowStyle:rowStyle,//通过自定义函数设置行样式
  492. ajaxOptions: {
  493. headers: {
  494. 'Accept': 'application/json',
  495. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  496. }
  497. },
  498. columns: [
  499. {
  500. field: 'receiptBill',
  501. title: '收据号',
  502. align: "center",
  503. valign: 'middle'
  504. }, {
  505. field: 'serialNo',
  506. title: '机制号',
  507. align: "center",
  508. valign: 'middle',
  509. }, {
  510. field: 'patientId',
  511. title: '病人ID',
  512. align: "center",
  513. valign: 'middle',
  514. }, {
  515. field: 'name',
  516. title: '病人姓名',
  517. align: "center",
  518. valign: 'middle',
  519. }, {
  520. field: 'unitCode',
  521. title: '科别',
  522. align: "center",
  523. valign: 'middle'
  524. }, {
  525. field: 'chargeType',
  526. title: '号别',
  527. align: "center",
  528. valign: 'middle'
  529. }, {
  530. field: 'cancelMark',
  531. title: '状态',
  532. align: "center",
  533. valign: 'middle',
  534. }, {
  535. field: 'chargeFee',
  536. title: '金额',
  537. align: "center",
  538. valign: 'middle',
  539. formatter: function (value, row, index) {
  540. return value.toFixed(2);
  541. }
  542. }, {
  543. field: 'opId',
  544. title: '收费员',
  545. align: "center",
  546. valign: 'middle'
  547. }, {
  548. field: 'opDay',
  549. title: '挂号日期',
  550. align: "center",
  551. valign: 'middle',
  552. formatter: function (value, row, index) {
  553. return format(value, "yyyy-MM-dd HH:mm:ss");
  554. }
  555. }
  556. ],
  557. responseHandler: function (res) {
  558. if (res == '401' || res == 401) {
  559. window.location.href = '/thmz/login/view'
  560. return;
  561. }
  562. var ress = eval(res);
  563. if (ress.code == -1) {
  564. if (ress.message != null && ress.message != '') {
  565. new PNotify({
  566. title: '错误提示',
  567. text: ress.message,
  568. type: 'error',
  569. hide: true,
  570. styling: 'bootstrap3'
  571. });
  572. }
  573. return {
  574. "total": 0,//总页数
  575. "rows": {} //数据
  576. };
  577. }
  578. return {
  579. "total": ress.data.length,//总页数
  580. "rows": ress.data //数据
  581. };
  582. },
  583. });
  584. }
  585. /**
  586. * 收费请单
  587. */
  588. function getsfqd() {
  589. $('#tb_table').bootstrapTable({
  590. url: '/thmz/getChargeFeeVoCollect', //请求后台的URL(*)
  591. method: 'post', //请求方式(*)
  592. toolbar: '#toolbar', //工具按钮用哪个容器
  593. striped: true, //是否显示行间隔色
  594. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  595. pagination: true, //是否显示分页(*)
  596. sortable: true, //是否启用排序
  597. sortOrder: "asc", //排序方式
  598. queryParams: queryParams, //传递参数(*)
  599. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  600. pageNumber: 1, //初始化加载第一页,默认第一页
  601. pageSize: 10, //每页的记录行数(*)
  602. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  603. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  604. strictSearch: true,
  605. showColumns: false, //是否显示所有的列
  606. showRefresh: false, //是否显示刷新按钮
  607. minimumCountColumns: 2, //最少允许的列数
  608. clickToSelect: true, //是否启用点击选中行
  609. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  610. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  611. cardView: false, //是否显示详细视图
  612. detailView: false,
  613. //rowStyle:rowStyle,//通过自定义函数设置行样式
  614. ajaxOptions: {
  615. headers: {
  616. 'Accept': 'application/json',
  617. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  618. }
  619. },
  620. columns: [
  621. {
  622. field: 'patientId',
  623. title: '病人ID',
  624. align: "center",
  625. valign: 'middle'
  626. }, {
  627. field: 'serialNo',
  628. title: '机制号',
  629. align: "center",
  630. valign: 'middle',
  631. }, {
  632. field: 'payMark',
  633. title: '退欠标识',
  634. align: "center",
  635. valign: 'middle',
  636. }, {
  637. field: 'totalCharge',
  638. title: '金额',
  639. align: "center",
  640. valign: 'middle',
  641. formatter: function (value, row, index) {
  642. return value.toFixed(2);
  643. }
  644. }, {
  645. field: 'receiptBill',
  646. title: '发票号',
  647. align: "center",
  648. valign: 'middle'
  649. }, {
  650. field: 'chequeType',
  651. title: '付款方式',
  652. align: "center",
  653. valign: 'middle'
  654. }, {
  655. field: 'opId',
  656. title: '收费员',
  657. align: "center",
  658. valign: 'middle'
  659. }, {
  660. field: 'chargeDate',
  661. title: '收费日期',
  662. align: "center",
  663. valign: 'middle',
  664. formatter: function (value, row, index) {
  665. return format(value, "yyyy-MM-dd HH:mm:ss");
  666. }
  667. }
  668. ],
  669. responseHandler: function (res) {
  670. if (res == '401' || res == 401) {
  671. window.location.href = '/thmz/login/view'
  672. return;
  673. }
  674. var ress = eval(res);
  675. if (ress.code == -1) {
  676. if (ress.message != null && ress.message != '') {
  677. new PNotify({
  678. title: '错误提示',
  679. text: ress.message,
  680. type: 'error',
  681. hide: true,
  682. styling: 'bootstrap3'
  683. });
  684. }
  685. return {
  686. "total": 0,//总页数
  687. "rows": {} //数据
  688. };
  689. }
  690. return {
  691. "total": ress.data.length,//总页数
  692. "rows": ress.data //数据
  693. };
  694. },
  695. });
  696. }
  697. /**
  698. * 构建列表查询参数
  699. * @param params
  700. * @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}}
  701. */
  702. function queryParams(params) {
  703. var rePortRangeArr = getRePortRangeArr();
  704. var temp = {
  705. beginDate: rePortRangeArr[0],
  706. endDate: rePortRangeArr[1],
  707. hisData: $('#hisData').is(':checked') ? 0 : 1
  708. };
  709. return temp;
  710. };
  711. /**
  712. * 获取按钮组选择的下标
  713. * @param id
  714. * @returns {number}
  715. */
  716. function getIndex(id) {
  717. var index = 0;
  718. var item = $("#" + id).find("button");
  719. for (var i = 0; i <= item.length; i++) {
  720. if ($(item[i]).hasClass("btn-primary")) {
  721. index = i;
  722. break;
  723. }
  724. }
  725. return index;
  726. }
  727. /**
  728. * 获取时间选择器的时间数组
  729. * @returns {string[]}
  730. */
  731. function getRePortRangeArr() {
  732. var rePortRange = $('#reportrange span').html();
  733. var rePortRangeArr = rePortRange.split(" - ");
  734. rePortRangeArr[0] = rePortRangeArr[0] + " 00:00:00"
  735. rePortRangeArr[1] = rePortRangeArr[1] + " 23:59:59"
  736. return rePortRangeArr;
  737. }
  738. /**
  739. * 查询默认打印机
  740. */
  741. function setPrint() {
  742. if (printIndex >= 0) {
  743. return;
  744. }
  745. $.ajax({
  746. type: "GET",
  747. url: '/thmz/getLastWindowsByCurrentUser',
  748. contentType: "application/json;charset=UTF-8",
  749. dataType: "json",
  750. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  751. async: false,
  752. success: function (res) {
  753. if (res == '401' || res == 401) {
  754. window.location.href = '/thmz/login/view'
  755. return;
  756. }
  757. if (res.code == 0) {
  758. printIndex = res.data.cgPrintIndex;
  759. } else {
  760. printIndex = -1;
  761. }
  762. }
  763. });
  764. }
  765. /**
  766. * 清空查询条件
  767. */
  768. function cleanParams() {
  769. $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
  770. $("#hisData").removeAttr("checked");
  771. canPrint = false;
  772. }
  773. /**
  774. * 打印报表
  775. */
  776. function print() {
  777. if (!canPrint) {
  778. new PNotify({
  779. title: '警告提示',
  780. text: '没有选择合适的报表,无需打印',
  781. hide: false,
  782. styling: 'bootstrap3'
  783. });
  784. return;
  785. }
  786. setPrint();
  787. LODOP = getLodop();
  788. LODOP.PRINT_INITA(6, 0, "210mm", "297mm", "门诊收费收入日报表");
  789. //设置默认打印机
  790. LODOP.SET_PRINTER_INDEX(printIndex);
  791. LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
  792. //设置默认打印机
  793. LODOP.SET_PRINTER_INDEX(printIndex);
  794. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "210mm");
  795. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "297mm");
  796. var strStyle="<style>table{width: 96%;margin-top: 20px;margin-bottom: 10px;} table,td,th {border-width: 1px;border-style: solid;border-collapse: collapse}</style>";
  797. LODOP.ADD_PRINT_HTM("0mm", "0mm", "200mm", "280mm", strStyle+document.getElementById("report_table_1").innerHTML);
  798. LODOP.NewPageA();
  799. LODOP.ADD_PRINT_TABLE(70,"5%","90%",1000,strStyle+document.getElementById("ghgzlhzb_parent").innerHTML);
  800. LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
  801. LODOP.ADD_PRINT_HTM(26,"5%","90%",109,document.getElementById("ghgzlhzb_title").innerHTML);
  802. LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
  803. LODOP.SET_PRINT_STYLEA(0,"LinkedItem",2);
  804. LODOP.NewPageA();
  805. LODOP.ADD_PRINT_TABLE(70,"5%","90%",1000,strStyle+document.getElementById("sfgzlhzb_parent").innerHTML);
  806. LODOP.SET_PRINT_STYLEA(0,"Vorient",3);
  807. LODOP.ADD_PRINT_HTM(26,"5%","90%",109,document.getElementById("sfgzlhzb_parent_title").innerHTML);
  808. LODOP.SET_PRINT_STYLEA(0,"ItemType",1);
  809. LODOP.SET_PRINT_STYLEA(0,"LinkedItem",4);
  810. // LODOP.ADD_PRINT_HTM(600,"5%","90%",109, document.getElementById("username_zbr_parent").innerHTML);
  811. LODOP.PRINT();
  812. //LODOP.PREVIEW();
  813. }
  814. /**
  815. * 日期改变事件
  816. * @param callback 回调函数
  817. */
  818. function daterangepicker(callback) {
  819. if (typeof ($.fn.daterangepicker) === 'undefined') {
  820. return;
  821. }
  822. console.log('init_daterangepicker');
  823. var cb = function (start, end, label) {
  824. console.log(start.toISOString(), end.toISOString(), label);
  825. $('#reportrange span').html(start.format('YYYY-MM-DD') + ' - ' + end.format('YYYY-MM-DD'));
  826. callback();
  827. };
  828. var optionSet1 = {
  829. //startDate: moment().subtract(29, 'days'),
  830. startDate: moment(),
  831. endDate: moment(),
  832. minDate: '2012-01-01',
  833. maxDate: nowString(),
  834. dateLimit: {
  835. days: 1200
  836. },
  837. showDropdowns: true,
  838. showWeekNumbers: true,
  839. timePicker: false,
  840. timePickerIncrement: 1,
  841. timePicker12Hour: true,
  842. ranges: {
  843. '今天': [moment(), moment()],
  844. '昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  845. '最近7天': [moment().subtract(6, 'days'), moment()],
  846. '最近30天': [moment().subtract(29, 'days'), moment()],
  847. '当月': [moment().startOf('month'), moment().endOf('month')],
  848. '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  849. },
  850. opens: 'left',
  851. buttonClasses: ['btn btn-default'],
  852. applyClass: 'btn-small btn-primary',
  853. cancelClass: 'btn-small',
  854. format: 'YYYY-MM-DD',
  855. separator: ' to ',
  856. locale: {
  857. applyLabel: '确定',
  858. cancelLabel: '取消',
  859. fromLabel: 'From',
  860. toLabel: 'To',
  861. customRangeLabel: '自定义',
  862. daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
  863. monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
  864. firstDay: 1
  865. }
  866. };
  867. //$('#reportrange span').html(moment().subtract(29, 'days').format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
  868. $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
  869. callback();
  870. $('#reportrange').daterangepicker(optionSet1, cb);
  871. $('#reportrange').on('show.daterangepicker', function () {
  872. console.log("show event fired");
  873. });
  874. $('#reportrange').on('hide.daterangepicker', function () {
  875. console.log("hide event fired");
  876. });
  877. $('#reportrange').on('apply.daterangepicker', function (ev, picker) {
  878. console.log("apply event fired, start/end dates are " + picker.startDate.format('YYYY-MM-DD') + " to " + picker.endDate.format('YYYY-MM-DD'));
  879. });
  880. $('#reportrange').on('cancel.daterangepicker', function (ev, picker) {
  881. console.log("cancel event fired");
  882. });
  883. $('#options1').click(function () {
  884. $('#reportrange').data('daterangepicker').setOptions(optionSet1, cb);
  885. });
  886. $('#options2').click(function () {
  887. $('#reportrange').data('daterangepicker').setOptions(optionSet2, cb);
  888. });
  889. $('#destroy').click(function () {
  890. $('#reportrange').data('daterangepicker').remove();
  891. });
  892. }