| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556 |
- <!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>
- <style>
- multiple:hover .dropdown-clear-all, .dropdown-single:hover .dropdown-clear-all {
- display: none;
- }
- .line {
- display: block;
- text-align: left;
- background-color: #fff;
- color: #333;
- border-bottom: 1px solid #0a6999;
- border-color: #fff;
- border-bottom: 1px solid #0a6999;
- margin-top: 10px;
- vertical-align: middle;
- padding: 4px 12px;
- height: 31px;
- line-height: 31px;
- font-size: 14px;
- font-weight: bold;
- }
- </style>
- </head>
- <body layout:fragment="content">
- <article class="page-container">
- <form class="form form-horizontal" id="form-add">
- <div class="line">基本信息 <span style="float:right">项目来源:[[${data?.resource}]]</span></div>
- <div class="row cl">
- <input id="id" name="id" type="hidden" th:value="${data.id}"/>
- <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" placeholder="请输入项目标题" id="title" name="title"
- th:value="${data.title}"/>
- </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" placeholder="请输入项目用地" id="location" name="location"
- th:value="${data.location}"/>
- </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">
- <textarea id="content" name="content" required>[[${data.content}]]</textarea>
- </div>
- </div>
- <div class="row cl" th:id="upload_file">
- <label class="form-label col-xs-4 col-sm-2"><span>上传附件:</span></label>
- <div class="formControls col-xs-8 col-sm-9">
- <!-- <div class="uploader-thum-container">-->
- <!-- <div id="fileListPre" class="uploader-list">-->
- <!-- <th:block th:unless="${data.fileDown==null || data.fileDown.file_url== null}">-->
- <!-- <a th:href=" ${fileUrl} + ${data.fileDown.file_url}" target="_blank">[[${data.fileDown.file_name}]]</a>-->
- <!-- </th:block>-->
- <!-- </div>-->
- <!-- <div id="filePicker">上传</div>-->
- <!-- <th:block th:switch="${data.fileDown==null || data.fileDown.file_url== null}">-->
- <!-- <input th:case="true" type="hidden" name="fileDown.file_id" id="files">-->
- <!-- <input th:case="false" type="hidden" name="fileDown.file_id" id="files"-->
- <!-- th:value="${data.fileDown.file_id}">-->
- <!-- </th:block>-->
- <!-- </div>-->
- <div><i class="Hui-iconfont" style="cursor: pointer;"
- th:onclick="'javascript:addFileLine(\'upload_file\')'"> 添加</i></div>
- <table class="table table-border table-bordered table-bg table-hover ">
- <thead>
- <tr class="text-c">
- <th>文件</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody class="add_file_line" th:id="'tbody_upload_file'">
- <th:block th:unless="${data.fileList==null}"
- th:each="item,itemStat: ${data.fileList}">
- <tr class="text-c">
- <td class="td_material">
- <div>
- <input class="uploadFileName btn btn-upload radius" name="uploadFileName"
- readonly="readonly"
- type="text" th:value="${item.file_name}"
- th:onclick="'javascript:addFileByName(\'/land_supply/addApplyFile\',this);'"/>
- <input class="uploadFileId" type="hidden" th:value="${item.file_id}"
- th:name="'fileList['+${itemStat.index}+'].file_id'"/>
- </div>
- </td>
- <td class="icon_font"><i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>
- </td>
- </tr>
- </th:block>
- </tbody>
- </table>
- </div>
- </div>
- <div th:if="*{canAsk}" th:each="item,itemStat: ${consulDepartmentList}">
- <div class="line">[[${item.name}]]</div>
- <div class="row cl" th:id=" 'department'+${item.id}">
- <label class="form-label col-xs-4 col-sm-2"></label>
- <div class="formControls col-xs-8 col-sm-9">
- <div><i class="Hui-iconfont" style="cursor: pointer;"
- th:onclick="'javascript:addQuestionLine(\''+'department'+${item.id}+'\')'"> 添加</i>
- </div>
- <table class="table table-border table-bordered table-bg table-hover ">
- <thead>
- <tr class="text-c">
- <th>咨询问题</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody class="add_file_line" th:id="'tbody_department'+${item.id}">
- <tr class="text-c"
- th:each="landSupplyCons,landSupplyConsStat: ${industrialLandSupplyConsultationList}"
- th:if="*{item.id+''==landSupplyCons.department_id}">
- <td class="td_material">
- <input type="text" class="input-text consultation" placeholder="请输入咨询的问题"
- th:name="'consultationList[1'+${landSupplyConsStat.index}+${itemStat.index}+'].consultation'"
- th:value="${landSupplyCons.consultation}"/>
- <input class="department_id" type="hidden"
- th:name="'consultationList[1'+${landSupplyConsStat.index}+${itemStat.index}+'].department_id'"
- th:value="${item.id}"/>
- <input type="hidden"
- th:name="'consultationList[1'+${landSupplyConsStat.index}+${itemStat.index}+'].id'"
- th:value="${landSupplyCons.id}"/>
- </td>
- <td class="icon_font"><i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </form>
- <form class="form form-horizontal" id="form-approve">
- <input id="status" type="hidden" name="status"/>
- <input id="apply_id" type="hidden" name="apply_id" th:value="${data.id}"/>
- <div th:if="*{data.approve_status=='2' || data.approve_status=='4' || data.approve_status=='12'}" class="line">流程信息</div>
- <div th:if="*{data.approve_status=='2' || data.approve_status=='4' || data.approve_status=='12'}" class="row cl">
- <label class="form-label col-xs-4 col-sm-2"></label>
- <div class="formControls col-xs-8 col-sm-9">
- <table class="table table-border table-bordered table-bg table-hover processTb">
- <thead>
- <tr class="text-c">
- <th>时间</th>
- <!-- <th>审核状态</th> -->
- <th>单位</th>
- <th>操作人</th>
- <th>操作</th>
- <th>审核意见</th>
- </tr>
- </thead>
- <tbody>
- <tr class="text-c" th:each="model,iterStat:${approvalList}" th:object="${model}">
- <td th:text="*{create_time}"></td>
- <!-- <td th:text="*{before_approvalstatus_str}"></td> -->
- <td th:text="*{department}"></td>
- <td th:text="*{create_name}"></td>
- <td th:text="*{oper_type}"></td>
- <td class="viewComment" th:data="*{approval_comment}" th:text="*{approval_comment}"></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div th:if="*{data.approve_status=='2'}" class="line">审核意见</div>
- <div th:if="*{data.approve_status=='2'}" class="row cl">
- <label class="form-label col-xs-4 col-sm-2">审核意见:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <textarea class="textarea" id="approval_comment" th:name="approval_comment"
- placeholder="请输入审核意见"></textarea>
- </div>
- </div>
- </form>
- <div class="row cl text-c" style="margin-top: 15px;background-color: white">
- <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
- <a onclick="save()" class="btn btn-secondary radius"
- th:if="*{data.approve_status=='1' || data.approve_status=='5'}">
- <i class="Hui-iconfont"></i>保存草稿</a>
- <a onclick="release()" class="btn btn-primary radius"><i class="Hui-iconfont"></i>提交 </a>
- <a onclick="audit(1)" class="btn btn-default radius"
- th:if="*{data.approve_status=='2'}">退回 </a>
- <a onClick="removeIframe();" class="btn btn-default radius" type="button"> 取消 </a>
- </div>
- </div>
- </article>
- <script type="text/javascript" th:src="@{/h-ui/lib/webuploader/0.1.5/webuploader.min.js}"></script>
- <script th:inline="javascript">
- //富文本kindeditor初始化
- var editor;
- KindEditor.ready(function (K) {
- editor = K.create('#content', {
- uploadJson: pagePath + '/upload/kindEditorUpload',
- cssData: 'body {font-family: "微软雅黑"; font-size: 14px}',
- allowFileManager: false,
- allowUpload: true,
- width: "100%",
- height: "350px",
- items: array,
- syncType: "auto",
- filterMode: false,
- afterBlur: function () {
- this.sync();
- }
- });
- });
- $(function () {
- // 初始化上传
- var options = {
- uploadBtnId: '#filePicker',
- picturePreId: 'fileListPre',
- hiddenPictureUrl: 'img',
- hiddenPictureName: 'imgName',
- width: 81,
- height: 81,
- fileSizeLimit: 100 * 1024 * 1024,
- fileSingleSizeLimit: 100 * 1024 * 1024
- };
- var webUploadDoc = new $WebUploadDoc(options);
- webUploadDoc.init();
- // var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
- // var isOpera = userAgent.indexOf("Opera") > -1;
- // //判断是否IE浏览器
- // if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) {
- // $("#apply_startdate").remove();
- // $("#apply_enddate").remove();
- // } else {
- // $("#apply_startdateIE").remove();
- // $("#apply_enddateIE").remove();
- // var startDate = laydate.render({
- // elem: '#apply_startdate',
- // type: 'datetime',
- // done: function (value, date) {
- // setTimeout(function () {
- // $("#form-add").validate().element($("#apply_startdate"));
- // }, 100)
- // if (value !== '') {
- // endDate.config.min.year = date.year;
- // endDate.config.min.month = date.month - 1;
- // endDate.config.min.date = date.date;
- // endDate.config.min.hours = date.hours;
- // endDate.config.min.minutes = date.minutes;
- // endDate.config.min.seconds = date.seconds;
- // } else {
- // endDate.config.min.year = '1900';
- // endDate.config.min.month = '0';
- // endDate.config.min.date = '1';
- // endDate.config.min.hours = '0';
- // endDate.config.min.minutes = '0';
- // endDate.config.min.seconds = '0';
- // }
- // }
- // });
- //
- // var endDate = laydate.render({
- // elem: '#apply_enddate',
- // type: 'datetime',
- // done: function (value, date) {
- // setTimeout(function () {
- // $("#form-add").validate().element($("#apply_enddate"));
- // }, 100)
- // if (value !== '') {
- // startDate.config.max.year = date.year;
- // startDate.config.max.month = date.month - 1;
- // startDate.config.max.date = date.date;
- // startDate.config.max.hours = date.hours;
- // startDate.config.max.minutes = date.minutes;
- // startDate.config.max.seconds = date.seconds;
- // } else {
- // startDate.config.max.year = '2100';
- // startDate.config.max.month = '0';
- // startDate.config.max.date = '1';
- // startDate.config.max.hours = '0';
- // startDate.config.max.minutes = '0';
- // startDate.config.max.seconds = '0';
- // }
- // }
- // });
- // }
- });
- //取消
- function removeIframe() {
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index);
- }
- //默认状态为草稿
- var state = '0';
- $("#form-add").validate({
- rules: {
- title: {
- required: true,
- },
- location: {
- required: true,
- },
- content: {
- required: true,
- }
- },
- onkeyup: false,
- focusCleanup: true,
- focusInvalid: false,
- success: "valid",
- submitHandler: function (form) {
- if (editor.isEmpty()) {
- errorMessage('请输入项目介绍');
- return false;
- } else if (editor.text().length > 2000) {
- //errorMessage('项目内容最多2000字');
- //return false;
- }
- $(form).ajaxSubmit({
- type: 'post',
- url: pagePath + "/land_supply/update",
- dataType: "json",
- data: {
- state: state,
- content_text: editor.text()
- },
- success: function (result) {
- if (result.success) {
- succeedMessage(result.message);
- setTimeClose();
- } else {
- // $(form).find(":submit").attr("disabled", false);
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- return false; // 非常重要,如果是false,则表明是不跳转,在本页上处理,也就是ajax,如果是非false,则传统的form跳转。
- }
- });
- //发布
- function release() {
- state = "1";
- $("#form-add").submit();
- }
- //保存草稿
- function save() {
- state = "0";
- $("#form-add").ajaxSubmit({
- type: 'post',
- url: pagePath + "/land_supply/update",
- dataType: "json",
- data: {
- state: state,
- content_text: editor.text()
- },
- success: function (data) {
- if (data.success) {
- succeedMessage(data.message);
- setTimeClose();
- } else {
- // $(form).find(":submit").attr("disabled", false);
- errorMessage(data.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- //status 1退回,2通过,3不通过
- function audit(status) {
- $("#status").val(status);
- if ($("#approval_comment").val() && $("#approval_comment").val().length > 5000) {
- errorMessage('审核意见最多支持5000个字符!');
- return false;
- }
- if (status == 1 || status == 3) {
- //退回、不通过审核意见必填
- if ($.trim($("#approval_comment").val()) == "") {
- errorMessage('请填写审核意见!');
- return false;
- }
- var str = "确定操作吗?"
- if (status == 1) {
- str = "确定退回吗?"
- } else if (status == 3) {
- str = "确定不通过吗?"
- }
- layer.confirm(str, function (index) {
- $("#form-approve").submit();
- layer.close(index);
- });
- } else if (status == 2) {
- $("#form-approve").submit();
- }
- }
- $(function () {
- $("#form-approve").validate({
- rules: {},
- messages: {},
- onkeyup: false,
- focusCleanup: true,
- success: "valid",
- submitHandler: function (form) {
- $(form).ajaxSubmit({
- type: 'post',
- url: pagePath + "/land_supply/approve",
- dataType: "json",
- success: function (data) {
- if (data.success) {
- succeedMessage(data.message);
- setTimeClose();
- } else {
- errorMessage(data.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- return false; // 非常重要,如果是false,则表明是不跳转,在本页上处理,也就是ajax,如果是非false,则传统的form跳转。
- }
- });
- //查看完整意见
- $(".viewComment").on("click", function () {
- layer.alert(
- $(this).attr('data'),
- {area: ['800px', '500px']}
- )
- });
- });
- var departmentList = [[${consulDepartmentList}]];
- var index = departmentList.length;
- function addQuestionLine(divId) {
- var length = index;
- if ($("#" + divId).find('.add_file_line>tr').length > 0) {
- var html = "<i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>";
- $("#" + divId).find(".add_file_line tr:eq(0)").clone().insertAfter($("#" + divId).find('.add_file_line>tr').eq(-1))
- .find(".consultation").removeAttr("name").attr("name", "consultationList[" + length + "].consultation").val("").end()
- .find(".department_id").removeAttr("name").attr("name", "consultationList[" + length + "].department_id").end()
- .find(".icon_font").html(html).end();
- } else {
- var str = "";
- str += "<tr class='text-c'>"
- str += "<td class='td_material'>"
- str += "<input type='text' class='input-text consultation' placeholder='请输入咨询的问题' name='consultationList[" + length + "].consultation'/>"
- str += "<input class='department_id' type='hidden' value='" + divId.split("department")[1] + "' name='consultationList[" + length + "].department_id' />"
- str += "</td>"
- str += "<td class='icon_font'><i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>"
- str += "</td>"
- str += "</tr>"
- $("#tbody_" + divId).html(str);
- }
- $('#layui-layer2').height(48);
- index++;
- }
- var fileList = [[${data.fileList}]];
- var file_index = fileList.length;
- function addFileLine(divId) {
- if (file_index == undefined) {
- file_index = 0
- }
- var length = file_index;
- if ($("#" + divId).find('.add_file_line>tr').length > 0) {
- var html = "<i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>";
- $("#" + divId).find(".add_file_line tr:eq(0)").clone().insertAfter($("#" + divId).find('.add_file_line>tr').eq(-1))
- .find(".uploadFileId").removeAttr("name").attr("name", "fileList[" + length + "].file_id").val("").end()
- .find(".uploadFileName").val("上传文件").end()
- .find(".icon_font").html(html).end();
- } else {
- var str = "";
- str += "<tr class='text-c'>"
- str += "<td class='td_material'>"
- str += "<div>"
- str += "<input class='uploadFileName btn btn-upload radius' name='uploadFileName' readonly='readonly' type='text' value='上传文件' onclick=\"addFileByName('/land_supply/addApplyFile',this);\"/>"
- str += "<input class='uploadFileId' hidden name='fileList[" + length + "].file_id'/>"
- str += "</div>"
- str += "</td>"
- str += "<td class='icon_font'><i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>"
- str += "</td>"
- str += "</tr>"
- $("#tbody_" + divId).html(str);
- }
- $('#layui-layer2').height(48);
- file_index++;
- }
- // function addFileLine(divId) {
- // // var length = $("#" + divId).find(".add_file_line tr").length;
- // var length = index;
- // var html = "<i class='Hui-iconfont' onclick='removeLine(this)'></i>";
- // $("#" + divId).find(".add_file_line tr:eq(0)").clone().insertAfter($("#" + divId).find('.add_file_line>tr').eq(-1))
- // .find(".consultation").removeAttr("name").attr("name", "consultationList[" + length + "].consultation").val("").end()
- // .find(".department_id").removeAttr("name").attr("name", "consultationList[" + length + "].department_id").end()
- // .find(".icon_font").html(html).end();
- // $('#layui-layer2').height(48);
- // index++;
- // }
- // function addFileLine(divId) {
- // var length = $("#" + divId).find(".add_file_line tr").length;
- // var html = "<i class='Hui-iconfont' onclick='removeLine(this)'></i>";
- // $("#" + divId).find(".add_file_line tr:eq(0)").clone().insertAfter($("#" + divId).find('.add_file_line>tr').eq(-1))
- // .find(".consultation").removeAttr("name").attr("name", divId + "[" + length + "].consultation").val("").end()
- // .find(".department_id").removeAttr("name").attr("name", divId + "[" + length + "].department_id").end()
- // .find(".icon_font").html(html).end();
- // $('#layui-layer2').height(48);
- // }
- //添加相应name的文件
- function addFileByName(url, obj) {
- var name = $(obj).next().attr("name");
- url += "?fileIdName=" + name;
- layer_show('添加文件', pagePath + url, 800, 350);
- }
- function removeLine(obj) {
- $(obj).parent().parent().remove();
- }
- </script>
- </body>
- </html>
|