Sfoglia il codice sorgente

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

xt_xuhao 8 anni fa
parent
commit
4daddac13a

+ 1 - 0
gkaq/yjpt-flex/trunk/locale/zh_CN/common.properties

@@ -152,6 +152,7 @@ msg.field.exist={0}\u5df2\u5b58\u5728\uff01
 msg.save=\u8bf7\u5148\u4fdd\u5b58\u8bb0\u5f55\uff01
 msg.select=\u8bf7\u9009\u62e9\u8bb0\u5f55\uff01
 msg.select.one=\u8bf7\u9009\u62e9\u4e00\u6761\u8bb0\u5f55\uff01
+msg.select.onePlace=\u8bf7\u9009\u62e9\u4e00\u4e2a\u4f5c\u4e1a\u573a\u6240\u7684\u8bb0\u5f55\uff01
 msg.success=\u64cd\u4f5c\u6210\u529f\uff01
 msg.field.inexistence={0}\u4e0d\u5b58\u5728
 msg.deleted=\u8be5\u8bb0\u5f55\u5df2\u88ab\u5220\u9664\uff0c\u662f\u5426\u5237\u65b0\u6570\u636e\uff1f

+ 2 - 0
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/common/util/Constants.as

@@ -347,6 +347,8 @@ package com.jtgh.yjpt.common.util
 		public static var FJSSLX_T_YJPT_ZDSGYHPCZGBA:Number=10000603;
 		/**作业附证照片*/
 		public static var FJSSLX_T_YJPT_FZSQ:Number=10000509;
+		/**作业附证照片 2 因为一泊一证所做的改动,原来附证照片附件是放在整个一条附证申请下面的,现改为放到每个作业地点下面                 edit by xh-2016-11-10 **/
+		public static var FJSSLX_T_YJPT_FZSQ_2:Number=10000510;
 		/**公告的附件*/
 		public static var FJSSLX_T_YJPT_GG:Number=10000993;
 		/**权力阳光发起督办*/

+ 5 - 5
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/model/jyr/JyrEditModel.as

@@ -716,7 +716,7 @@ package com.jtgh.yjpt.model.jyr
 				Utils.callRemote("gkwxhwzyfzblhhzcontroller", "queryfzs", function (r:ResultEvent):void{
 					var bc:BusinessContext=r.result as BusinessContext;
 					fzs = bc.result as ArrayCollection;
-					fzView.addEventListener(FlexEvent.CREATION_COMPLETE,loadfj);
+					//fzView.addEventListener(FlexEvent.CREATION_COMPLETE,loadfj);
 					fzView.vo=vo.fzsq;
 					fzView.enableflg=false;
 					Utils.popupWindow("附证发放信息", fzView as DisplayObject, thisView as DisplayObject,null,780,600);
@@ -724,7 +724,7 @@ package com.jtgh.yjpt.model.jyr
 			}
 			
 		
-		private function loadfj(e:Event):void{
+	/*	private function loadfj(e:Event):void{
 			Utils.callRemote("gkwxhwzyfzblhhzcontroller","findFj",function (r:ResultEvent):void{
 				var bc:BusinessContext = r.result as BusinessContext;
 				var yhrecords:ArrayCollection  = bc.getAttribute("records") as ArrayCollection;
@@ -738,8 +738,8 @@ package com.jtgh.yjpt.model.jyr
 					}
 				}
 			},fzView.vo.id,Constants.FJSSLX_T_YJPT_FZSQ);
-		}
-		public function loadBytesImage(img:ByteArray):void{
+		}*/
+		/*public function loadBytesImage(img:ByteArray):void{
 			var image:mx.controls.Image=new mx.controls.Image;
 			image.width=300;
 			image.height=200;
@@ -761,7 +761,7 @@ package com.jtgh.yjpt.model.jyr
 			image.source=img;
 			image.addEventListener(MouseEvent.CLICK,Utils.showImageHandler);
 			fzView.fztps.addElement(image); 
-		}
+		}*/
 	}
 }
 

+ 2 - 2
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/model/zyfzndjy/GkwxhwzyfzblhhzEditModel.as

@@ -203,7 +203,7 @@ package com.jtgh.yjpt.model.zyfzndjy
 			fzView.vo= vo;
 			fzView.view=view;
 			fzView.model=this;
