Toolbar.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. Ext.define('erp.view.hr.wage.Toolbar', {
  2. extend: 'Ext.toolbar.Toolbar',
  3. alias: 'widget.erpEmpWageStandard',
  4. items: [{
  5. xtype:'dbfindtrigger',
  6. hideTrigger:false,
  7. labelAlign:'right',
  8. fieldLabel:'薪资标准ID',
  9. id: 'em_wsid',
  10. name: 'em_wsid'
  11. },{
  12. xtype: 'textfield',
  13. fieldLabel:'薪资标准名称',
  14. labelAlign:'right',
  15. id: 'ws_name',
  16. name: 'ws_name',
  17. readOnly: true
  18. }, {
  19. xtype:'button',
  20. text : '保存设置',
  21. width: 80,
  22. style: {
  23. width: 80
  24. },
  25. id : 'submit',
  26. iconCls : 'x-button-icon-submit',
  27. handler : function(){
  28. var wsid = Ext.getCmp("em_wsid").rawValue;
  29. var records = Ext.getCmp('tree-panel').getChecked();
  30. if (wsid == null || wsid == "") {
  31. Ext.MessageBox.alert("提示", "请选择薪资标准!");
  32. return;
  33. }
  34. if (records.length == 0) {
  35. Ext.MessageBox.alert("提示", "请选择需要设置薪资标准的员工!");
  36. return;
  37. }
  38. var ids = "";
  39. Ext.each(records, function(item, index) {
  40. ids = ids + item.get("id");
  41. if (index < records.length - 1) {
  42. ids = ids + ",";
  43. }
  44. });
  45. Ext.Ajax.request({
  46. url : basePath + 'hr/wage/WageStandardSet.action',
  47. params : {
  48. wsid: wsid,
  49. condition: "em_id in (" + ids + ")"
  50. },
  51. method : 'post',
  52. callback : function(options,success,response){
  53. var ret = new Ext.decode(response.responseText);
  54. if (ret.success) {
  55. Ext.Msg.alert("提示", "设置成功!");
  56. } else {
  57. Ext.Msg.alert('提示','操作失败!');
  58. }
  59. }
  60. });
  61. }
  62. }]
  63. });