Parcourir la source

git-svn-id: https://192.168.57.71/svn/jsgkj@81 931142cf-59ea-a443-aa0e-51397b428577

xt_xuhao il y a 9 ans
Parent
commit
ce34f88b79

+ 3 - 0
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/common/Global.as

@@ -73,6 +73,9 @@ package com.jtgh.yjpt.common
 			return map;
 		}
 		
+		/** 危险品审批是否启用签章,默认不启用*/
+		public static var iSignature:String = YesNoSelect.NO;
+		
 		/** 超级管理员 */
 		public static var adminId:Number = 1;
 		/** 同步用户 */

+ 2 - 0
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/model/SystemModel.as

@@ -166,6 +166,8 @@ package com.jtgh.yjpt.model
 				Global.btyyj=bc.getAttribute("btyyj") as  String;
 				Global.thyj=bc.getAttribute("thyj") as  String;
 				Global.version=bc.getAttribute("version") as  String;
+				//设置是否在危险品审批中使用签章功能的参数
+				Global.iSignature=bc.getAttribute("iSignature") as String;
 			}
 			//界面,登陆界面换成主框架
 			thisModel.mainPane.removeAllElements();

+ 87 - 4
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/view/zysqbp/ZysqbpAudit.mxml

@@ -18,6 +18,8 @@
 			import com.jtgh.yjpt.model.zysqbp.ShbpModel;
 			import com.jtgh.yjpt.vo.common.CodeVo;
 			import com.jtgh.yjpt.vo.zysqbp.ZysqbpVo;
+			import com.jtgh.yjpt.select.YesNoSelect;
+			import flash.external.ExternalInterface;
 			
 			import mx.collections.ArrayCollection;
 			import mx.core.FlexGlobals;
@@ -71,24 +73,105 @@
 			/**
 			 * 通过
 			 */
+//			public function doPass(e:Event):void{
+//				var shjy:String=StringUtil.trim(shyj.text);
+//				if(shjy==""){
+//					Utils.showInfoMessage("shyj.empty",null,"zysqbp");
+//					return;
+//				}
+//				Utils.doOtherConfirm(function():void{
+//					var shDate:Date=shsj.selectedDate;
+//					Utils.callRemote("zysqbpController","aduit",function():void{
+//						if(taskModel!=null){
+//							taskModel.thisView.doQuery();
+//						}else{
+//							model.doQuery(null);
+//						}
+//						view.dispatchEvent(new CloseEvent(Event.CLOSE));
+//					},shjy,shDate,true,zysqbp);
+//				});
+//			}
 			public function doPass(e:Event):void{
 				var shjy:String=StringUtil.trim(shyj.text);
 				if(shjy==""){
 					Utils.showInfoMessage("shyj.empty",null,"zysqbp");
 					return;
+				} 
+				if(Global.iSignature== YesNoSelect.YES){
+					var view_self:ZysqbpAudit = this; 
+					var view:zysqbpConfirm = new zysqbpConfirm(); 
+					view.v = view_self;
+					Utils.popupWindow("确认信息",view as DisplayObject,FlexGlobals.topLevelApplication as DisplayObject,null, 300, 150);  
 				}
-				Utils.doOtherConfirm(function():void{
+				else{
+					Utils.doOtherConfirm(function():void{
 					var shDate:Date=shsj.selectedDate;
-					Utils.callRemote("zysqbpController","aduit",function():void{
+					Utils.callRemote("zysqbpController","aduit",function():void{ 				
 						if(taskModel!=null){
 							taskModel.thisView.doQuery();
 						}else{
 							model.doQuery(null);
 						}
 						view.dispatchEvent(new CloseEvent(Event.CLOSE));
-					},shjy,shDate,true,zysqbp);
-				});
+						},shjy,shDate,true,zysqbp);
+					});
+				} 
+			}
+			/**
+			 * 确认操作页面"同意"按钮回调的函数
+			 */
+			public function ConfirmBackPass():void{
+				//Alert.show("pass");
+				PassCallRemoteFun();
+			}
+			
+			/**
+			 * 确认操作页面"同意且盖章"按钮回调的函数
+			 */
+			public function ConfirmBackPassAndSignature():void{
+				//Alert.show("pass signature");
+				if(CallSignatue()){//调用签章代码,签章成功,再审批通过
+					PassCallRemoteFun();
+				}
+			}
+			
+			public function CallSignatue():Boolean{
+				var shjy:String=StringUtil.trim(shyj.text);
+				var shDate:String=shsj.selectedDate.fullYear+"-"+ (shsj.selectedDate.month+1)+"-"+ shsj.selectedDate.date;  
+				var shr_txt:String=StringUtil.trim(shr.text);  
+				var ExtParam:String = "SHYJ=" +shjy + "\r\n"+
+					                  "SHR=" +shr_txt+ "\r\n"+
+								      "SHSJ=" + shDate + "\r\n";
+				//签章
+				var SignatureResult:Boolean =ExternalInterface.call("RunBatchSignature",zysqbp.id,Global.user.name,ExtParam);
+				return SignatureResult;
 			}