-			Utils.popupWindow("作业场所信息", fzView as DisplayObject, view as DisplayObject,null,500,300);
+			Utils.popupWindow("作业场所信息", fzView as DisplayObject, view as DisplayObject,null,500,350);
 		}
 		
 		/**
@@ -259,7 +259,7 @@ package com.jtgh.yjpt.model.zyfzndjy
 			fzView.mode = Constants.mode_edit;
 			fzView.view=view;
 			fzView.model=this;
-			Utils.popupWindow("作业场所信息", fzView as DisplayObject, view as DisplayObject,null,500,300);
+			Utils.popupWindow("作业场所信息", fzView as DisplayObject, view as DisplayObject,null,500,350);
 		}
 		
 		/**

+ 9 - 6
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/model/zyfzndjy/GkwxhwzyfzblhhzModel.as

@@ -320,7 +320,7 @@ package com.jtgh.yjpt.model.zyfzndjy
 			editView.layoutModel=this;
 			editView.vo = new GkwxhwzyfzblhhzVo();
 			editView.functionId = Utils.getFunctionId(event.target);
-			Utils.popupWindow(resourceManager.getString('Gkwxhwzyfzblhhz','add'), editView as DisplayObject, thisView as DisplayObject, thisView.pager.doQuery, 780, 500);
+			Utils.popupWindow(resourceManager.getString('Gkwxhwzyfzblhhz','add'), editView as DisplayObject, thisView as DisplayObject, thisView.pager.doQuery, 780, 600);
 		}
 		/**
 		 * 窗口关闭
@@ -645,9 +645,12 @@ package com.jtgh.yjpt.model.zyfzndjy
 				Utils.callRemote("gkwxhwzyfzblhhzcontroller", "queryfzs", function (r:ResultEvent):void{
 					var bc:BusinessContext=r.result as BusinessContext;
 					fzs = bc.result as ArrayCollection;
-					editView.addEventListener(FlexEvent.CREATION_COMPLETE,loadfj);
+					
+					//去掉加载附件代码,附证发放信息页附件相关已去除,一个作业地点需要一个附证,放到与每个作业地点相关的页面中去了 edit by xh-2016-11-10
+					//editView.addEventListener(FlexEvent.CREATION_COMPLETE,loadfj);
+					
 					editView.enableflg=canLink;
-					Utils.popupWindow("附证发放信息", editView as DisplayObject, thisView as DisplayObject,null,780,600);
+					Utils.popupWindow("附证发放信息", editView as DisplayObject, thisView as DisplayObject,null,880,700);
 //					if(vo.bh==null||vo.bh==""){//信息未添加
 //						if(canLink==true){
 //							editView.enableflg=true;
@@ -665,8 +668,8 @@ package com.jtgh.yjpt.model.zyfzndjy
 //					}
 				},vo);
 			}
-
 		}
+		
 		private function loadfj(e:Event):void{
 			Utils.callRemote("gkwxhwzyfzblhhzcontroller","findFj",function (r:ResultEvent):void{
 				var bc:BusinessContext = r.result as BusinessContext;
@@ -717,7 +720,7 @@ package com.jtgh.yjpt.model.zyfzndjy
 			editView.vo= vo;
 			editView.view=view;
 			editView.model=this;
-			Utils.popupWindow("附证发放信息", editView as DisplayObject, thisView as DisplayObject,null,500,300);
+			Utils.popupWindow("附证发放信息", editView as DisplayObject, thisView as DisplayObject,null,880,720);
 		}
 		/**
 		 * 附证新增行操作
@@ -765,7 +768,7 @@ package com.jtgh.yjpt.model.zyfzndjy
 			editView.mode = Constants.mode_edit;
 			editView.view=view;
 			editView.model=this;
-			Utils.popupWindow("附证发放信息", editView as DisplayObject, thisView as DisplayObject,null,500,400);
+			Utils.popupWindow("附证发放信息", editView as DisplayObject, thisView as DisplayObject,null,880,720);
 		}
 		
 		/**

+ 191 - 53
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/view/zyfzndjy/FzChoose.mxml

@@ -24,6 +24,7 @@
 			import com.jtgh.yjpt.vo.zyfzndjy.Gkwxhwzyfzbl_fzVo;
 			import com.jtgh.yjpt.vo.zyfzndjy.GkwxhwzyfzblhhzVo;
 			import com.jtgh.yjpt.vo.zysqbp.wh;
+			import com.jtgh.yjpt.common.BusinessContext;
 			
 			import mx.collections.ArrayCollection;
 			import mx.controls.Alert;
@@ -32,6 +33,7 @@
 			import mx.events.ListEvent;
 			import mx.rpc.events.ResultEvent;
 			
+			import spark.components.Image;
 			import spark.components.gridClasses.GridColumn;
 			
 			[Bindable]
@@ -49,12 +51,19 @@
 			[Bindable]
 			public var wxhwpmArrCol:ArrayCollection = new ArrayCollection();
 			public var wxhwm_text:String = '';
+			[Bindable]
+			public var yhzp:FileReferenceList=new FileReferenceList();
+			[Bindable]
+			public var yhzpList:ArrayCollection=new ArrayCollection();
 			
 			/**
 			 * 创建完成
 			 */
 			protected function creationCompleteHandler(event:FlexEvent):void
 			{
+				//上传附件listener
+				this.yhzp.addEventListener(Event.SELECT,yhSelect);
+				
 				if(vo==null||vo.zycs==null){
 				
 				}else{
@@ -100,8 +109,10 @@
 					}else{
 						gbq.text = fzvo.qynbbh;
 					}
+					//加载附证扫描件附件
+					loadfj(event);
 				}
