<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改检查结果管理')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<style>
    .checkResult{
        color: green;
        font-size: 16px;
    }
    .checkResult1{
        color: red;
        font-size: 16px;
    }
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="app">
    <form class="form-horizontal m" id="form-check-edit" th:object="${tdCheck}">
        <input name="checkId" th:field="*{checkId}" type="hidden">
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-xs-4 control-label is-required">所属地市：</label>
                    <div class="col-xs-8">
                        <select id="City" name="framework" disabled required @change="getAreaList()" v-model="City" class="form-control m-b">
                            <option value="">---请选择---</option>
                            <option v-for="option in CityList" :value="option.id" :key="option.id">
                                {{ option.name }}
                            </option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-xs-4 control-label is-required">所属区县：</label>
                    <div class="col-xs-8">
                        <select id="Area" name="area" disabled required v-model="Area" class="form-control m-b">
                            <option value="">---请选择---</option>
                            <option v-for="option in AreaList" :value="option.id" :key="option.id">
                                {{ option.name }}
                            </option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-xs-4 control-label">检查单位：</label>
                    <div class="col-xs-8">
                        <input name="checkAddress" readonly th:value="${sysuser.dept.deptName}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-xs-4 control-label is-required">检查类型：</label>
                    <div class="col-xs-8">
                        <select name="checkType" required class="form-control m-b" th:with="type=${@dict.getType('sys_check_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{checkType}"></option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-xs-4 control-label">开始时间：</label>
                    <div class="col-xs-8">
                        <div class="input-group date">
                            <input name="checkStartTime" disabled th:value="${#dates.format(tdCheck.checkStartTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-xs-4 control-label">结束时间：</label>
                    <div class="col-xs-8">
                        <div class="input-group date">
                            <input name="checkEndTime" disabled th:value="${#dates.format(tdCheck.checkEndTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-xs-4 control-label">报告人员：</label>
                    <div class="col-xs-8">
                        <input name="adduser" readonly th:field="*{adduser}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-xs-4 control-label">检查人员：</label>
                    <div class="col-xs-8">
                        <input name="checkName" readonly th:value="${sysuser.userName}" class="form-control" type="text">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label is-required">人员检查：</label>
                    <div class="col-xs-10">
                        <div class="radio-box" th:each="dict : ${@dict.getType('sys_self_check')}">
                            <input type="radio" th:id="${'checkresult1_' + dict.dictCode}" name="checkresult1" th:value="${dict.dictValue}" th:field="*{checkresult1}">
                            <label th:for="${'checkresult1_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                        <span>自检结果：
                    <span class="checkResult" th:if="${tdCheck.checkcontentryjt} == 0">合格</span>
                    <span class="checkResult1" th:if="${tdCheck.checkcontentryjt} == 1">不合格</span>
                </span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label"></label>
                    <div class="col-xs-10">
                        <textarea name="checkcontentry" readonly th:field="*{checkcontentry}" class="form-control" ></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label">批注：</label>
                    <div class="col-xs-10">
                        <textarea name="remark1" th:field="*{remark1}" class="form-control" ></textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label is-required">文件检查：</label>
                    <div class="col-xs-10">
                        <div class="radio-box" th:each="dict : ${@dict.getType('sys_self_check')}">
                            <input type="radio" th:id="${'checkresult2_' + dict.dictCode}" name="checkresult2" th:value="${dict.dictValue}" th:field="*{checkresult2}">
                            <label th:for="${'checkresult2_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                        <span>自检结果：
                    <span class="checkResult" th:if="${tdCheck.checkcontentrywjjt} == 0">合格</span>
                    <span class="checkResult1" th:if="${tdCheck.checkcontentrywjjt} == 1">不合格</span>
                </span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label"></label>
                    <div class="col-xs-10">
                        <textarea name="checkcontentrywj" readonly th:field="*{checkcontentrywj}" class="form-control" ></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label">批注：</label>
                    <div class="col-xs-10">
                        <textarea name="remark2" th:field="*{remark2}" class="form-control" ></textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label is-required">资产检查：</label>
                    <div class="col-xs-10">
                        <div class="radio-box" th:each="dict : ${@dict.getType('sys_self_check')}">
                            <input type="radio" th:id="${'checkresult3_' + dict.dictCode}" name="checkresult3" th:value="${dict.dictValue}" th:field="*{checkresult3}">
                            <label th:for="${'checkresult3_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                        <span>自检结果：
                    <span class="checkResult" th:if="${tdCheck.checkcontentrysbjt} == 0">合格</span>
                    <span class="checkResult1" th:if="${tdCheck.checkcontentrysbjt} == 1">不合格</span>
                </span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label"></label>
                    <div class="col-xs-10">
                        <textarea name="checkcontentrysb" readonly th:field="*{checkcontentrysb}" class="form-control" ></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label">批注：</label>
                    <div class="col-xs-10">
                        <textarea name="remark3" th:field="*{remark3}" class="form-control" ></textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label is-required">管理制度检查：</label>
                    <div class="col-xs-10">
                        <div class="radio-box" th:each="dict : ${@dict.getType('sys_self_check')}">
                            <input type="radio" th:id="${'checkresult4_' + dict.dictCode}" name="checkresult4" th:value="${dict.dictValue}" th:field="*{checkresult4}">
                            <label th:for="${'checkresult4_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                        <span>自检结果：
                    <span class="checkResult" th:if="${tdCheck.checkcontentryglzdjt} == 0">合格</span>
                    <span class="checkResult1" th:if="${tdCheck.checkcontentryglzdjt} == 1">不合格</span>
                </span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label"></label>
                    <div class="col-xs-10">
                        <textarea name="checkcontentryglzd" readonly th:field="*{checkcontentryglzd}" class="form-control" ></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label">批注：</label>
                    <div class="col-xs-10">
                        <textarea name="remark4" th:field="*{remark4}" class="form-control" ></textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label is-required">泄密事件检查：</label>
                    <div class="col-xs-10">
                        <div class="radio-box" th:each="dict : ${@dict.getType('sys_self_check')}">
                            <input type="radio" th:id="${'checkresult5_' + dict.dictCode}" name="checkresult5" th:value="${dict.dictValue}" th:field="*{checkresult5}">
                            <label th:for="${'checkresult5_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                        <span>自检结果：
                    <span class="checkResult" th:if="${tdCheck.checkcontentryxmsjjt} == 0">合格</span>
                    <span class="checkResult1" th:if="${tdCheck.checkcontentryxmsjjt} == 1">不合格</span>
                </span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label"></label>
                    <div class="col-xs-10">
                        <textarea name="checkcontentryxmsj" readonly th:field="*{checkcontentryxmsj}" class="form-control" ></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label">批注：</label>
                    <div class="col-xs-10">
                        <textarea name="remark5" th:field="*{remark5}" class="form-control" ></textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <label class="col-xs-2 control-label is-required">其他内容检查：</label>
                    <div class="col-xs-10">
                        <div class="radio-box" th:each="dict : ${@dict.getType('sys_self_check')}">
                            <input type="radio" th:id="${'checkresult6_' + dict.dictCode}" name="checkresult6" th:value="${dict.dictValue}" th:field="*{checkresult6}">
                            <label th:for="${'checkresult6_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                        </div>
                        <span>自检结果：
                    <span class="checkResult" th:if="${tdCheck.checkcontentryxmsjotherjt} == 0">合格</span>
                    <span class="checkResult1" th:if="${tdCheck.checkcontentryxmsjotherjt} == 1">不合格</span>
                </span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label"></label>
                    <div class="col-xs-10">
                        <textarea name="checkcontentryother" readonly th:field="*{checkcontentryother}" class="form-control" ></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label">批注：</label>
                    <div class="col-xs-10">
                        <textarea name="remark6" th:field="*{remark6}" class="form-control" ></textarea>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "system/checkresult";
    $("#form-check-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/checkresult", $('#form-check-edit').serialize());
        }
    }
    var app = new Vue({
        el: '#app',
        data: {
            CityList: [],
            AreaList:[],
            City:[[${tdCheck.framework}]],
            Area:[[${tdCheck.area}]],
            params:{
                parentId:'',
            }
        },
        mounted(){
            // 初始化地市列表
            this.getCityList();
            if (this.City){
                this.getAreaList()
            }
        },
        methods:{
            getCityList(){
                $.ajax({
                    url: ctx + "system/area/getSysAreaList",
                    type: 'GET',
                    data:this.params ,
                    success:((res)=>{
                        this.CityList = res.data
                    }) ,
                });
            },
            getAreaList(){
                this.params.parentId = this.City
                $.ajax({
                    url: ctx + "system/area/getSysAreaList",
                    type: 'GET',
                    data:this.params,
                    success:((res)=>{
                        this.AreaList = res.data
                    }) ,
                });
            }
        }
    })
    $("input[name='checkStartTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
    var now = new Date();
    var year = now.getFullYear();
    var month = ("0" + (now.getMonth() + 1)).slice(-2);
    var day = ("0" + now.getDate()).slice(-2);
    var formattedNow = year + "-" + month + "-" + day;
    $("input[name='checkEndTime']").val(formattedNow);

    $("input[name='checkownresulttime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>