+			
+			/**
+			 * 点击通过按钮调用后台代码
+			 */
+			public function PassCallRemoteFun():void{
+				var shjy:String=StringUtil.trim(shyj.text);
+				if(shjy==""){
+					Utils.showInfoMessage("shyj.empty",null,"zysqbp");
+					return;
+				}
+				
+				var shDate:Date=shsj.selectedDate;
+				Utils.callRemote("zysqbpController","aduit",function():void{
+					
+					if(taskModel!=null){
+						taskModel.thisView.doQuery();
+					}else{
+						model.doQuery(null);
+					}
+					view.dispatchEvent(new CloseEvent(Event.CLOSE));
+				},shjy,shDate,true,zysqbp);
+				
+			}
+			
+
+
 			/**
 			 * 不同意
 			 */

+ 10 - 2
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/view/zysqbp/ZysqbpView.mxml

@@ -20,6 +20,8 @@
 			import com.jtgh.yjpt.select.MaoSelect;
 			import com.jtgh.yjpt.vo.common.CodeVo;
 			import com.jtgh.yjpt.vo.zysqbp.ZysqbpVo;
+			import com.jtgh.yjpt.select.YesNoSelect;
+			import flash.external.ExternalInterface;
 			
 			import mx.collections.ArrayCollection;
 			import mx.events.CloseEvent;
@@ -188,6 +190,11 @@
 				param.setParameter("type",PrintUtil.REPORT_EXPORT_TYPE_HTML);
 				PrintUtil.doPrint1(param,"_blank");
 			}
+			
+			protected function print2(event:MouseEvent):void{
+				ExternalInterface.call("ZysqbpPrintSignature",zysqbp.id);
+			}
+			
 			protected function download(event:MouseEvent):void{
 				var param:PrintParam=new PrintParam("zysqbp");
 				param.setParameter("id",zysqbp.id.toString());
@@ -688,9 +695,10 @@
 			</s:VGroup>
 		</s:BorderContainer>
 		<s:HGroup width="100%" height="40" gap="0" horizontalAlign="center" verticalAlign="middle">
+			<s:Button label="{resourceManager.getString('common','btn.print')}" click="print2(event)" skinClass="skins.cus.ButtonSkin" visible="{Global.iSignature==YesNoSelect.YES}" />
 			<s:Button label="{resourceManager.getString('common','btn.close')}" click="this.dispatchEvent(new CloseEvent(CloseEvent.CLOSE))" skinClass="skins.cus.ButtonSkin"/>
-			<s:Button label="{resourceManager.getString('common','btn.print')}" click="print(event)" skinClass="skins.cus.ButtonSkin"/>
-			<s:Button label="{resourceManager.getString('common','btn.download')}" click="download(event)" skinClass="skins.cus.ButtonSkin"/>
+			<s:Button label="{resourceManager.getString('common','btn.print')}" click="print(event)" skinClass="skins.cus.ButtonSkin" visible="{Global.iSignature!=YesNoSelect.YES}"/>
+			<s:Button label="{resourceManager.getString('common','btn.download')}" click="download(event)" skinClass="skins.cus.ButtonSkin" visible="{Global.iSignature!=YesNoSelect.YES}"/>
 		</s:HGroup>
 	</s:VGroup>
 </s:VGroup>

+ 38 - 0
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/view/zysqbp/zysqbpConfirm.mxml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009" 
+		  xmlns:eshangrao="com.systex.fp.jobschedule.util.*"
+		  xmlns:s="library://ns.adobe.com/flex/spark" 
+		  xmlns:mx="library://ns.adobe.com/flex/mx"  
+		  horizontalAlign="center"
+		  verticalAlign="middle"
+		  width="300" height="88">
+	  
+	<fx:Script>
+		<![CDATA[
+			import mx.events.CloseEvent;
+			[Bindable]
+			public var v:ZysqbpAudit;
+			
+		    public function doPass(e:Event):void{
+				this.dispatchEvent(new CloseEvent(CloseEvent.CLOSE));
+				//关闭自身 调用审批通过方法 
+				v.ConfirmBackPass();
+			}
+			
+			public function doPassAndSignature(e:Event):void{
+				this.dispatchEvent(new CloseEvent(CloseEvent.CLOSE));
+				//关闭自身 调用签章和审批通过方法
+				v.ConfirmBackPassAndSignature();
+			}
+		]]>
+	</fx:Script>
+	
+	<s:HGroup  width="100%" height="30"  horizontalAlign="center" verticalAlign="middle">
+		<s:Label id="tip" fontSize="15" fontWeight="bold" text="确认操作?"/>
+	</s:HGroup>
+	<s:HGroup y="67" width="100%" height="52" horizontalAlign="center" verticalAlign="middle"> 
+		<s:Button id="pass" label="同意" click="doPass(event)"  skinClass="skins.cus.ButtonSkin" />
+		<s:Button id="passAddSignature" label="同意且盖章" click="doPassAndSignature(event)"  skinClass="skins.cus.ButtonSkin"  width="100"/>
+		<s:Button id="close" label="{resourceManager.getString('common','btn.cancel')}" click="this.dispatchEvent(new CloseEvent(CloseEvent.CLOSE))" skinClass="skins.cus.ButtonSkin"/>
+	</s:HGroup> 
+</s:VGroup>