HPFW002B.js 1.4 KB
Newer Older
宋祥 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
$(function () {

	IPLATUI.EFSelect = {
		"result-0-customId": {
			select: function (e) {
				var dataItem = e.dataItem;
				var valueField = dataItem['valueField'];
				var textField = dataItem['textField'];
				if (valueField) {
					textField = textField.indexOf("-") > -1 ? textField.split("-")[1] : textField;
					$("#result-0-customName").val(textField);
				} else {
					$("#result-0-customName").val("");
				}
			}
		}
	}

	IPLATUI.EFGrid = {
		"result": {
			pageable: false,
			exportGrid: false,
			toolbarConfig: {
				hidden: false,
			},
			columns: [],
			loadComplete: function (grid) {
			},
			onSuccess: function (e) {
			}
		}
	};

	// 确认
	$('#SAVE').on('click', save);

	// 键盘按键
	downKeyUp();
})

/**
 * 保存
 */
let save = function () {
	let careDate = $("#result-0-careDate").val();
	if (isBlank(careDate)) {
		message("关怀日期不能为空");
		return;
	}
	let careWay = $("#result-0-careWay").val();
	if (isBlank(careWay)) {
		message("关怀方式不能为空");
		return;
	}
	let careType = $("#result-0-careType").val();
	if (isBlank(careType)) {
		message("关怀类型不能为空");
		return;
	}
	JSUtils.confirm("确定对数据做\"保存\"操作? ", {
		ok: function () {
			JSUtils.submitGridsData("", "HPFW002B", "save", true, function (res) {
				if (res.status > -1) {
					parent.JSColorbox.setValueCallback(res);
				} else {
					message(res.msg);
				}
			});
		}
	});
}