detail.html 7.9 KB
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改政务诚信评价')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-integrity-edit" th:object="${creditGovernmentIntegrity}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">序号:</label>
                <div class="col-sm-8">
                    <input name="serialNumber" th:field="*{serialNumber}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">一级指标:</label>
                <div class="col-sm-8">
                    <input name="firstIndex" th:field="*{firstIndex}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">二级指标:</label>
                <div class="col-sm-8">
                    <input name="secondIndex" th:field="*{secondIndex}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">分值:</label>
                <div class="col-sm-8">
                    <input name="score" th:field="*{score}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">材料:</label>
                <div class="col-sm-8">
                    <select name="fileType" class="form-control m-b" th:with="type=${@dict.getType('eit_government_file_type')}" disabled>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{fileType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">主要监测内容:</label>
                <div class="col-sm-8">
                    <textarea name="monitorContent" class="form-control" disabled>[[*{monitorContent}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">评分说明:</label>
                <div class="col-sm-8">
                    <textarea name="scoreStandard" class="form-control" disabled>[[*{scoreStandard}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">证明材料:</label>
                <div class="col-sm-8">
                    <textarea name="fileRequest" class="form-control" disabled>[[*{fileRequest}]]</textarea>
                </div>
            </div>

<!--            <div class="form-group" th:if="${auditPoint}">-->
<!--                <label class="col-sm-3 control-label is-required">得分:</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="point" th:field="*{point}" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="form-group" th:if="${auditPoint == false}">-->
<!--                <label class="col-sm-3 control-label is-required">得分:</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="point" th:field="*{point}" class="form-control" type="text" disabled>-->
<!--                </div>-->
<!--            </div>-->

<!--            <div class="row" th:if="${auditPoint}">-->
<!--                <div class="col-sm-offset-5 col-sm-10">-->
<!--                    <button type="button" class="btn btn-sm btn-primary" onclick="auditPoint()"><i class="fa fa-check"></i>评分更新</button>-->
<!--                </div>-->
<!--            </div>-->
        </form>

        <div class="row">
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "business/integrity";
        $("#form-integrity-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
        }

        function auditPoint() {
            var pointValue = $("input[name=point]").val();
            if (!pointValue) {
                $.modal.msgWarning('得分不能为空');
                return;
            }
            $.operate.save(prefix + "/point", $('#form-integrity-edit').serialize());
        }

        $(function() {
            var options = {
                data: [[${creditGovernmentIntegrity.fileRespList}]],
                sidePagination: "client",
                showSearch: false,
                showRefresh: false,
                showToggle: false,
                showColumns: false,
                pageSize: 50,
                columns: [{
                    checkbox: false
                },
                    {
                        field : 'id',
                        title : '文件ID',
                        visible: false
                    },
                    {
                        field : 'fileName',
                        title : '文件名'
                    },
                    {
                        field : 'deptName',
                        title : '上传部门'
                    },
                    {
                        field : 'point',
                        title : '得分',
                        formatter:function (value, row, index) {
                            var points = [];
                            points.push('<input name="point"  id="point'+row.id+'" class="form-control" type="text" value="'+value+'" width="300" />');
                            return points.join('');
                        }
                    },
                    {
                        title: '操作',
                        align: 'center',
                        formatter: function(value, row, index) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="updatePoint(\'' + row.id + '\',\'' + row.uploadDept + '\',\'' + row.bid + '\')"><i class="fa fa-edit"></i>更新分数</a> ');
                            // actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="downloadCloud(\'' + row.filePath + '\')"><i class="fa fa-edit"></i>下载</a> ');
                            return actions.join('');
                        }
                    }]
            };
            $.table.init(options);
        });

        function updatePoint(id,dept,bid){
            var point=$("#point"+id).val();
            console.log(point+"   "+dept+"  "+bid);
            $.ajax({
                url: ctx + "business/score/editPoint",
                data: {"point":point,"pId":bid,"reportDept":dept},
                type: 'POST',
                dataType: "json",
                success: function (result) {
                    $.modal.alertSuccess("得分更新成功");
                }
            })


            // $.operate.save(ctx + "business/score/editPoint",{"point":point,"pId":bid,"reportDept":dept}, function (result){
            //
            // });
        }
        function downloadCloud(fileUrl) {
            ///window.location.href = fileUrl;
            window.location.href = ctx + "business/common/oss/download?ossKey=" + encodeURI(fileUrl);
        }
    </script>
</body>
</html>