daily.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743
  1. //@ sourceURL=daily.js
  2. var LODOP; //声明为全局变量
  3. //默认打印机下标
  4. var printIndex = -1;
  5. $(function () {
  6. initFeeTable();
  7. //重置查询参数
  8. $('#btn_clean').click(function () {
  9. cleanParams();
  10. });
  11. //初始化页面上面的按钮事件
  12. $("#btn_daily").click(function (t) {
  13. dcountCharge();
  14. });
  15. setTimeout(function () {
  16. getLodop();
  17. }, 800);
  18. });
  19. /**
  20. * 列表类型按钮切换事件
  21. * @param object
  22. */
  23. function reportButtonChange(object) {
  24. $("#pay_mark_group").find("button").each(function (index, element) {
  25. if ($(element).hasClass("btn-primary")) {
  26. $(element).removeClass("btn-primary").addClass("btn-default");
  27. }
  28. });
  29. $(object).removeClass("btn-default").addClass("btn-primary");
  30. initFeeTable();
  31. }
  32. /**
  33. * 初始化收费表格
  34. */
  35. function initFeeTable() {
  36. $('#tb_table').bootstrapTable("destroy");
  37. $("#report_table").removeClass("in").addClass("hide");
  38. var payMarkGroup = getIndex("pay_mark_group");
  39. if (payMarkGroup == 0) {
  40. getRjbb();
  41. } else if (payMarkGroup == 1) {
  42. getsfqd();
  43. } else if (payMarkGroup == 2) {
  44. getGhqd();
  45. }
  46. }
  47. /**
  48. * 设置收费参数
  49. * @param res
  50. */
  51. function extractedSf (res) {
  52. //现金收款
  53. $("#xjbs").html(res.chargeCountVo.xjbs);
  54. if (res.chargeCountVo.xjsk != null) {
  55. $("#xjsk").html(res.chargeCountVo.xjsk.toFixed(2));
  56. }
  57. $("#xjtfbs").html(res.chargeCountVo.xjtfbs);
  58. if (res.chargeCountVo.xjtf != null) {
  59. $("#xjtf").html(res.chargeCountVo.xjtf.toFixed(2));
  60. }
  61. $("#xjssbs").html(res.chargeCountVo.xjssbs);
  62. if (res.chargeCountVo.xjss != null) {
  63. $("#xjss").html(res.chargeCountVo.xjss.toFixed(2));
  64. }
  65. //银行卡收款
  66. $("#yhsbs").html(res.chargeCountVo.yhsbs);
  67. if (res.chargeCountVo.yhksk != null) {
  68. $("#yhksk").html(res.chargeCountVo.yhksk.toFixed(2));
  69. }
  70. $("#yhktfbs").html(res.chargeCountVo.yhktfbs);
  71. if (res.chargeCountVo.yhktf != null) {
  72. $("#yhktf").html(res.chargeCountVo.yhktf.toFixed(2));
  73. }
  74. $("#yhkssbs").html(res.chargeCountVo.yhkssbs);
  75. if (res.chargeCountVo.yhkss != null) {
  76. $("#yhkss").html(res.chargeCountVo.yhkss.toFixed(2));
  77. }
  78. //医保卡卡收款
  79. $("#ybjzbs").html(res.chargeCountVo.ybjzbs);
  80. if (res.chargeCountVo.ybjzsk != null) {
  81. $("#ybjzsk").html(res.chargeCountVo.ybjzsk.toFixed(2));
  82. }
  83. $("#ybjztfbs").html(res.chargeCountVo.ybjztfbs);
  84. if (res.chargeCountVo.ybjztf != null) {
  85. $("#ybjztf").html(res.chargeCountVo.ybjztf.toFixed(2));
  86. }
  87. $("#ybjzssbs").html(res.chargeCountVo.ybjzssbs);
  88. if (res.chargeCountVo.ybjzss != null) {
  89. $("#ybjzss").html(res.chargeCountVo.ybjzss.toFixed(2));
  90. }
  91. //支付宝收款
  92. $("#zfbbs").html(res.chargeCountVo.zfbbs);
  93. if (res.chargeCountVo.zfbsk != null) {
  94. $("#zfbsk").html(res.chargeCountVo.zfbsk.toFixed(2));
  95. }
  96. $("#zfbtfbs").html(res.chargeCountVo.zfbtfbs);
  97. if (res.chargeCountVo.zfbtf != null) {
  98. $("#zfbtf").html(res.chargeCountVo.zfbtf.toFixed(2));
  99. }
  100. $("#zfbssbs").html(res.chargeCountVo.zfbssbs);
  101. if (res.chargeCountVo.zfbss != null) {
  102. $("#zfbss").html(res.chargeCountVo.zfbss.toFixed(2));
  103. }
  104. //微信收款
  105. $("#wxbs").html(res.chargeCountVo.wxbs);
  106. if (res.chargeCountVo.wxsk != null) {
  107. $("#wxsk").html(res.chargeCountVo.wxsk.toFixed(2));
  108. }
  109. $("#wxtfbs").html(res.chargeCountVo.wxtfbs);
  110. if (res.chargeCountVo.wxtf != null) {
  111. $("#wxtf").html(res.chargeCountVo.wxtf.toFixed(2));
  112. }
  113. $("#wxssbs").html(res.chargeCountVo.wxssbs);
  114. if (res.chargeCountVo.wxss != null) {
  115. $("#wxss").html(res.chargeCountVo.wxss.toFixed(2));
  116. }
  117. //记账绿色通道收款
  118. $("#zfbs").html(res.chargeCountVo.zfbs);
  119. if (res.chargeCountVo.zfsk != null) {
  120. $("#zfsk").html(res.chargeCountVo.zfsk.toFixed(2));
  121. }
  122. $("#zftfbs").html(res.chargeCountVo.zftfbs);
  123. if (res.chargeCountVo.zftf != null) {
  124. $("#zftf").html(res.chargeCountVo.zftf.toFixed(2));
  125. }
  126. $("#zfssbs").html(res.chargeCountVo.zfssbs);
  127. if (res.chargeCountVo.zfss != null) {
  128. $("#zfss").html(res.chargeCountVo.zfss.toFixed(2));
  129. }
  130. //医保卡收款
  131. $("#sybbs").html(res.chargeCountVo.sybbs);
  132. if (res.chargeCountVo.sybksk != null) {
  133. $("#sybksk").html(res.chargeCountVo.sybksk.toFixed(2));
  134. }
  135. $("#sybtfbs").html(res.chargeCountVo.sybtfbs);
  136. if (res.chargeCountVo.sybtf != null) {
  137. $("#sybtf").html(res.chargeCountVo.sybtf.toFixed(2));
  138. }
  139. $("#sybssbs").html(res.chargeCountVo.sybssbs);
  140. if (res.chargeCountVo.sybkss != null) {
  141. $("#sybkss").html(res.chargeCountVo.sybkss.toFixed(2));
  142. }
  143. //总计收款
  144. $("#zjbs").html(res.chargeCountVo.zjbs);
  145. if (res.chargeCountVo.zjsk != null) {
  146. $("#zjsk").html(res.chargeCountVo.zjsk.toFixed(2));
  147. }
  148. $("#ztfbs").html(res.chargeCountVo.ztfbs);
  149. if (res.chargeCountVo.zjtk != null) {
  150. $("#zjtk").html(res.chargeCountVo.zjtk.toFixed(2));
  151. }
  152. $("#zjssbs").html(res.chargeCountVo.zjssbs);
  153. if (res.chargeCountVo.zjss != null) {
  154. $("#zjss").html(res.chargeCountVo.zjss.toFixed(2));
  155. }
  156. if (res.chargeCountVo.sjhj != null) {
  157. $("#sjhj").html(res.chargeCountVo.sjhj.toFixed(2));
  158. }
  159. $("#sjhjdx").html(res.chargeCountVo.sjhjdx);
  160. if (res.chargeCountVo.zfss != null) {
  161. $("#zfsshj").html(res.chargeCountVo.zfss.toFixed(2));
  162. }
  163. $("#zfdx").html(res.chargeCountVo.zfdx);
  164. if (res.chargeCountVo.ybjzss != null) {
  165. $("#ybkjzhj").html(res.chargeCountVo.ybjzss.toFixed(2));
  166. }
  167. $("#ybkjzhjdx").html(res.chargeCountVo.ybkjzhjdx);
  168. if (res.chargeCountVo.zj != null) {
  169. $("#zj").html(res.chargeCountVo.zj.toFixed(2));
  170. }
  171. $("#zjdx").html(res.chargeCountVo.zjdx);
  172. }
  173. /**
  174. * 设置挂号参数
  175. * @param res
  176. */
  177. function extractedGh (res) {
  178. //现金收款
  179. $("#ghxjbs").html(res.ghsrgcmx.xjhs);
  180. if (res.ghsrgcmx.xjsk != null) {
  181. $("#ghxjsk").html(res.ghsrgcmx.xjsk.toFixed(2));
  182. }
  183. $("#ghxjtfbs").html(res.ghsrgcmx.xjthhs);
  184. if (res.ghsrgcmx.xjth != null) {
  185. $("#ghxjtf").html(res.ghsrgcmx.xjth.toFixed(2));
  186. }
  187. $("#ghxjssbs").html(res.ghsrgcmx.xjsshs);
  188. if (res.ghsrgcmx.xjss != null) {
  189. $("#ghxjss").html(res.ghsrgcmx.xjss.toFixed(2));
  190. }
  191. //银行卡收款
  192. $("#ghyhsbs").html(res.ghsrgcmx.yhkhs);
  193. if (res.ghsrgcmx.yhksk != null) {
  194. $("#ghyhksk").html(res.ghsrgcmx.yhksk.toFixed(2));
  195. }
  196. $("#ghyhktfbs").html(res.ghsrgcmx.yhkthhs);
  197. if (res.ghsrgcmx.yhkth != null) {
  198. $("#ghyhktf").html(res.ghsrgcmx.yhkth.toFixed(2));
  199. }
  200. $("#ghyhkssbs").html(res.ghsrgcmx.yhksshs);
  201. if (res.ghsrgcmx.yhkss != null) {
  202. $("#ghyhkss").html(res.ghsrgcmx.yhkss.toFixed(2));
  203. }
  204. //医保卡卡收款
  205. $("#ghsybbs").html(res.ghsrgcmx.ybkhs);
  206. if (res.ghsrgcmx.ybksk != null) {
  207. $("#ghsybksk").html(res.ghsrgcmx.ybksk.toFixed(2));
  208. }
  209. $("#ghsybtfbs").html(res.ghsrgcmx.ybkthhs);
  210. if (res.ghsrgcmx.ybkth != null) {
  211. $("#ghsybtf").html(res.ghsrgcmx.ybkth.toFixed(2));
  212. }
  213. $("#ghsybssbs").html(res.ghsrgcmx.ybksshs);
  214. if (res.ghsrgcmx.ybkss != null) {
  215. $("#ghsybkss").html(res.ghsrgcmx.ybkss.toFixed(2));
  216. }
  217. //支付宝收款
  218. $("#ghzfbbs").html(res.ghsrgcmx.zfbhs);
  219. if (res.ghsrgcmx.zfbsk != null) {
  220. $("#ghzfbsk").html(res.ghsrgcmx.zfbsk.toFixed(2));
  221. }
  222. $("#ghzfbtfbs").html(res.ghsrgcmx.zfbthhs);
  223. if (res.ghsrgcmx.zfbth != null) {
  224. $("#ghzfbtf").html(res.ghsrgcmx.zfbth.toFixed(2));
  225. }
  226. $("#ghzfbssbs").html(res.ghsrgcmx.zfbsshs);
  227. if (res.ghsrgcmx.zfbss != null) {
  228. $("#ghzfbss").html(res.ghsrgcmx.zfbss.toFixed(2));
  229. }
  230. //微信收款
  231. $("#ghwxbs").html(res.ghsrgcmx.wxhs);
  232. if (res.ghsrgcmx.wxsk != null) {
  233. $("#ghwxsk").html(res.ghsrgcmx.wxsk.toFixed(2));
  234. }
  235. $("#ghwxtfbs").html(res.ghsrgcmx.wxthhs);
  236. if (res.ghsrgcmx.wxth != null) {
  237. $("#ghwxtf").html(res.ghsrgcmx.wxth.toFixed(2));
  238. }
  239. $("#ghwxssbs").html(res.ghsrgcmx.wxsshs);
  240. if (res.ghsrgcmx.wxss != null) {
  241. $("#ghwxss").html(res.ghsrgcmx.wxss.toFixed(2));
  242. }
  243. //记账绿色通道收款
  244. $("#ghzfbs").html(res.ghsrgcmx.byjzhs);
  245. if (res.ghsrgcmx.byjzsk != null) {
  246. $("#ghzfsk").html(res.ghsrgcmx.byjzsk.toFixed(2));
  247. }
  248. $("#ghzftfbs").html(res.ghsrgcmx.byjzthhs);
  249. if (res.ghsrgcmx.byjzth != null) {
  250. $("#ghzftf").html(res.ghsrgcmx.byjzth.toFixed(2));
  251. }
  252. $("#ghzfssbs").html(res.ghsrgcmx.byjzsshs);
  253. if (res.ghsrgcmx.byjzss != null) {
  254. $("#ghzfss").html(res.ghsrgcmx.byjzss.toFixed(2));
  255. }
  256. //总计收款
  257. $("#ghzjbs").html(res.ghsrgcmx.hjhs);
  258. if (res.ghsrgcmx.hjsk != null) {
  259. $("#ghzjsk").html(res.ghsrgcmx.hjsk.toFixed(2));
  260. }
  261. $("#ghztfbs").html(res.ghsrgcmx.hjthhs);
  262. if (res.ghsrgcmx.hjth != null) {
  263. $("#ghzjtk").html(res.ghsrgcmx.hjth.toFixed(2));
  264. }
  265. $("#ghzjssbs").html(res.ghsrgcmx.hjsshs);
  266. if (res.ghsrgcmx.hjss != null) {
  267. $("#ghzjss").html(res.ghsrgcmx.hjss.toFixed(2));
  268. }
  269. if (res.ghsrgcmx.ghjebhjz != null) {
  270. $("#ghsjhj").html(res.ghsrgcmx.ghjebhjz.toFixed(2));
  271. }
  272. $("#ghsjhjdx").html(res.ghsrgcmx.ghjebhjzdx);
  273. if (res.ghsrgcmx.byjzss != null) {
  274. $("#ghzfsshj").html(res.ghsrgcmx.byjzss.toFixed(2));
  275. }
  276. $("#ghzfdx").html(res.ghsrgcmx.byjzssdx);
  277. if (res.ghsrgcmx.hjss != null) {
  278. $("#ghzj").html(res.ghsrgcmx.hjss.toFixed(2));
  279. }
  280. $("#ghzjdx").html(res.ghsrgcmx.hjssdx);
  281. if (res.ghsrgcmx.zcsr != null) {
  282. $("#zcsr").html(res.ghsrgcmx.zcsr.toFixed(2));
  283. }
  284. if (res.ghsrgcmx.jcsr != null) {
  285. $("#jcsr").html(res.ghsrgcmx.jcsr.toFixed(2));
  286. }
  287. if (res.ghsrgcmx.ghsr != null) {
  288. $("#ghsr").html(res.ghsrgcmx.ghsr.toFixed(2));
  289. }
  290. }
  291. /**
  292. * 获取日结报表
  293. */
  294. function getRjbb() {
  295. $("#report_table").removeClass("hide").addClass("in");
  296. $.ajax({
  297. type: "GET",
  298. url: '/thmz/getFullChargeUnAccount',
  299. contentType: "application/json;charset=UTF-8",
  300. dataType: "json",
  301. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  302. success: function (res) {
  303. if (res == '401' || res == 401) {
  304. window.location.href = '/thmz/login/view'
  305. return;
  306. }
  307. if (res.code == 0) {
  308. $("#userIdCode").html(res.user.userCode);
  309. $("#username").html(res.user.userName);
  310. $("#dcountDate").html(format(new Date(), "yyyy-MM-dd HH:mm:ss"));
  311. $("#charge1").html(res.mzReceiptSerial.charge1.toFixed(2));
  312. $("#charge2").html(res.mzReceiptSerial.charge2.toFixed(2));
  313. $("#charge3").html(res.mzReceiptSerial.charge3.toFixed(2));
  314. $("#charge4").html(res.mzReceiptSerial.charge4.toFixed(2));
  315. $("#charge5").html(res.mzReceiptSerial.charge5.toFixed(2));
  316. $("#charge6").html(res.mzReceiptSerial.charge6.toFixed(2));
  317. $("#charge7").html(res.mzReceiptSerial.charge7.toFixed(2));
  318. $("#charge8").html(res.mzReceiptSerial.charge8.toFixed(2));
  319. $("#charge9").html(res.mzReceiptSerial.charge9.toFixed(2));
  320. $("#charge10").html(res.mzReceiptSerial.charge10.toFixed(2));
  321. $("#charge11").html(res.mzReceiptSerial.charge11.toFixed(2));
  322. $("#charge12").html(res.mzReceiptSerial.charge12.toFixed(2));
  323. $("#charge13").html(res.mzReceiptSerial.charge13.toFixed(2));
  324. $("#charge14").html(res.mzReceiptSerial.charge14.toFixed(2));
  325. $("#charge15").html(res.mzReceiptSerial.charge15.toFixed(2));
  326. $("#charge16").html(res.mzReceiptSerial.charge16.toFixed(2));
  327. $("#charge17").html(res.mzReceiptSerial.charge17.toFixed(2));
  328. $("#charge18").html(res.mzReceiptSerial.charge18.toFixed(2));
  329. $("#charge19").html(res.mzReceiptSerial.charge19.toFixed(2));
  330. $("#charge20").html(res.mzReceiptSerial.charge20.toFixed(2));
  331. $("#totalCharge").html(res.mzReceiptSerial.totalCharge);
  332. $("#totalChargeStr").html(res.mzReceiptSerial.totalChargeStr);
  333. extractedSf(res);
  334. extractedGh (res);
  335. $("#receiptBills_table").html(null);
  336. var html = '';
  337. if (res.receiptBills != null && res.receiptBills.length > 0) {
  338. for (var i = 0; i < res.receiptBills.length; i++) {
  339. if (i % 4 == 0) {
  340. html += '<tr>';
  341. }
  342. html += '<td width="215px">' + res.receiptBills[i] + '</td>';
  343. if (i % 4 == 3 || i == res.receiptBills.length - 1) {
  344. html += '</tr>';
  345. }
  346. }
  347. }
  348. html+='<tr><td width="215px">发票总数:'+res.sffps+'</td><td width="215px">退票张数:'+res.tpzs+'</td><td width="215px">作废张数:'+res.zffps+'</td></tr>';
  349. $("#receiptBills_table").html(html);
  350. if (res.zffpmx.length == 0) {
  351. $("#sfzffpmx_table").css("display", "none");
  352. } else if (res.zffpmx.length > 0) {
  353. $("#sfzffpmx_table").css("display", "block");
  354. var html = '';
  355. for (var i = 0; i < res.zffpmx.length; i++) {
  356. var receiptBill = res.zffpmx[i].receiptBill;
  357. if (res.zffpmx[i].receiptBill != null && res.zffpmx[i].receiptBill.length > 8) {
  358. receiptBill = receiptBill.substring(0, 8);
  359. }
  360. if (i % 2 == 0) {
  361. html += '<tr>';
  362. }
  363. html += '<td>' + receiptBill + '</td>';
  364. html += '<td>' + res.zffpmx[i].name + '</td>';
  365. html += '<td>' + res.zffpmx[i].totalCharge.toFixed(2) + '</td>';
  366. if (i % 2 == 1 || i == res.zffpmx.length - 1) {
  367. html += '</tr>';
  368. }
  369. }
  370. $("#sfzffpmx").html(html);
  371. }
  372. $("#username_zbr").html(res.user.userName);
  373. } else if (res.code == -1) {
  374. new PNotify({
  375. title: '错误提示',
  376. text: res.message,
  377. type: 'error',
  378. hide: true,
  379. styling: 'bootstrap3'
  380. });
  381. }
  382. }
  383. });
  384. }
  385. /**
  386. * 挂号清单
  387. */
  388. function getGhqd() {
  389. $('#tb_table').bootstrapTable({
  390. url: '/thmz/getReqrecVoUnAccount', //请求后台的URL(*)
  391. method: 'post', //请求方式(*)
  392. toolbar: '#toolbar', //工具按钮用哪个容器
  393. striped: true, //是否显示行间隔色
  394. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  395. pagination: true, //是否显示分页(*)
  396. sortable: true, //是否启用排序
  397. sortOrder: "asc", //排序方式
  398. // queryParams: queryParams, //传递参数(*)
  399. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  400. pageNumber: 1, //初始化加载第一页,默认第一页
  401. pageSize: 10, //每页的记录行数(*)
  402. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  403. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  404. strictSearch: true,
  405. showColumns: false, //是否显示所有的列
  406. showRefresh: false, //是否显示刷新按钮
  407. minimumCountColumns: 2, //最少允许的列数
  408. clickToSelect: true, //是否启用点击选中行
  409. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  410. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  411. cardView: false, //是否显示详细视图
  412. detailView: false,
  413. //rowStyle:rowStyle,//通过自定义函数设置行样式
  414. ajaxOptions: {
  415. headers: {
  416. 'Accept': 'application/json',
  417. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  418. }
  419. },
  420. columns: [
  421. {
  422. field: 'receiptBill',
  423. title: '收据号',
  424. align: "center",
  425. valign: 'middle'
  426. }, {
  427. field: 'serialNo',
  428. title: '机制号',
  429. align: "center",
  430. valign: 'middle',
  431. }, {
  432. field: 'patientId',
  433. title: '病人ID',
  434. align: "center",
  435. valign: 'middle',
  436. }, {
  437. field: 'name',
  438. title: '病人姓名',
  439. align: "center",
  440. valign: 'middle',
  441. }, {
  442. field: 'unitCode',
  443. title: '科别',
  444. align: "center",
  445. valign: 'middle'
  446. }, {
  447. field: 'chargeType',
  448. title: '号别',
  449. align: "center",
  450. valign: 'middle'
  451. }, {
  452. field: 'cancelMark',
  453. title: '状态',
  454. align: "center",
  455. valign: 'middle',
  456. }, {
  457. field: 'chargeFee',
  458. title: '金额',
  459. align: "center",
  460. valign: 'middle',
  461. formatter: function (value, row, index) {
  462. return value.toFixed(2);
  463. }
  464. }, {
  465. field: 'opDay',
  466. title: '挂号日期',
  467. align: "center",
  468. valign: 'middle',
  469. formatter: function (value, row, index) {
  470. return format(value, "yyyy-MM-dd HH:mm:ss");
  471. }
  472. }
  473. ],
  474. responseHandler: function (res) {
  475. if (res == '401' || res == 401) {
  476. window.location.href = '/thmz/login/view'
  477. return;
  478. }
  479. var ress = eval(res);
  480. if (ress.code == -1) {
  481. if (ress.message != null && ress.message != '') {
  482. new PNotify({
  483. title: '错误提示',
  484. text: ress.message,
  485. type: 'error',
  486. hide: true,
  487. styling: 'bootstrap3'
  488. });
  489. }
  490. return {
  491. "total": 0,//总页数
  492. "rows": {} //数据
  493. };
  494. }
  495. return {
  496. "total": ress.data.length,//总页数
  497. "rows": ress.data //数据
  498. };
  499. },
  500. });
  501. }
  502. /**
  503. * 收费请单
  504. */
  505. function getsfqd() {
  506. $('#tb_table').bootstrapTable({
  507. url: '/thmz/getChargeFeeVoUnAccount', //请求后台的URL(*)
  508. method: 'post', //请求方式(*)
  509. toolbar: '#toolbar', //工具按钮用哪个容器
  510. striped: true, //是否显示行间隔色
  511. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  512. pagination: true, //是否显示分页(*)
  513. sortable: true, //是否启用排序
  514. sortOrder: "asc", //排序方式
  515. // queryParams: queryParams, //传递参数(*)
  516. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  517. pageNumber: 1, //初始化加载第一页,默认第一页
  518. pageSize: 10, //每页的记录行数(*)
  519. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  520. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  521. strictSearch: true,
  522. showColumns: false, //是否显示所有的列
  523. showRefresh: false, //是否显示刷新按钮
  524. minimumCountColumns: 2, //最少允许的列数
  525. clickToSelect: true, //是否启用点击选中行
  526. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  527. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  528. cardView: false, //是否显示详细视图
  529. detailView: false,
  530. //rowStyle:rowStyle,//通过自定义函数设置行样式
  531. ajaxOptions: {
  532. headers: {
  533. 'Accept': 'application/json',
  534. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  535. }
  536. },
  537. columns: [
  538. {
  539. field: 'patientId',
  540. title: '病人ID',
  541. align: "center",
  542. valign: 'middle'
  543. }, {
  544. field: 'serialNo',
  545. title: '机制号',
  546. align: "center",
  547. valign: 'middle',
  548. }, {
  549. field: 'payMark',
  550. title: '退欠标识',
  551. align: "center",
  552. valign: 'middle',
  553. }, {
  554. field: 'totalCharge',
  555. title: '金额',
  556. align: "center",
  557. valign: 'middle',
  558. formatter: function (value, row, index) {
  559. return value.toFixed(2);
  560. }
  561. }, {
  562. field: 'receiptBill',
  563. title: '发票号',
  564. align: "center",
  565. valign: 'middle'
  566. }, {
  567. field: 'chequeType',
  568. title: '付款方式',
  569. align: "center",
  570. valign: 'middle'
  571. }, {
  572. field: 'chargeDate',
  573. title: '收费日期',
  574. align: "center",
  575. valign: 'middle',
  576. formatter: function (value, row, index) {
  577. return format(value, "yyyy-MM-dd HH:mm:ss");
  578. }
  579. }
  580. ],
  581. responseHandler: function (res) {
  582. if (res == '401' || res == 401) {
  583. window.location.href = '/thmz/login/view'
  584. return;
  585. }
  586. var ress = eval(res);
  587. if (ress.code == -1) {
  588. if (ress.message != null && ress.message != '') {
  589. new PNotify({
  590. title: '错误提示',
  591. text: ress.message,
  592. type: 'error',
  593. hide: true,
  594. styling: 'bootstrap3'
  595. });
  596. }
  597. return {
  598. "total": 0,//总页数
  599. "rows": {} //数据
  600. };
  601. }
  602. return {
  603. "total": ress.data.length,//总页数
  604. "rows": ress.data //数据
  605. };
  606. },
  607. });
  608. }
  609. /**
  610. * 获取按钮组选择的下标
  611. * @param id
  612. * @returns {number}
  613. */
  614. function getIndex(id) {
  615. var index = 0;
  616. var item = $("#" + id).find("button");
  617. for (var i = 0; i <= item.length; i++) {
  618. if ($(item[i]).hasClass("btn-primary")) {
  619. index = i;
  620. break;
  621. }
  622. }
  623. return index;
  624. }
  625. /**
  626. * 查询默认打印机
  627. */
  628. function setPrint() {
  629. if (printIndex >= 0) {
  630. return;
  631. }
  632. $.ajax({
  633. type: "GET",
  634. url: '/thmz/getLastWindowsByCurrentUser',
  635. contentType: "application/json;charset=UTF-8",
  636. dataType: "json",
  637. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  638. async: false,
  639. success: function (res) {
  640. if (res == '401' || res == 401) {
  641. window.location.href = '/thmz/login/view'
  642. return;
  643. }
  644. if (res.code == 0) {
  645. printIndex = res.data.cgPrintIndex;
  646. } else {
  647. printIndex = -1;
  648. }
  649. }
  650. });
  651. }
  652. /**
  653. * 清空查询条件
  654. */
  655. function cleanParams() {
  656. $("#printNum").val(null);
  657. }
  658. /**
  659. * 费用结算
  660. */
  661. function dcountCharge() {
  662. $.ajax({
  663. type: "POST",
  664. url: '/thmz/dcountCharge',
  665. contentType: "application/json;charset=UTF-8",
  666. dataType: "json",
  667. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  668. success: function (res) {
  669. if (res == '401' || res == 401) {
  670. window.location.href = '/thmz/login/view'
  671. return;
  672. }
  673. if (res.code == 0) {
  674. var printNum = $("#printNum").val();
  675. if (printNum == null || printNum == undefined || printNum == '') {
  676. printNum = 1;
  677. }
  678. for (var i = 0; i < printNum; i++) {
  679. $("#dcountDate").html(format(res.dcountDate, "yyyy-MM-dd HH:mm:ss"));
  680. $("#dcountDate_gh").html(format(res.dcountDate, "yyyy-MM-dd HH:mm:ss"));
  681. setPrint();
  682. LODOP = getLodop();
  683. LODOP.PRINT_INITA(6, 0, "210mm", "297mm", "门诊收费收入日报表");
  684. LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
  685. //设置默认打印机
  686. LODOP.SET_PRINTER_INDEX(printIndex);
  687. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "210mm");
  688. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "297mm");
  689. 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>"
  690. LODOP.ADD_PRINT_HTM("0mm", "5mm", "200mm", "280mm",strStyle+ document.getElementById("report_table_1").innerHTML);
  691. LODOP.NewPageA();
  692. LODOP.ADD_PRINT_HTM("0mm", "5mm", "200mm", "280mm", document.getElementById("zbr_div").innerHTML);
  693. LODOP.PRINT();
  694. //LODOP.PREVIEW();
  695. //刷新数据
  696. getRjbb();
  697. }
  698. successMesage(res);
  699. } else {
  700. errorMesage(res);
  701. }
  702. }
  703. });
  704. }