doctorBookingSure.min.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. (function (c) {
  2. config.init();
  3. var a = {
  4. scheduleCode: Fx.getUrlParam("scheduleCode"),
  5. hospitalId: Fx.getUrlParam("hospitalId"),
  6. deptId: Fx.getUrlParam("deptId"),
  7. doctorId: Fx.getUrlParam("doctorId"),
  8. regDate: Fx.getUrlParam("regDate"),
  9. timeFlag: Fx.getUrlParam("timeFlag"),
  10. regFee: Fx.getUrlParam("regFee"),
  11. startTime: Fx.getUrlParam("startTime"),
  12. endTime: Fx.getUrlParam("endTime"),
  13. treatFee: Fx.getUrlParam("treatFee")
  14. };
  15. var b = {
  16. doing: function () {
  17. hzAPI.getData(window.apiUrl + "?c=Index&a=customerFamilyList", {},
  18. "#family", 1, true, 6)
  19. }
  20. };
  21. hzAPI.getData(window.apiUrl + "?c=Index&a=doctorInfo", a, "#list #form", 0, true, null, true);
  22. b.doing();
  23. c("#sure").on("tap",
  24. function () {
  25. c.extend(a, {
  26. //todo 更改控件
  27. customerFamilyId: c("input[type=radio][name=customerFamilyId]:checked").val()
  28. });
  29. var d = {
  30. doing: function (e) {
  31. setTimeout(function () {
  32. if (e[0].userFlag == "0") {
  33. hzAPI.dialog(false, 3000, "首诊患者请到医院缴费并办理就诊卡");
  34. setTimeout(function () {
  35. window.location = "doctorCalendar.html?id=" + a.customerFamilyId
  36. },
  37. 3000)
  38. } else {
  39. window.location = "cardPay.html?hospitalId=" + a.hospitalId + "&hospitalName=" + encodeURI(encodeURI(c("#hospitalName").text().trim())) + "&customerFamilyId=" + a.customerFamilyId
  40. }
  41. },
  42. 2000)
  43. }
  44. };
  45. hzAPI.sendData(window.apiUrl + "?c=Other&a=appointsOrder", a, false, [null, "挂号成功"], null, null, d)
  46. });
  47. c("i.add").on("tap",
  48. function () {
  49. window.location = "familyDataAdd.html"
  50. });
  51. c(".hd .fr i").on("tap",
  52. function () {
  53. if (validate.check("#testForm")) {
  54. var d = {
  55. trueName: c("#trueName").val(),
  56. phone: c("#phone").val(),
  57. tel: c("#tel").val(),
  58. email: c("#email").val(),
  59. idNo: c("#idNo").val(),
  60. birthDay: c("#idNo").val().substr(6, 8).replace(/(.{4})(.{2})/, "$1-$2-"),
  61. address: c("#address").val(),
  62. sex: c("#sex").val(),
  63. nation: c("#nation").val(),
  64. province: null,
  65. city: null,
  66. area: null,
  67. ownership: c("#ownership").val()
  68. };
  69. hzAPI.sendData(window.apiUrl + "?c=Index&a=customerFamilyAdd", d, false, ["添加失败", "添加成功"], null, null, b)
  70. }
  71. })
  72. })(Zepto);