123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- Ext.QuickTips.init();
- Ext.define('erp.controller.common.EditDatalist', {
- extend: 'Ext.app.Controller',
- requires: ['erp.util.BaseUtil', 'erp.util.FormUtil', 'erp.util.RenderUtil'],
- views:[
- 'common.editDatalist.Viewport','common.editDatalist.GridPanel','common.editDatalist.Toolbar','core.form.FtField',
- 'core.grid.TfColumn','core.grid.YnColumn','core.trigger.DbfindTrigger','core.form.FtDateField','core.form.FtFindField',
- 'core.form.FtNumberField','core.form.MonthDateField'
- ],
- init:function(){
- this.BaseUtil = Ext.create('erp.util.BaseUtil');
- this.FormUtil = Ext.create('erp.util.FormUtil');
- this.control({
- 'erpEditDatalistGridPanel': {
- afterrender:function(grid){
- if(Ext.isIE){
- document.body.attachEvent('onkeydown', function(){
- if(window.event.ctrlKey && window.event.keyCode == 67){//Ctrl + C
- var e = window.event;
- if(e.srcElement) {
- window.clipboardData.setData('text', e.srcElement.innerHTML);
- }
- }
- });
- } else {
- grid.getEl().dom.addEventListener("mouseover", function(e){
- if(e.ctrlKey){
- var Contextvalue=e.target.textContent==""?e.target.value:e.target.textContent;
- textarea_text = parent.document.getElementById("textarea_text");
- textarea_text.value=Contextvalue;
- textarea_text.focus();
- textarea_text.select();
- }
- });
- }
- }
- },
- 'erpVastDeleteButton': {
- click: function(btn){
- var dlwin = new Ext.window.Window({
- id : 'dlwin',
- title: btn.text,
- height: "100%",
- width: "80%",
- maximizable : true,
- buttonAlign : 'center',
- layout : 'anchor',
- items: [{
- tag : 'iframe',
- frame : true,
- anchor : '100% 100%',
- layout : 'fit',
- html : '<iframe id="iframe_dl_'+caller+'" src="'+basePath+'jsps/common/vastDatalist.jsp?urlcondition='+condition+'&whoami='+caller+'" height="100%" width="100%" frameborder="0" scrolling="auto"></iframe>'
- }],
- buttons : [{
- text: btn.text,
- iconCls: btn.iconCls,
- cls: 'x-btn-gray-1',
- handler: function(){
-
- }
- },{
- text : '关 闭',
- iconCls: 'x-button-icon-close',
- cls: 'x-btn-gray',
- handler : function(){
- Ext.getCmp('dlwin').close();
- }
- }]
- });
- dlwin.show();
- }
- },
- 'erpRefreshButton': {
- click: function(btn){
- Ext.Ajax.request({
- url: basePath + (btn.url || 'fa/gs/copyAccountRegister/refreshQuery.action'),
- params: {
-
- },
- method: 'post',
- callback: function(opt, s, r) {
- var rs = Ext.decode(r.responseText);
- if(rs.exceptionInfo){
- showError(rs.exceptionInfo);
- return "";
- }
- if(rs.success){
- Ext.Msg.alert("提示", "刷新成功!", function(){
- window.location.reload();
- });
- }
- }
- });
- }
- },
- 'erpVastSaveButton': {
- click: function(btn) {
- var grid = btn.ownerCt.ownerCt,
- data = grid.getEffectData();
- if(data.length > 0) {
- grid.setLoading(true);
- Ext.Ajax.request({
- url : basePath + (btn.url || 'common/vastSave.action'),
- params: {
- caller: caller,
- data: Ext.encode(data)
- },
- method : 'post',
- callback : function(options,success,response){
- grid.setLoading(false);
- var rs = new Ext.decode(response.responseText);
- if(rs.exceptionInfo){
- showError(rs.exceptionInfo);
- return "";
- }
- if(rs.success){
- Ext.Msg.alert("提示", "保存成功!", function(){
- window.location.reload();
- });
- }
- }
- });
- }
- }
- },
- 'erpVastGetButton': {
- click: function(btn) {
- var grid = btn.ownerCt.ownerCt,
- data = grid.getEffectData();
- if(data.length > 0) {
- grid.setLoading(true);
- Ext.Ajax.request({
- url : basePath + (btn.url || 'common/vastSave.action'),
- params: {
- caller: caller,
- data: Ext.encode(data)
- },
- method : 'post',
- callback : function(options,success,response){
- grid.setLoading(false);
- var rs = new Ext.decode(response.responseText);
- if(rs.exceptionInfo){
- showError(rs.exceptionInfo);
- return "";
- }
- if(rs.success){
- Ext.Msg.alert("提示", "保存成功!", function(){
- window.location.reload();
- });
- }
- }
- });
- }
- }
- },
- 'erpVastSendOutButton': {
- click: function(btn) {
- var grid = btn.ownerCt.ownerCt,
- data = grid.getEffectData();
- if(data.length > 0) {
- grid.setLoading(true);
- Ext.Ajax.request({
- url : basePath + (btn.url || 'common/vastSave.action'),
- params: {
- caller: caller,
- data: Ext.encode(data)
- },
- method : 'post',
- callback : function(options,success,response){
- grid.setLoading(false);
- var rs = new Ext.decode(response.responseText);
- if(rs.exceptionInfo){
- showError(rs.exceptionInfo);
- return "";
- }
- if(rs.success){
- Ext.Msg.alert("提示", "保存成功!", function(){
- window.location.reload();
- });
- }
- }
- });
- }
- }
- }
- });
- }
- });
|