<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>新增</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" th:href="@{/lib/layui/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/css/public.css}" media="all">
    <link rel="stylesheet" th:href="@{/css/WT/bugmanagement.css}" media="all">
</head>
<body>
<div class="layui-form layuimini-form" style="margin-left: -15px; margin-right: 20px">
    <div class="form-container">
        <!-- 左侧表单 -->
        <div class="form-left">
            <div class="layui-form-item">
                <label class="layui-form-label required">标题</label>
                <div class="layui-input-block" style="width: 69%;">
                    <input type="text" name="title" id="title" th:value="${bugmanage.title}"
                           lay-verify="required"
                           lay-reqtext="项目名称不能为空！"
                           autocomplete="off"
                           placeholder="请输入项目名称..." maxlength="30"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">缺陷描述</label>
                <div class="layui-input-block" style="width: 77%;height: 800px" >
                    <textarea name="descripTion" id="descripTion" class="layui-textarea" th:text="${bugmanage.descripTion}"></textarea>
                </div>
            </div>
        </div>
        <!-- 右侧表单 -->
        <div class="form-right">
            <div class="layui-form-item">
                <label class="layui-form-label required">项目名称</label>
                <div class="layui-input-inline">
                    <input type="hidden" class="layui-input-block" name="id" id="id" th:value="${bugmanage.id}"/>
                    <select id="xmid" name="xmid">
                        <option value="">请选择...</option>
                        <option th:each="item:${project}" th:text="${item.projectName}" th:value="${item.id}"/>
                    </select>
                    <div style="color: red">源项目: [[${bugmanage.projectName}]]</div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">工作类型</label>
                <div class="layui-input-inline">
                    <select id="workCode" name="workCode" >
                        <option value="">请选择...</option>
                        <option th:each="item:${workType}" th:text="${item.name}" th:value="${item.dict_id}" />
                    </select>
                    <div style="color: red">源工作类型: [[${bugmanage.workType}]]</div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label required">负责人</label>
                <div class="layui-input-inline">
                    <input type="hidden" id="leader" name="leader" class="layui-input"/>
                    <input type="text" id="leaderName" name="leaderName"  placeholder="请选择..." autocomplete="off"
                           class="layui-input" readonly>
                    <div style="color: red">原负责人: [[${bugmanage.leaderName}]]</div>
                </div>

            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">开始时间</label>
                <div class="layui-form-item layui-inline" style="width: auto">
                    <div class="layui-input-inline">
                        <input type="text" name="beginTimes" id="beginTimes" lay-verify="required|date" placeholder="开始日期"
                               lay-reqtext="开始日期不能为空" autocomplete="off" class="layui-input" th:value="${bugmanage.beginTime}"
                        >
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">结束时间</label>
                <div class="layui-form-item layui-inline" style="width: auto">
                    <div class="layui-input-inline" >
                        <input type="text" name="comeTimes" id="comeTimes" lay-verify="required|date" placeholder="结束日期"
                               lay-reqtext="结束日期不能为空" autocomplete="off" class="layui-input"  th:value="${bugmanage.comeTime}">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">优先级</label>
                <div class="layui-input-inline">
                    <select id="priorityCode" name="priorityCode" >
                        <option value="">请选择...</option>
                        <option th:each="item:${priority}" th:text="${item.name}" th:value="${item.dict_id}"/>
                    </select>
                    <div style="color: red">源优先级: [[${bugmanage.priorityType}]]</div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">风险等级</label>
                <div class="layui-input-inline">
                    <select id="riskCode" name="riskCode" >
                        <option value="">请选择...</option>
                        <option th:each="item:${risk}" th:text="${item.name}" th:value="${item.dict_id}" />
                    </select>
                    <div style="color: red">源风险等级: [[${bugmanage.riskType}]]</div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">需求类型</label>
                <div class="layui-input-inline">
                    <select id="reCode" name="reCode" >
                        <option value="">请选择...</option>
                        <option th:each="item:${reType}" th:text="${item.name}" th:value="${item.dict_id}"/>
                    </select>
                    <div style="color: red">源需求类型: [[${bugmanage.reType}]]</div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">需求来源</label>
                <div class="layui-input-inline">
                    <select id="demandCode" name="demandCode" >
                        <option value="">请选择...</option>
                        <option th:each="item:${demand}" th:text="${item.name}" th:value="${item.dict_id}"/>
                    </select>
                    <div style="color: red">源需求来源: [[${bugmanage.demandType}]]</div>
                </div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label">项目周期</label>
                <div class="layui-input-inline">
                    <input type="text" name="xmzq" id="xmzq" class="layui-input" readonly/>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-inline" style="height: 300px">
                    <textarea name="remark" id="remark" class="layui-textarea" autocomplete="off" th:text="${bugmanage.remark}"></textarea>
                </div>
            </div>

        </div>
    </div>
    <!-- 右侧悬浮按钮 -->
    <div class="right-bottom-btn">

        <button class="layui-btn" lay-filter="cancleBtn"><i
                class="layui-icon layui-icon-close"></i>取消
        </button>
        <button class="layui-btn" lay-submit lay-filter="saveBtns"><i
                class="layui-icon layui-icon-ok"></i>提交
        </button>
    </div>

</div>
<script th:src="@{/lib/jquery-3.4.1/jquery-3.4.1.min.js}" charset="utf-8"></script>
<script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
<script th:src="@{/lib/coco-message/coco-message.js}" charset="utf-8"></script>
<script th:src="@{/js/lay-config.js}" charset="utf-8"></script>
<script th:src="@{/js/WT/util/remarks.js}" charset="utf-8"></script>
<script type="text/javascript">

setTimeout(function () {
    let qs = $('#beginTimes').val();
    let wc = $('#comeTimes').val();
    if (qs != null && wc != null){
        let qss = new Date(qs);
        let wcc = new Date(wc);
        let timeDiff = wcc.getTime() - qss.getTime();
        let oneMonthsInMilid = 1*30*24*60*60*1000;
        let zq = timeDiff /(1000*60*60*24);
        $("#xmzq").val(zq+'天');
        return false;
    }else {
        $("#xmzq").val(NaN+'天');
        return false;
    }
},1500);
</script>
</body>
</html>