
shr.defineClass("shr.custom.EmployeeDynListEx", shr.emp.EmployeeDynList, {
	initalizeDOM: function () {
		var _self = this;
		shr.custom.EmployeeDynListEx.superClass.initalizeDOM.call(this);
	},
		/**
	*同步部门信息到Iot
	*/
	syncPersonToIotAction: function (action) {
		var _self = this;
		// var selectedId = _self.getSelectedIds();
		var selectedId = this.getSelectedFields(null);
		if (selectedId != null) {
			console.log("selectedId", selectedId);
			// shr.showConfirm("是否开始执行同步人员信息到OA？", function () {
				// $.block.show({
				// 	text: '正在同步，请勿操作！',
				// });
				var billId;
				if (selectedId.length == 0) {
					billId = selectedId
				} else {
					billId = selectedId + ""
				}
				_self.doRemoteWithBatchAction({
					method: "syncPersonToIot",
					billId: billId
				});
				// _self.remoteCall({
				// 	method: 'syncPersonToOA',
				// 	param: {
				// 		billID: selectedId,
				// 	},
				// 	success: function (data) {
				// 		shr.showInfo({
				// 			message: "同步成功",
				// 			hideAfter: 3
				// 		});
				// 		// 查询表格
				// 	}, complete: function () {
				// 		$.block.hide()
				// 	}
				// });
			// })
		}
	},
	/**
	*同步部门信息到OA
	*/
	syncPersonToOAAction: function (action) {
		var _self = this;
		// var selectedId = _self.getSelectedIds();
		var selectedId = this.getSelectedFields(null);
		if (selectedId != null) {
			console.log("selectedId", selectedId);
			shr.showConfirm("是否开始执行同步人员信息到OA？", function () {
				$.block.show({
					text: '正在同步，请勿操作！',
				});
				var billId;
				if (selectedId.length == 0) {
					billId = selectedId
				} else {
					billId = selectedId + ""
				}
				_self.doRemoteWithBatchAction({
					method: "syncPersonToOA",
					billId: billId
				});
				// _self.remoteCall({
				// 	method: 'syncPersonToOA',
				// 	param: {
				// 		billID: selectedId,
				// 	},
				// 	success: function (data) {
				// 		shr.showInfo({
				// 			message: "同步成功",
				// 			hideAfter: 3
				// 		});
				// 		// 查询表格
				// 	}, complete: function () {
				// 		$.block.hide()
				// 	}
				// });
			})
		}
	},
	/**
	 * 批量提示行数据，方便子类覆写
	 */
	getBatchTipsRowDatas: function (ids, options) {
		var _self = this;
		var $table = $(_self.gridId);
		var rowDatas = []; //获取选中的表格数据,这种方法只能获取到当前页数据   bug编号：BT1155539
		// for (var i = 0, l = ids.length; i < l; i++) {
		// 	rowDatas.push($table.jqGrid('getOriginalRowData', ids[i]));
		// }
		// rowDatas = _self.selectedRowData;
		_self.remoteCall({
			method: 'getPersonBatchInfo',
			param: {
				ids:ids+""
			},
			async:false,
			success: function (data) {
				rowDatas = data
				// 查询表格
			}
		});
		return rowDatas;
	},



	/**
	 * 如果重写过getBatchTipsRowDatas方法，则需要增加对应的列配置属性
	 */
	getBatchTipsTableModel: function () {
		var tableModel = $("#grid").jqGrid("getGridConfig").colModel;
		for (let i = 0; i < tableModel.length; i++) {
			var name = tableModel[i].name;
			if ("person.number" == name || "person.name" == name) {
				tableModel[i].isBatchTipsColumn = true;
			}
		}
		return tableModel;
	},

});

