|
@@ -11,24 +11,23 @@
|
|
|
|
|
|
<fx:Script>
|
|
|
<![CDATA[
|
|
|
- import com.anychart.context.AboutAnyChart;
|
|
|
import com.jtgh.yjpt.common.Global;
|
|
|
import com.jtgh.yjpt.common.TypeBase;
|
|
|
import com.jtgh.yjpt.common.util.Constants;
|
|
|
+ import com.jtgh.yjpt.common.util.Utils;
|
|
|
import com.jtgh.yjpt.model.jyrxxgl.ryqk.RyjbxxAddModel;
|
|
|
- import com.jtgh.yjpt.model.jyrxxgl.ryqk.RyjbxxModel;
|
|
|
- import com.jtgh.yjpt.vo.jyrxxgl.RyjbxxVo;
|
|
|
+ import com.jtgh.yjpt.vo.common.AccessoryVo;
|
|
|
|
|
|
import mx.collections.ArrayCollection;
|
|
|
- import mx.controls.Alert;
|
|
|
import mx.events.FlexEvent;
|
|
|
-
|
|
|
+ import mx.managers.CursorManager;
|
|
|
[Bindable]
|
|
|
public var model:RyjbxxAddModel = new RyjbxxAddModel();
|
|
|
[Bindable]
|
|
|
public var enable:Boolean = true;
|
|
|
[Bindable]
|
|
|
public var functionId:Number;
|
|
|
+ public var uploadFile:FileReference=new FileReference;
|
|
|
|
|
|
protected function creationComplete(event:FlexEvent):void
|
|
|
{
|
|
@@ -37,33 +36,110 @@
|
|
|
model.vo.ssjyr=Global.user.jyrjcxx;
|
|
|
model.vo.szd=Global.user.szd;
|
|
|
}
|
|
|
+ browseFile.addEventListener(MouseEvent.CLICK,selectFile);
|
|
|
+ uploadFile.addEventListener(Event.SELECT,selectFileHandle);
|
|
|
+ uploadFile.addEventListener(Event.COMPLETE, uploadCompleteHandler);
|
|
|
+ uploadFile.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA,uploadCompleteDataHandler)
|
|
|
}
|
|
|
+ public function selectFile(e:Event):void
|
|
|
+ {
|
|
|
+ var images:FileFilter=new FileFilter("Images(*.jpg;*.gif;*.png;*.bmp)", "*.jpg;*.gif;*.png;*.bmp");
|
|
|
+ uploadFile.browse([images]);
|
|
|
+ }
|
|
|
|
|
|
+ private function doDeleteFile(vo:AccessoryVo):void
|
|
|
+ {
|
|
|
+ var delFileList:ArrayCollection = new ArrayCollection();
|
|
|
+ if(vo!=null)
|
|
|
+ delFileList.addItem(vo);
|
|
|
+ Utils.callRemote("accessoryController","deleteFj",null,model.vo.id,Constants.FJSSLX_RYJBXX,0,model.vo.tbdyid);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 文件上传
|
|
|
+ */
|
|
|
+ private function selectFileHandle(e:Event):void{
|
|
|
+ // 验证上传文件大小
|
|
|
+ if(!Utils.checkUploadFileSize(uploadFile))
|
|
|
+ {
|
|
|
+ var arr:Array = new Array();
|
|
|
+ arr.push(Global.upload_file_size);
|
|
|
+ Utils.showInfoMessage("msg.upload.FileSizeOutOfRange",arr);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(model.vo.zp!=null)
|
|
|
+ {
|
|
|
+ doDeleteFile(model.vo.zp);
|
|
|
+ }
|
|
|
+ model.vo.zp=new AccessoryVo;
|
|
|
+ model.vo.zp.name = uploadFile.name;
|
|
|
+ var params:URLVariables = new URLVariables();
|
|
|
+ params.entityId=model.vo.id;
|
|
|
+ params.entityType=Constants.FJSSLX_RYJBXX;
|
|
|
+ params.type=0;
|
|
|
+ var url:String;
|
|
|
+ url = Utils.getBaseUrl()+"upload.do;jsessionid="+Global.jsessionid;
|
|
|
+ var request:URLRequest = new URLRequest(url);
|
|
|
+ request.data = params;
|
|
|
+ request.method = URLRequestMethod.POST;
|
|
|
+ uploadFile.upload(request,"file");
|
|
|
+ CursorManager.setBusyCursor();
|
|
|
+ }
|
|
|
+ private function uploadCompleteHandler(e:Event):void
|
|
|
+ {
|
|
|
+ CursorManager.removeBusyCursor();
|
|
|
+ }
|
|
|
+ private function uploadCompleteDataHandler(event:DataEvent):void
|
|
|
+ {
|
|
|
+ if(event.data)
|
|
|
+ model.vo.zp.id = new Number(event.data);
|
|
|
+ //加载图片
|
|
|
+ uploadFile.load();
|
|
|
+ uploadFile.addEventListener(Event.COMPLETE,showTx);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 头像显示
|
|
|
+ */
|
|
|
+ private function showTx(e:Event):void
|
|
|
+ {
|
|
|
+ this.tx.source=uploadFile.data;
|
|
|
+ }
|
|
|
]]>
|
|
|
</fx:Script>
|
|
|
<s:VGroup width="100%" height="100%" paddingBottom="5" paddingLeft="5"
|
|
|
paddingRight="15" paddingTop="5">
|
|
|
<s:HGroup width="100%" verticalAlign="middle">
|
|
|
- <cus:QLabel width="18%" text="姓名" notNull="true"/>
|
|
|
- <cus:QTextInput width="30%" id="xm" text="@{model.vo.xm}" editable="{enable}"/>
|
|
|
- </s:HGroup>
|
|
|
- <s:HGroup width="100%" verticalAlign="middle">
|
|
|
- <cus:QLabel width="18%" text="证件类型" notNull="true"/>
|
|
|
- <cus:QComboBox id="zjlx" codeType="{Constants.GROUP_CODE_ZJLX}"
|
|
|
- comboxClass="CodeSelect" hasBlank="true"
|
|
|
- selectedVO="{model.vo.zjlx}" width="30%"
|
|
|
- enabled="{enable}"/>
|
|
|
- <cus:QLabel width="18%" text="证件号码" notNull="true"/>
|
|
|
- <cus:QTextInput width="30%" id="sfzh" text="@{model.vo.sfzh}" editable="{enable}" />
|
|
|
- </s:HGroup>
|
|
|
- <s:HGroup width="100%" horizontalAlign="left" verticalAlign="middle">
|
|
|
- <cus:QLabel text="所在地" width="18%" notNull="true"/>
|
|
|
- <cus:QComboBox id="szd" comboxClass="SzdEditSelect" hasBlank="false"
|
|
|
- selectedVO="{model.vo.szd==null?Global.user.szd:model.vo.szd}" width="30%" parentId="{Global.szd.id}"/>
|
|
|
- <cus:QLabel text="所在港区" width="18%" notNull="true"/>
|
|
|
- <cus:QComboBox id="szgq" comboxClass="GqBySzdSelect" parentId="{model.vo.szd==null?Global.user.szd:model.vo.szd}"
|
|
|
- selectedVO="{model.vo.ssgq}" hasBlank="false" width="30%" enabled="{enable}"/>
|
|
|
- </s:HGroup>
|
|
|
+ <s:VGroup width="50%">
|
|
|
+ <s:HGroup width="100%" horizontalAlign="left" verticalAlign="middle">
|
|
|
+ <cus:QLabel width="36%" text="姓名" notNull="true"/>
|
|
|
+ <cus:QTextInput width="60%" id="xm" text="@{model.vo.xm}" editable="{enable}"/>
|
|
|
+ </s:HGroup>
|
|
|
+ <s:HGroup width="100%" verticalAlign="middle">
|
|
|
+ <cus:QLabel width="36%" text="证件类型" notNull="true"/>
|
|
|
+ <cus:QComboBox id="zjlx" codeType="{Constants.GROUP_CODE_ZJLX}"
|
|
|
+ comboxClass="CodeSelect" hasBlank="true"
|
|
|
+ selectedVO="{model.vo.zjlx}" width="60%"
|
|
|
+ enabled="{enable}"/>
|
|
|
+ </s:HGroup>
|
|
|
+ <s:HGroup width="100%" verticalAlign="middle">
|
|
|
+ <cus:QLabel width="36%" text="证件号码" notNull="true"/>
|
|
|
+ <cus:QTextInput width="60%" id="sfzh" text="@{model.vo.sfzh}" editable="{enable}" />
|
|
|
+ </s:HGroup>
|
|
|
+ <s:HGroup width="100%" verticalAlign="middle">
|
|
|
+ <cus:QLabel text="所在地" width="36%" notNull="true"/>
|
|
|
+ <cus:QComboBox id="szd" comboxClass="SzdEditSelect" hasBlank="false"
|
|
|
+ selectedVO="{model.vo.szd==null?Global.user.szd:model.vo.szd}" width="60%" parentId="{Global.szd.id}"/>
|
|
|
+ </s:HGroup>
|
|
|
+ <s:HGroup width="100%" verticalAlign="middle">
|
|
|
+ <cus:QLabel text="所在港区" width="36%" notNull="true"/>
|
|
|
+ <cus:QComboBox id="szgq" comboxClass="GqBySzdSelect" parentId="{model.vo.szd==null?Global.user.szd:model.vo.szd}"
|
|
|
+ selectedVO="{model.vo.ssgq}" hasBlank="false" width="60%" enabled="{enable}"/>
|
|
|
+ </s:HGroup>
|
|
|
+ </s:VGroup>
|
|
|
+ <s:VGroup width="50%" horizontalAlign="left">
|
|
|
+ <s:Image id="tx" width="96" height="96"/>
|
|
|
+ <s:Button id="browseFile" width="96" label="{resourceManager.getString('common','btn.uploadPhoto')}" enabled="{enable}"/>
|
|
|
+ </s:VGroup>
|
|
|
+ </s:HGroup>
|
|
|
<s:HGroup width="100%" verticalAlign="middle">
|
|
|
<cus:QLabel width="18%" text="{resourceManager.getString('common','gkjyr')}" notNull="true"/>
|
|
|
<cus:QComboBox id="qymc" comboxClass="JyrSelect" parentId="{Global.szd}"
|