|
|
@@ -53,13 +53,39 @@
|
|
|
<textarea id="content" name="content" required></textarea>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="row cl">
|
|
|
+ <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"></div>
|
|
|
- <div id="filePicker">选择文件</div>
|
|
|
- </div>
|
|
|
+ <!-- <div class="uploader-thum-container">-->
|
|
|
+ <!-- <div id="fileListPre" class="uploader-list"></div>-->
|
|
|
+ <!-- <div id="filePicker">选择文件</div>-->
|
|
|
+ <!-- </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'">
|
|
|
+<!-- <tr class="text-c">-->
|
|
|
+<!-- <td class="td_material">-->
|
|
|
+<!-- <div>-->
|
|
|
+<!-- <input class="uploadFileName btn btn-upload radius" name="uploadFileName"-->
|
|
|
+<!-- readonly="readonly"-->
|
|
|
+<!-- type="text" value="上传文件"-->
|
|
|
+<!-- th:onclick="'javascript:addFileByName(\'/land_supply/addApplyFile\',this);'"/>-->
|
|
|
+<!-- <input class="uploadFileId" type="hidden"-->
|
|
|
+<!-- th:name="'fileList[0].file_id'"/>-->
|
|
|
+<!-- </div>-->
|
|
|
+<!-- </td>-->
|
|
|
+<!-- <td class="icon_font"><i class='Hui-iconfont' onclick='removeLine(this)'> 删除</i>-->
|
|
|
+<!-- </td>-->
|
|
|
+<!-- </tr>-->
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div th:if="*{canAsk}" th:each="item,itemStat: ${consulDepartmentList}">
|
|
|
@@ -68,7 +94,8 @@
|
|
|
<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:addFileLine(\''+'department'+${item.id}+'\')'"> 添加</i></div>
|
|
|
+ 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">
|
|
|
@@ -276,7 +303,7 @@
|
|
|
dataType: "json",
|
|
|
data: {
|
|
|
state: state,
|
|
|
- content_text:editor.text()
|
|
|
+ content_text: editor.text()
|
|
|
},
|
|
|
success: function (data) {
|
|
|
if (data.success) {
|
|
|
@@ -296,7 +323,7 @@
|
|
|
var departmentList = [[${departmentList}]];
|
|
|
var index = departmentList.length;
|
|
|
|
|
|
- function addFileLine(divId) {
|
|
|
+ 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>";
|
|
|
@@ -321,27 +348,44 @@
|
|
|
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++;
|
|
|
- }*/
|
|
|
+ var file_index = 0;
|
|
|
+
|
|
|
+ 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 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();
|