-				
+				 
 				//初始化允许作业危险货物品列表 
 				wxhwm_text = fzvo.byzd5;
 				if(wxhwm_text!=null){
@@ -109,7 +120,7 @@
 					var _whCheckID_Name:Array = fzvo.wxhwm.split(';');
 					for(var i:int =0;i<_wh.length;i++){
 						if(_wh[i]!=null){
-							var wh_txt = _wh[i] as String;
+							var wh_txt:String = _wh[i] as String;
 							wh_txt = wh_txt.replace('\n','');
 							if(wh_txt !=''){
 								var whTemp:wh = new wh();
@@ -122,12 +133,77 @@
 						}
 					}
 				}
+			}//end load complete function
+			
+			
+			/**
+			 * 加载附件
+			 */
+			private function loadfj(e:Event):void{
+				Utils.callRemote("gkwxhwzyfzblhhzcontroller","findFj",function (r:ResultEvent):void{
+					var bc:BusinessContext = r.result as BusinessContext;
+					var yhrecords:ArrayCollection  = bc.getAttribute("records") as ArrayCollection;
+					for(var i:Number=0;i<yhrecords.length;i++){
+						var image:ByteArray=yhrecords[i] as ByteArray;
+						if(null!=image){
+							//						var loader:Loader=new Loader;
+							//						loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadCompleterHandler);
+							//						loader.loadBytes(image);
+							loadBytesImage(image);
+						}
+					}
+					
+				},this.fzvo.id,Constants.FJSSLX_T_YJPT_FZSQ_2);
+			}
+			public function loadBytesImage(img:ByteArray):void{
+				var image:mx.controls.Image=new mx.controls.Image;
+				image.width=300;
+				image.height=200;
+				image.source=img;
+				image.useHandCursor=true;
+				image.addEventListener(MouseEvent.CLICK,Utils.showImageHandler);
+				this.fztps.addElement(image); 
+			}
+			
+			
+			private function yhSelect(e:Event):void{
+				for(var i:int=0;i<yhzp.fileList.length;i++){
+					var updatefile:FileReference = FileReference(yhzp.fileList[i]);
+					// 验证上传文件大小
+					if(!Utils.checkUploadFileSize(updatefile))
+					{
+						var arr:Array = new Array();
+						arr.push(Global.upload_file_size);
+						Utils.showInfoMessage("msg.upload.FileSizeOutOfRange",arr);
+						return;
+					}
+					uploadCompleteDataHandler(updatefile);
+					cursorManager.setBusyCursor();
+				}
+				yhzpList.addItem(yhzp);
+				yhzp=new FileReferenceList();
+				this.yhzp.addEventListener(Event.SELECT,yhSelect);
 			}
 			
+			private function uploadCompleteDataHandler(file1:FileReference):void
+			{
+				file1.load();
+				file1.addEventListener(Event.COMPLETE,showTx);
+			}
+			
+			private function showTx(e:Event):void{
+				var image:Image=new Image();
+				image.width=300;
+				image.height=200;
+				image.source=(e.target as FileReference).data;
+				fztps.addElement(image);
+				cursorManager.removeBusyCursor();
+			}
 			 
 			
 			protected function doSave():void
 			{
+				onUpLoad();
 				fzvo.fzsq = vo;
 				fzvo.zycs = vo.zycs;
 				fzvo.byzd5 = wxhwm_text;
@@ -206,7 +282,7 @@
 				});
 			}
 			/**
-			 * 货物品名树弹出方法
+			 * 货物品名树弹出方法 (树你妹,就是一列表,会不会写注释)
 			 * 
 			 */ 
 			public function treeBtnClick():void
