| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- /**
- * 分配人员明细动态list.js(负责人)
- */
- shr.defineClass("shr.custom.DetailPrincipalDynamicList", shr.custom.CustomDynamicList, {
- //可编辑列 数组(不区分大小写)
- editColumns: [],
- isSum: false,
- initalizeDOM: function () {
- //新增编辑列
- this.editColumns.push("person.name");
- this.editColumns.push("bdpapd.functioncoefficient");
- this.editColumns.push("bdpapd.energyinputcoeff");
- this.editColumns.push("bdpapd.performancegradeq1");
- this.editColumns.push("bdpapd.performancegradeq2");
- this.editColumns.push("bdpapd.performancecoeffq1");
- this.editColumns.push("bdpapd.performancecoeffq2");
- this.editColumns.push("bdpapd.bonusduedate");
- this.editColumns.push("bdpapd.bonusstartingdate");
- this.editColumns.push("bdpapd.initialproportion");
- shr.custom.DetailPrincipalDynamicList.superClass.initalizeDOM.call(this);
- var self = this;
- $('#busDep').shrPromptBox("option", {
- //确定按钮设置值,之后执行方法
- afterOK: function (datas, e) {
- //查询表格数据
- self.queryGrid();
- },
- //open方法里调用
- verifyBeforeOpenCallback: function (e, value) {
- var parentId = shr.getUrlParam('parentId');
- var options = {
- action: 'getBusDepIdStrByParentId',
- uipk: this.uipk,
- type: 'POST',
- async: false,
- param: {
- parentId: parentId
- },
- success: function (res) {
- $("#busDep").shrPromptBox("setFilter", "id in ( " + res + ")");
- },
- };
- shr.remoteCall(options);
- }
- });
- },
- // 根据动态列表配置 取业务主键
- getBillIdFieldName: function () {
- return 'bDPAPD.id';
- },
- /**
- * 描述: 导入action
- */
- importAction: function () {
- //自定义参数
- var parentId = shr.getUrlParam('parentId');
- var customParam = { "parentId": parentId }
- this.doImportData('import', customParam);
- },
- /**
- * 获得自定义过滤条件,供子类覆写使用
- */
- getCustomFilterItems: function () {
- var parentId = shr.getUrlParam('parentId');
- var busDepIds = $("#busDep_el").val();
- var filter = "bonusCycle.id = '" + parentId + "' and bDPAPD.id is not null";
- if (busDepIds) {
- busDepIds = busDepIds.replace(/,/g, "','");
- return filter += " and busDep.id in ('" + busDepIds + "')";
- }
- return filter;
- },
- /**
- * 组装保存时传至服务端的数据
- */
- assembleSaveData: function (action) {
- var _self = this;
- //组装需要修改的数据
- var data = [];
- var meta;
- var id, column, value, cur, element, personCode, datatype;
- var tds = $("#grid td[class*='dirty-cell']");
- var $table = $("#grid")[0];
- for (var i = 0; i < tds.length; i++) {
- //获取父节点,以获取对应id
- meta = {};
- var cur = $(tds[i]);
- //获取输入的内容,而不是转以后的字符实体,同时对单引号处理
- fid = cur.parent().attr('id');
- element = cur.attr('aria-describedby').replace('grid_', '');
- value = $($table).getCell(fid, element);
- //value = cur.text().replace(/\'/g, "''").trim();
- fid = cur.parent().attr('id');
- element = cur.attr('aria-describedby').replace('grid_', '');
- datatype = _self.getColumnType(element);
- if ("promptbox" == datatype) {
- column = element.split('.')[0];
- value = value["id"];
- } else {
- column = element.split('.')[1];
- }
- //列表需要显示id列
- id = $("#" + _self.getEscapeChars(fid) + " td[aria-describedby='grid_bdp\\.id']").attr('title');
- // //校验输入内容
- if (!_self.checkNumValid(value, datatype)) {
- $(tds[i]).focus();
- $(tds[i]).css({
- "border": "solid 2px red"
- });
- throw new Error("请输入正确的格式");
- }
- meta.fid = id;
- meta.column = column;
- meta.value = value;
- meta.type = datatype;
- data.push(meta);
- }
- return data;
- },
- /**
- * 默认的action处理方法
- */
- defaultBatchActionHandle: function (option) {
- var selectedIds = this.getSelectedIds();
- if (!selectedIds) {
- shr.showWarning({ message: "请先选中数据!", hideAfter: 3 })
- return;
- }
- shr.custom.DetailPrincipalDynamicList.superClass.defaultBatchActionHandle.call(this, option);
- },
- });
|