MyAppeal.js 25.9 KB
Newer Older
R
roo00 已提交
1 2 3 4 5 6 7 8 9 10
MWF.xDesktop.requireApp("Attendance", "Explorer", null, false);
MWF.xDesktop.requireApp("Selector", "package", null, false);
MWF.xDesktop.requireApp("Template", "MForm", null, false);
MWF.xApplication.Attendance.MyAppeal = new Class({
    Extends: MWF.xApplication.Attendance.Explorer,
    Implements: [Options, Events],

    initialize: function(node, app, actions, options){
        this.setOptions(options);
        this.app = app;
11 12
        this.path = "../x_component_Attendance/$MyAppeal/";
        this.cssPath = "../x_component_Attendance/$MyAppeal/"+this.options.style+"/css.wcss";
R
roo00 已提交
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
        this._loadCss();

        this.actions = actions;
        this.node = $(node);

        this.initData();
        if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions();
    },
    load: function(){
        this.loadToolbar();
        this.loadFilter();
        this.loadContentNode();

        var month = (new Date().getMonth()+1).toString();
        if( month.length == 1 )month = "0"+month;
        var filterData = {
            "status" : "999",
            "yearString" : new Date().getFullYear().toString(),
            "monthString" : month
        };
        this.loadView( filterData );
        this.setNodeScroll();

    },
    loadFilter: function(){
        this.fileterNode = new Element("div.fileterNode", {
            "styles" : this.css.fileterNode
        }).inject(this.node);

42
        var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' style='width: 580px;font-size: 14px;color:#666'>"+
R
roo00 已提交
43
            "<tr>" +
44 45 46 47
            "    <td styles='filterTableTitle' lable='yearString'></td>"+
            "    <td styles='filterTableValue' item='yearString'></td>" +
            "    <td styles='filterTableTitle' lable='monthString'></td>"+
            "    <td styles='filterTableValue' item='monthString'></td>" +
R
roo00 已提交
48 49 50 51 52 53 54 55 56 57 58 59 60
            "    <td styles='filterTableTitle' lable='status'></td>"+
            "    <td styles='filterTableValue' item='status'></td>" +
            "    <td styles='filterTableTitle' lable='appealReason'></td>"+
            "    <td styles='filterTableValue' item='appealReason'></td>" +
            "    <td styles='filterTableValue' item='action'></td>" +
            "</tr>" +
            "</table>";
        this.fileterNode.set("html",html);

        MWF.xDesktop.requireApp("Template", "MForm", function(){
            this.form = new MForm( this.fileterNode, {}, {
                isEdited : true,
                itemTemplate : {
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
                    yearString : {
                        text : "年度",
                        "type" : "select",
                        "selectValue" : function(){
                            var years = [];
                            var year = new Date().getFullYear();
                            for(var i=0; i<6; i++ ){
                                years.push( year-- );
                            }
                            return years;
                        },
                        "event" : {
                            "change" : function( item, ev ){
                                var values = this.getDateSelectValue();
                                item.form.getItem( "date").resetItemOptions( values , values )
                            }.bind(this)
                        }
                    },
                    monthString : {
                        text : "月份",
                        "type" : "select",
                        "defaultValue" : function(){
                            var month = (new Date().getMonth() + 1 ).toString();
                            return  month.length == 1 ? "0"+month : month;
                        },
                        "selectValue" :["","01","02","03","04","05","06","07","08","09","10","11","12"],
                        "event" : {
                            "change" : function( item, ev ){
                                var values = this.getDateSelectValue();
                                item.form.getItem( "date").resetItemOptions( values , values )
                            }.bind(this)
                        }
                    },
R
roo00 已提交
94 95 96 97 98 99 100 101 102 103 104 105 106
                    status : {
                        "text" : "申述状态",
                        "type" : "select",
                        "value" : "999",
                        "selectText" :["所有状态","待处理","审批通过","审批未通过"],
                        "selectValue" :["999","0","1","-1"]
                    },
                    appealReason : {
                        "text" : "申述原因",
                        "type" : "select",
                        "selectText" :["","临时请假","出差","因公外出","其他"]
                    },
                    action : { "value" : "查询", type : "button", className : "filterButton", event : {
S
st 已提交
107 108 109 110 111 112
                            click : function(){
                                var result = this.form.getResult(true,",",true,true,false);
                                if( !result )return;
                                this.loadView( result );
                            }.bind(this)
                        }}
R
roo00 已提交
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300
                }
            }, this.app, this.css);
            this.form.load();
        }.bind(this), true);
    },
    //loadFilter : function(){
    //    this.fileterNode = new Element("div.fileterNode", {
    //        "styles" : this.css.fileterNode
    //    }).inject(this.node)
    //
    //    var table = new Element("table", {
    //        "width" : "100%", "border" : "0", "cellpadding" : "5", "cellspacing" : "0",  "styles" : this.css.filterTable, "class" : "filterTable"
    //    }).inject( this.fileterNode );
    //
    //    var tr = new Element("tr").inject(table);
    //
    //    var td = new Element("td", {  "styles" : this.css.filterTableTitle, "text" : (new Date).format(this.app.lp.dateFormatMonth)  }).inject(tr);
    //
    //    this.createStatusSelectTd(tr);
    //    this.createAppealReasonTd(tr);
    //    //this.createUnitTd(tr);
    //    //this.createPersonTd( tr );
    //    //this.createYearSelectTd( tr );
    //    //this.createMonthSelectTd( tr );
    //    this.createActionTd( tr );
    //},
    //createStatusSelectTd : function( tr ){
    //    var _self = this;
    //    var td = new Element("td", {  "styles" : this.css.filterTableTitle, "text" : "审批状态"  }).inject(tr);
    //    var td = new Element("td", {  "styles" : this.css.filterTableValue }).inject(tr);
    //    this.status = new MDomItem( td, {
    //        "name" : "status",
    //        "type" : "select",
    //        "value" : "999",
    //        "selectText" :["所有状态","待处理","审批通过","审批未通过"],
    //        "selectValue" :["999","0","1","-1"]
    //    }, true, this.app );
    //    this.status.load();
    //},
    //createAppealReasonTd : function( tr ){
    //    var _self = this;
    //    var td = new Element("td", {  "styles" : this.css.filterTableTitle, "text" : "申诉原因"  }).inject(tr);
    //    var td = new Element("td", {  "styles" : this.css.filterTableValue }).inject(tr);
    //    this.appealReason = new MDomItem( td, {
    //        "name" : "appealReason",
    //        "type" : "select",
    //        "selectText" :["","临时请假","出差","因公外出","其他"]
    //    }, true, this.app );
    //    this.appealReason.load();
    //},
    //createUnitTd : function(tr){
    //    var _self = this;
    //    var td = new Element("td", {  "styles" : this.css.filterTableTitle, "text" : "部门"  }).inject(tr);
    //    var td = new Element("td", {  "styles" : this.css.filterTableValue }).inject(tr);
    //    this.unitName = new MDomItem( td, {
    //        "name" : "unitName",
    //        "style" : {"width":"60px"},
    //        "defaultValue" : this.app.manageUnits.length > 0 ? this.app.manageUnits[0] : "",
    //        "event" : {
    //            "click" : function(mdi){ _self.selecePerson( mdi, "unit" ); }
    //        }
    //    }, true, this.app );
    //    this.unitName.load();
    //},
    //createPersonTd : function(tr){
    //    var _self = this;
    //    var td = new Element("td", {  "styles" : this.css.filterTableTitle, "text" : "人员"  }).inject(tr);
    //    var td = new Element("td", {  "styles" : this.css.filterTableValue }).inject(tr);
    //    this.empName = new MDomItem( td, {
    //        "name" : "empName",
    //        "style" : {"width":"60px"},
    //        "event" : {
    //            "click" : function(mdi){ _self.selecePerson( mdi, "person" ); }
    //        }
    //    }, true, this.app );
    //    this.empName.load();
    //},
    //createYearSelectTd : function( tr ){
    //    var _self = this;
    //    var td = new Element("td", {  "styles" : this.css.filterTableTitle, "text" : "年度"  }).inject(tr);
    //    var td = new Element("td", {  "styles" : this.css.filterTableValue }).inject(tr);
    //    this.yearString = new MDomItem( td, {
    //        "name" : "yearString",
    //        "type" : "select",
    //        "selectValue" : function(){
    //            var years = [];
    //            var year = new Date().getFullYear();
    //            for(var i=0; i<6; i++ ){
    //                years.push( year-- );
    //            }
    //            return years;
    //        }
    //    }, true, this.app );
    //    this.yearString.load();
    //},
    //createMonthSelectTd : function( tr ){
    //    var _self = this;
    //    var td = new Element("td", {  "styles" : this.css.filterTableTitle, "text" : "月份"  }).inject(tr);
    //    var td = new Element("td", {  "styles" : this.css.filterTableValue }).inject(tr);
    //    this.monthString = new MDomItem( td, {
    //        "name" : "monthString",
    //        "type" : "select",
    //        "selectValue" :["","01","02","03","04","05","06","07","08","09","10","11","12"]
    //    }, true, this.app );
    //    this.monthString.load();
    //},
    //createActionTd : function( tr ){
    //    var td = new Element("td", {  "styles" : this.css.filterTableValue }).inject(tr);
    //    var input = new Element("button",{
    //        "text" : "查询",
    //        "styles" : this.css.filterButton
    //    }).inject(td);
    //    input.addEvent("click", function(){
    //        var filterData = {
    //            status : this.status.getValue(),
    //            appealReason : this.appealReason.getValue(),
    //            //unitName : this.unitName.getValue(),
    //            //empName : this.empName.getValue(),
    //            //yearString : this.yearString.getValue(),
    //           //monthString : this.monthString.getValue()
    //        }
    //        this.loadView( filterData );
    //    }.bind(this))
    //},
    //selecePerson: function( el, type ){
    //    var text = "选择人员"
    //    if( type=="topUnit") {
    //        text = "选择公司"
    //    }else if( type=="unit"){
    //        text = "选择部门"
    //    }
    //    var options = {
    //        "type": type, //topUnit unit person,
    //        "title": text,
    //        "count" : "1",
    //        "values": [ el.get("value") ] || [],
    //        "onComplete": function(items){
    //            var  arr = [];
    //            items.each(function(item){
    //                arr.push(item.data.name);
    //            }.bind(this));
    //            el.set("value",arr.join(","));
    //        }.bind(this)
    //    };
    //    var selector = new MWF.O2Selector(this.app.content, options);
    //},
    setContentSize: function(){
        var toolbarSize = this.toolbarNode ? this.toolbarNode.getSize() : {"x":0,"y":0};
        var titlebarSize = this.app.titleBar ? this.app.titleBar.getSize() : {"x":0,"y":0};
        var filterSize = this.fileterNode ? this.fileterNode.getSize() : {"x":0,"y":0};
        var nodeSize = this.node.getSize();
        var pt = this.elementContentNode.getStyle("padding-top").toFloat();
        var pb = this.elementContentNode.getStyle("padding-bottom").toFloat();
        //var filterSize = this.filterNode.getSize();
        var filterConditionSize = this.filterConditionNode ? this.filterConditionNode.getSize() : {"x":0,"y":0};

        var height = nodeSize.y-toolbarSize.y-pt-pb-filterConditionSize.y-titlebarSize.y-filterSize.y;
        this.elementContentNode.setStyle("height", ""+height+"px");

        this.pageCount = (height/30).toInt()+5;

        if (this.view && this.view.items.length<this.pageCount){
            this.view.loadElementList(this.pageCount-this.view.items.length);
        }
    },
    loadView : function( filterData ){
        this.elementContentNode.empty();
        this.view = new MWF.xApplication.Attendance.MyAppeal.View(this.elementContentNode, this.app,this, this.viewData, this.options.searchKey );
        this.view.filterData = filterData;
        this.view.load();
        this.setContentSize();
    },
    createDocument: function(){
        if(this.view)this.view._createDocument();
    }
});

