|
|
@@ -9,15 +9,15 @@ Ext.define('school.view.basic.staff.StaffList', {
|
|
|
_title: '教职工信息导入',
|
|
|
caller: 'Teacher',
|
|
|
pathKey: 'teacher',
|
|
|
-
|
|
|
|
|
|
- initComponent: function() {
|
|
|
+
|
|
|
+ initComponent: function () {
|
|
|
var me = this;
|
|
|
Ext.apply(this, {
|
|
|
searchField: [{
|
|
|
xtype: 'textfield',
|
|
|
name: 'code',
|
|
|
- fieldLabel:'教职工号'
|
|
|
+ fieldLabel: '教职工号'
|
|
|
}, {
|
|
|
xtype: 'textfield',
|
|
|
name: 'name',
|
|
|
@@ -27,7 +27,7 @@ Ext.define('school.view.basic.staff.StaffList', {
|
|
|
name: 'job',
|
|
|
fieldLabel: '职位'
|
|
|
}],
|
|
|
-
|
|
|
+
|
|
|
gridConfig: {
|
|
|
addTitle: '教职工信息',
|
|
|
addXtype: 'basic-staff-staffdetail',
|
|
|
@@ -39,10 +39,10 @@ Ext.define('school.view.basic.staff.StaffList', {
|
|
|
totalProperty: 'data.total',
|
|
|
actionColumn: [],
|
|
|
selModel: {
|
|
|
- checkOnly:true,
|
|
|
- type:'checkboxmodel',
|
|
|
- mode : "MULTI" ,
|
|
|
- ignoreRightMouseSelection : false
|
|
|
+ checkOnly: true,
|
|
|
+ type: 'checkboxmodel',
|
|
|
+ mode: "MULTI",
|
|
|
+ ignoreRightMouseSelection: false
|
|
|
},
|
|
|
hiddenTools: false,
|
|
|
toolBtns: [{
|
|
|
@@ -50,7 +50,7 @@ Ext.define('school.view.basic.staff.StaffList', {
|
|
|
belong: me,
|
|
|
caller: me.caller,
|
|
|
pathKey: me.pathKey,
|
|
|
- onSuccess: function() {
|
|
|
+ onSuccess: function () {
|
|
|
//刷新界面
|
|
|
var g = me.down('grid');
|
|
|
g.store.loadPage(g.store.currentPage);
|
|
|
@@ -61,18 +61,18 @@ Ext.define('school.view.basic.staff.StaffList', {
|
|
|
}, {
|
|
|
xtype: 'button',
|
|
|
text: '删除',
|
|
|
- handler: function() {
|
|
|
+ handler: function () {
|
|
|
let grid = this.up('grid'),
|
|
|
- selectedRecords = grid.getSelection();
|
|
|
+ selectedRecords = grid.getSelection();
|
|
|
let data;
|
|
|
|
|
|
- data = selectedRecords.map(function(r) {
|
|
|
+ data = selectedRecords.map(function (r) {
|
|
|
return {
|
|
|
id: r.get('teacher_id')
|
|
|
};
|
|
|
});
|
|
|
|
|
|
- if(data.length == 0) {
|
|
|
+ if (data.length == 0) {
|
|
|
school.util.BaseUtil.showErrorToast('请先勾选需要删除的记录');
|
|
|
return;
|
|
|
}
|
|
|
@@ -85,11 +85,11 @@ Ext.define('school.view.basic.staff.StaffList', {
|
|
|
params: JSON.stringify({
|
|
|
baseDTOs: data
|
|
|
})
|
|
|
- }).then(function(res) {
|
|
|
+ }).then(function (res) {
|
|
|
grid.setLoading(false);
|
|
|
school.util.BaseUtil.showSuccessToast('成功删除' + data.length + '条记录');
|
|
|
grid.store.loadPage(grid.store.currentPage);
|
|
|
- }).catch(function(e) {
|
|
|
+ }).catch(function (e) {
|
|
|
grid.setLoading(false);
|
|
|
school.util.BaseUtil.showErrorToast('删除失败: ' + e.message);
|
|
|
});
|
|
|
@@ -97,11 +97,11 @@ Ext.define('school.view.basic.staff.StaffList', {
|
|
|
}, {
|
|
|
xtype: 'button',
|
|
|
text: '新增',
|
|
|
- handler: function() {
|
|
|
+ handler: function () {
|
|
|
school.util.BaseUtil.openTab('basic-staff-staffdetail', '新增教职工信息', 'basic-staff-staffdetail-add');
|
|
|
}
|
|
|
}],
|
|
|
- columns : [{
|
|
|
+ columns: [{
|
|
|
text: 'ID',
|
|
|
dataIndex: 'teacher_id',
|
|
|
hidden: true
|
|
|
@@ -120,7 +120,7 @@ Ext.define('school.view.basic.staff.StaffList', {
|
|
|
}, {
|
|
|
text: '性别',
|
|
|
dataIndex: 'teacher_sex',
|
|
|
- renderer: function(v, m, r) {
|
|
|
+ renderer: function (v, m, r) {
|
|
|
return v == 1 ? '男' : (v == 0 ? '女' : '未知');
|
|
|
}
|
|
|
}, {
|
|
|
@@ -172,33 +172,33 @@ Ext.define('school.view.basic.staff.StaffList', {
|
|
|
return conditionValue;
|
|
|
},
|
|
|
|
|
|
- getExtraParams: function(store, op, condition) {
|
|
|
+ getExtraParams: function (store, op, condition) {
|
|
|
var temp = {};
|
|
|
|
|
|
- for(let x = 0; x < condition.length; x++) {
|
|
|
+ for (let x = 0; x < condition.length; x++) {
|
|
|
let c = condition[x];
|
|
|
- if(c.field == 'keyword') {
|
|
|
+ if (c.field == 'keyword') {
|
|
|
temp.keyword = c.value;
|
|
|
- }else if(c.field == 'date') {
|
|
|
+ } else if (c.field == 'date') {
|
|
|
temp.fromDate = new Date(c.value.split(',')[0]).getTime();
|
|
|
temp.endDate = new Date(c.value.split(',')[1]).getTime();
|
|
|
- }else if(c.field == 'quoted') {
|
|
|
+ } else if (c.field == 'quoted') {
|
|
|
temp.quoted = c.value == 'all' ? null : c.value;
|
|
|
- }else if(c.field == 'closed') {
|
|
|
+ } else if (c.field == 'closed') {
|
|
|
// temp.endDate = c.value == 'all' ? null : (
|
|
|
// c.value == '0' ?
|
|
|
// );
|
|
|
}
|
|
|
}
|
|
|
let obj = {
|
|
|
- pageNumber: store.exportNumber?store.exportNumber:op._page,
|
|
|
- pageSize: store.exportPageSize?store.exportPageSize:store.pageSize
|
|
|
+ pageNumber: store.exportNumber ? store.exportNumber : op._page,
|
|
|
+ pageSize: store.exportPageSize ? store.exportPageSize : store.pageSize
|
|
|
};
|
|
|
- for(let k in temp) {
|
|
|
- if(!!temp[k]) {
|
|
|
+ for (let k in temp) {
|
|
|
+ if (!!temp[k]) {
|
|
|
obj[k] = temp[k];
|
|
|
}
|
|
|
}
|
|
|
return obj;
|
|
|
- },
|
|
|
+ },
|
|
|
});
|