Browse Source

湿敏条码维护模块

callm 1 year ago
parent
commit
abb9ffcacb

+ 61 - 61
WebContent/app/controller/scm/product/MsdInfo.js

@@ -27,7 +27,7 @@ Ext.define('erp.controller.scm.product.MsdInfo', {
 			}
 		});
 	},
-    deleteMsdInfo : function(btn) {
+	deleteMsdInfo : function(btn) {
 		var me = this;
 		var grid = Ext.getCmp('grid');
 		var id;
@@ -36,57 +36,57 @@ Ext.define('erp.controller.scm.product.MsdInfo', {
 		}else{
 			return;
 		}
-        Ext.MessageBox.show({
-            title:'提示',
-            msg: '是否删除所选行?',
-            buttons: Ext.Msg.YESNO,
-            icon: Ext.Msg.WARNING,
-            fn: function(btns){
-                if(btns == 'yes'){
-                    Ext.Ajax.request({
-                        url : basePath + 'scm/product/deleteMsdInfo.action',
-                        params : {
-                            id : id,
-                            caller:caller
-                        },
-                        method : 'post',
-                        callback : function(options, success, response) {
-                            me.getActiveTab().setLoading(false);
-                            var localJson = new Ext.decode(response.responseText);
-                            if (localJson.success) {
-                                delSuccess(function() {
-                                    var grid = Ext.getCmp('grid');
-                                    // add成功后刷新页面进入可编辑的页面
-                                    var gridCondition = me.BaseUtil.getUrlParam('gridCondition');
-                                    gridCondition = (gridCondition == null || gridCondition == "null") ? "1=1" : gridCondition;
-                                    var gridParam = {caller: caller, condition: gridCondition};
-                                    me.GridUtil.getGridColumnsAndStore(grid, 'common/singleGridPanel.action', gridParam, "");
-                                });
-                            } else if (localJson.exceptionInfo) {
-                                var str = localJson.exceptionInfo;
-                                if (str.trim().substr(0, 12) == 'AFTERSUCCESS') {// 特殊情况:操作成功,但是出现警告,允许刷新页面
-                                    str = str.replace('AFTERSUCCESS', '');
-                                    delSuccess(function() {
-                                        var grid = Ext.getCmp('grid');
-                                        // add成功后刷新页面进入可编辑的页面
-                                        var gridCondition = me.BaseUtil.getUrlParam('gridCondition');
-                                        gridCondition = (gridCondition == null || gridCondition == "null") ? "" : gridCondition;
-                                        var gridParam = {caller: caller, condition: gridCondition};
-                                        me.GridUtil.getGridColumnsAndStore(grid, 'common/singleGridPanel.action', gridParam, "");
-                                    });
-                                    showError(str);
-                                } else {
-                                    showError(str);
-                                    return;
-                                }
-                            } else {
-                                saveFailure();// @i18n/i18n.js
-                            }
-                        }
-                    });
-                }
-            }
-        });
+		Ext.MessageBox.show({
+			title:'提示',
+			msg: '是否删除所选行?',
+			buttons: Ext.Msg.YESNO,
+			icon: Ext.Msg.WARNING,
+			fn: function(btns){
+				if(btns == 'yes'){
+					Ext.Ajax.request({
+						url : basePath + 'scm/product/deleteMsdInfo.action',
+						params : {
+							id : id,
+							caller:caller
+						},
+						method : 'post',
+						callback : function(options, success, response) {
+							me.getActiveTab().setLoading(false);
+							var localJson = new Ext.decode(response.responseText);
+							if (localJson.success) {
+								delSuccess(function() {
+									var grid = Ext.getCmp('grid');
+									// add成功后刷新页面进入可编辑的页面
+									var gridCondition = me.BaseUtil.getUrlParam('gridCondition');
+									gridCondition = (gridCondition == null || gridCondition == "null") ? "1=1" : gridCondition;
+									var gridParam = {caller: caller, condition: gridCondition};
+									me.GridUtil.getGridColumnsAndStore(grid, 'common/singleGridPanel.action', gridParam, "");
+								});
+							} else if (localJson.exceptionInfo) {
+								var str = localJson.exceptionInfo;
+								if (str.trim().substr(0, 12) == 'AFTERSUCCESS') {// 特殊情况:操作成功,但是出现警告,允许刷新页面
+									str = str.replace('AFTERSUCCESS', '');
+									delSuccess(function() {
+										var grid = Ext.getCmp('grid');
+										// add成功后刷新页面进入可编辑的页面
+										var gridCondition = me.BaseUtil.getUrlParam('gridCondition');
+										gridCondition = (gridCondition == null || gridCondition == "null") ? "" : gridCondition;
+										var gridParam = {caller: caller, condition: gridCondition};
+										me.GridUtil.getGridColumnsAndStore(grid, 'common/singleGridPanel.action', gridParam, "");
+									});
+									showError(str);
+								} else {
+									showError(str);
+									return;
+								}
+							} else {
+								saveFailure();// @i18n/i18n.js
+							}
+						}
+					});
+				}
+			}
+		});
 	},
 	getForm : function(btn) {
 		return btn.ownerCt.ownerCt;
@@ -142,8 +142,8 @@ Ext.define('erp.controller.scm.product.MsdInfo', {
 		Ext.Ajax.request({
 			url : basePath + 'scm/product/updateMsdInfo.action',
 			params : {
-				param : param,
-                caller:caller
+				param : unescape(param),
+				caller:caller
 			},
 			method : 'post',
 			callback : function(options, success, response) {
@@ -153,9 +153,9 @@ Ext.define('erp.controller.scm.product.MsdInfo', {
 					saveSuccess(function() {
 						// add成功后刷新页面进入可编辑的页面
 						var grid = Ext.getCmp('grid');
-                        var gridCondition = me.BaseUtil.getUrlParam('gridCondition');
-                        gridCondition = (gridCondition == null || gridCondition == "null") ? "1=1" : gridCondition;
-                        var gridParam = {caller: caller, condition: gridCondition};
+						var gridCondition = me.BaseUtil.getUrlParam('gridCondition');
+						gridCondition = (gridCondition == null || gridCondition == "null") ? "1=1" : gridCondition;
+						var gridParam = {caller: caller, condition: gridCondition};
 						me.GridUtil.getGridColumnsAndStore(grid, 'common/singleGridPanel.action', gridParam, "");
 					});
 				} else if (localJson.exceptionInfo) {
@@ -163,10 +163,10 @@ Ext.define('erp.controller.scm.product.MsdInfo', {
 					if (str.trim().substr(0, 12) == 'AFTERSUCCESS') {// 特殊情况:操作成功,但是出现警告,允许刷新页面
 						str = str.replace('AFTERSUCCESS', '');
 						saveSuccess(function() {
-                            var grid = Ext.getCmp('grid');
-                            var gridCondition = me.BaseUtil.getUrlParam('gridCondition');
-                            gridCondition = (gridCondition == null || gridCondition == "null") ? "1=1" : gridCondition;
-                            var gridParam = {caller: caller, condition: gridCondition};
+							var grid = Ext.getCmp('grid');
+							var gridCondition = me.BaseUtil.getUrlParam('gridCondition');
+							gridCondition = (gridCondition == null || gridCondition == "null") ? "1=1" : gridCondition;
+							var gridParam = {caller: caller, condition: gridCondition};
 							me.GridUtil.getGridColumnsAndStore(grid, 'common/singleGridPanel.action', gridParam, "");
 						});
 						showError(str);

+ 9 - 9
WebContent/app/view/scm/product/MSDProduct/MsdInfo.js

@@ -1,15 +1,15 @@
 Ext.define('erp.view.scm.product.MSDProduct.MsdInfo',{
-	extend: 'Ext.Viewport', 
-	layout: 'anchor', 
-	initComponent : function(){ 
-		var me = this; 
-		Ext.apply(me, { 
+	extend: 'Ext.Viewport',
+	layout: 'anchor',
+	initComponent : function(){
+		var me = this;
+		Ext.apply(me, {
 			items: [{
 				xtype: 'msdInfoGridGrid',
 				anchor: '100% 100%',
-				keyField: 'ml_id'
+				keyField: 'ac_id'
 			}]
-		}); 
-		me.callParent(arguments); 
-	} 
+		});
+		me.callParent(arguments);
+	}
 });

+ 110 - 110
WebContent/app/view/scm/product/MSDProduct/MsdInfoGrid.js

@@ -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);
-        //给页面加上ctrl+alt+s键盘事件,自动跳转form配置界面
-        this.addKeyBoardEvents();//监听Ctrl+Alt+S事件
+		//给页面加上ctrl+alt+s键盘事件,自动跳转form配置界面
+		this.addKeyBoardEvents();//监听Ctrl+Alt+S事件
 	},
 	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(){//ie的事件名称不同,也不支持addEventListener
-                if(window.event.altKey && window.event.ctrlKey && window.event.keyCode == 83){
-                    if(Ext.ComponentQuery.query('gridpanel').length > 0){//有grid
-                        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(){//ie的事件名称不同,也不支持addEventListener
+				if(window.event.altKey && window.event.ctrlKey && window.event.keyCode == 83){
+					if(Ext.ComponentQuery.query('gridpanel').length > 0){//有grid
+						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){//firefox不支持window.event
-                    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){//有grid
-                        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){//只有form
-                        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){//firefox不支持window.event
+					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){//有grid
+						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){//只有form
+						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',{
 				}
 			});
 		}
-    }
+	}
 });

+ 33 - 33
WebContent/jsps/scm/product/msdInfo.jsp

@@ -1,44 +1,44 @@
 <%@ page language="java" contentType="text/html; charset=utf-8"
-    pageEncoding="utf-8"%>
+         pageEncoding="utf-8"%>
 <%
-String path = request.getContextPath();
-String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
+    String path = request.getContextPath();
+    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 %>
 <!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<link rel="stylesheet" href="<%=basePath %>resource/ext/resources/css/ext-all-gray.css" type="text/css"></link>
-<!--[if IE]>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+    <link rel="stylesheet" href="<%=basePath %>resource/ext/resources/css/ext-all-gray.css" type="text/css"></link>
+    <!--[if IE]>
 	<link rel="stylesheet" href="<%=basePath %>resource/ext/resources/css/ext-ie.css" type="text/css"></link>
 <![endif]-->
-<link rel="stylesheet" href="<%=basePath %>resource/css/main.css" type="text/css"></link>
-<script type="text/javascript" src="<%=basePath %>resource/ext/ext-all.js"></script>
-<script type="text/javascript" src="<%=basePath %>resource/i18n/i18n.js"></script>
-<style type="text/css">
-.x-btn-default-toolbar-small-noicon button {
-    height: 20px;
-    line-height: 20px;
-}
-</style>
-<script type="text/javascript">	
-Ext.Loader.setConfig({
-	enabled: true
-});//开启动态加载
-Ext.application({
-    name: 'erp',//为应用程序起一个名字,相当于命名空间
-    appFolder: basePath+'app',//app文件夹所在路径
-    controllers: [//声明所用到的控制层
-        'scm.product.MsdInfo'
-    ],
-    launch: function() {
-    	Ext.create('erp.view.scm.product.MSDProduct.MsdInfo');//创建视图
-    }
-});
-var caller = 'MsdInfo';
-var formCondition = '';
-var gridCondition = '';
-</script>
+    <link rel="stylesheet" href="<%=basePath %>resource/css/main.css" type="text/css"></link>
+    <script type="text/javascript" src="<%=basePath %>resource/ext/ext-all.js"></script>
+    <script type="text/javascript" src="<%=basePath %>resource/i18n/i18n.js"></script>
+    <style type="text/css">
+        .x-btn-default-toolbar-small-noicon button {
+            height: 20px;
+            line-height: 20px;
+        }
+    </style>
+    <script type="text/javascript">
+        Ext.Loader.setConfig({
+            enabled: true
+        });//开启动态加载
+        Ext.application({
+            name: 'erp',//为应用程序起一个名字,相当于命名空间
+            appFolder: basePath+'app',//app文件夹所在路径
+            controllers: [//声明所用到的控制层
+                'scm.product.MsdInfo'
+            ],
+            launch: function() {
+                Ext.create('erp.view.scm.product.MSDProduct.MsdInfo');//创建视图
+            }
+        });
+        var caller = 'MsdInfo';
+        var formCondition = '';
+        var gridCondition = '';
+    </script>
 </head>
 <body >
 </body>