MWF.xApplication.Attendance.MyAppeal.View = new Class({
    Extends: MWF.xApplication.Attendance.Explorer.View,
    _createItem: function(data){
        return new MWF.xApplication.Attendance.MyAppeal.Document(this.table, data, this.explorer, this);
    },

    _getCurrentPageData: function(callback, count){
        if(!count )count=20;
        var id = (this.items.length) ? this.items[this.items.length-1].data.id : "(0)";
        var filter = this.filterData || {};

301
        /*var month = (new Date().getMonth()+1).toString();
R
roo00 已提交
302 303
        if( month.length == 1 )month = "0"+month;
        filter.yearString = new Date().getFullYear().toString();
304
        filter.monthString = month;*/
R
roo00 已提交
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
        filter.empName = layout.desktop.session.user.distinguishedName;

        this.actions.listAppealFilterNext(id, count, filter, function(json){
            var data = json.data;
            data.sort( function( a, b ){
                return parseInt( b.appealDateString.replace(/-/g,"") ) -  parseInt( a.appealDateString.replace(/-/g,"") );
            });
            json.data = data;
            if (callback) callback(json);
        });
    },
    _removeDocument: function(documentData, all){

    },
    _createDocument: function(){

    },
    _openDocument: function( documentData ){
S
st 已提交
323 324 325 326 327 328 329 330

        if(documentData.appealAuditInfo){
            if(documentData.appealAuditInfo.workId){
                var workid = documentData.appealAuditInfo.workId;
                var options = {"workId":workid, "appId": "process.Work"+workid};
                this.app.desktop.openApplication(null, "process.Work", options);
                return;
            }
B
boomEgg 已提交
331
        }
S
st 已提交
332 333
        var appeal = new MWF.xApplication.Attendance.MyAppeal.Appeal(this.explorer, documentData );
        appeal.open();
B
boomEgg 已提交
334

R
roo00 已提交
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490
    }

});

