add_mzzyreq.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838
  1. //@ sourceURL=user_manage.js
  2. var LODOP; //声明为全局变量
  3. //默认打印机下标
  4. var printIndex = -1;
  5. var hospitalName='沭阳铭和医院'
  6. $(function () {
  7. getAjaxRequst("/thmz/queryHospitalName",{},true,function (res) {
  8. hospitalName = res.data
  9. $('.hospitalName').text(hospitalName)
  10. })
  11. $("input").each(function () {
  12. this.onkeydown = function (e) { // 监听键盘事件
  13. var theEvent = window.event || e;
  14. var code = theEvent.keyCode || theEvent.which;
  15. if (code == 13) {//回车事件
  16. $("#btn_search").click(); //触发搜索按钮点击事件
  17. }
  18. }
  19. });
  20. //角色保存按钮点击事件
  21. $("#btn_save").click(function (t) {
  22. var validatorResult = validator.checkAll($("#editForm"));
  23. if (validatorResult) {
  24. saveData();
  25. }
  26. });
  27. $("#icdCodeForm").click(function (t) {
  28. $("#diagModal").modal();
  29. diagResetSearch()
  30. getDiagData()
  31. });
  32. //初始化表格数据
  33. getAllPatient();
  34. initListDeptSelect();
  35. iniAdmissStatus();
  36. initZySelect();
  37. initRelationSelect();
  38. });
  39. /**
  40. * 清空入院证输入框
  41. */
  42. function clearZyReq() {
  43. $("#inpatientWardBeHospitalized").selectpicker('val', null);
  44. $('#inpatientWardBeHospitalized').selectpicker('refresh');
  45. $("#smallWardBeHospitalized").selectpicker('val', null);
  46. $('#smallWardBeHospitalized').selectpicker('refresh');
  47. $("#admissStatus").selectpicker('val', null);
  48. $('#admissStatus').selectpicker('refresh');
  49. $("#conditionCode").selectpicker('val', null);
  50. $('#conditionCode').selectpicker('refresh');
  51. $("#routeOfAdmission").selectpicker('val', null);
  52. $('#routeOfAdmission').selectpicker('refresh');
  53. $("#totalBedNum").val(null);
  54. $("#freeBedNum").val(null);
  55. $("#occupationBedNum").val(null);
  56. $("#icdCodeForm").val(null);
  57. $("#icdTextForm").val(null);
  58. $("#deposit").val(null);
  59. $("#contacterName").val(null);
  60. $("#contacterRelationship").selectpicker('val', null);
  61. $("#contacterRelationship").selectpicker('refresh');
  62. $("#contacterPhone").val(null);
  63. $("#contacterAddress").val(null);
  64. initSmallDeptByDept();
  65. }
  66. function diagResetSearch() {
  67. $("#diagParamSearch").val(null);
  68. }
  69. /**
  70. * 获取诊断数据
  71. */
  72. function getDiagData() {
  73. $('#diag_tb_table').bootstrapTable("destroy");
  74. $('#diag_tb_table').bootstrapTable({
  75. url: '/thmz/queryIcdCodePage', //请求后台的URL(*)
  76. method: 'post', //请求方式(*)
  77. toolbar: '#toolbar', //工具按钮用哪个容器
  78. striped: true, //是否显示行间隔色
  79. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  80. pagination: true, //是否显示分页(*)
  81. sortable: true, //是否启用排序
  82. sortOrder: "asc", //排序方式
  83. queryParams: diagQueryParams, //传递参数(*)
  84. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  85. pageNumber: 1, //初始化加载第一页,默认第一页
  86. pageSize: 10, //每页的记录行数(*)
  87. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  88. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  89. strictSearch: true,
  90. showColumns: false, //是否显示所有的列
  91. showRefresh: false, //是否显示刷新按钮
  92. minimumCountColumns: 2, //最少允许的列数
  93. clickToSelect: true, //是否启用点击选中行
  94. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  95. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  96. cardView: false, //是否显示详细视图
  97. detailView: false,
  98. //rowStyle:rowStyle,//通过自定义函数设置行样式
  99. ajaxOptions: {
  100. headers: {
  101. 'Accept': 'application/json',
  102. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  103. }
  104. },
  105. columns: [
  106. {
  107. title: '操作',
  108. align: "center",
  109. valign: 'middle',
  110. formatter: function (value, row, index) {
  111. // var rowData = JSON.stringify(row);
  112. var str = '<button type="button" class="btn btn-primary btn-sm" onclick="xuanZheDiag(\'' + row.code + '\',\'' + row.name + '\')">选中</button>';
  113. return str;
  114. }
  115. },
  116. {
  117. field: 'code',
  118. title: '诊断编码',
  119. align: "center",
  120. valign: 'middle'
  121. },
  122. {
  123. field: 'name',
  124. title: '诊断名称',
  125. align: "center",
  126. valign: 'middle'
  127. }
  128. ],
  129. responseHandler: function (res) {
  130. if (res == '401' || res == 401) {
  131. window.location.href = '/thmz/login/view'
  132. return;
  133. }
  134. var ress = eval(res);
  135. if (ress.code == -1) {
  136. if (ress.message != null && ress.message != '') {
  137. new PNotify({
  138. title: '错误提示',
  139. text: ress.message,
  140. type: 'error',
  141. hide: true,
  142. styling: 'bootstrap3'
  143. });
  144. }
  145. return {
  146. "total": 0,//总页数
  147. "rows": {} //数据
  148. };
  149. }
  150. return {
  151. "total": ress.total,//总页数
  152. "rows": ress.data //数据
  153. };
  154. },
  155. });
  156. }
  157. //选择诊断
  158. function xuanZheDiag(code,name) {
  159. $("#icdCodeForm").val(code)
  160. $("#icdTextForm").val(name)
  161. $("#diagModal").modal("hide");
  162. }
  163. //初始化科室下拉
  164. function initDeptSelect() {
  165. //科室列表
  166. $.ajax({
  167. type: "GET",
  168. url: '/thmz/allUnitCode',
  169. dataType: "json",
  170. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  171. success: function (data) {
  172. if (data == '401' || data == 401) {
  173. window.location.href = '/thmz/login/view'
  174. return;
  175. }
  176. let html = '';
  177. $.each(data.data, function (commentIndex, comment) {
  178. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  179. });
  180. $('#deptNoManagerDept').empty();
  181. $('#deptNoManagerDept').html(html);
  182. $('#deptNoManagerDept').selectpicker('refresh');
  183. }
  184. });
  185. }
  186. /**
  187. * 保存用户数据
  188. */
  189. function saveData() {
  190. var s_data = {
  191. "patientId": $("#patientId").val(),
  192. "reqDept": $("#inpatientWardBeHospitalized").val(),
  193. "smallDept": $("#smallWardBeHospitalized").val(),
  194. "admissStatus": $("#admissStatus").val(),
  195. "conditionCode":$("#conditionCode").val(),
  196. "routeOfAdmission":$("#routeOfAdmission").val(),
  197. "icdCode":$("#icdCodeForm").val(),
  198. "deposit":$("#deposit").val(),
  199. "icdText":$("#icdTextForm").val(),
  200. "contacterName":$("#contacterName").val(),
  201. "contacterRelationship":$("#contacterRelationship").val(),
  202. "contacterPhone":$("#contacterPhone").val(),
  203. "contacterAddress":$("#contacterAddress").val()
  204. }
  205. $.ajax({
  206. type: "POST",
  207. url: '/thmz/banLiZyReq',
  208. contentType: "application/json;charset=UTF-8",
  209. dataType: "json",
  210. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  211. data: JSON.stringify(s_data),
  212. success: function (res) {
  213. let visitDate = format(res.data,'yyyy-MM-dd HH:mm:ss');
  214. if (res == '401' || res == 401) {
  215. window.location.href = '/thmz/login/view'
  216. return;
  217. }
  218. if (res.code == 0) {
  219. $("#editModal").modal("hide");
  220. clearZyReq();
  221. //successMesage(res);
  222. printZyReq($("#patientId").val(),1, visitDate)
  223. } else {
  224. errorMesage(res);
  225. }
  226. }
  227. });
  228. }
  229. /**
  230. * 查询病人信息
  231. */
  232. function getAllPatient() {
  233. $('#tb_table').bootstrapTable("destroy");
  234. $('#tb_table').bootstrapTable({
  235. url: '/thmz/getPatientMiPage', //请求后台的URL(*)
  236. method: 'post', //请求方式(*)
  237. toolbar: '#toolbar', //工具按钮用哪个容器
  238. striped: true, //是否显示行间隔色
  239. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  240. pagination: true, //是否显示分页(*)
  241. sortable: true, //是否启用排序
  242. sortOrder: "asc", //排序方式
  243. queryParams: queryParams, //传递参数(*)
  244. sidePagination: "server", //分页方式:client客户端分页,server服务端分页(*)
  245. pageNumber: 1, //初始化加载第一页,默认第一页
  246. pageSize: 10, //每页的记录行数(*)
  247. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  248. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  249. strictSearch: true,
  250. showColumns: false, //是否显示所有的列
  251. showRefresh: false, //是否显示刷新按钮
  252. minimumCountColumns: 2, //最少允许的列数
  253. clickToSelect: true, //是否启用点击选中行
  254. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  255. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  256. cardView: false, //是否显示详细视图
  257. detailView: false,
  258. //rowStyle:rowStyle,//通过自定义函数设置行样式
  259. ajaxOptions: {
  260. headers: {
  261. 'Accept': 'application/json',
  262. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  263. }
  264. },
  265. columns: [
  266. {
  267. title: '操作',
  268. align: "center",
  269. valign: 'middle',
  270. formatter: function (value, row, index) {
  271. // var rowData = JSON.stringify(row);
  272. var str = '<button type="button" class="btn btn-primary btn-sm" onclick="editAdd(\'' + row.patientId + '\')">办理住院证</button>';
  273. str += '<button type="button" class="btn btn-primary btn-sm" onclick="bdZyz(\'' + row.patientId + '\')">补打住院证</button>';
  274. return str;
  275. }
  276. },
  277. {
  278. field: 'patientId',
  279. title: '门诊号',
  280. align: "center",
  281. valign: 'middle'
  282. },
  283. {
  284. field: 'name',
  285. title: '姓名',
  286. align: "center",
  287. valign: 'middle'
  288. }, {
  289. field: 'sex',
  290. title: '性别',
  291. align: "center",
  292. valign: 'middle',
  293. formatter: function (value, row, index) {
  294. return value == 1 ? "男":"女";
  295. }
  296. },
  297. {
  298. field: 'birthDayStr',
  299. title: '出生日期',
  300. align: "center",
  301. valign: 'middle'
  302. },
  303. {
  304. field: 'socialNo',
  305. title: '身份证号码',
  306. align: "center",
  307. valign: 'middle'
  308. }
  309. ],
  310. responseHandler: function (res) {
  311. if (res == '401' || res == 401) {
  312. window.location.href = '/thmz/login/view'
  313. return;
  314. }
  315. var ress = eval(res);
  316. if (ress.code == -1) {
  317. if (ress.message != null && ress.message != '') {
  318. new PNotify({
  319. title: '错误提示',
  320. text: ress.message,
  321. type: 'error',
  322. hide: true,
  323. styling: 'bootstrap3'
  324. });
  325. }
  326. return {
  327. "total": 0,//总页数
  328. "rows": {} //数据
  329. };
  330. }
  331. return {
  332. "total": ress.total,//总页数
  333. "rows": ress.data //数据
  334. };
  335. },
  336. });
  337. }
  338. /**
  339. * 关系列表初始化
  340. */
  341. function initRelationSelect() {
  342. //医生列表
  343. $.ajax({
  344. type: "GET",
  345. url: '/thmz/getRelation',
  346. dataType: "json",
  347. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  348. success: function (res) {
  349. if (res == '401' || res == 401) {
  350. window.location.href = '/thmz/login/view'
  351. return;
  352. }
  353. var html = '';
  354. $.each(res.data, function (commentIndex, comment) {
  355. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  356. });
  357. $('#contacterRelationship').empty();
  358. $('#contacterRelationship').html(html);
  359. $('#contacterRelationship').selectpicker('destroy').selectpicker('refresh');
  360. }
  361. });
  362. }
  363. /**
  364. * 构建列表查询参数
  365. * @param params
  366. * @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}}
  367. */
  368. function queryParams(params) {
  369. var temp = {
  370. pageSize: params.limit,
  371. offset: params.offset/params.limit,
  372. patientId: $("#patientIdSearch").val() == "" ? null : $("#patientIdSearch").val(),
  373. name: $("#nameSearch").val() == "" ? null : $("#nameSearch").val(),
  374. socialNo: $("#socialNoSearch").val() == "" ? null : $("#socialNoSearch").val()
  375. };
  376. return temp;
  377. };
  378. function diagQueryParams(params) {
  379. var temp = {
  380. pageSize: params.limit,
  381. pageIndex: params.offset / params.limit,
  382. name: $("#diagParamSearch").val() == "" ? null : $("#diagParamSearch").val(),
  383. };
  384. return temp;
  385. };
  386. function initZySelect() {
  387. //入院病情
  388. var conditionCode = '<option value="1">有</option><option value="2">临床未确定</option><option value="3">情况不明</option><option value="4">无</option>';
  389. $('#conditionCode').html(conditionCode);
  390. $('#conditionCode').selectpicker('refresh');
  391. //入院途径
  392. initRouteOfAdmission()
  393. }
  394. /**
  395. * 初始化入院途径
  396. */
  397. function initRouteOfAdmission() {
  398. getAjaxRequst("/thmz/queryRouteOfAdmission",{},true,function (res) {
  399. if (res == '401' || res == 401) {
  400. window.location.href = '/thmz/login/view'
  401. return;
  402. }
  403. let html = '';
  404. $.each(res.data, function (commentIndex, comment) {
  405. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  406. });
  407. $('#routeOfAdmission').empty();
  408. $('#routeOfAdmission').html(html);
  409. $('#routeOfAdmission').selectpicker('refresh');
  410. })
  411. }
  412. /**
  413. * 所有的入院状态
  414. */
  415. function iniAdmissStatus() {
  416. $.ajax({
  417. type: "GET",
  418. url: '/thmz/getAdmissStatus',
  419. dataType: "json",
  420. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  421. success: function (res) {
  422. if (res == '401' || res == 401) {
  423. window.location.href = '/thmz/login/view'
  424. return;
  425. }
  426. let html = '';
  427. $.each(res.data, function (commentIndex, comment) {
  428. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  429. });
  430. $('#admissStatus').empty();
  431. $('#admissStatus').html(html);
  432. $('#admissStatus').selectpicker('refresh');
  433. }
  434. });
  435. }
  436. /**
  437. * 入院登记的病区列表
  438. */
  439. function initListDeptSelect() {
  440. //科室列表
  441. $.ajax({
  442. type: "GET",
  443. url: '/thmz/allInpatientWard',
  444. dataType: "json",
  445. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  446. success: function (data) {
  447. if (data == '401' || data == 401) {
  448. window.location.href = '/thmz/login/view'
  449. return;
  450. }
  451. var html = '';
  452. $.each(data.data, function (commentIndex, comment) {
  453. html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
  454. });
  455. $('#inpatientWardBeHospitalized').empty();
  456. $('#inpatientWardBeHospitalized').html(html);
  457. $('#inpatientWardBeHospitalized').selectpicker('refresh');
  458. initSmallDeptByDept();
  459. }
  460. });
  461. }
  462. /**
  463. * 小科室列表
  464. */
  465. function initSmallDeptByDept() {
  466. let code = escape($('#inpatientWardBeHospitalized').val()).replace(/\+/g, '%2B');
  467. //小科室列表
  468. $.ajax({
  469. type: "GET",
  470. url: '/thmz/getSmallDeptByDept?code=' + code,
  471. dataType: "json",
  472. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  473. success: function (res) {
  474. if (res == '401' || res == 401) {
  475. window.location.href = '/thmz/login/view'
  476. return;
  477. }
  478. var html = '';
  479. $.each(res.data, function (commentIndex, comment) {
  480. html += '<option value="' + comment.code + '">' + comment.name + '</option>';
  481. });
  482. $('#smallWardBeHospitalized').empty();
  483. $('#smallWardBeHospitalized').html(html);
  484. $('#smallWardBeHospitalized').selectpicker('destroy').selectpicker('refresh');
  485. }
  486. });
  487. //病床数
  488. $.ajax({
  489. type: "GET",
  490. url: '/thmz/getBedStatusNumByDept?code=' + code,
  491. dataType: "json",
  492. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  493. success: function (res) {
  494. if (res == '401' || res == 401) {
  495. window.location.href = '/thmz/login/view'
  496. return;
  497. }
  498. if (res.code == 0) {
  499. var data = res.data;
  500. if (data == null) {
  501. $("#totalBedNum").val(0);
  502. $("#freeBedNum").val(0);
  503. $("#occupationBedNum").val(0);
  504. } else {
  505. $("#totalBedNum").val(data.total);
  506. $("#freeBedNum").val(data.free);
  507. $("#occupationBedNum").val(data.occupation);
  508. }
  509. } else {
  510. errorMesage(res);
  511. }
  512. }
  513. });
  514. }
  515. /**
  516. * 打开编辑窗口
  517. * @param row
  518. */
  519. function editAdd(patientId) {
  520. $("#patientId").val(patientId)
  521. clearZyReq();
  522. $("#editModal").modal();
  523. }
  524. /**
  525. * 重置查询表单
  526. */
  527. function resetSearch() {
  528. $("#patientIdSearch").val(null);
  529. $("#nameSearch").val(null);
  530. $("#socialNoSearch").val(null);
  531. }
  532. //住院证补打
  533. function bDPrintZyz(patientId,visitDate) {
  534. let date = format(visitDate,'yyyy-MM-dd HH:mm:ss')
  535. printZyReq(patientId,1,date)
  536. }
  537. /**
  538. * 打开编辑窗口
  539. * @param row
  540. */
  541. function bdZyz(patientId) {
  542. $("#bdZyzModal").modal();
  543. getBdZyzData(patientId);
  544. }
  545. function getBdZyzData(patientId) {
  546. $('#bdZyz_tb_table').bootstrapTable("destroy");
  547. $('#bdZyz_tb_table').bootstrapTable({
  548. url: '/thmz/queryZyzByPatientId', //请求后台的URL(*)
  549. method: 'post', //请求方式(*)
  550. toolbar: '#toolbar', //工具按钮用哪个容器
  551. striped: true, //是否显示行间隔色
  552. cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
  553. pagination: true, //是否显示分页(*)
  554. sortable: true, //是否启用排序
  555. sortOrder: "asc", //排序方式
  556. queryParams: {patientId:patientId}, //传递参数(*)
  557. sidePagination: "client", //分页方式:client客户端分页,server服务端分页(*)
  558. pageNumber: 1, //初始化加载第一页,默认第一页
  559. pageSize: 10, //每页的记录行数(*)
  560. pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
  561. search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
  562. strictSearch: true,
  563. showColumns: false, //是否显示所有的列
  564. showRefresh: false, //是否显示刷新按钮
  565. minimumCountColumns: 2, //最少允许的列数
  566. clickToSelect: true, //是否启用点击选中行
  567. uniqueId: "ID", //每一行的唯一标识,一般为主键列
  568. showToggle: false, //是否显示详细视图和列表视图的切换按钮
  569. cardView: false, //是否显示详细视图
  570. detailView: false,
  571. //rowStyle:rowStyle,//通过自定义函数设置行样式
  572. ajaxOptions: {
  573. headers: {
  574. 'Accept': 'application/json',
  575. 'Authorization': 'Bearer ' + localStorage.getItem("token")
  576. }
  577. },
  578. columns: [
  579. {
  580. title: '操作',
  581. align: "center",
  582. valign: 'middle',
  583. formatter: function (value, row, index) {
  584. // var rowData = JSON.stringify(row);
  585. var str = '<button type="button" class="btn btn-primary btn-sm" onclick="bDPrintZyz(\'' + row.patientId + '\',\'' + row.visitDate + '\')">打印</button>';
  586. return str;
  587. }
  588. },
  589. {
  590. field: 'patientId',
  591. title: '门诊号',
  592. align: "center",
  593. valign: 'middle'
  594. },
  595. {
  596. field: 'name',
  597. title: '姓名',
  598. align: "center",
  599. valign: 'middle',
  600. },
  601. {
  602. field: 'visitDate',
  603. title: '就诊时间',
  604. align: "center",
  605. valign: 'middle',
  606. formatter:function (value,row,index) {
  607. return format(value,'yyyy-MM-dd HH:mm:ss')
  608. }
  609. },
  610. {
  611. field: 'doctorName',
  612. title: '医生',
  613. align: "center",
  614. valign: 'middle'
  615. },
  616. {
  617. field: 'icdTextNew',
  618. title: '诊断',
  619. align: "center",
  620. valign: 'middle'
  621. },
  622. {
  623. field: 'reqDeptName',
  624. title: '入院科室',
  625. align: "center",
  626. valign: 'middle'
  627. },
  628. {
  629. field: 'smallDeptName',
  630. title: '入院病区',
  631. align: "center",
  632. valign: 'middle'
  633. }
  634. ],
  635. responseHandler: function (res) {
  636. if (res == '401' || res == 401) {
  637. window.location.href = '/thmz/login/view'
  638. return;
  639. }
  640. var ress = eval(res);
  641. if (ress.code == -1) {
  642. if (ress.message != null && ress.message != '') {
  643. new PNotify({
  644. title: '错误提示',
  645. text: ress.message,
  646. type: 'error',
  647. hide: true,
  648. styling: 'bootstrap3'
  649. });
  650. }
  651. return {
  652. "total": 0,//总页数
  653. "rows": {} //数据
  654. };
  655. }
  656. return {
  657. // "total": ress.total,//总页数
  658. "rows": ress.data //数据
  659. };
  660. },
  661. });
  662. }
  663. /**
  664. * 打印入院通知单
  665. * @param patientId
  666. * @param times
  667. * @param clnicId
  668. * @param payMark
  669. * @param printType 打印模式 1 预览打印 2 打印设置
  670. */
  671. function printZyReq(patientId, printType,visitDate) {
  672. $.ajax({
  673. type: "GET",
  674. url: '/thmz/printZyReq?patientId=' + patientId+'&visitDate='+visitDate,
  675. contentType: "application/json;charset=UTF-8",
  676. dataType: "json",
  677. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  678. success: function (res) {
  679. if (res == '401' || res == 401) {
  680. window.location.href = '/thmz/login/view'
  681. return;
  682. }
  683. if (res.code == 0) {
  684. setPrint();
  685. LODOP = getLodop();
  686. LODOP.PRINT_INITA(6, 0, "148mm", "210mm", hospitalName+"入院通知单");
  687. LODOP.SET_PRINT_STYLE("FontSize", 9); //字体大小
  688. //设置默认打印机
  689. LODOP.SET_PRINTER_INDEX(printIndex);
  690. LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "148mm");
  691. LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "210mm");
  692. LODOP.SET_PRINT_PAGESIZE(1, "148mm", "210mm", "CreateCustomPage");
  693. LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "入院通知单");//对新建的纸张重命名
  694. //intDispMode:预览比例,数字型,0-适高 1-正常大小 2-适宽
  695. //intToolMode:工具条和按钮,数字型 0-显示(上方)工具栏 1-显示(下方)按钮栏 2-两个都显示 3-两个都不显示
  696. //blDirectPrint: 打印按钮是否“直接打印” 1-是 0-否(弹出界面“选机打印”)
  697. //intWidth,intHeight 窗口的宽和高,整数型,单位是px
  698. //strTitleButtonCaptoin 预览窗口和打印按钮的名称组合,字符型,用“点”分隔
  699. //LODOP.SET_PREVIEW_WINDOW(intDispMode,intToolMode,blDirectPrint,intWidth,intHeight,strTitleButtonCaptoin)
  700. LODOP.SET_PREVIEW_WINDOW(0, 2, 0, 700, 900, "");
  701. //LODOP.SET_PRINT_STYLE("FontSize", 8); //字体大小
  702. var strStyle = "<style>table{width: 96%;} table,td,th {}</style>";
  703. var mzPatientMi = res.mzPatientMi;
  704. var mzZyReq = res.mzZyReq;
  705. $("#patientIdZyReq").text(mzPatientMi.patientId);
  706. $("#patientNameZyReq").text(mzPatientMi.name);
  707. $("#patientGenderZyReq").text(mzPatientMi.gender);
  708. $("#patientAgeZyReq").text(mzPatientMi.ageString);
  709. $("#sfzZyReq").text(mzPatientMi.socialNo);
  710. $("#birthDateZyReq").text(format(mzPatientMi.birthDay, "yyyy-MM-dd"));
  711. $("#phoneZyReq").text(mzPatientMi.phoneNo);
  712. $("#responseTypeZyReq").text(mzPatientMi.responseTypeName);
  713. $("#addressZyReq").text(mzPatientMi.address);
  714. if (mzZyReq.icdCode == null || mzZyReq.icdCode == "" || mzZyReq.icdCode.length == 0) {
  715. $("#icsCodeZyReq").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
  716. $("#icsTextZyReq").text(mzZyReq.icdText);
  717. } else {
  718. $("#icsCodeZyReq").text(mzZyReq.icdCode);
  719. $("#icsTextZyReq").text(mzZyReq.icdText);
  720. }
  721. $("#reqDeptZyReq").text(mzZyReq.reqWardName);
  722. $("#smallDeptZyReq").text(mzZyReq.smallDeptName);
  723. $("#routeOfAdmissionName").text(mzZyReq.routeOfAdmissionName);
  724. $("#depositZyReq").text(mzZyReq.deposit);
  725. //$("#admissStatusZyReq").text(mzZyReq.admissStatus);
  726. // $("input:checkbox[value='" + mzZyReq.admissStatus + "']").prop('checked', true);
  727. $("input:checkbox[name='admissStatusZyReq']").each(function (i, e) {
  728. $(this).removeAttr("checked");
  729. if ($(this).val() ==Number(mzZyReq.admissStatus) ||$(this).val()==mzZyReq.admissStatus) {
  730. $(this).attr("checked",true)
  731. }
  732. });
  733. $("#visitDateZyReq").text(format(mzZyReq.visitDate, "yyyy-MM-dd HH:mm:ss"));
  734. $("#deptCodeZyReq").text(mzZyReq.deptName);
  735. getAjaxRequst("/thmz/getDoctorSignatureImage",{doctorCode:mzZyReq.doctorCode},false,function (signRes) {
  736. if(signRes.code == 0){
  737. $("#doctorCodeZyReq").html("<img src='" + signRes.data + "' style='width:100px;height:23px;'/>")
  738. }else {
  739. $("#doctorCodeZyReq").text(mzZyReq.doctorName);
  740. }
  741. })
  742. LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("mz_zy_req_table").innerHTML);
  743. if (printType == 1) {
  744. LODOP.PREVIEW();
  745. } else if (printType == 2) {
  746. LODOP.PRINT_SETUP();
  747. }
  748. } else {
  749. errorMesage(res);
  750. }
  751. }
  752. });
  753. }
  754. /**
  755. * 查询默认打印机
  756. */
  757. function setPrint() {
  758. if (printIndex >= 0) {
  759. return;
  760. }
  761. $.ajax({
  762. type: "GET",
  763. url: '/thmz/getLastWindowsByCurrentUser',
  764. contentType: "application/json;charset=UTF-8",
  765. dataType: "json",
  766. headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
  767. async: false,
  768. success: function (res) {
  769. if (res == '401' || res == 401) {
  770. window.location.href = '/thmz/login/view'
  771. return;
  772. }
  773. if (res.code == 0) {
  774. printIndex = res.data.cgPrintIndex;
  775. } else {
  776. printIndex = -1;
  777. }
  778. }
  779. });
  780. }