|
@@ -2,53 +2,53 @@
|
|
|
* ERP项目gridpanel通用样式1
|
|
|
*/
|
|
|
Ext.define('erp.view.scm.product.MSDProduct.MsdInfoGrid',{
|
|
|
- extend: 'Ext.grid.Panel',
|
|
|
+ extend: 'Ext.grid.Panel',
|
|
|
alias: 'widget.msdInfoGridGrid',
|
|
|
region: 'south',
|
|
|
layout : 'fit',
|
|
|
- id: 'grid',
|
|
|
- emptyText : $I18N.common.grid.emptyText,
|
|
|
- columnLines : true,
|
|
|
- autoScroll : true,
|
|
|
- store: [],
|
|
|
- columns: [],
|
|
|
+ id: 'grid',
|
|
|
+ emptyText : $I18N.common.grid.emptyText,
|
|
|
+ columnLines : true,
|
|
|
+ autoScroll : true,
|
|
|
+ store: [],
|
|
|
+ columns: [],
|
|
|
tbar:[{
|
|
|
xtype:'erpSaveButton'
|
|
|
},{
|
|
|
xtype:'erpDeleteButton'
|
|
|
},{
|
|
|
- text: '操作日志',
|
|
|
- extend: 'Ext.Button',
|
|
|
- alias: 'widget.erpSaveButton',
|
|
|
- param: [],
|
|
|
- iconCls: 'x-button-icon-query',
|
|
|
- cls:'x-btn-gray',
|
|
|
- style: {
|
|
|
- marginLeft: '10px'
|
|
|
- },
|
|
|
- listeners:{
|
|
|
- click: function(btn){
|
|
|
- var grid = Ext.getCmp('grid');
|
|
|
- grid.getLogs();
|
|
|
- }
|
|
|
- }
|
|
|
- },'->',{
|
|
|
+ text: '操作日志',
|
|
|
+ extend: 'Ext.Button',
|
|
|
+ alias: 'widget.erpSaveButton',
|
|
|
+ param: [],
|
|
|
+ iconCls: 'x-button-icon-query',
|
|
|
+ cls:'x-btn-gray',
|
|
|
+ style: {
|
|
|
+ marginLeft: '10px'
|
|
|
+ },
|
|
|
+ listeners:{
|
|
|
+ click: function(btn){
|
|
|
+ var grid = Ext.getCmp('grid');
|
|
|
+ grid.getLogs();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },'->',{
|
|
|
xtype:'erpCloseButton'
|
|
|
}],
|
|
|
- GridUtil: Ext.create('erp.util.GridUtil'),
|
|
|
- BaseUtil: Ext.create('erp.util.BaseUtil'),
|
|
|
- FormUtil: Ext.create('erp.util.FormUtil'),
|
|
|
- plugins: Ext.create('Ext.grid.plugin.CellEditing', {
|
|
|
- clicksToEdit: 1
|
|
|
- }),
|
|
|
+ GridUtil: Ext.create('erp.util.GridUtil'),
|
|
|
+ BaseUtil: Ext.create('erp.util.BaseUtil'),
|
|
|
+ FormUtil: Ext.create('erp.util.FormUtil'),
|
|
|
+ plugins: Ext.create('Ext.grid.plugin.CellEditing', {
|
|
|
+ clicksToEdit: 1
|
|
|
+ }),
|
|
|
initComponent : function(){
|
|
|
var gridCondition = this.BaseUtil.getUrlParam('gridCondition');
|
|
|
gridCondition = (gridCondition == null || gridCondition == "null") ? "1=1" : gridCondition;
|
|
|
- var gridParam = {caller: caller, condition: gridCondition};
|
|
|
- this.GridUtil.getGridColumnsAndStore(this, 'common/singleGridPanel.action', gridParam, "");
|
|
|
+ var gridParam = {caller: caller, condition: gridCondition};
|
|
|
+ this.GridUtil.getGridColumnsAndStore(this, 'common/singleGridPanel.action', gridParam, "");
|
|
|
this.callParent(arguments);
|
|
|
-
|
|
|
- this.addKeyBoardEvents();
|
|
|
+
|
|
|
+ this.addKeyBoardEvents();
|
|
|
},
|
|
|
getGridStore: function(){
|
|
|
var grid = this;
|
|
@@ -78,73 +78,73 @@ Ext.define('erp.view.scm.product.MSDProduct.MsdInfoGrid',{
|
|
|
}
|
|
|
return jsonGridData;
|
|
|
},
|
|
|
- * 监听一些事件,
|
|
|
- * 如Ctrl+Alt+S
|
|
|
- */
|
|
|
- addKeyBoardEvents: function(){
|
|
|
- var me = this;
|
|
|
- if(Ext.isIE && !Ext.isIE11){
|
|
|
- document.body.attachEvent('onkeydown', function(){
|
|
|
- if(window.event.altKey && window.event.ctrlKey && window.event.keyCode == 83){
|
|
|
- if(Ext.ComponentQuery.query('gridpanel').length > 0){
|
|
|
- me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/multiform.jsp?formCondition=fo_idIS" + me.fo_id +
|
|
|
- "&gridCondition=fd_foidIS" + me.fo_id + "&whoami=" + caller);
|
|
|
- }else if(Ext.ComponentQuery.query('formpanel').length == 0){
|
|
|
- me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/multiform.jsp?formCondition=fo_idIS" + me.fo_id +
|
|
|
- "&gridCondition=fd_foidIS" + me.fo_id + "&whoami=" + caller);
|
|
|
- } else {
|
|
|
- me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/form.jsp?formCondition=fo_idIS" + me.fo_id +
|
|
|
- "&gridCondition=fd_foidIS" + me.fo_id);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- document.body.attachEvent("onmouseover", function(){
|
|
|
- if(window.event.ctrlKey){
|
|
|
- var e = window.event;
|
|
|
- me.Contextvalue = e.target.textContent == "" ? e.target.value : e.target.textContent;
|
|
|
- textarea_text = parent.document.getElementById("textarea_text");
|
|
|
- textarea_text.value = me.Contextvalue;
|
|
|
- textarea_text.focus();
|
|
|
- textarea_text.select();
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- document.body.addEventListener("keydown", function(e){
|
|
|
+ * 监听一些事件,
|
|
|
+ * 如Ctrl+Alt+S
|
|
|
+ */
|
|
|
+ addKeyBoardEvents: function(){
|
|
|
+ var me = this;
|
|
|
+ if(Ext.isIE && !Ext.isIE11){
|
|
|
+ document.body.attachEvent('onkeydown', function(){
|
|
|
+ if(window.event.altKey && window.event.ctrlKey && window.event.keyCode == 83){
|
|
|
+ if(Ext.ComponentQuery.query('gridpanel').length > 0){
|
|
|
+ me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/multiform.jsp?formCondition=fo_idIS" + me.fo_id +
|
|
|
+ "&gridCondition=fd_foidIS" + me.fo_id + "&whoami=" + caller);
|
|
|
+ }else if(Ext.ComponentQuery.query('formpanel').length == 0){
|
|
|
+ me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/multiform.jsp?formCondition=fo_idIS" + me.fo_id +
|
|
|
+ "&gridCondition=fd_foidIS" + me.fo_id + "&whoami=" + caller);
|
|
|
+ } else {
|
|
|
+ me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/form.jsp?formCondition=fo_idIS" + me.fo_id +
|
|
|
+ "&gridCondition=fd_foidIS" + me.fo_id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ document.body.attachEvent("onmouseover", function(){
|
|
|
+ if(window.event.ctrlKey){
|
|
|
+ var e = window.event;
|
|
|
+ me.Contextvalue = e.target.textContent == "" ? e.target.value : e.target.textContent;
|
|
|
+ textarea_text = parent.document.getElementById("textarea_text");
|
|
|
+ textarea_text.value = me.Contextvalue;
|
|
|
+ textarea_text.focus();
|
|
|
+ textarea_text.select();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ document.body.addEventListener("keydown", function(e){
|
|
|
|
|
|
- if(Ext.isFF5){
|
|
|
- e = e || window.event;
|
|
|
- }
|
|
|
- if(e.altKey && e.ctrlKey && e.keyCode == 83){
|
|
|
- if(Ext.ComponentQuery.query('gridpanel').length > 0&&Ext.ComponentQuery.query('formpanel').length > 0){
|
|
|
- me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/multiform.jsp?formCondition=fo_idIS" + me.fo_id +
|
|
|
- "&gridCondition=fd_foidIS" + me.fo_id + "&whoami=" + caller);
|
|
|
- }else if(Ext.ComponentQuery.query('formpanel').length == 0&&Ext.ComponentQuery.query('gridpanel').length > 0){
|
|
|
- me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/multigrid.jsp?formCondition=fo_idIS" + me.fo_id +
|
|
|
- "&gridCondition=fd_foidIS" + me.fo_id + "&whoami=" + caller);
|
|
|
- } else {
|
|
|
- me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/form.jsp?formCondition=fo_idIS" + me.fo_id +
|
|
|
- "&gridCondition=fd_foidIS" + me.fo_id);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- document.body.addEventListener("mouseover", function(e){
|
|
|
- if(Ext.isFF5){
|
|
|
- e = e || window.event;
|
|
|
- }
|
|
|
- if(e.ctrlKey){
|
|
|
- me.Contextvalue = e.target.textContent == "" ? e.target.value : e.target.textContent;
|
|
|
- textarea_text = parent.document.getElementById("textarea_text");
|
|
|
- textarea_text.value = me.Contextvalue;
|
|
|
- textarea_text.focus();
|
|
|
- textarea_text.select();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- * 查询操作日志
|
|
|
- */
|
|
|
- getLogs: function() {
|
|
|
+ if(Ext.isFF5){
|
|
|
+ e = e || window.event;
|
|
|
+ }
|
|
|
+ if(e.altKey && e.ctrlKey && e.keyCode == 83){
|
|
|
+ if(Ext.ComponentQuery.query('gridpanel').length > 0&&Ext.ComponentQuery.query('formpanel').length > 0){
|
|
|
+ me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/multiform.jsp?formCondition=fo_idIS" + me.fo_id +
|
|
|
+ "&gridCondition=fd_foidIS" + me.fo_id + "&whoami=" + caller);
|
|
|
+ }else if(Ext.ComponentQuery.query('formpanel').length == 0&&Ext.ComponentQuery.query('gridpanel').length > 0){
|
|
|
+ me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/multigrid.jsp?formCondition=fo_idIS" + me.fo_id +
|
|
|
+ "&gridCondition=fd_foidIS" + me.fo_id + "&whoami=" + caller);
|
|
|
+ } else {
|
|
|
+ me.FormUtil.onAdd('form' + caller, 'Form配置维护(' + caller + ')', "jsps/ma/form.jsp?formCondition=fo_idIS" + me.fo_id +
|
|
|
+ "&gridCondition=fd_foidIS" + me.fo_id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ document.body.addEventListener("mouseover", function(e){
|
|
|
+ if(Ext.isFF5){
|
|
|
+ e = e || window.event;
|
|
|
+ }
|
|
|
+ if(e.ctrlKey){
|
|
|
+ me.Contextvalue = e.target.textContent == "" ? e.target.value : e.target.textContent;
|
|
|
+ textarea_text = parent.document.getElementById("textarea_text");
|
|
|
+ textarea_text.value = me.Contextvalue;
|
|
|
+ textarea_text.focus();
|
|
|
+ textarea_text.select();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ * 查询操作日志
|
|
|
+ */
|
|
|
+ getLogs: function() {
|
|
|
if(Ext.getCmp('win' + caller)){
|
|
|
Ext.getCmp('win' + caller).show();
|
|
|
} else {
|
|
@@ -188,17 +188,17 @@ Ext.define('erp.view.scm.product.MSDProduct.MsdInfoGrid',{
|
|
|
columnLines: true,
|
|
|
columns: [
|
|
|
{ header: '时间', dataIndex: 'ml_date', flex: 1.5 , renderer: function(val){
|
|
|
- if(val != '无数据'){
|
|
|
- return Ext.Date.format(new Date(val), 'Y-m-d H:i:s');
|
|
|
- }
|
|
|
- }},
|
|
|
+ if(val != '无数据'){
|
|
|
+ return Ext.Date.format(new Date(val), 'Y-m-d H:i:s');
|
|
|
+ }
|
|
|
+ }},
|
|
|
{ header: '操作人员', dataIndex: 'ml_man', flex: 1 ,renderer: function(val){
|
|
|
- if(val == em_name){
|
|
|
- return '<font color=red>' + val + '</font>';
|
|
|
- } else {
|
|
|
- return val;
|
|
|
- }
|
|
|
- }},
|
|
|
+ if(val == em_name){
|
|
|
+ return '<font color=red>' + val + '</font>';
|
|
|
+ } else {
|
|
|
+ return val;
|
|
|
+ }
|
|
|
+ }},
|
|
|
{ header: '操作', dataIndex: 'ml_content', flex: 1.5},
|
|
|
{ header: '结果', dataIndex: 'ml_result', flex: 3}
|
|
|
]
|
|
@@ -215,5 +215,5 @@ Ext.define('erp.view.scm.product.MSDProduct.MsdInfoGrid',{
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
});
|