Prechádzať zdrojové kódy

【上线需求】【MRP指定类型投放】

DINGYL 1 rok pred
rodič
commit
847a217d44

+ 27 - 3
WebContent/app/controller/pm/mps/MRPThrow.js

@@ -62,7 +62,30 @@ Ext.define('erp.controller.pm.mps.MRPThrow', {
 	    			   }; 
 	    			}
     			}
-    		}, 
+    		},
+			'erpSelectThrowMakeButton': {
+				click: {
+					lock: 2000,
+					fn:function(btn){
+						var gridStore = me.NeedSelectThrow();
+						if(gridStore != null){
+							me.NeedThrow(gridStore, btn,'MAKE')
+						};
+					}
+				}
+			},
+			'erpSelectThrowOSButton': {
+				click: {
+					lock: 2000,
+					fn:function(btn){
+						var gridStore = me.NeedSelectThrow();
+						if(gridStore != null){
+							me.NeedThrow(gridStore, btn,'OSMAKE')
+						};
+					}
+				}
+			},
+
     		'erpVastDealButton': {
     			click: function(btn){
    				  var gridStore = me.NeedSelectThrow();
@@ -338,7 +361,7 @@ Ext.define('erp.controller.pm.mps.MRPThrow', {
 		}		
 	 },
  
-		NeedThrow:function(store, btn){
+		NeedThrow:function(store, btn,maTasktype){
 			if(btn){
 	    		btn.setDisabled(true);
 	    	}
@@ -360,7 +383,8 @@ Ext.define('erp.controller.pm.mps.MRPThrow', {
 		   			maKind: maKind ? maKind.value : '',
 		   			condition: '' ,
 		   			purcaseCop: purcaseCop ? purcaseCop.value : '',
-		   			apKind: apKind ? apKind.value : ''
+		   			apKind: apKind ? apKind.value : '',
+					maTasktype: maTasktype ? maTasktype:''
 		   		},
 				showProgress: true,
 				onComplete: function(result) {

+ 2 - 1
WebContent/app/view/common/batchDeal/Form.js

@@ -20,7 +20,8 @@ Ext.define('erp.view.common.batchDeal.Form',{
 	           'erp.view.core.button.BatchTurnReturn','erp.view.core.button.BatchPLXG','erp.view.core.button.FlowFinish','erp.view.core.button.BatchFlowFinish','erp.view.core.button.ProcessTransfer','erp.view.core.button.CombiningAndBreaking','erp.view.core.button.HistoryQuotation','erp.view.core.button.Commonquery','erp.view.core.button.BatchTransfer','erp.view.core.button.BatchSearch','erp.view.core.button.BOMAttachDownload','erp.view.core.button.ThrowCancel',
 	           'erp.view.core.button.FlowDelete','erp.view.core.button.FlowChangeHandler','erp.view.core.button.FlowBack','erp.view.core.button.BatchResourceChange','erp.view.core.button.InviteVendors','erp.view.core.button.BomSync','erp.view.core.button.ECNSync','erp.view.core.button.VastTurnMakeFromAppl','erp.view.core.button.TurnPerformMakeECN','erp.view.core.button.CancelPerformMakeECN','erp.view.core.button.BatchUpdateMake',
 	           'erp.view.core.button.BusinessTripDepart','erp.view.core.button.BusinessTripAllOpen','erp.view.core.button.BusinessTripFrozen','erp.view.core.button.VastTurnPurcChange','erp.view.core.button.BatchCommitKpibill','erp.view.core.button.vastLockBatch','erp.view.core.button.VastShareFee','erp.view.core.button.VastConfirm','erp.view.core.button.VastUnConfirm','erp.view.core.button.BatchDealUpdateData','erp.view.core.button.VastAgreeJProcess','erp.view.core.button.VastDisagreeJProcess',
-			   'erp.view.core.button.OkVastTurnBoChu','erp.view.core.button.NGVastTurnPurcCheckout','erp.view.core.button.JasperBatchPrint','erp.view.core.button.BatchSave','erp.view.core.button.BoxLablePrint','erp.view.core.button.CaseLabelPrint','erp.view.core.button.BatchPrintByCondition2'
+			   'erp.view.core.button.OkVastTurnBoChu','erp.view.core.button.NGVastTurnPurcCheckout','erp.view.core.button.JasperBatchPrint','erp.view.core.button.BatchSave','erp.view.core.button.BoxLablePrint','erp.view.core.button.CaseLabelPrint','erp.view.core.button.BatchPrintByCondition2',
+				'erp.view.core.button.SelectThrowMake','erp.view.core.button.SelectThrowOS'
 	],
 	id: 'dealform',
 	source:'',//全功能导航展示使用

+ 15 - 0
WebContent/app/view/core/button/SelectThrowMake.js

@@ -0,0 +1,15 @@
+Ext.define('erp.view.core.button.SelectThrowMake',{
+		extend: 'Ext.Button', 
+		alias: 'widget.erpSelectThrowMakeButton',
+		iconCls: 'x-button-icon-save',
+    	cls: 'x-btn-gray-1',
+    	id: 'erpSelectThrowMakeButton',
+    	text: $I18N.common.button.erpSelectThrowMakeButton,
+    	style: {
+    		marginLeft: '10px'
+        },
+        width:90,
+		initComponent : function(){ 
+			this.callParent(arguments); 
+		}
+	});

+ 15 - 0
WebContent/app/view/core/button/SelectThrowOS.js

@@ -0,0 +1,15 @@
+Ext.define('erp.view.core.button.SelectThrowOS',{
+		extend: 'Ext.Button', 
+		alias: 'widget.erpSelectThrowOSButton',
+		iconCls: 'x-button-icon-save',
+    	cls: 'x-btn-gray-1',
+    	id: 'erpSelectThrowOSButton',
+    	text: $I18N.common.button.erpSelectThrowOSButton,
+    	style: {
+    		marginLeft: '10px'
+        },
+        width:90,
+		initComponent : function(){ 
+			this.callParent(arguments); 
+		}
+	});

+ 3 - 1
WebContent/resource/i18n/messages_zh_CN.js

@@ -889,7 +889,9 @@ var $I18N = {
 				erpTurnProductOrderReviewButton: '生成生产订单评审',
 				erpProductAttachUploadButton:'附件上传',
 				erpProductAttachUploadHistoryButton:'附件上传历史',
-				erpDistributeSampleButton:'计 算'
+				erpDistributeSampleButton:'计 算',
+				erpSelectThrowMakeButton:'投放制造单',
+				erpSelectThrowOSButton:'投放委外单'
 			},
 			status: {
 				

+ 2 - 2
src/com/uas/erp/controller/pm/MPSMainController.java

@@ -158,10 +158,10 @@ public class MPSMainController {
 	@ResponseBody
 	@ResponseEmitter
 	public Map<String, Object> NeedThrow(String caller, String mainCode, String gridStore, String toWhere, String toCode, String condition,
-			String maKind, String purcaseCop, String apKind) {
+			String maKind, String purcaseCop, String apKind,String maTasktype) {
 		Map<String, Object> modelMap = new HashMap<String, Object>();
 		Map<String, Object> resmap = new HashMap<String, Object>();
-		resmap = mPSMainService.NeedThrow(caller, mainCode, gridStore, toWhere, toCode, condition, maKind, purcaseCop, apKind);
+		resmap = mPSMainService.NeedThrow(caller, mainCode, gridStore, toWhere, toCode, condition, maKind, purcaseCop, apKind,maTasktype);
 		modelMap.put("success", true);
 		modelMap.put("resmap", resmap);
 		return modelMap;

+ 1 - 1
src/com/uas/erp/service/pm/MPSMainService.java

@@ -38,7 +38,7 @@ public interface MPSMainService {
 
 	String RunMrp(String code, String caller);
 
-	Map<String, Object> NeedThrow(String caller, String mainCode, String gridStore, String toWhere, String toCode, String condition,String maKind,String purcaseCop,String apKind);
+	Map<String, Object> NeedThrow(String caller, String mainCode, String gridStore, String toWhere, String toCode, String condition,String maKind,String purcaseCop,String apKind, String maTaskType);
 
 	String mpsdesk_turnmake(String code, String caller);
 

+ 5 - 5
src/com/uas/erp/service/pm/impl/MPSMainServiceImpl.java

@@ -793,7 +793,7 @@ public class MPSMainServiceImpl implements MPSMainService {
 	@Override
 	@Transactional(propagation = Propagation.REQUIRED)
 	public synchronized Map<String, Object> NeedThrow(String caller, String mainCode, String gridStore, String toWhere, String toCode,
-			String condition, String maKind, String purcaseCop, String apKind) {
+			String condition, String maKind, String purcaseCop, String apKind, String maTaskType) {
 		List<Map<Object, Object>> grid = BaseUtil.parseGridStoreToMaps(gridStore);
 		int count = 0;
 		int Makecount = 0;
@@ -935,7 +935,7 @@ public class MPSMainServiceImpl implements MPSMainService {
 				}
 			}
 			Map<Object, Object> map = new HashMap<Object, Object>();
-			if ("MAKE".equals(rs.getString("pr_manutype"))) {
+			if (((maTaskType ==null || "".equals(maTaskType)) && "MAKE".equals(rs.getString("pr_manutype"))) || "MAKE".equals(maTaskType)) {
 				if (makekind == null || makekind.equals("")) {
 					BaseUtil.showError("未定义默认的MRP投放制造单类型,不能投放");
 				}
@@ -1031,7 +1031,7 @@ public class MPSMainServiceImpl implements MPSMainService {
 				count++;
 				Makecount++;
 				handlerService.handler("MpsDesk", "ThrowMake", "after", new Object[] { mainid });
-			} else if ("OSMAKE".equals(rs.getObject("pr_manutype"))) {
+			} else if (((maTaskType ==null || "".equals(maTaskType)) && "OSMAKE".equals(rs.getString("pr_manutype"))) || "OSMAKE".equals(maTaskType)) {
 				if (osmakekind == null || osmakekind.equals("")) {
 					BaseUtil.showError("未定义默认的MRP投放委外单类型,不能投放");
 				}
@@ -2836,7 +2836,7 @@ public class MPSMainServiceImpl implements MPSMainService {
 			}
 			// 清理无效PR 转投放状态为 PURCHASE 投放采购件
 			mpsdesk_turnpurchase(mainCode.toString(), "MpsDesk");
-			NeedThrow("MPSNeed", mainCode, gridStore, "AUTO", null, "", "", "", "", mianMaster);
+			NeedThrow("MPSNeed", mainCode, gridStore, "AUTO", null, "", "", "", "", mianMaster,null);
 			if (mdIdList.size() == 1000) {// 递归 每次1000投放数据
 				throwMrp(sql, mainCode, mianMaster, sonMaster);
 			}
@@ -2845,7 +2845,7 @@ public class MPSMainServiceImpl implements MPSMainService {
 
 	@Transactional(propagation = Propagation.REQUIRED)
 	public synchronized Map<String, Object> NeedThrow(String caller, String mainCode, String gridStore, String toWhere, String toCode,
-			String condition, String maKind, String purcaseCop, String apKind, String mianMaster) {// 自动投放
+			String condition, String maKind, String purcaseCop, String apKind, String mianMaster, String maTasktype) {// 自动投放
 		int count = 0;
 		int Makecount = 0;
 		int OSMakecount = 0;