| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- <!DOCTYPE HTML>
- <html xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{admin/common/common}">
- <head>
- <title>编辑项目名称</title>
- </head>
- <body layout:fragment="content">
- <article class="page-container">
- <form class="form form-horizontal" id="form-project-edit">
- <input type="hidden" class="input-text" required th:value="${project.id}" th:id="project_id" th:name="id"/>
- <!--<div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>项目大类:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <span class="select-box">
- <select class="select" th:name="project_super_type" id="project_super_type" required onchange="changeSuperType()">
- <option value="" >-- 请选择项目大类 --</option>
- <option th:each="item : ${projectSuperTypeList}" th:value="${item.value}"
- th:text="${item.name}" th:selected = "${project.project_super_type}==${item.value}">
- </option>
- </select>
- </span>
- </div>
- </div>-->
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>年份:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <!--<input type="text" class="input-text" required th:value="${project.project_year}" th:id="project_year" th:name="project_year"/>-->
- <span class="select-box">
- <select class="select" th:name="project_year" id="project_year" required>
- </select>
- </span>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>项目大类:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <span class="select-box">
- <select class="select" th:name="project_type" id="project_type" required>
- <option value="" >-- 请选择项目类别 --</option>
- <option th:each="item : ${projectTypeList}" th:value="${item.id}"
- th:text="${item.type_name}" th:selected = "${project.project_type}==${item.id}">
- </option>
- </select>
- </span>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>项目小类:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="text" class="input-text" required th:value="${project.project_name}" th:id="project_name" th:name="project_name"/>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">互斥类:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <span class="select-box">
- <select class="select" th:name="mutex" id="mutex" >
- <option value="" >-- 请选择互斥类 --</option>
- <option th:each="item : ${mutexList}" th:value="${item.value}"
- th:text="${item.name}" th:selected = "${project.mutex}==${item.value}" >
- </option>
- </select>
- </span>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span><span>技改类:</span></label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="radio" name="is_technical" th:checked="${project.is_technical}==true" value="1">是</input>
- <input type="radio" name="is_technical" th:checked="${project.is_technical}==false" value="0">否</input>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span><span>申请类:</span></label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="radio" name="is_application" th:checked="${project.is_application}==true" value="1">是</input>
- <input type="radio" name="is_application" th:checked="${project.is_application}==false" value="0">否</input>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>责任单位:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <span class="select-box">
- <select class="select" th:name="department_id" id="department_id" required>
- <option value="" >-- 请选择责任单位 --</option>
- <option th:each="item : ${departmentList}" th:value="${item.id}"
- th:text="${item.name}" th:selected = "${project.department_id}==${item.id}">
- </option>
- </select>
- </span>
- </div>
- </div>
- <div class="row cl">
- <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
- <button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont"></i>保存</button>
- <button onClick="removeIframe();" class="btn btn-default radius" type="button"> 返回 </button>
- </div>
- </div>
- </form>
- </article>
- <script type="text/javascript" th:src="@{/js/government/project/project_edit.js}"></script>
- <script th:inline="javascript">
- onload = function ()
- {
- var year=new Date().getFullYear(); //获取当前年份
- var sel = document.getElementById ('project_year');//获取select下拉列表
- for ( var i = 2018; i < year+3; i++)//循环添加2006到当前年份加3年的每个年份依次添加到下拉列表
- {
- var option = document.createElement ('option');
- option.value = i;
- var txt = document.createTextNode (i);
- option.appendChild (txt);
- sel.appendChild (option);
- }
- var selectYear = [[${project.project_year}]];
- $("#project_year").find("option:contains('"+selectYear+"')").attr("selected",true);
- };
- /**
- * 取消
- */
- function removeIframe() {
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index);
- }
-
- function changeSuperType(){
- $.ajax({
- url :pagePath+"/project/getProjectTypeBySuper",
- type : "get",
- data : {
- 'superType': $("#project_super_type").val()
- },
- dataType : "json",
- success: function (result) {
- if (result.success) {
- var types = result.obj;
- if(types.length>0){
- $("#project_type").find("option").remove();
- var options = '';
- for(var i=0;i< types.length;i++){
- options += '<option value="'+types[i].id+'" >'+types[i].type_name+'</option>';
- }
- $("#project_type").append(options);
- }
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- </script>
- </body>
- </html>
|