shr.defineClass("shr.project.memberManagementEdit", shr.framework.Edit, {
	/**
	 * 描述:初始化操作
	 *
	 * @action
	 */
	initalizeDOM: function () {
		var _self = this;
		shr.project.memberManagementEdit.superClass.initalizeDOM.call(this);
		var opse = this.getOperateState();

		if ("VIEW" == opse) {
			var MemberState = _self.initData.MemberState;
			if (MemberState && '1' != MemberState) {
				$("#edit").show();
			}
		} else if ("ADDNEW" == opse) {
			var projectManagement = _self.initData.projectManagement;
			if (projectManagement) {
				$("#projectManagement").shrPromptBox("setValue", projectManagement);
				$("#projectName").val(projectManagement.projectName);
				$("#projectCode").val(projectManagement.number);
			}
		}


		if ("VIEW" != opse) {
			$("#projectManagement").shrPromptBox(
				{
					"onchange":
						(e, data) => {
							if (data && data.current) {
								var current = data.current;
								$("#projectName").val(current.projectName);
								$("#projectCode").val(current.number);
								var projectMa = $("#employee").shrPromptBox("getValue");
								if (projectMa && projectMa.id) {
									$("#number").val(projectMa.number + current.number);
								}
								var adminOrg = { id: current["adminOrg.id"],name: current["adminOrg.name"] };
								$("#adminOrg").shrPromptBox("setValue", adminOrg);
							}
						}
				});
			$("#employee").shrPromptBox(
				{
					"onchange": (e, data) => {
						if (data && data.current) {
							var projectMa = $("#projectManagement").shrPromptBox("getValue");
							if (projectMa && projectMa.id) {
								$("#number").val(projectMa.number + "_" + data.current.number);
							}
						}
					}
				});
		}
	},
});