drug_q_plan_add.min.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. (function (a) {
  2. config.init();
  3. var b = {
  4. customerFamilyId: Fx.getUrlParam("id"), fn_call: {
  5. doing: function () {
  6. window.location = "drugCalendar.html?id=" + b.customerFamilyId
  7. }
  8. }, doing: function () {
  9. var d = Fx.getDrugHoursQuantity();
  10. var c = {
  11. customerFamilyId: b.customerFamilyId,
  12. drugName: a("#drugName").val(),
  13. frequency: a("#frequency").val(),
  14. doseType: a("#doseType").val(),
  15. startDate: a("#start_date").val(),
  16. consumptionHoursString: d[0],
  17. quantityString: d[1],
  18. diagnose: a("#diagnose").val(),
  19. source: a("#source").val()
  20. };
  21. if (a("input[type=radio][name=days]").get(1).checked) {
  22. a.extend(c, {days: a("#days_value").val()})
  23. }
  24. if (a("input[type=radio][name=everyXDays]").get(1).checked) {
  25. a.extend(c, {everyXDays: a("#everyXDays").val()})
  26. }
  27. hzAPI.sendData(window.apiUrl + "?c=Other&a=medicineAdd", c, false, ["添加失败", "添加成功"], null, null, b.fn_call)
  28. }, init: function () {
  29. a("#start_date").val(new Date().format("yyyy-M-dd"));
  30. [].slice.call(a("select")).forEach(function (c) {
  31. a(c).parent().find(".select_text_ui").text(Fx.getSelectOptionsText(a(c)))
  32. })
  33. }
  34. };
  35. b.init();
  36. a("i.menu_cn").bind("tap", function () {
  37. if (validate.check("form")) {
  38. b.doing()
  39. }
  40. });
  41. a("i.menu_left").bind("tap", function () {
  42. b.fn_call.doing()
  43. })
  44. })(Zepto);