コード例 #1
0
def overtime_iframe_data():
    templates = DocTemplates.templates_vkreport()
    data = {}
    data['manager'] = request.args.get('manager')
    data['add'] = request.args.get('add')
    data['overrate'] = request.args.get('overrate')
    data['overdays'] = request.args.get('overdays')
    data['score'] = request.args.get('score')
    project_id = Project.query.filter_by(manager=current_user.username,
                                         quarter=utils.quarter_calc()).first()
    data['quarter'] = utils.quarter_calc()
    data['project'] = project_id.pname
    if data['add'] == "add":
        db.create_all()
        oday = Oday(quarter=data['quarter'],
                    pname=data['project'],
                    manager=project_id.manager,
                    department=project_id.department,
                    member=data['manager'],
                    rate=data['overrate'],
                    days=data['overdays'],
                    score=data['score'],
                    project_id=project_id.id)
        db.session.add(oday)
        db.session.commit()
    else:
        delid = int(data['add'])
        oday = Oday.query.filter_by(id=delid).first()
        oday.rate = request.args.get('overrate')
        oday.days = request.args.get('overdays')
        oday.score = request.args.get('score')
        db.session.commit()
    return render_template("ProMemDetail/proManager_iframeAdd.html",
                           templates=templates)
コード例 #2
0
def index():
    if current_user.is_authenticated:
        flag = utils.information_completion(current_user)
        if flag:
            temps = DocTemplates.templates_index()
            return render_template('main/index.html',
                                   title="首页",
                                   DocTemplates=temps)
        else:
            flash('请首先完善个人信息,实名认证,绑定部门', 'danger')
            return redirect(url_for('User.setting'))
    else:
        temps = DocTemplates.templates_index()
        return render_template('main/index.html',
                               title="首页",
                               DocTemplates=temps)
コード例 #3
0
def vkreport():
    if current_user.is_authenticated:

        flag = utils.information_completion(current_user)
        check_flag = current_user.flag
        if flag and check_flag:
            if current_user.role == 1:
                templates = DocTemplates.templates_vkreport()
                querydata = Project.query.filter_by(
                    manager=current_user.username,
                    quarter=utils.quarter_calc()).first()
                if querydata == None:
                    flash("部门总监暂未创建由您负责的项目,所以暂时还不能访问", 'danger')
                    return redirect(url_for('main.index'))
                else:
                    data = querydata.to_dict()
                    return render_template('WeeklyReport/proManager.html',
                                           templates=templates,
                                           msg=data)
            elif current_user.role == 2:
                return render_template('WeeklyReport/departDirector.html')
            elif current_user.role == 3 or current_user.role == 4:
                return render_template('WeeklyReport/headManager.html')
            elif current_user.role == 5:
                return render_template('WeeklyReport/techDirector.html')
        elif flag:
            flash('请等待或者联系管理员进行信息审核', 'info')
            return redirect(url_for('main.index'))
        else:
            flash('请首先完善个人信息,实名认证,绑定部门', 'danger')
            return redirect(url_for('User.setting'))
    else:
        flash("权限管理页面,请登录后访问!", 'info')
        return redirect(url_for('User.login'))
コード例 #4
0
def discipline_iframe():
    jump = utils.information_completion(current_user)
    if not jump:
        flash("请首先完善个人信息哦~", 'info')
        return redirect(url_for('User.setting'))
    print('#' * 10)
    templates = DocTemplates.templates_vkreport()
    return render_template(
        'DepartDisciplineDetail/headManager_iframeDetail.html',
        templates=templates)
