ShbpModel.as 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113
  1. package com.jtgh.yjpt.model.zysqbp
  2. {
  3. import com.jtgh.yjpt.common.BusinessContext;
  4. import com.jtgh.yjpt.common.Global;
  5. import com.jtgh.yjpt.common.IModule;
  6. import com.jtgh.yjpt.common.MyEvent;
  7. import com.jtgh.yjpt.common.component.ui.DataGridColumn;
  8. import com.jtgh.yjpt.common.component.ui.Pager;
  9. import com.jtgh.yjpt.common.component.ui.TitleWindow;
  10. import com.jtgh.yjpt.common.component.ui.ZysqbpPager;
  11. import com.jtgh.yjpt.common.util.Constants;
  12. import com.jtgh.yjpt.common.util.Utils;
  13. import com.jtgh.yjpt.model.BaseModel;
  14. import com.jtgh.yjpt.model.SystemModel;
  15. import com.jtgh.yjpt.model.task.TaskModel;
  16. import com.jtgh.yjpt.select.YesNoSelect;
  17. import com.jtgh.yjpt.view.access.UserEdit;
  18. import com.jtgh.yjpt.view.task.TaskLayout;
  19. import com.jtgh.yjpt.view.zysqbp.BgEdit;
  20. import com.jtgh.yjpt.view.zysqbp.FrxzxkLayout;
  21. import com.jtgh.yjpt.view.zysqbp.HsdbInfo;
  22. import com.jtgh.yjpt.view.zysqbp.HwpmTree;
  23. import com.jtgh.yjpt.view.zysqbp.MessageLayout;
  24. import com.jtgh.yjpt.view.zysqbp.QxEdit;
  25. import com.jtgh.yjpt.view.zysqbp.ZdspszView;
  26. import com.jtgh.yjpt.view.zysqbp.ZysqKgEdit;
  27. import com.jtgh.yjpt.view.zysqbp.ZysqWgEdit;
  28. import com.jtgh.yjpt.view.zysqbp.ZysqbpAudit;
  29. import com.jtgh.yjpt.view.zysqbp.ZysqbpCount;
  30. import com.jtgh.yjpt.view.zysqbp.ZysqbpEdit;
  31. import com.jtgh.yjpt.view.zysqbp.ZysqbpLayout;
  32. import com.jtgh.yjpt.view.zysqbp.ZysqbpView;
  33. import com.jtgh.yjpt.view.zysqbp.ZysqqxAudit;
  34. import com.jtgh.yjpt.view.zysqbp.count.WhzysbContainerCount;
  35. import com.jtgh.yjpt.view.zysqbp.count.WhzysbCount;
  36. import com.jtgh.yjpt.view.zysqbp.count.WhzysbCountBw;
  37. import com.jtgh.yjpt.view.zysqbp.count.WhzysbHuizongInformate;
  38. import com.jtgh.yjpt.view.zysqbp.count.WhzysbTabMain;
  39. import com.jtgh.yjpt.vo.access.UserVo;
  40. import com.jtgh.yjpt.vo.common.AccessoryVo;
  41. import com.jtgh.yjpt.vo.common.CodeVo;
  42. import com.jtgh.yjpt.vo.common.PagerVo;
  43. import com.jtgh.yjpt.vo.common.SinglePageRequestVo;
  44. import com.jtgh.yjpt.vo.common.TaskInfoVo;
  45. import com.jtgh.yjpt.vo.gkgq.GqVo;
  46. import com.jtgh.yjpt.vo.jyr.JyrVo;
  47. import com.jtgh.yjpt.vo.jyrxxgl.JyrxxglVo;
  48. import com.jtgh.yjpt.vo.zysqbp.ZysqbpBgVo;
  49. import com.jtgh.yjpt.vo.zysqbp.ZysqbpVo;
  50. import com.smapp.sg186.appframework.datamodel.ext.ReturnCode;
  51. import flash.display.DisplayObject;
  52. import flash.events.Event;
  53. import flash.events.MouseEvent;
  54. import flash.net.FileReference;
  55. import flash.net.URLRequest;
  56. import flash.net.URLRequestMethod;
  57. import flash.net.URLVariables;
  58. import flash.net.navigateToURL;
  59. import mx.binding.utils.BindingUtils;
  60. import mx.collections.ArrayCollection;
  61. import mx.collections.ArrayList;
  62. import mx.controls.Alert;
  63. import mx.core.FlexGlobals;
  64. import mx.events.CloseEvent;
  65. import mx.events.FlexEvent;
  66. import mx.formatters.DateFormatter;
  67. import mx.managers.CursorManager;
  68. import mx.managers.PopUpManager;
  69. import mx.rpc.events.ResultEvent;
  70. import mx.utils.ObjectUtil;
  71. import mx.utils.StringUtil;
  72. import spark.components.gridClasses.GridColumn;
  73. import spark.events.GridSortEvent;
  74. [Bindable]
  75. public class ShbpModel extends BaseModel
  76. {
  77. public var thisView:Object;
  78. public var thisDataList:ArrayCollection;
  79. public var sfsbList:ArrayCollection;
  80. public var pager:ZysqbpPager;
  81. public var editView:Object;
  82. public var model:Object;
  83. public var text:String;
  84. public function ShbpModel()
  85. {
  86. super(IModule.MODEL_004001);
  87. }
  88. public static var instance:ShbpModel=new ShbpModel();
  89. /**********************
  90. * 此方法只能调用一次
  91. */
  92. public function doCreationComplete(view:Object):void
  93. {
  94. thisView = view;
  95. var pageVo:SinglePageRequestVo = pager.pageVo;
  96. pageVo.direction = "desc";
  97. pageVo.sortField = "bgsj";
  98. BindingUtils.bindProperty(thisView.dataGrid,"dataProvider",this,"thisDataList");
  99. thisView.dataGrid.addEventListener(MouseEvent.DOUBLE_CLICK,toView);
  100. thisView.add.addEventListener(MouseEvent.CLICK,toAdd);
  101. thisView.edit.addEventListener(MouseEvent.CLICK, toEdit);
  102. thisView.del.addEventListener(MouseEvent.CLICK, doDel);
  103. // if(view is ZysqbpLayout)
  104. thisView.query.addEventListener(MouseEvent.CLICK,switchSearchBox);
  105. thisView.print.addEventListener(MouseEvent.CLICK,doPrint);
  106. // thisView.wfHistory.addEventListener(MouseEvent.CLICK,doWfHistory);
  107. thisView.qxzy.addEventListener(MouseEvent.CLICK,doQxzy);
  108. thisView.bgzy.addEventListener(MouseEvent.CLICK,doBgzy);
  109. // thisView.displayhs.addEventListener(MouseEvent.CLICK,doDisplayHS);
  110. thisView.copy.addEventListener(MouseEvent.CLICK,doCopy);
  111. doQuery(null);
  112. if(!Global.user.jyr ){//非经营人特有的按钮
  113. thisView.wfHistory.addEventListener(MouseEvent.CLICK,doWfHistory);
  114. thisView.dataGrid.addEventListener(MouseEvent.CLICK,showFlow);
  115. }else{
  116. }
  117. }
  118. /**
  119. * 开关查询框
  120. */
  121. private function switchSearchBox(event:MouseEvent):void{
  122. if(thisView.searchGroup.visible){
  123. thisView.searchGroup.visible=false;
  124. thisView.searchGroup.includeInLayout=false;
  125. }else{
  126. thisView.searchGroup.visible=true;
  127. thisView.searchGroup.includeInLayout=true;
  128. }
  129. }
  130. /**
  131. * 单击记录显示流程
  132. */
  133. private function showFlow(event:MouseEvent):void{
  134. // 获取选中项
  135. var vo:ZysqbpVo = thisView.dataGrid.selectedItem as ZysqbpVo;
  136. if(vo==null){
  137. return;
  138. }
  139. /* Set PassNodesCode*/
  140. var nodesCode:Array=new Array();
  141. for(var i:int=0; i<vo.taskList.length; i++){
  142. var task:TaskInfoVo = vo.taskList.getItemAt(i) as TaskInfoVo;
  143. nodesCode.push(task.currName);//trace(task.currName);
  144. }
  145. if(vo.recordStatus == 2){// 流程完成
  146. nodesCode.push("zdsgyhpc_rk");
  147. nodesCode.push("zdsgyhpc_cxtj");
  148. }
  149. thisView.flowDisplay.passNodesCode=nodesCode;// 更新流程显示
  150. }
  151. /**
  152. * 下载
  153. */
  154. public function downloadFile(vo:ZysqbpVo):void
  155. {
  156. var acc:AccessoryVo = vo.accessory;
  157. var url:String = Utils.getBaseUrl()+"download.do";
  158. var request:URLRequest = new URLRequest(url);
  159. var params:URLVariables = new URLVariables();
  160. params.accessoryId=acc.id;
  161. request.data = params;
  162. request.method = URLRequestMethod.POST;
  163. navigateToURL(request,"_self");
  164. }
  165. public function doWfHistory(event:MouseEvent):void
  166. {
  167. //检查选中项
  168. if(thisView.dataGrid.selectedIndex==-1){
  169. Utils.showInfoMessage("msg.select.one");
  170. return;
  171. }
  172. // 获取选中项
  173. var zysqbp:ZysqbpVo = thisView.dataGrid.selectedItem as ZysqbpVo;
  174. Utils.showWfHistory("zysbsp-city",zysqbp.id.toString(),FlexGlobals.topLevelApplication as DisplayObject);
  175. }
  176. /**
  177. * 新增页面跳转
  178. */
  179. public function toAdd(event:MouseEvent):void
  180. {
  181. if(Global.user.sfjyr=="Y"&&Global.user.sfyxzysq=="N"){
  182. Alert.show("该权限已被锁定","提示");
  183. return ;
  184. }
  185. editView = new ZysqbpEdit();
  186. editView.zysqbp = new ZysqbpVo();
  187. editView.functionId= Utils.getFunctionId(thisView);
  188. editView.model=this;
  189. Utils.popupWindow("危货作业申报申请",editView as DisplayObject,FlexGlobals.topLevelApplication as DisplayObject,thisView.pager.doQuery,780, 600);
  190. }
  191. /**
  192. * 窗口关闭
  193. */
  194. public function doCloseThis():void{
  195. editView.dispatchEvent(new CloseEvent(CloseEvent.CLOSE));
  196. doQuery(null);
  197. }
  198. /**
  199. * 双击显示查看用户
  200. */
  201. public function toView(event:MouseEvent):void
  202. {
  203. //检查选中项
  204. if(thisView.dataGrid.selectedIndex==-1){
  205. Utils.showInfoMessage("msg.select.one");
  206. return;
  207. }
  208. // 获取选中项
  209. var zysqbp:ZysqbpVo = thisView.dataGrid.selectedItem as ZysqbpVo;
  210. editView = new ZysqbpView();
  211. editView.model = this;
  212. editView.zysqbp = zysqbp;
  213. if(zysqbp.recordStatus!=Constants.RECORD_STATE_COMPLETED&&zysqbp.recordStatus!=Constants.RECORD_STATE_CALEL){//审核已经完成的数据才能显示签章
  214. editView.qianzhang=false;
  215. }
  216. editView.enable = false;
  217. if(null != zysqbp.zydd){
  218. editView.zydd = zysqbp.zydd.id;
  219. }
  220. Utils.popupWindow(resourceManager.getString('common','btn.view'), editView as DisplayObject, FlexGlobals.topLevelApplication as DisplayObject, thisView.pager.doQuery, 0, 0);
  221. Utils.callRemote("zysqbpController","compare",function (r:ResultEvent):void{},zysqbp);
  222. }
  223. /**
  224. * 编辑
  225. */
  226. public function toEdit(event:MouseEvent):void
  227. {
  228. //检查选中项
  229. if(thisView.dataGrid.selectedIndex==-1){
  230. Utils.showInfoMessage("msg.select.one");
  231. return;
  232. }
  233. //只有在未提交状态下能删除,在未提交和退回重提状态下能编辑,前者能保存,能提交,后者不能保存,只能提交
  234. if(!editOrDelEnable(thisView.dataGrid.selectedItem as ZysqbpVo))//如果数据处于提交或者完成状态,不能编辑页不能删除
  235. return;
  236. // 获取选中项
  237. var zysqbp:ZysqbpVo = thisView.dataGrid.selectedItem as ZysqbpVo;
  238. editView = new ZysqbpEdit();
  239. //if(zysqbp.recordStatus==Constants.RECORD_STATE_REJECT){//如果是退回重提的,只能提交
  240. // editView.addSave.enabled=false;
  241. //}
  242. if(zysqbp.recordStatus==Constants.RECORD_STATE_SUBMIT){//如果是审核中,只能编辑
  243. editView.submitBtn.enabled=false;
  244. }
  245. editView.zysqbp = zysqbp;
  246. editView.model=this;
  247. editView.mode = Constants.mode_edit;
  248. editView.thisModel.thisView=editView;
  249. if(null != zysqbp.zydd){
  250. editView.zydd = zysqbp.zydd.id;
  251. }
  252. Utils.popupWindow(resourceManager.getString('common','btn.edit'), editView as DisplayObject, FlexGlobals.topLevelApplication as DisplayObject, thisView.pager.doQuery, 780, 600);
  253. }
  254. /**
  255. * 是否有附件
  256. */
  257. public function showFile(vo:ZysqbpVo):Boolean
  258. {
  259. if(vo!=null&&vo.accessory!=null)
  260. {
  261. return true;
  262. }
  263. return false;
  264. }
  265. /**
  266. * 附件名称
  267. */
  268. public function showFileName(vo:ZysqbpVo):String
  269. {
  270. if(vo!=null&&vo.accessory!=null)
  271. {
  272. return vo.accessory.name;
  273. }
  274. return "";
  275. }
  276. /**
  277. * 返回选中的记录
  278. */
  279. private function getSelectedRecords():ArrayCollection
  280. {
  281. var items:Vector.<Object> = thisView.dataGrid.selectedItems;
  282. var records:ArrayCollection = new ArrayCollection();
  283. if(items != null)
  284. {
  285. for(var i : int=0;i< items.length;i++){
  286. var obj:ZysqbpVo = ZysqbpVo(items[i]);
  287. records.addItem(obj);
  288. }
  289. }
  290. return records;
  291. }
  292. /**
  293. * 删除用户
  294. */
  295. public function doDel(event:MouseEvent):void
  296. {
  297. //检查选中项
  298. var records:ArrayCollection = getSelectedRecords();
  299. if(records.length == 0){
  300. Utils.showInfoMessage("msg.select");
  301. return;
  302. }
  303. Utils.doDelConfirm(function():void
  304. {
  305. if((thisView.dataGrid.selectedItem as ZysqbpVo).recordStatus!=Constants.RECORD_STATE_VALID){
  306. Alert.show(instance.resourceManager.getString("common","state.ytj"),resourceManager.getString("common","tip"));
  307. return ;
  308. }
  309. /* 删除操作 */
  310. Utils.callRemote("zysqbpController", "doDelete", function(res:ResultEvent):void{
  311. var bc:BusinessContext=res.result as BusinessContext;
  312. Alert.show(Utils.getTopMsg(bc.msgs).localeLabel,resourceManager.getString('common','tip'));
  313. doQuery(null);
  314. }, records);
  315. });
  316. }
  317. /**
  318. * 回调函数,通过r.token.message["operation"]区分调用的方法名
  319. */
  320. public function resultCallback(r:ResultEvent):void
  321. {
  322. var doAction:String = r.token.message["operation"];
  323. var bc:BusinessContext=r.result as BusinessContext;
  324. if(null == bc){
  325. return;
  326. }
  327. //check error msgs
  328. if(Utils.checkMsgError(bc.msgs))
  329. {
  330. Alert.show(Utils.getFirstErrorMsg(bc.msgs).localeLabel,resourceManager.getString("common","errorTitle"));
  331. return;
  332. }
  333. if(doAction == "list")
  334. {
  335. sfsbList = bc.getAttribute("sfsbList") as ArrayCollection;
  336. thisDataList = bc.getAttribute("records") as ArrayCollection;
  337. thisView.pager.pageVo.totalCount = bc.getAttribute("totalCount") as int;
  338. queryBty();
  339. return;
  340. }
  341. else if(doAction == "listNoFlow"){
  342. sfsbList = bc.getAttribute("sfsbList") as ArrayCollection;
  343. thisDataList = bc.getAttribute("records") as ArrayCollection;
  344. thisView.pager.pageVo.totalCount = bc.getAttribute("totalCount") as int;
  345. return;
  346. }
  347. else if(doAction == "deleteUser")
  348. {
  349. doQuery(null);
  350. return;
  351. } else if(doAction == "countStatus"){
  352. var btgs:int = bc.getAttribute("btgs") as int;
  353. var ths:int = bc.getAttribute("ths") as int;
  354. text="不通过"+"<font color='#ff0000'>" + btgs + "</font>" + "条,退回"+
  355. "<font color='#ff0000'>" + ths + "</font>" + "条";
  356. thisView.pager.extraText=text;
  357. return;
  358. }
  359. }
  360. /**
  361. * 查询
  362. */
  363. public function doQuery(e:Event):void{
  364. queryByFlowDisplay=false;
  365. if(thisView.pager!=null){
  366. thisView.pager.doQuery();
  367. }
  368. }
  369. /**
  370. * 显示海事申报货物信息
  371. */
  372. public function doDisplayHS(e:Event):void{
  373. thisView.zysblayout.visible=false;
  374. thisView.hssblayout.model.doQuery(null);
  375. }
  376. /**
  377. * 分页
  378. */
  379. private var queryByFlowDisplay:Boolean = false;
  380. public function pageQuery(pager:SinglePageRequestVo):void
  381. {
  382. var queryOperation:String;
  383. //查询一览
  384. var vo:ZysqbpVo = new ZysqbpVo();
  385. if(null !=thisView.query_gk.selectedVO&&"NaN"!=(thisView.query_gk.selectedVO as CodeVo).id.toString()){
  386. vo.szd = thisView.query_gk.selectedVO as CodeVo;
  387. }
  388. if(null != thisView.query_gq.selectedVO){
  389. vo.szgq = thisView.query_gq.selectedVO as GqVo;
  390. }
  391. if(null!=thisView.query_gkdw2.selectedVO){
  392. vo.zydw = thisView.query_gkdw2.selectedVO as JyrVo;
  393. }
  394. vo.bh = thisView.query_bh.text;
  395. vo.mao = thisView.mao.textValue as String;
  396. vo.cm = thisView.query_hmhc.text;
  397. vo.wxwpmc = thisView.query_hwpmbh.text;
  398. vo.wxhwmcbh = thisView.query_hwpm.text;
  399. vo.recordStatus=9;
  400. if(undefined != thisView.query_rwzt.selectedItem && ""!=thisView.query_rwzt.selectedItem.id){
  401. vo.recordStatus =new Number(thisView.query_rwzt.selectedItem.id);
  402. }
  403. // vo.jcg=thisView.jcg.text;
  404. //根据流程状态查询
  405. var lcStatus:String = "";
  406. if(queryByFlowDisplay){
  407. if(Global.deployMode=="0"){//省级 只能点击省级部分的节点
  408. if(selectedNodeName!= "查询与统计"&&selectedNodeName!="入库"){
  409. return;
  410. }else{
  411. lcStatus = selectedNodeName;
  412. }
  413. }else{//市级只能点击所在地和经营人的节点
  414. if(selectedNodeName == "zdsgyhpc_cxtj"||selectedNodeName=="查询"){
  415. }else if(selectedNodeName== "查询与统计"||selectedNodeName=="入库"){
  416. return;
  417. }else{
  418. lcStatus = selectedNodeName;
  419. }
  420. }
  421. }
  422. Utils.callRemote("zysqbpController","list",resultCallback,pager,
  423. Utils.getFunctionId(thisView),vo,lcStatus,
  424. thisView.query_bgsj_1.dateTime,thisView.query_bgsj_2.dateTime,
  425. thisView.query_kgsj_1.dateTime,thisView.query_kgsj_2.dateTime,
  426. thisView.query_wgsj_1.dateTime,thisView.query_wgsj_2.dateTime,
  427. thisView.query_shr.text,thisView.query_gkdw.text
  428. );
  429. }
  430. /**
  431. * 查询不同意数和退回数
  432. */
  433. public function queryBty():void
  434. {
  435. var queryOperation:String;
  436. //查询一览
  437. var vo:ZysqbpVo = new ZysqbpVo();
  438. if(null !=thisView.query_gk.selectedVO&&"NaN"!=(thisView.query_gk.selectedVO as CodeVo).id.toString()){
  439. vo.szd = thisView.query_gk.selectedVO as CodeVo;
  440. }
  441. if(null != thisView.query_gq.selectedVO){
  442. vo.szgq = thisView.query_gq.selectedVO as GqVo;
  443. }
  444. if(null!=thisView.query_gkdw2.selectedVO){
  445. vo.zydw = thisView.query_gkdw2.selectedVO as JyrVo;
  446. }
  447. vo.bh = thisView.query_bh.text;
  448. vo.mao = thisView.mao.textValue as String;
  449. vo.cm = thisView.query_hmhc.text;
  450. vo.wxwpmc = thisView.query_hwpmbh.text;
  451. vo.wxhwmcbh = thisView.query_hwpm.text;
  452. vo.recordStatus=9;
  453. if(undefined != thisView.query_rwzt.selectedItem && ""!=thisView.query_rwzt.selectedItem.id){
  454. vo.recordStatus =new Number(thisView.query_rwzt.selectedItem.id);
  455. }
  456. // vo.jcg=thisView.jcg.text;
  457. //根据流程状态查询
  458. var lcStatus:String = "";
  459. if(queryByFlowDisplay){
  460. if(Global.deployMode=="0"){//省级 只能点击省级部分的节点
  461. if(selectedNodeName!= "查询与统计"&&selectedNodeName!="入库"){
  462. return;
  463. }else{
  464. lcStatus = selectedNodeName;
  465. }
  466. }else{//市级只能点击所在地和经营人的节点
  467. if(selectedNodeName == "zdsgyhpc_cxtj"||selectedNodeName=="查询"){
  468. }else if(selectedNodeName== "查询与统计"||selectedNodeName=="入库"){
  469. return;
  470. }else{
  471. lcStatus = selectedNodeName;
  472. }
  473. }
  474. }
  475. Utils.callRemote("zysqbpController","countStatus",resultCallback,
  476. Utils.getFunctionId(thisView),vo,lcStatus,
  477. thisView.query_bgsj_1.dateTime,thisView.query_bgsj_2.dateTime,
  478. thisView.query_kgsj_1.dateTime,thisView.query_kgsj_2.dateTime,
  479. thisView.query_wgsj_1.dateTime,thisView.query_wgsj_2.dateTime,
  480. thisView.query_shr.text,thisView.query_gkdw.text
  481. );
  482. }
  483. /**
  484. * 打印
  485. */
  486. public function doPrint(e:Event):void{
  487. var vo:ZysqbpVo;
  488. vo=new ZysqbpVo;
  489. if(null !=thisView.query_gk.selectedVO&&"NaN"!=(thisView.query_gk.selectedVO as CodeVo).id.toString()){
  490. vo.szd = thisView.query_gk.selectedVO as CodeVo;
  491. }
  492. if(null != thisView.query_gq.selectedVO){
  493. vo.szgq = thisView.query_gq.selectedVO as GqVo;
  494. }
  495. if(null!=thisView.query_gkdw2.selectedVO){
  496. vo.zydw = thisView.query_gkdw2.selectedVO as JyrVo;
  497. }
  498. var status:String ="";
  499. if(undefined != thisView.query_rwzt.selectedItem){
  500. status=thisView.query_rwzt.selectedItem.id;
  501. }
  502. vo.bh = thisView.query_bh.text;
  503. vo.mao = thisView.mao.textValue as String;
  504. vo.cm = thisView.query_hmhc.text;
  505. vo.wxwpmc = thisView.query_hwpm.text;
  506. vo.wxhwmcbh = thisView.query_hwpmbh.text;
  507. //根据流程状态查询
  508. var lcStatus:String = "";
  509. if(queryByFlowDisplay){
  510. if(Global.deployMode=="0"){//省级 只能点击省级部分的节点
  511. if(selectedNodeName!= "查询与统计"&&selectedNodeName!="入库"){
  512. }else{
  513. lcStatus = selectedNodeName;
  514. }
  515. }else{//市级只能点击所在地和经营人的节点
  516. if(selectedNodeName == "zdsgyhpc_cxtj"||selectedNodeName=="查询"){
  517. }else if(selectedNodeName== "查询与统计"||selectedNodeName=="入库"){
  518. }else{
  519. lcStatus = selectedNodeName;
  520. }
  521. }
  522. }
  523. var title:String="危货作业申报";
  524. var columns:ArrayList=thisView.dataGrid.columns as ArrayList;
  525. var headers:Array=new Array;
  526. for each(var column:DataGridColumn in columns.source){
  527. if(column.visible&&""!=column.headerText&&"附件下载"!=column.headerText&&resourceManager.getString('common','btn.cz')!=column.headerText)
  528. headers.push(column.headerText);
  529. }
  530. var fomaterDate:DateFormatter=new DateFormatter();
  531. fomaterDate.formatString="YYYY-MM-DD";
  532. var param:Vector.<String>=new Vector.<String>();
  533. param.push(
  534. vo.cm,
  535. vo.wxhwmcbh,
  536. thisView.query_gkdw.text,
  537. null==vo.szd?"":vo.szd.id+"",
  538. null==vo.szgq?"":vo.szgq.id+"",
  539. lcStatus,
  540. Utils.getFunctionId(thisView)+"",
  541. vo.mao,
  542. null==thisView.query_bgsj_1.dateTime?"":fomaterDate.format(thisView.query_bgsj_1.dateTime),
  543. null==thisView.query_bgsj_2.dateTime?"":fomaterDate.format(thisView.query_bgsj_2.dateTime),
  544. null==thisView.query_kgsj_1.dateTime?"":fomaterDate.format(thisView.query_kgsj_1.dateTime),
  545. null==thisView.query_kgsj_2.dateTime?"":fomaterDate.format(thisView.query_kgsj_2.dateTime),
  546. null==thisView.query_wgsj_1.dateTime?"":fomaterDate.format(thisView.query_wgsj_1.dateTime),
  547. null==thisView.query_wgsj_2.dateTime?"":fomaterDate.format(thisView.query_wgsj_2.dateTime),
  548. vo.bh,
  549. status,
  550. thisView.query_shr.text,
  551. null==vo.zydw?"":vo.zydw.id+"",
  552. vo.wxwpmc
  553. );
  554. var params:URLVariables = new URLVariables();
  555. params.title=title;
  556. params.headers=headers;
  557. params.controller="zysqbpController";
  558. params.method="print";
  559. params.param=param;
  560. var url:String = Utils.getBaseUrl()+"exportExcel.do";
  561. var request:URLRequest = new URLRequest(url);
  562. request.data = params;
  563. request.method = URLRequestMethod.POST;
  564. var file:FileReference = new FileReference();
  565. file.addEventListener(Event.COMPLETE, downloadCompleteHandler);
  566. file.addEventListener(Event.CANCEL, downloadCompleteHandler);
  567. file.download(request, title+".xls");
  568. CursorManager.setBusyCursor();
  569. }
  570. private function downloadCompleteHandler(event:Event):void {
  571. CursorManager.removeBusyCursor();
  572. }
  573. /**
  574. * 根据流程节点查询
  575. */
  576. private var selectedNodeName:String;
  577. public function nodeClick(nodeName:String):void{
  578. queryByFlowDisplay=true;
  579. selectedNodeName = nodeName;
  580. this.thisView.pager.doQuery();
  581. }
  582. //显示开工情况的名称
  583. public function showKgqkName(vo:ZysqbpVo):String{
  584. if(vo.recordStatus!=Constants.RECORD_STATE_COMPLETED&&vo.recordStatus!=Constants.RECORD_STATE_BGCOMPLETED)
  585. return "";
  586. else{
  587. if(vo.kgzt=='N')
  588. return "未开工";
  589. else if(vo.kgzt=='Y')
  590. return "已开工";
  591. }
  592. return "";
  593. }
  594. //显示完工情况的名称
  595. public function showWgqkName(vo:ZysqbpVo):String{
  596. if(vo.recordStatus!=Constants.RECORD_STATE_COMPLETED&&vo.recordStatus!=Constants.RECORD_STATE_BGCOMPLETED)
  597. return "";
  598. else{
  599. if(vo.wgzt=='N')
  600. return "未完工";
  601. else if(vo.wgzt=='Y')
  602. return "已完工";
  603. }
  604. return "";
  605. }
  606. //开工按钮是否可点
  607. public function KgEnble(vo:ZysqbpVo):Boolean
  608. {
  609. // if(Global.user.id!=vo.addUser.id)
  610. // return false;
  611. //数据为完成或者变更完成状态并且 当前不是经营人,可以查看修改保存
  612. if((vo.recordStatus==Constants.RECORD_STATE_COMPLETED||vo.recordStatus==Constants.RECORD_STATE_BGCOMPLETED)&&(Global.user.sfjyr==YesNoSelect.NO)){
  613. return true;
  614. }
  615. //数据为完成或者变更完成状态并且 当前不是经营人,可以查看修改保存
  616. if((vo.recordStatus==Constants.RECORD_STATE_COMPLETED||vo.recordStatus==Constants.RECORD_STATE_BGCOMPLETED)
  617. &&(vo.kgsj==null || vo.kgzt !="Y"))
  618. return true;
  619. else
  620. return false;
  621. }
  622. //开工按钮是否可点
  623. public function WgEnble(vo:ZysqbpVo):Boolean
  624. {
  625. //数据为完成或者变更完成状态并且 当前不是经营人,可以查看修改保存
  626. if((vo.recordStatus==Constants.RECORD_STATE_COMPLETED||vo.recordStatus==Constants.RECORD_STATE_BGCOMPLETED)&&(Global.user.sfjyr==YesNoSelect.NO)){
  627. return true;
  628. }
  629. //数据为完成或者变更完成状态并且 当前不是经营人,可以查看修改保存
  630. if((vo.recordStatus==Constants.RECORD_STATE_COMPLETED||vo.recordStatus==Constants.RECORD_STATE_BGCOMPLETED)
  631. &&(vo.wgsj==null||vo.wgzt!="Y"))
  632. return true;
  633. else
  634. return false;
  635. }
  636. /**开工按钮处理事件*/
  637. public function KgHandle(vo:ZysqbpVo):void
  638. {
  639. var view:ZysqKgEdit=new ZysqKgEdit();
  640. view.vo=vo;
  641. view.model=this;
  642. Utils.popupWindow("开工情况", view, FlexGlobals.topLevelApplication as DisplayObject, thisView.pager.doQuery, 600, 300);
  643. }
  644. /**完工按钮处理事件*/
  645. public function WgHandle(vo:ZysqbpVo):void
  646. {
  647. var view:ZysqWgEdit=new ZysqWgEdit();
  648. view.vo=vo;
  649. view.model=this;
  650. Utils.popupWindow("完工情况", view, FlexGlobals.topLevelApplication as DisplayObject, thisView.pager.doQuery, 600, 300);
  651. }
  652. public function doViewPop(id:Number,mode:String,taskModel:TaskModel):void{
  653. var editView:ZysqbpAudit=new ZysqbpAudit();
  654. if(taskModel!=null&&instance.thisView is TaskLayout)
  655. editView.model = instance;
  656. else
  657. editView.model = this;
  658. Utils.callRemote("zysqbpController","doViewInit",function (r:ResultEvent):void{
  659. var bc:BusinessContext=r.result as BusinessContext;
  660. var vo:ZysqbpVo=bc.result as ZysqbpVo;
  661. editView.taskModel=taskModel;
  662. editView.zysqbp=vo;
  663. editView.mode=mode;
  664. Utils.popupWindow("审核",editView as DisplayObject,FlexGlobals.topLevelApplication as DisplayObject);
  665. },id)
  666. }
  667. public function dolistView(id:Number):void{
  668. Utils.callRemote("zysqbpController","doViewInit",function (r:ResultEvent):void{
  669. var bc:BusinessContext=r.result as BusinessContext;
  670. var vo:ZysqbpVo=bc.result as ZysqbpVo;
  671. var editView:ZysqbpAudit=new ZysqbpAudit();
  672. editView.zysqbp=vo;
  673. editView.model = this;
  674. Utils.popupWindow("审核",editView as DisplayObject,FlexGlobals.topLevelApplication as DisplayObject);
  675. },id)
  676. }
  677. /**
  678. * 开工报告超过72个小时过期
  679. */
  680. public function rowColorFunction(item:ZysqbpVo):uint
  681. {
  682. var bgsj:Date=item.bgsj;
  683. var currentDate:Date= new Date();
  684. currentDate.date -= 3;
  685. if(bgsj!=null&&item.wgsj==null&&ObjectUtil.dateCompare(bgsj,currentDate)<0&&item.recordStatus==Constants.RECORD_STATE_COMPLETED)
  686. return 0xff6666;
  687. return 0xffffff;
  688. }
  689. /**
  690. * 排序方法
  691. */
  692. public function doSort(e:GridSortEvent):void
  693. {
  694. var sortColumn:GridColumn = thisView.dataGrid.columns.getItemAt(e.columnIndices[0]) as GridColumn;
  695. var sortField:String = sortColumn.dataField;
  696. var pageVo:SinglePageRequestVo = thisView.pager.pageVo;
  697. if(pageVo.sortField == sortField)
  698. {
  699. if(sortColumn.sortDescending)
  700. {
  701. pageVo.direction = Constants.SORT_DIRECTION_ASC;
  702. sortColumn.sortDescending = false;
  703. }
  704. else
  705. {
  706. pageVo.direction = Constants.SORT_DIRECTION_DESC;
  707. sortColumn.sortDescending = true;
  708. }
  709. }
  710. else
  711. {
  712. pageVo.sortField = sortField;
  713. pageVo.direction = Constants.SORT_DIRECTION_ASC;
  714. sortColumn.sortDescending = false;
  715. }
  716. doQuery(null);
  717. }
  718. /**
  719. * 待办任务页面调用
  720. */
  721. public static function showWorkflow(busId:String,mode:String,layout:DisplayObject,taskModel:TaskModel):void
  722. {
  723. instance.thisView=layout;
  724. Utils.callRemote("zysqbpController","doViewInit",function (r:ResultEvent):void{
  725. var bc:BusinessContext=r.result as BusinessContext;
  726. var vo:ZysqbpVo=bc.result as ZysqbpVo;
  727. if("view"==mode){
  728. var editView:ZysqbpView=new ZysqbpView();
  729. editView.zysqbp=vo;
  730. editView.enable = false;
  731. if(null != vo.zydd){
  732. editView.zydd = vo.zydd.id;
  733. }
  734. Utils.popupWindow(instance.resourceManager.getString('common','btn.view'), editView as DisplayObject, FlexGlobals.topLevelApplication as DisplayObject, null, 0, 0);
  735. }else{
  736. if(vo.recordStatus==Constants.RECORD_STATE_SUBMIT){//点击办理,如果是退回重提,到编辑页面,如果是提交中,跳刀审核页面
  737. instance.doViewPop(new Number(busId),"audit",taskModel);
  738. }else if(vo.recordStatus==Constants.RECORD_STATE_REJECT){
  739. var edit:ZysqbpEdit = new ZysqbpEdit();
  740. edit.addSave.enabled=false;
  741. edit.zysqbp = vo;
  742. edit.taskModel=taskModel;
  743. if(null != vo.zydd){
  744. edit.zydd = vo.zydd.id;
  745. }
  746. Utils.popupWindow(instance.resourceManager.getString('common','btn.edit'), edit as DisplayObject, FlexGlobals.topLevelApplication as DisplayObject,null, 780, 600);
  747. }
  748. }
  749. },new Number(busId))
  750. }
  751. //判断数据可以不可以编辑和删除
  752. private function editOrDelEnable(vo:ZysqbpVo):Boolean{//如果数据不是1状态,不能删除和编辑
  753. if(vo.recordStatus==Constants.RECORD_STATE_COMPLETED||vo.recordStatus==Constants.RECORD_STATE_CALEL
  754. || vo.recordStatus== Constants.RECORD_STATE_REJECT){
  755. Alert.show(instance.resourceManager.getString("common","state.ywc"),resourceManager.getString("common","tip"));
  756. return false;
  757. }
  758. if(vo.recordStatus!=Constants.RECORD_STATE_VALID
  759. &&vo.recordStatus!=Constants.RECORD_STATE_SUBMIT){
  760. Alert.show(instance.resourceManager.getString("common","state.shz"),resourceManager.getString("common","tip"));
  761. return false;
  762. }
  763. if(vo.recordStatus==Constants.RECORD_STATE_SUBMIT && Global.user.cd){
  764. Alert.show(instance.resourceManager.getString("common","state.shz"),resourceManager.getString("common","tip"));
  765. return false;
  766. }
  767. return true
  768. }
  769. //统计查询
  770. /** 统计处理 */
  771. public function doCountHandler(event:MouseEvent):void
  772. {
  773. var view:WhzysbCount= new WhzysbCount();
  774. Utils.popupWindow(resourceManager.getString('common','btn.count'),view as DisplayObject,thisView as DisplayObject);
  775. }
  776. /** 集装箱统计处理 */
  777. public function doContainerCountHandler(event:MouseEvent):void
  778. {
  779. var view:WhzysbContainerCount= new WhzysbContainerCount();
  780. Utils.popupWindow(resourceManager.getString('common','btn.count'),view as DisplayObject,thisView as DisplayObject);
  781. }
  782. //汇总功能
  783. public function gather(event:MouseEvent):void{
  784. var view:WhzysbHuizongInformate=new WhzysbHuizongInformate() ;
  785. Utils.popupWindow(resourceManager.getString('common','btn.gather1'),view as DisplayObject,thisView as DisplayObject);
  786. }
  787. //汇总功能
  788. public function gather1(event:MouseEvent):void{
  789. //var view:WhzysbCount1=new WhzysbCount1() ;
  790. var view:WhzysbTabMain = new WhzysbTabMain();
  791. Utils.popupWindow(resourceManager.getString('common','btn.count'),view as DisplayObject,thisView as DisplayObject);
  792. }
  793. //===================================================
  794. //取消作业
  795. public function doQxzy(event:MouseEvent):void{
  796. var zysqbp:ZysqbpVo = thisView.dataGrid.selectedItem as ZysqbpVo;
  797. if(zysqbp==null){
  798. Alert.show("请选择一条数据","提示");
  799. return;
  800. }
  801. if(zysqbp.recordStatus==Constants.RECORD_STATE_CALEL){
  802. Alert.show("该数据已作废","提示");
  803. return;
  804. }
  805. if(zysqbp.recordStatus!=Constants.RECORD_STATE_COMPLETED&&zysqbp.recordStatus!=Constants.RECORD_STATE_BGCOMPLETED){//状态为已完成才能取消,取消后便不可进行开工完工
  806. Alert.show("该数据暂时不能取消作业","提示");
  807. return;
  808. }
  809. if(zysqbp.kgzt=="Y" ){
  810. Alert.show("该数据已进行开工,不能变更!","提示");
  811. return;
  812. }
  813. // var dif:Number;
  814. // if(zysqbp.xsscTask!=null){
  815. // dif = (Number(new Date)-Number(zysqbp.xsscTask.auditTime))/3600000;
  816. //
  817. // }else{
  818. // dif = (Number(new Date)-Number(zysqbp.zdspTask.auditTime))/3600000;
  819. // }
  820. // if(dif>48000){
  821. // Alert.show("超出法规时限期限","提示");
  822. // return;
  823. // }
  824. // Alert.show("确认取消作业?","提示",Alert.YES | Alert.NO,null,
  825. // function (closeEvt:CloseEvent):void
  826. // {
  827. // if(closeEvt.detail == Alert.YES){
  828. // Utils.callRemote("zysqbpController","doQxzy",function(r:ResultEvent):void{
  829. // var bc:BusinessContext = r.result as BusinessContext;
  830. // if(bc.getAttribute("info")=="success"){
  831. // Alert.show("取消提交成功,请等待审核","提示");
  832. // doQuery(null);
  833. // }
  834. // },zysqbp);
  835. // }
  836. // }
  837. // );
  838. var view:QxEdit = new QxEdit;
  839. view.model=this;
  840. view.vo = zysqbp;
  841. Utils.popupWindow("危货作业取消", view, FlexGlobals.topLevelApplication as DisplayObject, null, 600, 150);
  842. }
  843. //取消作业办理
  844. public function doqxAudit(id:Number,mode:String,taskModel:TaskModel):void{
  845. var editView:ZysqqxAudit = new ZysqqxAudit();
  846. if(taskModel!=null&&instance.thisView is TaskLayout)
  847. editView.model = instance;
  848. else
  849. editView.model = this;
  850. Utils.callRemote("zysqbpController","doViewInit",function (r:ResultEvent):void{
  851. var bc:BusinessContext=r.result as BusinessContext;
  852. var vo:ZysqbpVo=bc.result as ZysqbpVo;
  853. editView.taskModel=taskModel;
  854. editView.zysqbp=vo;
  855. editView.mode=Constants.mode_audit;
  856. Utils.popupWindow("取消作业审核",editView as DisplayObject,FlexGlobals.topLevelApplication as DisplayObject);
  857. },id)
  858. }
  859. //变更作业
  860. public function doBgzy(event:MouseEvent):void{
  861. var zysqbp:ZysqbpVo = thisView.dataGrid.selectedItem as ZysqbpVo;
  862. if(zysqbp==null){
  863. Alert.show("请选择一条数据","提示");
  864. return;
  865. }
  866. if(zysqbp.recordStatus==Constants.RECORD_STATE_CALEL){
  867. Alert.show("该数据已作废","提示");
  868. return;
  869. }
  870. if(zysqbp.recordStatus!=Constants.RECORD_STATE_COMPLETED){//状态为2和10时可以变更
  871. Alert.show("该数据暂时不能变更","提示");
  872. return;
  873. }
  874. if(zysqbp.kgzt=="Y" ){
  875. Alert.show("该数据已进行开工,不能变更!","提示");
  876. return;
  877. }
  878. var dif:Number;
  879. if(zysqbp.xsscTask!=null){
  880. dif = (Number(new Date)-Number(zysqbp.xsscTask.auditTime))/3600000;
  881. }else{
  882. dif = (Number(new Date)-Number(zysqbp.zdspTask.auditTime))/3600000;
  883. }
  884. // if(dif>48000){
  885. // Alert.show("超出法规时限期限","提示");
  886. // return;
  887. // }
  888. var view:BgEdit = new BgEdit();
  889. view.model=this;
  890. view.vo = zysqbp;
  891. view.bgvo = new ZysqbpBgVo;
  892. Utils.popupWindow("危货作业变更", view, FlexGlobals.topLevelApplication as DisplayObject, null, 600, 360);
  893. }
  894. //变更作业办理
  895. public function dobgAudit(id:Number,mode:String,taskModel:TaskModel):void{
  896. var editView:BgEdit = new BgEdit();
  897. if(taskModel!=null&&instance.thisView is TaskLayout)
  898. editView.model = instance;
  899. else
  900. editView.model = this;
  901. Utils.callRemote("zysqbpController","doAuditInit",function (r:ResultEvent):void{
  902. var bc:BusinessContext=r.result as BusinessContext;
  903. var vo:ZysqbpVo=bc.result as ZysqbpVo;
  904. editView.taskModel=taskModel;
  905. editView.vo=vo;
  906. editView.bgvo = bc.getAttribute("bgvo") as ZysqbpBgVo;
  907. editView.mode=Constants.mode_audit;
  908. Utils.popupWindow("变更作业审核",editView as DisplayObject,FlexGlobals.topLevelApplication as DisplayObject,null, 600, 360);
  909. },id)
  910. }
  911. //变更办理代办跳转
  912. public static function showWorkflow2(busId:String,mode:String,layout:DisplayObject,taskModel:TaskModel):void
  913. {
  914. instance.thisView=layout;
  915. instance.dobgAudit(new Number(busId),mode,taskModel);
  916. }
  917. //取消办理代办跳转
  918. public static function showWorkflow3(busId:String,mode:String,layout:DisplayObject,taskModel:TaskModel):void
  919. {
  920. instance.thisView=layout;
  921. instance.doqxAudit(new Number(busId),mode,taskModel);
  922. }
  923. //查看海事对比详细
  924. public function showHsdbinfo(event:MouseEvent):void
  925. {
  926. var view:HsdbInfo = new HsdbInfo();
  927. //这边还需要设置一下ID view.pid=你传过来的id
  928. Utils.popupWindow("对比结果",view as DisplayObject,FlexGlobals.topLevelApplication as DisplayObject,null, 600, 400);
  929. }
  930. // 复制
  931. public function doCopy(event:MouseEvent):void
  932. {
  933. if(thisView.dataGrid.selectedIndex==-1)
  934. {
  935. Utils.showInfoMessage("msg.select.one");
  936. return ;
  937. }
  938. if(Global.user.sfjyr=="Y"&&Global.user.sfyxzysq=="N"){
  939. Alert.show("该权限已被锁定","提示");
  940. return ;
  941. }
  942. var zysqbp:ZysqbpVo=thisView.dataGrid.selectedItem as ZysqbpVo;
  943. //if(zysqbp.recordStatus != Constants.RECORD_STATE_COMPLETED && zysqbp.recordStatus != Constants.RECORD_STATE_BGCOMPLETED)
  944. //{
  945. // Alert.show("只能复制已完成和变更已完成的数据","提示");
  946. // return ;
  947. //}
  948. model=this;
  949. Utils.callRemote("zysqbpController","doCheck",function (r:ResultEvent):void{
  950. var bc:BusinessContext = r.result as BusinessContext;
  951. if(bc.getAttribute("info")=="yes"){
  952. editView = new ZysqbpEdit();
  953. editView.functionId= Utils.getFunctionId(thisView);
  954. editView.zysqbp= zysqbp;
  955. editView.zysqbp.recordStatus=1;
  956. editView.zysqbp.zysjq=null;
  957. editView.zysqbp.zysjz=null;
  958. //提单号置空
  959. editView.zysqbp.BLNo=null;
  960. editView.bgsj.dateTime = new Date();
  961. editView.model=model;
  962. editView.mode = Constants.mode_edit;
  963. editView.thisModel.thisView=editView;
  964. editView.thisModel.flag = true;
  965. if(null != zysqbp.zydd){
  966. editView.zydd = zysqbp.zydd.id;
  967. }
  968. Utils.popupWindow(resourceManager.getString('common','btn.edit'), editView as DisplayObject, FlexGlobals.topLevelApplication as DisplayObject, thisView.pager.doQuery, 780, 600);
  969. }else{
  970. Alert.show("该危货申报不能进行复制","提示");
  971. }
  972. },zysqbp)
  973. }
  974. //
  975. public function kgwgTxFun(item:Object):uint
  976. {
  977. if((item as ZysqbpVo).bgsj!=null &&
  978. ((item as ZysqbpVo).kgzt=="N"||(item as ZysqbpVo).wgzt=="N")&&
  979. ((item as ZysqbpVo).recordStatus==Constants.RECORD_STATE_COMPLETED||
  980. (item as ZysqbpVo).recordStatus==Constants.RECORD_STATE_BGCOMPLETED)) {
  981. var tempDate:Date = new Date();
  982. tempDate["date"]-=Constants.ZYSB_LIMIT;
  983. if(ObjectUtil.dateCompare((item as ZysqbpVo).bgsj,tempDate)<0)
  984. return 0xFF6666;
  985. }
  986. if((item as ZysqbpVo).recordStatus == Constants.RECORD_STATE_COMPLETED) {
  987. var shyj:String = "";
  988. if((item as ZysqbpVo).zdspTask!=null){
  989. shyj=(item as ZysqbpVo).zdspTask.auditMsg;
  990. }
  991. if((item as ZysqbpVo).xsscTask!=null){
  992. shyj=(item as ZysqbpVo).xsscTask.auditMsg;
  993. }
  994. if(""!=StringUtil.trim(shyj)&&"同意作业" !=StringUtil.trim(shyj))
  995. return 0xFFFF33;
  996. }
  997. //集装箱公司的申报如果未申报过则变色
  998. if((item as ZysqbpVo).recordStatus == Constants.RECORD_STATE_SUBMIT &&
  999. (item as ZysqbpVo).zyddqybh !=null &&
  1000. (item as ZysqbpVo).zyddqybh.wxhwm.indexOf("LB")!=-1) {
  1001. if(sfsbList.length >0 && !(sfsbList.getItemAt(thisView.dataGrid.dataProvider.getItemIndex(item)) as Boolean)) {
  1002. return 0xFF8000;
  1003. }
  1004. }
  1005. return 0xffffff;
  1006. }
  1007. //自动审批设置
  1008. public function doAuto(event:Event):void {
  1009. var zdspView:ZdspszView = new ZdspszView;
  1010. Utils.popupWindow(resourceManager.getString('common','btn.automate'), zdspView as DisplayObject, FlexGlobals.topLevelApplication as DisplayObject, thisView.pager.doQuery, 860, 600);
  1011. }
  1012. /**
  1013. * 待办任务页面调用
  1014. */
  1015. public static function showView(busId:String,mode:String,layout:DisplayObject,taskModel:TaskModel):void
  1016. {
  1017. instance.thisView=layout;
  1018. Utils.callRemote("zysqbpController","doViewInit",function (r:ResultEvent):void{
  1019. var bc:BusinessContext=r.result as BusinessContext;
  1020. var vo:ZysqbpVo=bc.result as ZysqbpVo;
  1021. if("view"==mode){
  1022. var editView:ZysqbpView=new ZysqbpView();
  1023. editView.zysqbp=vo;
  1024. editView.enable = false;
  1025. if(null != vo.zydd){
  1026. editView.zydd = vo.zydd.id;
  1027. }
  1028. Utils.popupWindow(instance.resourceManager.getString('common','btn.view'), editView as DisplayObject, FlexGlobals.topLevelApplication as DisplayObject, null, 0, 0);
  1029. }
  1030. },new Number(busId))
  1031. }
  1032. /**
  1033. * 显示行政许可信息
  1034. */
  1035. public function doAdministrative(e:Event):void{
  1036. var view:FrxzxkLayout=new FrxzxkLayout();
  1037. Utils.callRemote("zysqbpController","findDataMenu",function(r:ResultEvent):void{
  1038. var bc:BusinessContext = r.result as BusinessContext;
  1039. var fr:String = bc.getAttribute("fr") as String;
  1040. var bd:String = bc.getAttribute("bd") as String;
  1041. var xk:String = bc.getAttribute("xk") as String;
  1042. if(fr!=null&& fr.length>16)
  1043. view.frString = fr;
  1044. if(bd!=null&& bd.length>39)
  1045. view.bdString = bd;
  1046. if(xk!=null&& xk.length>14)
  1047. view.xkString = xk;
  1048. Utils.popupWindow("法人行政许可",view,FlexGlobals.topLevelApplication as DisplayObject,null,1250,550);
  1049. });
  1050. }
  1051. /**
  1052. * 显示消息
  1053. */
  1054. public function showMessage (e:Event):void{
  1055. var view:MessageLayout=new MessageLayout();
  1056. view.parentView=thisView;
  1057. Utils.popupWindow("消息",view,FlexGlobals.topLevelApplication as DisplayObject,null,1000,550);
  1058. }
  1059. }
  1060. }