123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- Ext.QuickTips.init();
- Ext.define('erp.controller.common.VastDatalist', {
- extend: 'Ext.app.Controller',
- views:[
- 'common.vastDatalist.Viewport','common.vastDatalist.GridPanel','core.grid.YnColumn',
- 'common.vastDatalist.Toolbar','core.button.VastDelete','core.button.VastPost',
- 'core.button.VastClose','core.button.VastReStart','core.button.VastFreeze',
- 'core.button.VastSend','core.button.VastAudit','core.button.VastSubmit',
- 'core.button.VastSave','core.button.VastSpare','core.button.VastSimulate',
- 'core.button.VastWriexam','core.button.VastInterview','core.button.VastJointalcpool',
- 'core.button.VastWritemark','core.button.VastIntermark','core.button.VastTurnfullmemb',
- 'core.button.VastTurnover','core.button.VastTurnCaree','core.button.Turnfullmemb',
- 'core.button.TurnPosition','core.button.TurnCaree','core.button.VastSocailaccount',
- 'core.button.VastSocailsecu','core.button.VastGet','core.button.VastSendOut',
- 'core.button.AgreeToPrice','core.button.AgreeAllToPrice','core.button.NotAgreeToPrice',
- 'core.button.Sync'
- ],
- init:function(){
- var me = this;
- this.control({
- 'erpVastDeleteButton': {//btn.url在GridButton里面配置
- click: function(btn){
- me.vastDeal(btn.url || 'common/vastDelete.action');
- }
- },
- 'erpVastCloseButton': {
- click: function(btn){
- me.vastDeal(btn.url || 'common/vastClose.action');
- }
- },
- 'erpVastReStartButton': {
- click: function(btn){
- me.vastDeal(btn.url || 'common/vastResStart.action');
- }
- },
- 'erpVastFreezeButton': {
- click: function(btn){
- me.vastDeal(btn.url || 'common/vastFreeze.action');
- }
- },
- 'erpVastSendButton': {
- click: function(btn){
- me.vastDeal(btn.url || 'common/vastSend.action');
- }
- },
- 'erpVastAuditButton': {
- click: function(btn){
- me.vastDeal(btn.url || 'common/vastAudit.action');
- }
- },
- 'erpVastSubmitButton': {
- click: function(btn){
- me.vastDeal(btn.url || 'common/vastSubmit.action');
- }
- },
- 'erpVastSaveButton': {
- click: function(btn){
- me.vastSave(btn.url || 'common/vastSave.action');
- }
- },
- 'erpVastSpareButton': {
- click: function(btn){
- me.vastDeal(btn.url || 'common/vastSpare.action');
- }
- },
- 'erpVastSimulateButton': {
- click: function(btn){
- me.vastDeal(btn.url || 'common/vastSimulate.action');
- }
- },
- 'erpVastWriexamButton':{
- click: function(btn){
- me.vastDeal(btn.url || 'hr/emplmana/vastWriexam.action');
- }
- },
- 'erpVastInterviewButton':{
- click: function(btn){
- me.vastDeal(btn.url || 'hr/emplmana/vastInterview.action');
- }
- },
- 'erpVastJointalcpoolButton':{
- click: function(btn){
- me.vastDeal(btn.url || 'hr/emplmana/vastJointalcpool.action');
- }
- },
- 'erpVastWritemarkButton':{
- click: function(btn){
- me.vastMark(btn.url || 'hr/emplmana/vastWritemark.action','re_mark');
- }
- },
- 'erpVastIntermarkButton':{
- click: function(btn){
- me.vastMark(btn.url || 'hr/emplmana/vastIntermark.action','re_intermark');
- }
- },
- 'erpVastSocailaccountButton':{
- click: function(btn){
- me.vastMark(btn.url || 'hr/emplmana/vastSocailaccount.action','em_accumucard');
- }
- },
- 'erpVastSocailsecuButton':{
- click: function(btn){
- me.vastMark(btn.url || 'hr/emplmana/vastSocailsecu.action','em_socailcard');
- }
- },
- 'erpVastTurnfullmembButton':{
- click: function(btn){
- me.vastDealreload(btn.url || 'hr/emplmana/vastTurnfullmemb.action');
- }
- },
- 'erpVastTurnoverButton':{
- click: function(btn){
- me.vastDealreload(btn.url || 'hr/emplmana/vastTurnover.action');
- }
- },
- 'erpVastTurnCareeButton':{
- click: function(btn){
- me.vastDeal(btn.url || 'hr/emplmana/vastTurnCaree.action');
- }
- },
- 'erpTurnfullmembButton':{
- click: function(btn){
- me.vastDeal(btn.url || 'hr/emplmana/turnfullmemb.action');
- }
- },
- 'erpTurnPositionButton':{
- click: function(btn){
- me.vastDeal(btn.url || 'hr/emplmana/turnPosition.action');
- }
- },
- 'erpTurnCareeButton':{
- click: function(btn){
- me.vastDeal(btn.url || 'hr/emplmana/turnCaree.action');
- }
- },
- 'erpVastGetButton': {
- click: function(btn){
- me.vastSave(btn.url || 'common/vastSave.action');
- }
- },
- 'erpVastSendOutButton': {
- click: function(btn){
- me.vastSave(btn.url || 'common/vastSave.action');
- }
- },
- 'erpAgreeToPriceButton': {
- click: function(btn){
- me.vastDeal(btn.url || 'common/vastAgreeTurnPrice.action?_noc=1');
- }
- },
- 'erpNotAgreeToPriceButton': {
- click: function(btn){
- me.vastDeal(btn.url || 'common/vastNotAgreeTurnPrice.action?_noc=1');
- }
- },
- 'button[id=closebutton]':{
- afterrender:function(btn){
- btn.ownerCt.ownerCt.getButtons();
- }
- },
- 'erpSyncButton': {
- afterrender: function(btn) {
- btn.caller = caller;
- var grid = btn.ownerCt.ownerCt;
- if(typeof keyField !== 'undefined') {
- grid.selModel.on('selectionchange', function(sel, selected){
- var ids = [];
- Ext.Array.each(selected, function(){
- ids.push(this.get(keyField));
- });
- btn.syncdatas = ids.join(',');
- });
- }
- }
- }
- });
- },
- vastDealreload: function(url){
- var grid = Ext.getCmp('grid');
- var records = grid.getMultiSelected();
- if(records.length > 0){
- var id = new Array();
- Ext.each(records, function(record, index){
- id[index] = record.data[keyField];
- });
- var main = parent.Ext.getCmp("content-panel");
- main.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + url,
- params: {
- caller: caller,
- id: id
- },
- method : 'post',
- callback : function(options,success,response){
- main.getActiveTab().setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.exceptionInfo){
- showError(localJson.exceptionInfo);
- return "";
- }
- if(localJson.success){
- Ext.Msg.alert("提示", "处理成功!", function(){
- window.location.reload();
- /*main.getActiveTab().close();*/
- });
- }
- }
- });
- }
- },
- vastDeal: function(url){
- var grid = Ext.getCmp('grid');
- var records = grid.getMultiSelected();
- if(records.length > 0){
- var id = new Array();
- Ext.each(records, function(record, index){
- id[index] = record.data[keyField];
- });
- var main = parent.Ext.getCmp("content-panel");
- main.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + url,
- params: {
- caller: caller,
- id: id
- },
- method : 'post',
- callback : function(options,success,response){
- main.getActiveTab().setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.exceptionInfo){
- showError(localJson.exceptionInfo);
- return "";
- }
- if(localJson.success){
- Ext.Msg.alert("提示", "处理成功!", function(){
- //window.location.reload();
- main.getActiveTab().close();
- });
- }
- }
- });
- }
- },
- vastMark: function(url,field){
- var grid = Ext.getCmp('grid');
- var records = grid.multiselected;
- if(records.length > 0){
- var id = new Array();
- var mark = new Array();
- Ext.each(records, function(record, index){
- id[index] = record.data[keyField];
- mark[index] = record.data[field];
- });
- var main = parent.Ext.getCmp("content-panel");
- main.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + url,
- params: {
- caller: caller,
- id: id,
- mark:mark
- },
- method : 'post',
- callback : function(options,success,response){
- main.getActiveTab().setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.exceptionInfo){
- showError(localJson.exceptionInfo);
- return "";
- }
- if(localJson.success){
- Ext.Msg.alert("提示", "处理成功!", function(){
- main.getActiveTab().close();
- });
- }
- }
- });
- }
- },
- vastSave: function(url){
- var grid = Ext.getCmp('grid');
- var data = grid.getEffectData();
- if(data.length > 0){
- var main = parent.Ext.getCmp("content-panel");
- main.getActiveTab().setLoading(true);//loading...
- Ext.Ajax.request({
- url : basePath + url,
- params: {
- caller: caller,
- data: Ext.encode(data)
- },
- method : 'post',
- callback : function(options,success,response){
- main.getActiveTab().setLoading(false);
- var localJson = new Ext.decode(response.responseText);
- if(localJson.exceptionInfo){
- showError(localJson.exceptionInfo);
- return "";
- }
- if(localJson.success){
- Ext.Msg.alert("提示", "处理成功!", function(){
- window.location.href = window.location.href;
- });
- }
- }
- });
- }
- }
- });
|