@@ -230,7 +306,7 @@
 					wxhwpmArrCol = new ArrayCollection();
 					for(var i:int =0;i<_wh.length;i++){
 						if(_wh[i]!=null){
-							var wh_txt = _wh[i] as String;
+							var wh_txt:String = _wh[i] as String;
 							wh_txt = wh_txt.replace('\n','');
 							if(wh_txt !=''){
 								var whTemp:wh = new wh();
@@ -253,7 +329,7 @@
 				wxhwpmArrCol = new ArrayCollection();
 				for(var i:int =0;i<_wh.length;i++){
 					if(_wh[i]!=null){
-						var wh_txt = _wh[i] as String;
+						var wh_txt:String = _wh[i] as String;
 						wh_txt = wh_txt.replace('\n','');
 						if(wh_txt !='' && data.wxhwpm !=wh_txt){
 							var whTemp:wh = new wh();
@@ -267,27 +343,78 @@
 				
 				fzvo.wxhwm=''; 
 				fzvo.byzd5 = '';
-				for(var i:int=0;i<wxhwpmArrCol.length;i++){
+				for(var i:int=0;i < wxhwpmArrCol.length;i++){
 					fzvo.byzd5 += (wxhwpmArrCol[i] as wh).wxhwpm + ';';
 					fzvo.wxhwm += (wxhwpmArrCol[i] as wh).whID + ';';
 				}
 				wxhwm_text=fzvo.byzd5;
 			}
 			
+			
+			/**
+			 * 上传附件
+			 */
+			private  function fileBrowse(e:Event):void{
+				var images:FileFilter=new FileFilter("Images(*.jpg;*.gif;*.png;*.bmp)", "*.jpg;*.gif;*.png;*.bmp");
+				yhzp.browse([images]);
+			}
+			
+			/**
+			 * 删除附件
+			 */
+			private function deFile(e:Event):void{
+				if(vo.id.toString()=="NaN"){
+					fztps.removeAllElements();
+					yhzpList.removeAll();
+				}else{
+					Utils.callRemote("accessoryController","deleteFj", function (r:ResultEvent):void{
+						fztps.removeAllElements();
+						yhzpList.removeAll();
+					},fzvo.id,Constants.FJSSLX_T_YJPT_FZSQ_2,0);
+				}
+			}
+			
+			/**
+			 *保存时调用,保存附件
+			 */
+			private  function onUpLoad():void
+			{
+				for( var j:int=0;j<yhzpList.length;j++){
+					yhzp=yhzpList.getItemAt(j) as FileReferenceList;
+					for(var i:int=0;i<yhzp.fileList.length;i++){
+						var updatefile:FileReference = FileReference(yhzp.fileList[i]);
+						if(!Utils.checkUploadFileSize(updatefile))
+						{
+							var arr:Array = new Array();
+							arr.push(Global.upload_file_size);
+							Utils.showInfoMessage("msg.upload.FileSizeOutOfRange",arr);
+							break;
+						}
+						var params:URLVariables = new URLVariables();
+						params.entityId=fzvo.id;
+						params.entityType=Constants.FJSSLX_T_YJPT_FZSQ_2;
+						params.type=0;
+						var url:String = Utils.getBaseUrl()+"uploadtb.do;jsessionid="+Global.jsessionid;
+						var request:URLRequest = new URLRequest(url);
+						request.data = params;
+						request.method = URLRequestMethod.POST;
+						updatefile.upload(request,"file");
+					}
+				}
+			}//end save attachment (accessory指实物附件,英文渣爆了,难怪全他妈汉语拼音,谁他妈认识,全靠猜)
+			
 		]]>
 	</fx:Script>
 	
 	<s:VGroup width="100%" height="100%">
 		<s:VGroup width="100%" paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="10">
-			<s:HGroup visible="{enableflg}" width="100%" horizontalAlign="left"
-					  includeInLayout="{enableflg}" verticalAlign="middle">
-				<cus:QLabel width="80" text="作业场所"/>
-				<cus:QTextInput width="340" enabled="false" text="{vo.zycs.localeName}"/>
+			<s:HGroup visible="{enableflg}" width="100%" horizontalAlign="left" includeInLayout="{enableflg}" verticalAlign="middle">
+				<cus:QLabel width="15%" text="作业场所"/>
+				<cus:QTextInput width="75%" enabled="false" text="{vo.zycs.localeName}"/>
 			</s:HGroup>
-			<s:HGroup visible="{enableflg}" width="100%" horizontalAlign="left"
-					  includeInLayout="{enableflg}" verticalAlign="middle">
-				<cus:QLabel width="80" notNull="true" text="附证编号"/> 
-				<cus:QTextInput id="fzbh_gkjyxkz" width="220" editable="false" text="{vo.gkjyxkz}"/>
+			<s:HGroup visible="{enableflg}" width="100%" horizontalAlign="left" includeInLayout="{enableflg}" verticalAlign="middle">
+				<cus:QLabel width="15%" notNull="true" text="附证编号"/> 
+				<cus:QTextInput id="fzbh_gkjyxkz" width="60%" editable="false" text="{vo.gkjyxkz}"/>
 				<cus:QLabel width="5" text="-"/>
 				<cus:QTextInput id="fzbh_zyqylsh" width="40" text="@{fzvo.byzd1}"/>
 				<cus:QLabel width="5" text="-"/>
@@ -295,61 +422,72 @@
 							   dataField="{fzvo.byzd2}" enabled="{vo.zycs.id==10000501}"
 							   hasBlank="true"
 							   toolTip="{resourceManager.getString('Gkwxhwzyfzblhhz','mtlx')}"/>
-				</s:HGroup>
-				<s:HGroup id="mtg" visible="false" width="100%" horizontalAlign="left"
-						  includeInLayout="false" verticalAlign="middle">
-					<cus:QLabel width="80" notNull="true" text="名称"/>
-					<cus:QComboBox id="mt" width="340" comboxClass="BwByJyrSelect"
-								   parentId="{vo.jyrVo}"/>
-				</s:HGroup>
-				<s:HGroup id="cgg" visible="false" width="100%" horizontalAlign="left"
-						  includeInLayout="false" verticalAlign="middle">
-					<cus:QLabel width="80" notNull="true" text="名称"/>
-					<cus:QComboBox id="cg" width="340" comboxClass="CgSelect" parentId="{vo.jyrVo}"/>
-				</s:HGroup>
-				<s:HGroup id="dcg" visible="false" width="100%" horizontalAlign="left"
-						  includeInLayout="false" verticalAlign="middle">
-					<cus:QLabel width="80" notNull="true" text="名称"/>
-					<cus:QComboBox id="dc" width="340" comboxClass="DcSelect" parentId="{vo.jyrVo}"/>
-				</s:HGroup>
-				<s:HGroup id="ckg" visible="false" width="100%" horizontalAlign="left"
-						  includeInLayout="false" verticalAlign="middle">
-					<cus:QLabel width="80" notNull="true" text="名称"/>
-					<cus:QComboBox id="ck" width="340" comboxClass="CkSelect" parentId="{vo.jyrVo}"/>
-				</s:HGroup>
-				<s:HGroup id="gbqg" visible="false" width="100%" horizontalAlign="left"
-						  includeInLayout="false" verticalAlign="middle">
-					<cus:QLabel width="80" notNull="true" text="名称"/>
-					<cus:QTextInput id="gbq" width="340"/>
-				</s:HGroup>
+			</s:HGroup>
+			<s:HGroup id="mtg" visible="false" width="100%" horizontalAlign="left" includeInLayout="false" verticalAlign="middle">
+				<cus:QLabel width="15%" notNull="true" text="名称"/>
+				<cus:QComboBox id="mt" width="75%" comboxClass="BwByJyrSelect" parentId="{vo.jyrVo}"/>
+			</s:HGroup>
+			<s:HGroup id="cgg" visible="false" width="100%" horizontalAlign="left" includeInLayout="false" verticalAlign="middle">
+				<cus:QLabel width="15%" notNull="true" text="名称"/>
+				<cus:QComboBox id="cg" width="75%" comboxClass="CgSelect" parentId="{vo.jyrVo}"/>
+			</s:HGroup>
+			<s:HGroup id="dcg" visible="false" width="100%" horizontalAlign="left" includeInLayout="false" verticalAlign="middle">
+				<cus:QLabel width="15%" notNull="true" text="名称"/>
+				<cus:QComboBox id="dc" width="75%" comboxClass="DcSelect" parentId="{vo.jyrVo}"/>
+			</s:HGroup>
+			<s:HGroup id="ckg" visible="false" width="100%" horizontalAlign="left" includeInLayout="false" verticalAlign="middle">
+				<cus:QLabel width="15%" notNull="true" text="名称"/>
+				<cus:QComboBox id="ck" width="75%" comboxClass="CkSelect" parentId="{vo.jyrVo}"/>
+			</s:HGroup>
+			<s:HGroup id="gbqg" visible="false" width="100%" horizontalAlign="left" includeInLayout="false" verticalAlign="middle">
+				<cus:QLabel width="15%" notNull="true" text="名称"/>
+				<cus:QTextInput id="gbq" width="75%"/>
+			</s:HGroup>
+			
+			<!--<s:BorderContainer  width="100%" borderWeight="0" >-->
+				<cus:QLabel fontWeight="bold" text="允许作业的危险货物品名"  width="100%" textalign="center" height="100%" fontSize="22" verticalAlign="middle"/>
+			<!--</s:BorderContainer>-->
 			<s:HGroup width="100%" horizontalAlign="left" verticalAlign="middle">
-				<cus:QLabel width="80" text="允许作业的危险货物品名"/>
 				<!-- 危货附证货种列表 -->
-				<ui:DataGrid id="fzDataGrid" width="260" height="200" dataProvider="{wxhwpmArrCol}" editable="true">
+				<ui:DataGrid id="fzDataGrid" width="100%" height="200" dataProvider="{wxhwpmArrCol}" editable="true">
 					<ui:columns>
 						<s:ArrayList>
-							<ui:DataGridColumn width="180" dataField="wxhwpm" headerText="危险货物品名" showDataTips="true" />  
-							<ui:DataGridColumn width="60" linkButtonFunc="{delWxhwpm}"
+							<ui:DataGridColumn   dataField="wxhwpm" headerText="危险货物品名" showDataTips="true" />  
+							<ui:DataGridColumn width="60" linkButtonFunc="{delWxhwpm}" headerText="删除"
 											   linkButtonLabel="{resourceManager.getString('common','btn.del')}"
 											   type="{TypeBase.LINKBUTTON}"/>
 						</s:ArrayList>
 					</ui:columns>
 				</ui:DataGrid>
-				<s:Button id="treeBtn" label="选择" click="treeBtnClick()" enabled="true"
-							  skinClass="skins.cus.ButtonSkin"/>
+				<s:Button id="treeBtn" label="选择" click="treeBtnClick()" enabled="true" skinClass="skins.cus.ButtonSkin"/>
 			</s:HGroup>	
 				 <!--
 				<s:HGroup width="100%" horizontalAlign="left" verticalAlign="middle">
 					
 					<cus:QTextArea id="wxhwm" width="340" height="100" editable="false"
 								   text="@{fzvo.byzd5}"/>
-				</s:HGroup>		-->			
-			</s:VGroup>
-		<s:HGroup width="100%" height="30" horizontalAlign="center" paddingLeft="10"
-				  paddingRight="10" verticalAlign="middle">
+				</s:HGroup>		-->		
+			
+			<!--<s:BorderContainer  width="100%" borderWeight="0" visible="{enableflg}" includeInLayout="{enableflg}">-->
+				<cus:QLabel fontWeight="bold" text="证书扫描件"  width="100%" textalign="center" height="100%" fontSize="22" verticalAlign="middle"/>
+			<!--</s:BorderContainer>-->
+			<cus:QLabel width="200" text="建议图片大小:300*200" textAlign="left" visible="{enableflg}" includeInLayout="{enableflg}"/>
+			<s:HGroup id="fztp" width="100%" height="200" horizontalAlign="left" verticalAlign="middle" visible="{enableflg}" includeInLayout="{enableflg}">
+				<mx:VBox width="{fztp.width*0.99}" height="200" borderVisible="true" borderStyle="inset" borderColor="#d2d2d2">
+					<s:HGroup  id="fztps" width="100%" horizontalAlign="left" verticalAlign="middle" height="200">
+					</s:HGroup>
+				</mx:VBox>
+			</s:HGroup>
+			<s:HGroup visible="{enableflg}" includeInLayout="{enableflg}">
+				<cus:QLabel width="120" />
+				<s:Button label="上传附件" id="yh"  click="fileBrowse(event)" width="120"/>
+				<s:Button label="删除" id="yhdelete"  click="deFile(event)"  width="70"/>
+			</s:HGroup>
+		</s:VGroup>
+			
+		<s:HGroup width="100%" height="30" horizontalAlign="center" paddingLeft="10" paddingRight="10" verticalAlign="middle">
 			<s:Button id="btnSave" label="确定" click="doSave()" skinClass="skins.cus.ButtonSkin"/>
-			<s:Button id="btnClose" label="{resourceManager.getString('common','btn.close')}"
-					  click="doPopupClose(event)" skinClass="skins.cus.ButtonSkin"/>
+			<s:Button id="btnClose" label="{resourceManager.getString('common','btn.close')}" click="doPopupClose(event)" skinClass="skins.cus.ButtonSkin"/>
 		</s:HGroup>
 	</s:VGroup>
 </s:Group>

+ 58 - 30
gkaq/yjpt-flex/trunk/src/com/jtgh/yjpt/view/zyfzndjy/FzEdit.mxml

@@ -33,16 +33,16 @@
 			
 			[Bindable]
 			public var model:Object;
-			[Bindable]
-			public var yhzp:FileReferenceList=new FileReferenceList();
+			/* [Bindable]
+			public var yhzp:FileReferenceList=new FileReferenceList(); */
 			[Bindable]
 			public var view:FzEdit;
 			[Bindable]
 			public var vo:GkwxhwzyfzblhhzVo = new GkwxhwzyfzblhhzVo();
 			[Bindable]
 			public var enableflg:Boolean = false;
-			[Bindable]
-			public var yhzpList:ArrayCollection=new ArrayCollection();
+			/* [Bindable]
+			public var yhzpList:ArrayCollection=new ArrayCollection(); */
 			
 			/**
 			 * 创建完成
@@ -50,7 +50,7 @@
 			protected function creationCompleteHandler(event:FlexEvent):void
 			{
 				view=this;
-				this.yhzp.addEventListener(Event.SELECT,yhSelect);
+//				this.yhzp.addEventListener(Event.SELECT,yhSelect);
 				if(vo!=null){
 					//vo.bh = vo.gkjyxkz;
 					if(vo.yxqjssj!=null){
@@ -83,9 +83,9 @@
 //					vo.byzd5=res["hwpmStr"];
 					//vo.bh=res["fzcsbh"];
 					Utils.callRemote("gkwxhwzyfzblhhzcontroller", "saveFz", function (r:ResultEvent):void{
-						onUpLoad();
+						//onUpLoad();
 						model.doQuery(null);
-						model.doClose(view);
+						//model.doClose(view);
 						Alert.show("保存成功","提示");
 					},vo,model.fzs);
 				}
@@ -94,8 +94,18 @@
 			private function doPreview(e:Event):void{
 				var param:URLVariables = new URLVariables();
 				param.fzcsbh = "";
-				if(model.fzs.length>0)
-					param.fzcsbh =encodeURIComponent((model.fzs[0] as Gkwxhwzyfzbl_fzVo).fzcsbh);
+				
+				
+//				if(model.fzs.length>0)
+//					param.fzcsbh =encodeURIComponent((model.fzs[0] as Gkwxhwzyfzbl_fzVo).fzcsbh);
+				//检查选中项
+				if(fzDataGrid.selectedIndex==-1){
+					Utils.showInfoMessage("msg.select.onePlace");
+					return;
+				}
+				
+				param.fzcsbh =encodeURIComponent((fzDataGrid.selectedItem as Gkwxhwzyfzbl_fzVo).fzcsbh);
+				
 				var url:String = Utils.getBaseUrl()+"previewFzsq.do";
 				var req:URLRequest=new URLRequest(url);
 				req.method = URLRequestMethod.POST;
@@ -104,7 +114,16 @@
 			}
 			
 			private function doChPrint(e:Event):void{
-				var fzcsbh:String = (model.fzs[0] as Gkwxhwzyfzbl_fzVo).fzcsbh;
+				
+				//检查选中项
+				if(fzDataGrid.selectedIndex==-1){
+					Utils.showInfoMessage("msg.select.onePlace");
+					return;
+				}
+				
+				//var fzcsbh:String = (model.fzs[0] as Gkwxhwzyfzbl_fzVo).fzcsbh;
+				var fzcsbh:String = (fzDataGrid.selectedItem as Gkwxhwzyfzbl_fzVo).fzcsbh;
+				
 				var pages:Number=1;
 				Utils.callRemote("gkwxhwzyfzblhhzcontroller","chPrint",function(r:ResultEvent):void{
 					var bc:BusinessContext = r.result as BusinessContext;
@@ -217,7 +236,7 @@
 			{
 				model.doFzDelete(data);
 			}
-			private  function fileBrowse(e:Event):void{
+			/* private  function fileBrowse(e:Event):void{
 				var images:FileFilter=new FileFilter("Images(*.jpg;*.gif;*.png;*.bmp)", "*.jpg;*.gif;*.png;*.bmp");
 				yhzp.browse([images]);
 			}
@@ -239,12 +258,13 @@
 				yhzp=new FileReferenceList();
 				this.yhzp.addEventListener(Event.SELECT,yhSelect);
 			}
+			
 			private function uploadCompleteDataHandler(file1:FileReference):void
 			{
 				file1.load();
 				file1.addEventListener(Event.COMPLETE,showTx);
-				
 			}
+			
 			private function showTx(e:Event):void{
 				var image:Image=new Image();
 				image.width=300;
@@ -252,8 +272,13 @@
 				image.source=(e.target as FileReference).data;
 				fztps.addElement(image);
 				cursorManager.removeBusyCursor();
-			}
-			public  function onUpLoad():void
+			} */
+			
+			
+			/**
+			 *保存时调用,保存附件
+			 */
+		/* 	private  function onUpLoad():void
 			{
 				for( var j:int=0;j<yhzpList.length;j++){
 					yhzp=yhzpList.getItemAt(j) as FileReferenceList;
@@ -277,8 +302,9 @@
 						updatefile.upload(request,"file");
 					}
 				}
-			}
-			private function deFile(e:Event):void{
+			} */
+			
+		/* 	private function deFile(e:Event):void{
 				if(vo.id.toString()=="NaN"){
 					fztps.removeAllElements();
 					yhzpList.removeAll();
@@ -288,7 +314,7 @@
 						yhzpList.removeAll();
 					},vo.id,Constants.FJSSLX_T_YJPT_FZSQ,0);
 				}
-			}
+			} */
 			private function check():Boolean{
 			if(vo.fzjg==null||vo.fzjg.length==0){
 				Alert.show("发证机关不能为空","提示");
@@ -344,25 +370,27 @@
 					<cus:QLabel width="120" text="{resourceManager.getString('Gkwxhwzyfzblhhz','fzbh')}" notNull="true"/>
 					<cus:QTextInput enabled="{enableflg}" text="@{vo.bh}" width="300"/>
 				</s:HGroup>
+				<s:BorderContainer  width="100%" borderWeight="1">
+					<cus:QLabel fontWeight="bold" text="作业场所信息" width="100%" textalign="center" height="100%" fontSize="22" verticalAlign="middle"/>
+				</s:BorderContainer>
 				<s:VGroup width="100%" horizontalAlign="left" verticalAlign="middle"> 
 					<ui:DataGrid id="fzDataGrid" width="100%" editable="true" dataProvider="{model.fzs}">
-						<ui:columns><s:ArrayList>
-										<ui:DataGridColumn dataField="zycsname"  headerText="作业场所" resizable="false"/>
-										<ui:DataGridColumn dataField="fzcsbh" width="150"  editable="true"
-														   headerText="附证编号" showDataTips="true" dataTipField="fzcsbh"/>
-										<ui:DataGridColumn dataField="qynbmc" 
-														   headerText="企业内部编号" />
-										<ui:DataGridColumn dataField="byzd5" width="300"
-														   headerText="允许作业的危险货物品名" showDataTips="true" dataTipField="byzd5"/>
+						<ui:columns>
+							<s:ArrayList>
+										<ui:DataGridColumn dataField="zycsname" width="100" headerText="作业场所" resizable="false"/>
+										<ui:DataGridColumn dataField="fzcsbh" width="200"  editable="true" headerText="附证编号" showDataTips="true" dataTipField="fzcsbh"/>
+										<ui:DataGridColumn dataField="qynbmc" width="150" headerText="企业内部编号" showDataTips="true" dataTipField="qynbmc"/>
+										<ui:DataGridColumn dataField="byzd5" headerText="允许作业的危险货物品名" showDataTips="true" dataTipField="byzd5"/>
 										<ui:DataGridColumn type="{TypeBase.LINKBUTTON}" linkButtonLabel="{resourceManager.getString('common','btn.edit')}"
 														   width="80" linkButtonFunc="{linkButtonFunc3}" visible="{enableflg}" />
 										<ui:DataGridColumn type="{TypeBase.LINKBUTTON}" linkButtonLabel="{resourceManager.getString('common','btn.del')}"
 														   width="80" linkButtonFunc="{linkButtonFunc2}" visible="{enableflg}" />
-									</s:ArrayList></ui:columns>
+							</s:ArrayList>
+						</ui:columns>
 					</ui:DataGrid>
 					<s:Button click="model.doFzAdd(vo,view)"  label="{resourceManager.getString('common','btn.add')}" skinClass="skins.cus.ButtonSkin"  visible="{enableflg}" includeInLayout="{enableflg}"/>
 				</s:VGroup>
-				<s:BorderContainer  width="100%" borderWeight="1">
+				<!--<s:BorderContainer  width="100%" borderWeight="1">
 					<cus:QLabel fontWeight="bold" text="证书扫描件" 
 								width="100%" textalign="center" height="100%" fontSize="22" verticalAlign="middle"/>
 				</s:BorderContainer>
@@ -377,13 +405,13 @@
 					<cus:QLabel width="120" />
 					<s:Button label="上传附件" id="yh"  click="fileBrowse(event)" width="120"/>
 					<s:Button label="删除" id="yhdelete"  click="deFile(event)"  width="70"/>
-				</s:HGroup>
+				</s:HGroup>-->
 			</s:VGroup>
 		</s:BorderContainer>
 		<s:HGroup width="100%" verticalAlign="middle" height="30" horizontalAlign="center" paddingLeft="10" paddingRight="10">
 			<s:Button id="btnSave" label="{resourceManager.getString('common','btn.save')}" click="doSave()" skinClass="skins.cus.ButtonSkin" visible="{enableflg}" includeInLayout="{enableflg}"/>
-			<s:Button id="btnPreview" label="{resourceManager.getString('common','btn.preview')}" click="doPreview(event)" skinClass="skins.cus.ButtonSkin"/>
-			<s:Button id="btnPrint" label="{resourceManager.getString('common','btn.print')}" click="doChPrint(event)" skinClass="skins.cus.ButtonSkin"/>
+			<s:Button id="btnPreview" label="{resourceManager.getString('common','btn.preview')}" click="doPreview(event)" skinClass="skins.cus.ButtonSkin" toolTip="请保存后再点击预览!"/>
+			<s:Button id="btnPrint" label="{resourceManager.getString('common','btn.print')}" click="doChPrint(event)" skinClass="skins.cus.ButtonSkin" toolTip="请保存后再点击打印!"/>
 			<s:Button id="btnClose" label="{resourceManager.getString('common','btn.close')}" click="doPopupClose(event)" skinClass="skins.cus.ButtonSkin"/>
 		</s:HGroup>
 	</s:VGroup>