Browse Source

微浦MES,SMT上料追溯(根据料卷号)开头的两个导航前台筛选增加校验必填项

xiaost 5 months ago
parent
commit
0845e9d07a
1 changed files with 55 additions and 1 deletions
  1. 55 1
      WebContent/app/view/common/query/CheckForm.js

+ 55 - 1
WebContent/app/view/common/query/CheckForm.js

@@ -102,12 +102,20 @@ Ext.define('erp.view.common.query.CheckForm',{
 			showError("[" + error.slice(0, -1) + "]不允许为空");
 			return false;
 		}
+		//特殊校验
+		if("BarSmtReduce!Query" ==caller || "BarSmtReduce!Query2" ==caller ){
+			 error = form.specialCheck();
+			if(error!=""){
+				showError(error);
+				return false;
+			}
+		}
 		var condition = grid.defaultCondition || '';
 		condition = form.spellCondition(condition);
 		if(Ext.isEmpty(condition)) {
 			condition = grid.emptyCondition || '1=1';
 		}
-		form.beforeQuery(caller, condition);//鎵ц鏌ヨ鍓嶉�杈�
+		form.beforeQuery(caller, condition);
 		var gridParam = {caller: caller, condition: condition, start: 1, end: getUrlParam('_end')||1000};
 		grid.GridUtil.loadNewStore(grid, gridParam);
 	},
@@ -388,5 +396,51 @@ Ext.define('erp.view.common.query.CheckForm',{
 			}
 		});
 		return allowBlank;
+	},
+	specialCheck:function(){
+		var re = "";
+		if("BarSmtReduce!Query2"==caller) {
+			//fieldLabel
+			var bar = Ext.getCmp("msl_barcode");
+			var macode = Ext.getCmp("SMT_MS_MAKECODE");
+			var vendbar = Ext.getCmp("bar_vendbarcode");
+			if(bar && bar.value == ""){
+				if((vendbar && vendbar.value == "") && (macode && macode.value == "")){
+					re ="料卷号或者工单号需要必填其中一个项!";
+					return re;
+				}
+				if((vendbar && vendbar.value == "") || (macode && macode.value == "")){
+					re ="料卷号未填写时,工单号必填!";
+					return re;
+				}
+			}
+			if(!bar || !macode || !vendbar){
+				re ="主表筛选字段必须包含料卷号、工单号、供应商批号!";
+				return re;
+			}
+			//msl_barcode,SMT_MS_MAKECODE 、bar_vendbarcode
+		}else if("BarSmtReduce!Query"==caller) {
+			//msl_barcode ,SMT_MS_MAKECODE,bar_vendbarcode ,msl_prodcode
+			var bar = Ext.getCmp("msl_barcode");
+			var macode = Ext.getCmp("SMT_MS_MAKECODE");
+			var vendbar = Ext.getCmp("bar_vendbarcode");
+			var prodcode = Ext.getCmp("msl_prodcode");
+			if(bar && bar.value == ""){
+				if((vendbar && vendbar.value == "") && (macode && macode.value == "") && (prodcode && prodcode.value == "")){
+					re ="料卷号或者(工单号+物料编号)需要必填其中一个项!";
+					return re;
+				}
+				if((vendbar && vendbar.value == "") || (macode && macode.value == "") || (prodcode && macode.prodcode == "")){
+					re ="料卷号未填写时,工单号、物料编号都必填!";
+					return re;
+				}
+			}
+			if(!bar || !macode || !vendbar || !prodcode){
+				re ="主表筛选条件必须包含料卷号、工单号、供应商批号、物料编号!";
+				return re;
+			}
+		}
+		return re;
+
 	}
 });