<%@ page contentType="text/html;charset=UTF-8" %>
	<script>
    /**
     * 项目经理组织交底页面
     * */
    $(document).ready(function () {
        jp.ajaxForm("#inputForm", function (data) {
            if (data.success) {
                jp.success(data.msg);
                jp.go("${ctx}/managementcenter/divide");
            } else {
                jp.error(data.msg);
                $("#inputForm").find("button:submit").button("reset");
            }
        });


        $('#startTime').datetimepicker({
            format: "YYYY-MM-DD HH:mm:ss"
        });
        $('#endTime').datetimepicker({
            format: "YYYY-MM-DD HH:mm:ss"
        });
        //富文本初始化
        $('#reason').summernote({
            height: 300,
            lang: 'zh-CN',
            readonly: true,
            callbacks: {
                onChange: function (contents, $editable) {
                    $("input[name='reason']").val($('#reason').summernote('code'));//取富文本的值
                }
            }
        });

        /**
         * 导入交底结论
         * */
        $("#importConclusion").click(function () {
            var procInsId = $("#procInsId").val();
            var projectName = $("#projectName").val();
            jp.open({
                type: 2,
                area: [500, 200],
                auto: true,
                title: "导入交底结论",
                content: "${ctx}/tag/importExcel",
                btn: ['下载模板','确定', '关闭'],
                btn1: function(){
                    jp.downloadFile("${ctx}/managementcenter/activiti/excelOut");
                },
                btn2: function (index, layero) {
                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                    iframeWin.contentWindow.importExcel('${ctx}/managementcenter/activiti/importDisclose', function (data) {
                        if (data.success) {
                            jp.alert(data.msg);
                            jp.go("${ctx}/act/task/todo")
                        } else {
                            jp.alert(data.msg);
                        }
                        jp.close(index);
                    });//调用保存事件
                    return false;
                },
                btn3: function (index) {
                    jp.close(index);
                }
            });
        });
        $("#edit").click(function () {
            var val = $("#id").val();
            jp.openSaveDialog('修改交底结论', "${ctx}/managementcenter/activiti/editCon?id="+val, '1000px', '800px');
        });
    })

    //刷新列表
    function refresh(){
        location.reload();
    }
</script>