コード例 #5
0
def qplan():
    if current_user.is_authenticated:
        flag = utils.information_completion(current_user)
        check_flag = current_user.flag
        if flag and check_flag:
            temps = DocTemplates.templates_index()
            quarter = utils.quarter_calc()
            templates = DocTemplates.templates_vkreport()
            if current_user.role == 1:
                querydata = Project.query.filter_by(
                    manager=current_user.username,
                    quarter=utils.quarter_calc()).first()
                if (querydata) != None:
                    data = querydata.to_dict()
                    return render_template('QuarterPlan/proManager.html',
                                           templates=templates,
                                           msg=data)
                else:
                    flash("请确认用户名是否正确,或部门总监暂未创建项目", 'info')
                    return redirect(url_for('main.index'))
            elif current_user.role == 2:
                return render_template('QuarterPlan/departDirector.html',
                                       templates=templates,
                                       quarter=quarter)
            elif current_user.role == 3 or current_user.role == 4:
                return render_template('QuarterPlan/headManager.html',
                                       templates=templates)
            elif current_user.role == 5:
                return render_template('QuarterPlan/techDirector.html',
                                       templates=templates,
                                       quarter=quarter)
            else:
                abort(404)
        elif flag:
            flash('请等待或者联系管理员进行信息审核', 'info')
            return redirect(url_for('main.index'))
        else:
            flash('请首先完善个人信息,实名认证,绑定部门', 'danger')
            return redirect(url_for('User.setting'))
    else:
        flash("权限管理模块,请登录后访问!", 'info')
        return redirect(url_for('User.login'))
コード例 #6
0
def weeklyreport(flag):
    if flag == "submit":
        templates = DocTemplates.templates_vkreport()
        data = {}
        data['schedule'] = request.args.get('quiz4')
        data['lastPlan'] = request.args.get('lastPlan')
        data['thisWork'] = request.args.get('thisWeek')
        data['nextPlan'] = request.args.get('nextPlan')
        project = Project.query.filter_by(
            manager=current_user.username,
            quarter=utils.quarter_calc()).first()
        project.schedule = data['schedule']
        db.session.commit()
        vkinformation = Vkreport(quarter=project.quarter,
                                 pname=project.pname,
                                 department=project.department,
                                 manager=project.manager,
                                 schedule=data['schedule'],
                                 lastContent=data['lastPlan'],
                                 thisContent=data['thisWork'],
                                 nextContent=data['nextPlan'],
                                 project_id=project.id)
        db.session.add(vkinformation)
        db.session.commit()
        return redirect(url_for('WeeklyReport.vkreport'))
    elif flag == "query":
        project_id = Project.query.filter_by(
            manager=current_user.username,
            quarter=utils.quarter_calc()).first().id
        querydata = Vkreport.query.filter_by(project_id=project_id).all()
        data = []
        if querydata != None:
            for msg in querydata:
                msg = msg.to_dict()
                msg['time'] = msg['time'].strftime("%Y-%m-%d %H:%M:%S")
                data.append(msg)
        page = int(request.args["page"])
        limit = int(request.args["limit"])
        data_ = data[(page - 1) * limit:page * limit]
        backdata = {"code": 0, "msg": "", "count": len(data), "data": data_}
        return backdata
    else:
        abort(404)
コード例 #7
0
def overtime_iframe_add():
    templates = DocTemplates.templates_vkreport()
    return render_template("ProMemDetail/proManager_iframeAdd.html",
                           templates=templates)
コード例 #8
0
def qplan_iframe():
    templates = DocTemplates.templates_vkreport()
    return render_template('QuarterPlan/headManager_iframe.html',
                           templates=templates)
コード例 #9
0
def performance_iframe():
    templates = DocTemplates.templates_vkreport()
    return render_template('DepartAchieveDetail/headManger_iframeAdd.html',
                           templates=templates)
コード例 #10
0
def employee_iframe_header():
    templates = DocTemplates.templates_vkreport()
    return render_template(
        'DepartMemDetail/departDirector_iframeDetail_read.html',
        templates=templates)
コード例 #11
0
def vkreport_iframe():
    templates = DocTemplates.templates_vkreport()
    return render_template("WeeklyReport/iframeDetail.html",
                           templates=templates)
コード例 #12
0
def weeklyreportiframe_read():
    templates = DocTemplates.templates_vkreport()
    return render_template("WeeklyReport/iframeRead.html", templates=templates)
コード例 #13
0
def noticeManager():
    if current_user.username != "admin_docmind":
        abort(404)
    ranks = DocTemplate.notice_type()
    return render_template('SuperAdmin/notice.html', ranks=ranks)
コード例 #14
0
def setting():
    templates = DocTemplates.templates_vkreport()
    role = current_user.role
    return render_template('User/setting.html', role=role, templates=templates)