MWF.xApplication.Attendance.MyAppeal.Document = new Class({
    Extends: MWF.xApplication.Attendance.Explorer.Document,
    agree : function(){

    },
    deny : function(){

    }

});


MWF.xApplication.Attendance.MyAppeal.Appeal = new Class({
    Extends: MWF.widget.Common,
    initialize: function( explorer, data ){
        this.explorer = explorer;
        this.app = explorer.app;
        this.data = data || {};
        //this.app.restActions.getAppeal(this.data.detailId, function(json){
        //    this.data = json.data
        //}.bind(this),null,false)
        //alert(JSON.stringify(this.data))
        this.css = this.explorer.css;

        this.load();
    },
    load: function(){
        this.app.restActions.getDetail(this.data.detailId, function(json){
            this.data.onDutyTime = json.data.onDutyTime;
            this.data.offDutyTime = json.data.offDutyTime;
        }.bind(this),null,false)
    },

    open: function(e){
        this.isNew = false;
        this.isEdited = false;
        this._open();
    },
    create: function(){
        this.isNew = true;
        this._open();
    },
    edit: function(){
        this.isEdited = true;
        this._open();
    },
    _open : function(){
        this.createMarkNode = new Element("div", {
            "styles": this.css.createMarkNode,
            "events": {
                "mouseover": function(e){e.stopPropagation();},
                "mouseout": function(e){e.stopPropagation();}
            }
        }).inject(this.app.content, "after");

        this.createAreaNode = new Element("div", {
            "styles": this.css.createAreaNode
        });

        this.createNode();

        this.createAreaNode.inject(this.createMarkNode, "after");
        this.createAreaNode.fade("in");

        this.setCreateNodeSize();
        this.setCreateNodeSizeFun = this.setCreateNodeSize.bind(this);
        this.addEvent("resize", this.setCreateNodeSizeFun);
    },
    createNode: function(){
        var _self = this;

        this.createNode = new Element("div", {
            "styles": this.css.createNode
        }).inject(this.createAreaNode);

        //
        //this.createIconNode = new Element("div", {
        //    "styles": this.isNew ? this.css.createNewNode : this.css.createIconNode
        //}).inject(this.createNode);

        this.createContainerNode = new Element("div", {
            "styles": this.css.createContainerNode
        }).inject(this.createNode);


        this.setScrollBar( this.createContainerNode );


        this.createFormNode = new Element("div", {
            "styles": this.css.createFormNode
        }).inject(this.createContainerNode);

        this.createTableContainer = new Element("div", {
            "styles": this.css.createTableContainer
        }).inject(this.createFormNode);

        this.createTableArea = new Element("div", {
            "styles": this.css.createTableArea
        }).inject(this.createTableContainer);


        var d = this.data;
        var appealStatus = "发起";
        if (d.status == 0 ) {
            appealStatus = "待处理"
        } else if (d.status == 1) {
            appealStatus = "审批通过"
        } else if (d.status == -1) {
            appealStatus = "申诉不通过"
        }
        this.data.appealStatusShow = appealStatus;

        var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>"+
            "<tr><td colspan='4' styles='formTableHead'>申诉申请单</td></tr>" +
            "<tr><td styles='formTableTitle'>员工姓名</td>"+
            "    <td styles='formTableValue'>"+this.data.empName.split("@")[0]+"</td>" +
            "    <td styles='formTableTitle' lable='recordDateString'></td>"+
            "    <td styles='formTableValue' item='recordDateString'></td></tr>" +
            "<tr><td styles='formTableTitle' lable='onDutyTime'></td>"+
            "    <td styles='formTableValue' item='onDutyTime'></td>" +
            "    <td styles='formTableTitle' lable='offDutyTime'></td>"+
            "    <td styles='formTableValue' item='offDutyTime'></td></tr>" +
            "<tr><td styles='formTableTitle' lable='appealStatusShow'></td>"+
            "    <td styles='formTableValue' item='appealStatusShow'  colspan='3'></td></tr>" +
            "<tr><td styles='formTableTitle' lable='appealReason'></td>"+
            "    <td styles='formTableValue' item='appealReason'></td>" +
            "   <td styles='formTableTitle' lable='processPerson1Show'></td>"+
            "    <td styles='formTableValue' item='processPerson1Show'></td></tr>" +
            "<tr contain='selfHolidayType'><td styles='formTableTitle' lable='selfHolidayType'></td>"+
            "    <td styles='formTableValue' item='selfHolidayType' colspan='3'></td></tr>" +
            "<tr contain='address'><td styles='formTableTitle' lable='address'></td>"+
            "    <td styles='formTableValue' item='address' colspan='3'></td></tr>" +
            "<tr contain='startTime'><td styles='formTableTitle' lable='startTime'></td>"+
            "    <td styles='formTableValue' item='startTime' colspan='3'></td></tr>" +
            "<tr contain='endTime'><td styles='formTableTitle' lable='endTime'></td>"+
            "    <td styles='formTableValue' item='endTime' colspan='3'></td></tr>" +
            "<tr contain='appealDescription'><td styles='formTableTitle' lable='appealDescription'></td>"+
            "    <td styles='formTableValue' item='appealDescription' colspan='3'></td></tr>" +
            "<tr contain='opinion1'><td styles='formTableTitle' lable='opinion1'></td>"+
            "    <td styles='formTableValue' item='opinion1' colspan='3'></td></tr>" +
            "</table>";
        this.createTableArea.set("html",html);

        this.document = new MForm( this.createTableArea, this.data, {
            style : "popup",
            isEdited : this.isEdited || this.isNew,
            itemTemplate : {
                recordDateString : { text:"考勤日期",  type : "innertext"},
                onDutyTime : { text:"上班打卡时间",  type : "innertext"},
                offDutyTime : { text:"下班打卡时间",  type : "innertext"},
                statusShow : {  text:"考勤状态", type : "innertext" },
                appealStatusShow : { text:"审批状态",type : "innertext"},
S
st 已提交
491
                processPerson1Show : {text:"审核人",type:"innertext", value : this.data.processPerson1?this.data.processPerson1.split("@")[0] :""},
R
roo00 已提交
492 493 494 495 496 497
                appealReason : {
                    notEmpty : true,
                    text:"申述原因",
                    type : "select",
                    selectValue : ["","临时请假","出差","因公外出","其他"],
                    event : { change : function(mdi){
S
st 已提交
498 499
                            _self.switchFieldByAppealReason(mdi.getValue());
                        }}
R
roo00 已提交
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629
                },
                address : { text:"地点" },
                selfHolidayType : {
                    text:"请假类型",
                    type : "select",
                    selectValue : ["","带薪年休假","带薪病假","带薪福利假","扣薪事假","其他"]
                },
                startTime : {  text:"开始日期", tType : "datetime" },
                endTime : {  text:"结束日期", tType : "datetime" },
                appealDescription : { text:"事由" },
                opinion1 : { text :"审批意见" }
            }
        }, this.app,this.css);
        this.document.load();
        _self.switchFieldByAppealReason(this.data.appealReason);


        //createFormNode.set("html", html);

        //this.setScrollBar(this.createTableContainer)


        this.cancelActionNode = new Element("div", {
            "styles": this.css.createCancelActionNode,
            "text": "关闭"
        }).inject(this.createFormNode);


        this.cancelActionNode.addEvent("click", function(e){
            this.cancelCreate(e);
        }.bind(this));

        if( this.isNew || this.isEdited){
            this.denyActionNode = new Element("div", {
                "styles": this.css.createDenyActionNode,
                "text": "不同意"
            }).inject(this.createFormNode);
            this.createOkActionNode = new Element("div", {
                "styles": this.css.createOkActionNode,
                "text": "同意"
            }).inject(this.createFormNode);

            this.denyActionNode.addEvent("click", function(e){
                this.deny(e);
            }.bind(this));
            this.createOkActionNode.addEvent("click", function(e){
                this.okCreate(e);
            }.bind(this));
        }

    },
    switchFieldByAppealReason : function( ar ){
        var tempField = ["selfHolidayType","startTime","endTime","address","appealDescription"];
        var showField = [];
        if( ar == "临时请假" ){
            showField = ["selfHolidayType","startTime","endTime"];
        }else if( ar == "出差" ){
            showField = ["address","startTime","endTime"];
        }else if( ar == "因公外出" ){
            showField = ["address","startTime","endTime","appealDescription"];
        }else if( ar == "其他" ){
            showField = ["appealDescription"];
        }
        tempField.each( function( f ){
            this.createTableArea.getElement("[contain='"+f+"']").setStyle("display", showField.contains(f) ? "" : "none" );
            if( this.isNew || this.isEdited )this.document.items[f].options.notEmpty = (showField.contains(f) ? true : false )
        }.bind(this))
    },
    setCreateNodeSize: function(){
        var size = this.app.node.getSize();
        var allSize = this.app.content.getSize();

        var height = "560";
        var width = "800";

        this.createAreaNode.setStyles({
            "width": ""+size.x+"px",
            "height": ""+size.y+"px"
        });
        var hY = height;
        var mY = (size.y-height)/2;
        this.createNode.setStyles({
            "height": ""+hY+"px",
            "margin-top": ""+mY+"px",
            "width" : ""+width+"px"
        });

        this.createContainerNode.setStyles({
            "height": ""+hY+"px"
        });

        var iconSize = this.createIconNode ? this.createIconNode.getSize() : {x:0,y:0};
        var formMargin = hY-iconSize.y-60;
        this.createFormNode.setStyles({
            "height": ""+formMargin+"px",
            "margin-top": ""+60+"px"
        });
    },
    cancelCreate: function(e){
        this.createMarkNode.destroy();
        this.createAreaNode.destroy();
        delete this;
    },
    deny : function(e){
        var data = { 'ids' : [this.data.id], 'status':'-1', 'opinion1': this.opinion1.getValue() };
        if (data.opinion1 ){
            this.process( data );
        }else{
            this.app.notice( "请填写意见", "error");
        }
    },
    okCreate: function(e){
        var data = { 'ids' : [this.data.id], 'status':'1', 'opinion1': this.opinion1.getValue() };
        this.process( data );
    },
    process: function( data ){
        this.app.restActions.processAppeal( data, function(json){
            if( json.type == "ERROR" ){
                this.app.notice( json.message  , "error");
            }else{
                this.createMarkNode.destroy();
                this.createAreaNode.destroy();
                if(this.explorer.view)this.explorer.view.reload();
                this.app.notice( "处理成功" , "success");
            }
            //    this.app.processConfig();
        }.bind(this));
    }
});