define("src/bus/court/divisionCase/writtenJudgment/main-debug", ["bus/global/main-debug", "common/jquery-debug", "model/upload/main-debug", "common/delegate-debug", "common/validator-debug", "model/ajax/main-debug", "common/tinymce-debug"], function(require, exports, module) {
    function handleAction() {
        $("#content").val(tinymce.get("content").getContent()), new Ajax({
            request: "/court/lassenCourtJudgmentRpc/saveCourtJudgment.json?securityCaseId=" + encodeURIComponent($("input[name='securityCaseId']").val()),
            paramName: "lassenCourtJudgmentVo",
            parseForm: $("#writtenJudgment-form")
        }).on("ajaxSuccess", function(rtv, msg, con) {
            location.reload()
        }).submit()
    }
    require("bus/global/main-debug");
    var $ = require("common/jquery-debug"),
        Upload = require("model/upload/main-debug"),
        delegate = require("common/delegate-debug"),
        Validator = require("common/validator-debug"),
        Ajax = require("model/ajax/main-debug"),
        tinymceUse = require("common/tinymce-debug"),
        validatorExp = Validator.use("#writtenJudgment-form");
    tinymceUse({
        selector: "#content"
    }), delegate.on("click", ".JS-trigger-click-publish", function() {
        $("input[name='division']").val("publish"), validatorExp.execute(function(flag, err) {
            flag || handleAction()
        })
    }), delegate.on("click", ".JS-trigger-click-save", function() {
        $("input[name='division']").val("save"), handleAction()
    }), delegate.on("mouseover", ".JS-trigger-click-link", function(target) {
        $(target.target).addClass("fn-btn-primary")
    }), delegate.on("mouseout", ".JS-trigger-click-link", function(target) {
        $(target.target).removeClass("fn-btn-primary")
    });
    Upload.use(".JS-trigger-click-upload")
});
define("src/bus/suit/trial/global/main-debug", ["common/jquery-debug", "common/delegate-debug"], function(require, exports, module) {
    var $ = require("common/jquery-debug"),
        delegate = require("common/delegate-debug"),
        noticCheckNext = $("#notic-check-next");
    delegate.on("click", "#trial-checked", function() {
        var node = $(this);
        node.prop("checked") ? (noticCheckNext.removeClass("fn-input-button-disabled"), noticCheckNext.addClass("fn-input-button")) : (noticCheckNext.removeClass("fn-input-button"), noticCheckNext.addClass("fn-input-button-disabled"))
    }), delegate.on("click", ".JS-trigger-click-next", function(e) {
        var node = $(this);
        node.hasClass("fn-input-button-disabled") && e.preventDefault()
    })
});
define("src/bus/suit/start/common/preview/main-debug", ["bus/global/main-debug", "common/jquery-debug", "common/delegate-debug", "common/scroller-debug", "model/ajax/main-debug"], function(require, exports, module) {
    require("bus/global/main-debug");
    var $ = require("common/jquery-debug"),
        delegate = require("common/delegate-debug"),
        Scroller = require("common/scroller-debug"),
        Ajax = require("model/ajax/main-debug");
    Scroller.use(".JS-need-scroller"), delegate.on("click", ".JS-trigger-click-submit", function() {
        var self = $(this);
        new Ajax({
            autoSubmit: !0,
            request: "/suit/legalCaseRpc/submitLegalCase.json",
            parseForm: "#pageParam",
            onAjaxSuccess: function() {
                this.redirect(self.data("href"))
            }
        })
    })
});
define("src/bus/court/divisionCase/objectionsDeal/main-debug", ["bus/global/main-debug", "common/jquery-debug", "common/delegate-debug", "common/dialog-debug", "model/modal/main-debug"], function(require, exports, module) {
    function beZero(num) {
        return num < 10 ? "0" + num : num
    }

    function format(date) {
        return date.getFullYear(date) + "-" + beZero(date.getMonth() + 1) + "-" + beZero(date.getDate()) + " " + beZero(date.getHours()) + ":" + beZero(date.getMinutes())
    }
    require("bus/global/main-debug");
    var $ = require("common/jquery-debug"),
        delegate = require("common/delegate-debug"),
        Dialog = require("common/dialog-debug"),
        Modal = require("model/modal/main-debug");
    delegate.on("click", ".JS-trigger-click-detail", function() {
        var tr = $(this).closest("tr"),
            data = tr.data("json") || tr.attr("data-json");
        data.applyTimeEx = data.applyTime && format(new Date(data.applyTime)), data.deal ? Dialog.showTemplate("#template-detail", data, {
            width: 400
        }) : Dialog.showTemplate("#template-wait", data, {
            width: 400
        })
    }), $(document).on("click", "#submit-wait", function(e) {
        e.preventDefault();
        var self = this,
            table = $(this).closest("table"),
            save = {};
        return table.find("select, textarea").each(function() {
            save[$(this).attr("name")] = $.trim($(this).val())
        }), save.opinion && save.opinion.replace(/[^x00-xff]/g, "xx").length > 1e3 ? void Modal.alert(0, "意见的字符长度不能超过1000") : void $.ajax({
            type: "POST",
            url: "/court/LassenSuitObjectionRpc/editSuitObjection.json?securityCaseId=" + encodeURIComponent($("input[name='securityCaseId']").val()),
            data: {
                objectionDo: JSON.stringify(save)
            }
        }).done(function(res) {
            $(self).closest(".kuma-dialog").find(".kuma-dialog-close").click(), res.hasError ? Modal.alert(0, res.errors[0].msg) : res.content.isSuccess ? (Modal.alert(1, "提交成功"), setTimeout(function() {
                location.reload()
            }, 300)) : Modal.alert(0, res.content.message)
        })
    })
});
define("src/bus/court/putOnRecord/defendantServed/main-debug", ["bus/global/main-debug", "common/jquery-debug", "common/delegate-debug", "common/handlerbars-debug", "common/validator-debug", "model/ajax/main-debug", "model/imgView/main-debug", "common/dialog-debug"], function(require, exports, module) {
    require("bus/global/main-debug");
    var $ = require("common/jquery-debug"),
        delegate = require("common/delegate-debug"),
        handlerbars = require("common/handlerbars-debug"),
        delegate = require("common/delegate-debug"),
        Validator = require("common/validator-debug"),
        Ajax = require("model/ajax/main-debug"),
        ImgView = require("model/imgView/main-debug"),
        Dialog = require("common/dialog-debug"),
        service = $("#service");
    new ImgView;
    var ajaxExp = new Ajax({
            element: "#search-list",
            autoDestroy: !1,
            autoSuccessAlert: !1,
            parseForm: "#page-param"
        }).on("ajaxSuccess", function(rtv, msg, res) {
            var me = this,
                content = me.$(".content"),
                template = handlerbars.compile(me.$(".template"), !0);
            content.html(template(rtv)), me.hide(service);
            var endStatus = ["conciliate", "sentenced", "jurisediction_objection", "not_accepted", "return", "dropped", "not_be_served", "cancel_apply", "unpaid_dropped"];
            rtv && $.inArray(rtv.status, endStatus) < 0 && me.breakEachArr(rtv.lassenReceiveConfirmVoList, function(val) {
                if (!val.receiveTime) return me.show(service), !0
            })
        }).submit(),
        templateService = Dialog.showTemplate("#template-service", {
            flag: !0
        }, {
            width: 500,
            autoShow: !1,
            autoDestroy: !1,
            events: {
                "click .JS-trigger-click-submit": function(e) {
                    new Ajax({
                        element: this.element,
                        request: "/court/lassenReceiveConfirmRpc/saveReceiveWithunable.json",
                        paramName: "lassenReceiveWithunableDo",
                        parseForm: "#page-param"
                    }).on("ajaxSuccess", function() {
                        ajaxExp.submit(), templateService.hide()
                    }).submit()
                }
            }
        });
    templateService.render(), templateService.before("show", function(entityMapList) {
        this.$(".JS-target-entitylist").html(entityMapList)
    }), delegate.on("click", ".JS-trigger-click-sended", function() {
        var self = $(this);
        new Ajax({
            request: "/court/lassenReceiveConfirmRpc/queryReceive.json",
            param: self.data("param")
        }).on("ajaxSuccess", function(rtv, msg, res) {
            Dialog.showTemplate("#template-sended", rtv, {
                width: 450
            })
        }).submit()
    }), delegate.on("click", ".JS-trigger-click-treatment", function() {
        var self = $(this);
        new Ajax({
            request: "/court/lassenReceiveConfirmRpc/queryReceiveConfirm.json",
            param: self.data("param")
        }).on("ajaxSuccess", function(rtv, msg, res) {
            Dialog.showTemplate("#template-treatment", rtv, {
                width: 500,
                events: {
                    "click .JS-trigger-click-submit": function(e) {
                        var me = this;
                        Validator.oneExecute(this.element) || new Ajax({
                            element: me.element,
                            request: "/court/lassenReceiveConfirmRpc/saveReceiveConfirm.json",
                            paramName: "lassenReceiveConfirmDo",
                            onAjaxSuccess: function() {
                                ajaxExp.submit(), me.hide()
                            }
                        }).submit()
                    }
                }
            })
        }).submit()
    }), delegate.on("click", ".JS-trigger-click-record", function() {
        var self = $(this);
        new Ajax({
            request: "/court/lassenReceiveConfirmRpc/queryReceive.json",
            param: self.data("param")
        }).on("ajaxSuccess", function(rtv, msg, res) {
            rtv.receiveInfo && "y" === rtv.receiveInfo.isReceive ? Dialog.showTemplate("#template-record", rtv, {
                width: 500
            }) : Dialog.showTemplate("#template-service", rtv, {
                width: 450
            })
        }).submit()
    }), delegate.on("click", ".JS-trigger-click-service", function() {
        new Ajax({
            request: "/court/lassenReceiveConfirmRpc/queryReceiveWithunable.json",
            parseForm: "#page-param"
        }).on("ajaxSuccess", function(rtv, msg, res) {
            templateService.show(rtv.entityMapList.join(","))
        }).submit()
    })
});
define("src/bus/domain/agentManagement/main-debug", ["bus/global/main-debug", "common/jquery-debug", "common/dialog-debug", "model/addLawyer/main-debug", "common/delegate-debug", "model/imgView/main-debug", "common/validator-debug", "model/ajax/main-debug"], function(require, exports, module) {
    require("bus/global/main-debug");
    var $ = require("common/jquery-debug"),
        Dialog = require("common/dialog-debug"),
        AddLawyer = require("model/addLawyer/main-debug"),
        delegate = require("common/delegate-debug"),
        ImgView = require("model/imgView/main-debug"),
        Validator = require("common/validator-debug"),
        Ajax = require("model/ajax/main-debug");
    (new AddLawyer).on("addLawyerSuccess", function() {}), new ImgView;
    var validatorExp;
    delegate.on("click", '[data-role="editRight"]', function(e) {
        var securityId = $(e.target).data("param");
        new Ajax({
            request: "/suit/lassenLitigantAgentRpc/getEntityBySecurityId.json?securityId=" + securityId
        }).on("ajaxSuccess", function(rtv, msg, con) {
            var dig = Dialog.showTemplate("#edit-agent-right", rtv, {
                width: 720,
                autoDestroy: !0,
                autoShow: !1,
                events: {
                    "click #save": function(e) {
                        validatorExp && validatorExp.execute(function(err, errlist) {
                            err ? util.log(errlist) : new Ajax({
                                request: "/suit/lassenLitigantAgentRpc/updateEntity.json",
                                paramName: "filemap",
                                parseForm: $("#form-agent"),
                                autoSuccessAlert: !0,
                                autoErrorAlert: !0
                            }).on("ajaxSuccess", function(rtv, msg, con) {
                                setTimeout(window.location.reload(), 3e3), dig.hide()
                            }).submit()
                        })
                    }
                }
            }).after("show", function() {
                if ("normal_lawyer" !== rtv.relationCode && "legal_lawyer" !== rtv.relationCode && $('[data-role="commonRelationFileTr"]').removeClass("fn-hide"), rtv.auth) {
                    var auths = rtv.auth.split(",");
                    $('[name="auth"]').each(function(index, item) {
                        var authValue = $(item).val();
                        $.inArray(authValue, auths) > -1 && $(item).prop("checked", !0)
                    })
                }
                validatorExp = Validator.use("#form-agent")
            }).show()
        }).submit()
    }), delegate.on("click", '[data-role="releaseRight"]', function(e) {
        var agentEntityId = $(e.target).data("param"),
            rtv = {};
        rtv.agentEntityId = agentEntityId, new Ajax({
            request: "/suit/lassenLitigantAgentRpc/relieveEntrustContent.json",
            param: {
                agentEntityId: agentEntityId
            }
        }).on("ajaxSuccess", function(data1, content, data3) {
            rtv.content = content;
            var dig = Dialog.showTemplate("#release-agent", rtv, {
                width: 720,
                autoDestroy: !0,
                autoShow: !0,
                autoSuccessAlert: !0,
                autoErrorAlert: !0,
                events: {
                    "click #noticecheck": function(e) {
                        $(e.target).prop("checked") ? $("#conformRelease").removeClass("fn-btn-disabled") : $("#conformRelease").addClass("fn-btn-disabled")
                    },
                    "click #conformRelease": function(e) {
                        if (!$(e.target).hasClass("fn-btn-disabled")) {
                            var agentEntityId = $('input[name="agentEntityId"]').val(),
                                content = $('[name="content"]').val();
                            new Ajax({
                                request: "/suit/lassenLitigantAgentRpc/relieveEntrust.json",
                                param: {
                                    agentEntityId: agentEntityId,
                                    content: content
                                }
                            }).on("ajaxSuccess", function(rtv, msg, con) {
                                setTimeout(window.location.reload(), 3e3), dig.hide()
                            }).submit()
                        }
                    },
                    "click #cancelRelease": function(e) {
                        dig.hide()
                    }
                }
            })
        }).submit()
    }), delegate.on("click", '[data-role="releaseRightFile"]', function(e) {
        var agentEntityId = $(e.target).data("param"),
            rtv = {};
        rtv.agentEntityId = agentEntityId, new Ajax({
            request: "/suit/lassenLitigantAgentRpc/relieveEntrustFile.json",
            param: {
                agentEntityId: agentEntityId
            }
        }).on("ajaxSuccess", function(data1, content, data3) {
            rtv.content = content;
            Dialog.showTemplate("#release-agent-file", rtv, {
                width: 1180,
                autoDestroy: !0,
                autoShow: !0
            })
        }).submit()
    })
});
define("src/bus/court/putOnRecord/withdrawalTreatment/main-debug", ["bus/global/main-debug", "common/jquery-debug", "common/delegate-debug", "common/dialog-debug", "common/handlerbars-debug", "model/ajax/main-debug", "common/tinymce-debug"], function(require, exports, module) {
    function queryAndOpen(element) {
        var param = $(element.target).data("sendParam");
        new Ajax({
            request: "/court/lassenSuitWithdrawalRpc/queryWithdrawalDocument.json",
            paramName: "withdrawalDocMap",
            param: param
        }).on("ajaxSuccess", function(rtv, msg, con) {
            openFullTextDialog(rtv, param)
        }).submit()
    }

    function openFullTextDialog(fullTextContent, param) {
        var temp = handlerbars.compile("#template-full-text", !0),
            html = temp(fullTextContent);
        new Dialog({
            content: html,
            width: 800,
            events: {
                "click .JS-trigger-click-save": function(e) {
                    var me = this;
                    me.$("#content").val(tinymce.get("content").getContent()), new Ajax({
                        request: "/court/lassenSuitWithdrawalRpc/saveWithdrawalDocument.json",
                        paramName: "withdrawalDocMap",
                        param: $.extend(param, {
                            content: me.$("#content").val()
                        }),
                        autoSuccessAlert: !0
                    }).on("ajaxSuccess", function(rtv, msg, con) {
                        tinymce.remove("#content"), me.hide()
                    }).submit()
                },
                "click .JS-trigger-click-send": function(e) {
                    var me = this;
                    me.$("#content").val(tinymce.get("content").getContent()), new Ajax({
                        request: "/court/lassenSuitWithdrawalRpc/resendWithdrawalNofity.json",
                        paramName: "withdrawalDocMap",
                        param: $.extend(param, {
                            content: me.$("#content").val()
                        }),
                        autoSuccessAlert: !0
                    }).on("ajaxSuccess", function(rtv, msg, con) {
                        tinymce.remove("#content"), me.hide()
                    }).submit()
                }
            }
        }).after("show", function() {
            var me = this;
            tinymceUse({
                selector: "#content",
                init_instance_callback: function(eb) {
                    me._setPosition()
                }
            })
        }).after("hide", function() {
            this.destroy()
        }).show()
    }
    require("bus/global/main-debug");
    var $ = require("common/jquery-debug"),
        delegate = require("common/delegate-debug"),
        Dialog = require("common/dialog-debug"),
        handlerbars = require("common/handlerbars-debug"),
        Ajax = require("model/ajax/main-debug"),
        tinymceUse = require("common/tinymce-debug"),
        ajaxExp = new Ajax({
            element: "#search-list",
            autoDestroy: !1,
            autoSuccessAlert: !1
        }).on("ajaxSuccess", function(rtv, msg, res) {
            var me = this,
                content = me.$(".content"),
                template = handlerbars.compile(me.$(".template"), !0);
            content.html(template(rtv)), "cased" == rtv.status && "y" != rtv.isPaid ? $("#notPay").show() : $("#notPay").hide(), $("input[name='name']").val(rtv.name)
        }).submit();
    delegate.on("click", ".JS-trigger-click-sendagain", function(element) {
        queryAndOpen(element)
    }), delegate.on("click", ".JS-trigger-click-detail", function(element) {
        new Ajax({
            request: "/court/lassenSuitWithdrawalRpc/querySuitWithdrawal.json",
            param: $(element.target).data("param")
        }).on("ajaxSuccess", function(rtv, msg, con) {
            Dialog.showTemplate("#template-detail", rtv, {
                width: 420
            })
        }).submit()
    }), delegate.on("click", ".JS-trigger-click-treat-auto", function(element) {
        new Ajax({
            request: "/court/lassenSuitWithdrawalRpc/querySuitWithdrawal.json?",
            param: $(element.target).data("param")
        }).on("ajaxSuccess", function(rtv, msg, con) {
            var templateAuto = Dialog.showTemplate("#template-treat-auto", rtv, {
                width: 500,
                events: {
                    "click .JS-trigger-click-save": function(e) {
                        new Ajax({
                            request: "/court/lassenSuitWithdrawalRpc/saveSuitWithdrawal.json",
                            parseForm: "#suitWithdrawal-form-auto",
                            paramName: "suitWithdrawalMap",
                            autoSuccessAlert: !0
                        }).on("ajaxSuccess", function(rtv, msg, con) {
                            ajaxExp.submit(), "agreed" === $('select[name="deal"]').val() && queryAndOpen(element), templateAuto.hide()
                        }).submit()
                    }
                }
            })
        }).submit()
    }), delegate.on("click", ".JS-trigger-click-treat-unpaid", function(element) {
        var parameter = {};
        parameter.name = $("input[name='name']").val(), parameter.applyTime = (new Date).getTime(), $("input[name='applyTime']").val(parameter.applyTime);
        var templateUnpaid = Dialog.showTemplate("#template-treat-unpaid", parameter, {
            width: 500,
            events: {
                "click .JS-trigger-click-save": function(e) {
                    new Ajax({
                        request: "/court/lassenSuitWithdrawalRpc/saveSuitWithdrawal.json",
                        parseForm: "#suitWithdrawal-form-unpaid",
                        paramName: "suitWithdrawalMap"
                    }).on("ajaxSuccess", function(rtv, msg, con) {
                        ajaxExp.submit(), templateUnpaid.hide(), queryAndOpen(element)
                    }).submit()
                }
            }
        })
    })
});