|
@@ -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>
|