1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- (function (a) {
- config.init();
- var b = {
- customerFamilyId: Fx.getUrlParam("id"), fn_call: {
- doing: function () {
- window.location = "drugCalendar.html?id=" + b.customerFamilyId
- }
- }, doing: function () {
- var d = Fx.getDrugHoursQuantity();
- var c = {
- customerFamilyId: b.customerFamilyId,
- drugName: a("#drugName").val(),
- frequency: a("#frequency").val(),
- doseType: a("#doseType").val(),
- startDate: a("#start_date").val(),
- consumptionHoursString: d[0],
- quantityString: d[1],
- diagnose: a("#diagnose").val(),
- source: a("#source").val()
- };
- if (a("input[type=radio][name=days]").get(1).checked) {
- a.extend(c, {days: a("#days_value").val()})
- }
- if (a("input[type=radio][name=everyXDays]").get(1).checked) {
- a.extend(c, {everyXDays: a("#everyXDays").val()})
- }
- hzAPI.sendData(window.apiUrl + "?c=Other&a=medicineAdd", c, false, ["添加失败", "添加成功"], null, null, b.fn_call)
- }, init: function () {
- a("#start_date").val(new Date().format("yyyy-M-dd"));
- [].slice.call(a("select")).forEach(function (c) {
- a(c).parent().find(".select_text_ui").text(Fx.getSelectOptionsText(a(c)))
- })
- }
- };
- b.init();
- a("i.menu_cn").bind("tap", function () {
- if (validate.check("form")) {
- b.doing()
- }
- });
- a("i.menu_left").bind("tap", function () {
- b.fn_call.doing()
- })
- })(Zepto);
|