projectMaterialCollectInfoView.jsp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/webpage/include/taglib.jsp"%>
  3. <html>
  4. <head>
  5. <title>子项目列表</title>
  6. <meta name="decorator" content="default"/>
  7. <%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
  8. <script type="text/javascript">
  9. $(document).ready(function() {
  10. //搜索框收放
  11. $('#moresee').click(function(){
  12. if($('#moresees').is(':visible'))
  13. {
  14. $('#moresees').slideUp(0,resizeListWindow2);
  15. $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
  16. }else{
  17. $('#moresees').slideDown(0,resizeListWindow2);
  18. $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
  19. }
  20. });
  21. laydate.render({
  22. elem: '#beginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
  23. event: 'focus', //响应事件。如果没有传入event,则按照默认的click
  24. type : 'date'
  25. , trigger: 'click'
  26. });
  27. laydate.render({
  28. elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
  29. event: 'focus', //响应事件。如果没有传入event,则按照默认的click
  30. type : 'date'
  31. , trigger: 'click'
  32. });
  33. });
  34. function reset() {
  35. $("#searchForm").resetForm();
  36. }
  37. function openDialog(title,url,width,height,target,formId,tableId) {
  38. if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
  39. width = 'auto';
  40. height = 'auto';
  41. } else {//如果是PC端,根据用户设置的width和height显示。
  42. }
  43. top.layer.open({
  44. type: 2,
  45. area: [width, height],
  46. title: title,
  47. skin:"three-btns",
  48. maxmin: false, //开启最大化最小化按钮
  49. content: url ,
  50. btn: ['下载模板','提交','关闭'],
  51. btn1: function(index, layero){
  52. window.location.href='${ctx}/project/projectMaterialsWarehouse/import/template';
  53. },
  54. btn2:function(index,layero){
  55. var body = top.layer.getChildFrame('body', index);
  56. var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
  57. var inputForm = body.find('#inputForm');
  58. var top_iframe;
  59. if(target){
  60. top_iframe = target;//如果指定了iframe,则在改frame中跳转
  61. }else{
  62. top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
  63. }
  64. inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
  65. inputForm.attr("action","${ctx}/project/projectMaterialsWarehouse/save");//表单提交成功后,从服务器返回的url在当前tab中展示
  66. var $document = iframeWin.contentWindow.document;
  67. formSubmit2($document,formId,index,tableId);
  68. return false;
  69. },
  70. btn3: function(index){
  71. }
  72. });
  73. }
  74. function formSubmit2($document,inputForm,index,tableId){
  75. var validateForm = $($document.getElementById(inputForm)).validate({
  76. submitHandler: function(form){
  77. loading('正在提交,请稍等...');
  78. form.submit();
  79. },
  80. errorContainer: "#messageBox",
  81. errorPlacement: function(error, element) {
  82. $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
  83. if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
  84. error.appendTo(element.parent().parent());
  85. } else {
  86. error.insertAfter(element);
  87. }
  88. }
  89. });
  90. if(validateForm.form()){
  91. $($document.getElementById(inputForm)).ajaxSubmit({
  92. success:function(data) {
  93. var d = data;
  94. //输出提示信息
  95. if(d.success){
  96. parent.layer.msg(d.str,{icon:1});
  97. window.location.reload();
  98. //关闭当前页
  99. top.layer.close(index)
  100. }else{
  101. parent.layer.msg(d.str,{icon:0});
  102. }
  103. }
  104. });
  105. }
  106. }
  107. function openDialogre(title,url,width,height,target,formId,tableId) {
  108. if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
  109. width = 'auto';
  110. height = 'auto';
  111. } else {//如果是PC端,根据用户设置的width和height显示。
  112. }
  113. top.layer.open({
  114. type: 2,
  115. area: [width, height],
  116. title: title,
  117. skin:"two-btns",
  118. maxmin: false, //开启最大化最小化按钮
  119. content: url ,
  120. btn: ['确定','关闭'],
  121. yes: function(index, layero){
  122. var body = top.layer.getChildFrame('body', index);
  123. var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
  124. var inputForm = body.find('#inputForm');
  125. var top_iframe;
  126. if(target){
  127. top_iframe = target;//如果指定了iframe,则在改frame中跳转
  128. }else{
  129. top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
  130. }
  131. inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
  132. inputForm.attr("action","${ctx}/subProject/subProject/save");//表单提交成功后,从服务器返回的url在当前tab中展示
  133. var $document = iframeWin.contentWindow.document;
  134. formSubmit2($document,formId,index,tableId);
  135. },
  136. cancel: function(index){
  137. }
  138. });
  139. }
  140. // 确认对话框
  141. function subConfirmx(mess, href, closed){
  142. top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
  143. //do something
  144. if (typeof href == 'function') {
  145. href();
  146. }else{
  147. $.ajax({
  148. type:"post",
  149. url:href,
  150. dataType:"json",
  151. success:function(data){
  152. if(data.success) {
  153. top.layer.msg(data.str, {icon: 1});
  154. window.location.reload();
  155. }else {
  156. top.layer.msg(data.str, {icon: 0});
  157. }
  158. }
  159. })
  160. }
  161. top.layer.close(index);
  162. });
  163. return false;
  164. }
  165. </script>
  166. <style>
  167. body{
  168. background-color:transparent;
  169. filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
  170. color:#ffffff;
  171. background-color:rgba(255,255,255,0);
  172. height:100%;
  173. }
  174. </style>
  175. </head>
  176. <body>
  177. <div class="wrapper wrapper-content">
  178. <sys:message content="${message}"/>
  179. <div class="layui-row">
  180. <div class="full-width fl">
  181. <div class="layui-row contentShadow shadowLR" id="queryDiv">
  182. <form:form id="searchForm" modelAttribute="projectMaterialCollectInfo" action="${ctx}/project/projectMaterialsWarehouse/particularsListView?projectId=${projectId}" method="post" class="form-inline">
  183. <input id="projectId" type="hidden" value="${projectId}"/>
  184. <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
  185. <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
  186. <table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
  187. <div class="commonQuery lw6">
  188. <div class="layui-item query athird">
  189. <label class="layui-form-label">材料名称:</label>
  190. <div class="layui-input-block with-icon">
  191. <form:input path="materialName" htmlEscape="false" maxlength="64" class=" form-control layui-input"/>
  192. </div>
  193. </div>
  194. <div class="layui-item query athird">
  195. <label class="layui-form-label">工程类型:</label>
  196. <div class="layui-input-block with-icon">
  197. <form:input path="projectType" htmlEscape="false" maxlength="64" class="form-control layui-input"/>
  198. <%--<form:select path="projectType" class="form-control simple-select">
  199. <form:option value="" label=""/>
  200. <form:options items="${fns:getMainDictList('work_material_engineer_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
  201. </form:select>--%>
  202. </div>
  203. </div>
  204. <%--<div class="layui-item query athird ">
  205. <label class="layui-form-label">工程日期:</label>
  206. <div class="layui-input-block">
  207. <input id="beginDate" name="beginDate" placeholder="开始时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
  208. value="<fmt:formatDate value="${beginDate}" pattern="yyyy-MM-dd"/>"/>
  209. </input>
  210. <span class="group-sep">-</span>
  211. <input id="endDate" name="endDate" placeholder="结束时间" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
  212. value="<fmt:formatDate value="${endDate}" pattern="yyyy-MM-dd"/>"/>
  213. </input>
  214. </div>
  215. </div>--%>
  216. <div class="layui-item fr">
  217. <div class="input-group">
  218. <a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
  219. <div class="layui-btn-group search-spacing">
  220. <button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
  221. <button id="searchReset" class="layui-btn layui-btn-sm" onclick="resetSearch()">重置</button>
  222. </div>
  223. </div>
  224. </div>
  225. <div style=" clear:both;"></div>
  226. </div>
  227. <div id="moresees" style="clear:both;display:none;" class="lw6">
  228. <div class="layui-item query athird">
  229. <label class="layui-form-label">工程部位:</label>
  230. <div class="layui-input-block with-icon">
  231. <form:input path="projectPart" htmlEscape="false" maxlength="64" class="form-control layui-input"/>
  232. <%--<form:select path="projectPart" class="form-control simple-select">
  233. <form:option value="" label=""/>
  234. <form:options items="${fns:getMainDictList('work_material_engineer_part1')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
  235. </form:select>--%>
  236. </div>
  237. </div>
  238. <div style="clear:both;"></div>
  239. </div>
  240. </form:form>
  241. </div>
  242. </div>
  243. <div class="full-width fl">
  244. <div class="layui-form contentDetails contentShadow shadowLBR">
  245. <div class="nav-btns">
  246. <div class="layui-btn-group ">
  247. <%--<shiro:hasPermission name="ruralProject:ruralProjectRecords:add">
  248. <table:subProjectAddRow url="${ctx}/project/projectMaterialsWarehouse/form?projectId=${projectId}" width="500px" height="500px" label="导入" title="输变电项目材料信息"></table:subProjectAddRow><!-- 增加按钮 -->
  249. </shiro:hasPermission>
  250. <shiro:hasPermission name="project:pojectMaterialsWarehouse:list">
  251. <button type="button" data-toggle="tooltip" data-placement="top" class="layui-btn layui-btn-sm layui-bg-red" id="delUser"> 批量删除</button>
  252. </shiro:hasPermission>--%>
  253. <button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新">&nbsp;刷新</button>
  254. </div>
  255. <div style="clear: both;"></div>
  256. </div>
  257. <table class="oa-table layui-table" id="contentTable1"></table>
  258. <!-- 分页代码 -->
  259. <table:page page="${page}"></table:page>
  260. <div style="clear: both;"></div>
  261. </div>
  262. </div>
  263. </div>
  264. <div id="changewidth"></div>
  265. </div>
  266. <script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
  267. <script>
  268. layui.use('table', function(){
  269. layui.table.render({
  270. limit:${ page.pageSize }
  271. ,elem: '#contentTable1'
  272. ,page: false
  273. ,cols: [[
  274. //{checkbox: true, fixed: true},
  275. {field:'index',align:'center', title: '序号',width:40}
  276. ,{field:'projectName',align:'center', title: '项目名称',templet:function(d){
  277. return "<a class=\"attention-info\" title=\"" + d.projectName + "\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看项目信息', '${ctx}/project/projectRecords/view?id=" + d.projectId +"','95%', '95%')\">" + d.projectName + "</a>";
  278. }}
  279. ,{field:'materialName', align:'center',title: '材料名称',templet:function(d){
  280. return "<span title='"+ d.materialName +"'>" + d.materialName + "</span>";
  281. }}
  282. ,{field:'specifications', align:'center',title: '规格',templet:function(d){
  283. return "<span title='"+ d.specifications +"'>" + d.specifications + "</span>";
  284. }}
  285. ,{field:'unit', align:'center',title: '单位',templet:function(d){
  286. return "<span title=\"" + d.unit + "\">" + d.unit + "</span>";
  287. }}
  288. ,{field:'excludingTax',align:'center', title: '除税市场价', templet:function(d){
  289. return "<span title=\"" + d.excludingTax + "\">" + d.excludingTax + "</span>";
  290. }}
  291. ,{field:'userTheParts',align:'center', title: '使用部位', width:100}
  292. //,{field:'projectDate',align:'center', title: '工程日期', width:180}
  293. ,{field:'projectType',align:'center', title: '工程类型', width:100}
  294. ,{field:'projectSite',align:'center', title: '工程地点', width:100}
  295. ,{field:'projectPart',align:'center', title: '工程部位', width:100}
  296. /*,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
  297. ////对操作进行初始化
  298. var xml="";
  299. if(d.canedit1 != undefined && d.canedit1 =="1")
  300. {
  301. xml+="<a href=\"${ctx}/project/projectMaterialsWarehouse/delete?id=" + d.id + "\" onclick=\"return subConfirmx('确认要删除该信息吗?', this.href)\" class=\"layui-btn layui-btn-xs layui-bg-red\"> 删除</a>";
  302. }
  303. return xml;
  304. }}*/
  305. ]]
  306. ,data: [
  307. <c:if test="${ not empty page.list}">
  308. <c:forEach items="${page.list}" var="projectMaterial" varStatus="index">
  309. <c:if test="${index.index != 0}">,</c:if>
  310. {
  311. "index":"${index.index+1}"
  312. ,"id":"${projectMaterial.id}"
  313. ,"materialName":"${projectMaterial.materialName}"
  314. ,"projectName":"${projectMaterial.projectName}"
  315. ,"projectId":"${projectMaterial.projectId}"
  316. ,"specifications":"${projectMaterial.specifications}"
  317. ,"unit":"${projectMaterial.unit}"
  318. ,"excludingTax":"${projectMaterial.excludingTax}"
  319. ,"userTheParts":"${projectMaterial.userTheParts}"
  320. ,"projectDate":"<fmt:formatDate value="${projectMaterial.startDate}" pattern="yyyy-MM-dd"/>"+"/"+"<fmt:formatDate value="${projectMaterial.endDate}" pattern="yyyy-MM-dd"/>"
  321. ,"projectType":"${projectMaterial.projectType}"
  322. ,"projectSite":"${projectMaterial.projectSite}"
  323. ,"projectPart":"${projectMaterial.projectPart}"
  324. /*,"canedit1":
  325. <c:choose>
  326. <c:when test="${fns:getUser().id == projectMaterial.createBy.id}">"1"</c:when>
  327. <c:otherwise>"0"</c:otherwise>
  328. </c:choose>*/
  329. }
  330. </c:forEach>
  331. </c:if>
  332. ]
  333. // ,even: true
  334. // ,height: 315
  335. });
  336. /*$("#delUser").bind("click",function () {
  337. //获得表格CheckBox已经选中的行的信息
  338. var checkList = layui.table.checkStatus('contentTable1').data;
  339. //定义数组存放批量删除的行的id
  340. var listId = [];
  341. //进行遍历所有选中行数据,拿出每一行的id存储到数组中
  342. $.each(checkList, function (i, data) {
  343. listId.push(data.id);
  344. });
  345. if (listId.length <= 0) {
  346. layer.msg("请选择需要删除的信息", {icon: 2})
  347. } else {
  348. $.ajax({
  349. type:"post",
  350. url:"${ctx}/project/projectMaterialsWarehouse/deleteAll?listId="+ listId,
  351. dataType:"json",
  352. success:function(data){
  353. if(data.success) {
  354. top.layer.msg(data.str, {icon: 1});
  355. window.location.reload();
  356. }else {
  357. top.layer.msg(data.str, {icon: 0});
  358. }
  359. }
  360. })
  361. return true;
  362. }
  363. });*/
  364. })
  365. resizeListTable();
  366. $("a").on("click",addLinkVisied);
  367. </script>
  368. <script>
  369. resizeListWindow2();
  370. $(window).resize(function(){
  371. resizeListWindow2();
  372. });
  373. </script>
  374. </body>
  375. </html>