123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401 |
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/webpage/include/taglib.jsp"%>
- <html>
- <head>
- <title>子项目列表</title>
- <meta name="decorator" content="default"/>
- <%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
- <script type="text/javascript">
- $(document).ready(function() {
- //搜索框收放
- $('#moresee').click(function(){
- if($('#moresees').is(':visible'))
- {
- $('#moresees').slideUp(0,resizeListWindow2);
- $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
- }else{
- $('#moresees').slideDown(0,resizeListWindow2);
- $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
- }
- });
- laydate.render({
- elem: '#beginDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
- event: 'focus', //响应事件。如果没有传入event,则按照默认的click
- type : 'date'
- , trigger: 'click'
- });
- laydate.render({
- elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
- event: 'focus', //响应事件。如果没有传入event,则按照默认的click
- type : 'date'
- , trigger: 'click'
- });
- });
- function reset() {
- $("#searchForm").resetForm();
- }
- function openDialog(title,url,width,height,target,formId,tableId) {
- if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
- width = 'auto';
- height = 'auto';
- } else {//如果是PC端,根据用户设置的width和height显示。
- }
- top.layer.open({
- type: 2,
- area: [width, height],
- title: title,
- skin:"three-btns",
- maxmin: false, //开启最大化最小化按钮
- content: url ,
- btn: ['下载模板','提交','关闭'],
- btn1: function(index, layero){
- window.location.href='${ctx}/project/projectMaterialsWarehouse/import/template';
- },
- btn2:function(index,layero){
- var body = top.layer.getChildFrame('body', index);
- var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
- var inputForm = body.find('#inputForm');
- var top_iframe;
- if(target){
- top_iframe = target;//如果指定了iframe,则在改frame中跳转
- }else{
- top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
- }
- inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
- inputForm.attr("action","${ctx}/project/projectMaterialsWarehouse/save");//表单提交成功后,从服务器返回的url在当前tab中展示
- var $document = iframeWin.contentWindow.document;
- formSubmit2($document,formId,index,tableId);
- return false;
- },
- btn3: function(index){
- }
- });
- }
- function formSubmit2($document,inputForm,index,tableId){
- var validateForm = $($document.getElementById(inputForm)).validate({
- submitHandler: function(form){
- loading('正在提交,请稍等...');
- form.submit();
- },
- errorContainer: "#messageBox",
- errorPlacement: function(error, element) {
- $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
- if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
- error.appendTo(element.parent().parent());
- } else {
- error.insertAfter(element);
- }
- }
- });
- if(validateForm.form()){
- $($document.getElementById(inputForm)).ajaxSubmit({
- success:function(data) {
- var d = data;
- //输出提示信息
- if(d.success){
- parent.layer.msg(d.str,{icon:1});
- window.location.reload();
- //关闭当前页
- top.layer.close(index)
- }else{
- parent.layer.msg(d.str,{icon:0});
- }
- }
- });
- }
- }
- function openDialogre(title,url,width,height,target,formId,tableId) {
- if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {//如果是移动端,就使用自适应大小弹窗
- width = 'auto';
- height = 'auto';
- } else {//如果是PC端,根据用户设置的width和height显示。
- }
- top.layer.open({
- type: 2,
- area: [width, height],
- title: title,
- skin:"two-btns",
- maxmin: false, //开启最大化最小化按钮
- content: url ,
- btn: ['确定','关闭'],
- yes: function(index, layero){
- var body = top.layer.getChildFrame('body', index);
- var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
- var inputForm = body.find('#inputForm');
- var top_iframe;
- if(target){
- top_iframe = target;//如果指定了iframe,则在改frame中跳转
- }else{
- top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
- }
- inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
- inputForm.attr("action","${ctx}/subProject/subProject/save");//表单提交成功后,从服务器返回的url在当前tab中展示
- var $document = iframeWin.contentWindow.document;
- formSubmit2($document,formId,index,tableId);
- },
- cancel: function(index){
- }
- });
- }
- // 确认对话框
- function subConfirmx(mess, href, closed){
- top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
- //do something
- if (typeof href == 'function') {
- href();
- }else{
- $.ajax({
- type:"post",
- url:href,
- dataType:"json",
- success:function(data){
- if(data.success) {
- top.layer.msg(data.str, {icon: 1});
- window.location.reload();
- }else {
- top.layer.msg(data.str, {icon: 0});
- }
- }
- })
- }
- top.layer.close(index);
- });
- return false;
- }
- </script>
- <style>
- body{
- background-color:transparent;
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
- color:#ffffff;
- background-color:rgba(255,255,255,0);
- height:100%;
- }
- </style>
- </head>
- <body>
- <div class="wrapper wrapper-content">
- <sys:message content="${message}"/>
- <div class="layui-row">
- <div class="full-width fl">
- <div class="layui-row contentShadow shadowLR" id="queryDiv">
- <form:form id="searchForm" modelAttribute="projectMaterialCollectInfo" action="${ctx}/project/projectMaterialsWarehouse/particularsListView?projectId=${projectId}" method="post" class="form-inline">
- <input id="projectId" type="hidden" value="${projectId}"/>
- <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
- <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
- <table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
- <div class="commonQuery lw6">
- <div class="layui-item query athird">
- <label class="layui-form-label">材料名称:</label>
- <div class="layui-input-block with-icon">
- <form:input path="materialName" htmlEscape="false" maxlength="64" class=" form-control layui-input"/>
- </div>
- </div>
- <div class="layui-item query athird">
- <label class="layui-form-label">工程类型:</label>
- <div class="layui-input-block with-icon">
- <form:input path="projectType" htmlEscape="false" maxlength="64" class="form-control layui-input"/>
- <%--<form:select path="projectType" class="form-control simple-select">
- <form:option value="" label=""/>
- <form:options items="${fns:getMainDictList('work_material_engineer_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
- </form:select>--%>
- </div>
- </div>
- <%--<div class="layui-item query athird ">
- <label class="layui-form-label">工程日期:</label>
- <div class="layui-input-block">
- <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"
- value="<fmt:formatDate value="${beginDate}" pattern="yyyy-MM-dd"/>"/>
- </input>
- <span class="group-sep">-</span>
- <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"
- value="<fmt:formatDate value="${endDate}" pattern="yyyy-MM-dd"/>"/>
- </input>
- </div>
- </div>--%>
- <div class="layui-item fr">
- <div class="input-group">
- <a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
- <div class="layui-btn-group search-spacing">
- <button id="searchQuery" class="layui-btn layui-btn-sm layui-bg-blue" onclick="search()">查询</button>
- <button id="searchReset" class="layui-btn layui-btn-sm" onclick="resetSearch()">重置</button>
- </div>
- </div>
- </div>
- <div style=" clear:both;"></div>
- </div>
- <div id="moresees" style="clear:both;display:none;" class="lw6">
- <div class="layui-item query athird">
- <label class="layui-form-label">工程部位:</label>
- <div class="layui-input-block with-icon">
- <form:input path="projectPart" htmlEscape="false" maxlength="64" class="form-control layui-input"/>
- <%--<form:select path="projectPart" class="form-control simple-select">
- <form:option value="" label=""/>
- <form:options items="${fns:getMainDictList('work_material_engineer_part1')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
- </form:select>--%>
- </div>
- </div>
- <div style="clear:both;"></div>
- </div>
- </form:form>
- </div>
- </div>
- <div class="full-width fl">
- <div class="layui-form contentDetails contentShadow shadowLBR">
- <div class="nav-btns">
- <div class="layui-btn-group ">
- <%--<shiro:hasPermission name="ruralProject:ruralProjectRecords:add">
- <table:subProjectAddRow url="${ctx}/project/projectMaterialsWarehouse/form?projectId=${projectId}" width="500px" height="500px" label="导入" title="输变电项目材料信息"></table:subProjectAddRow><!-- 增加按钮 -->
- </shiro:hasPermission>
- <shiro:hasPermission name="project:pojectMaterialsWarehouse:list">
- <button type="button" data-toggle="tooltip" data-placement="top" class="layui-btn layui-btn-sm layui-bg-red" id="delUser"> 批量删除</button>
- </shiro:hasPermission>--%>
- <button class="layui-btn layui-btn-sm" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"> 刷新</button>
- </div>
- <div style="clear: both;"></div>
- </div>
- <table class="oa-table layui-table" id="contentTable1"></table>
- <!-- 分页代码 -->
- <table:page page="${page}"></table:page>
- <div style="clear: both;"></div>
- </div>
- </div>
- </div>
- <div id="changewidth"></div>
- </div>
- <script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
- <script>
- layui.use('table', function(){
- layui.table.render({
- limit:${ page.pageSize }
- ,elem: '#contentTable1'
- ,page: false
- ,cols: [[
- //{checkbox: true, fixed: true},
- {field:'index',align:'center', title: '序号',width:40}
- ,{field:'projectName',align:'center', title: '项目名称',templet:function(d){
- 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>";
- }}
- ,{field:'materialName', align:'center',title: '材料名称',templet:function(d){
- return "<span title='"+ d.materialName +"'>" + d.materialName + "</span>";
- }}
- ,{field:'specifications', align:'center',title: '规格',templet:function(d){
- return "<span title='"+ d.specifications +"'>" + d.specifications + "</span>";
- }}
- ,{field:'unit', align:'center',title: '单位',templet:function(d){
- return "<span title=\"" + d.unit + "\">" + d.unit + "</span>";
- }}
- ,{field:'excludingTax',align:'center', title: '除税市场价', templet:function(d){
- return "<span title=\"" + d.excludingTax + "\">" + d.excludingTax + "</span>";
- }}
- ,{field:'userTheParts',align:'center', title: '使用部位', width:100}
- //,{field:'projectDate',align:'center', title: '工程日期', width:180}
- ,{field:'projectType',align:'center', title: '工程类型', width:100}
- ,{field:'projectSite',align:'center', title: '工程地点', width:100}
- ,{field:'projectPart',align:'center', title: '工程部位', width:100}
- /*,{field:'op',align:'center',title:"操作",width:130,templet:function(d){
- ////对操作进行初始化
- var xml="";
- if(d.canedit1 != undefined && d.canedit1 =="1")
- {
- 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>";
- }
- return xml;
- }}*/
- ]]
- ,data: [
- <c:if test="${ not empty page.list}">
- <c:forEach items="${page.list}" var="projectMaterial" varStatus="index">
- <c:if test="${index.index != 0}">,</c:if>
- {
- "index":"${index.index+1}"
- ,"id":"${projectMaterial.id}"
- ,"materialName":"${projectMaterial.materialName}"
- ,"projectName":"${projectMaterial.projectName}"
- ,"projectId":"${projectMaterial.projectId}"
- ,"specifications":"${projectMaterial.specifications}"
- ,"unit":"${projectMaterial.unit}"
- ,"excludingTax":"${projectMaterial.excludingTax}"
- ,"userTheParts":"${projectMaterial.userTheParts}"
- ,"projectDate":"<fmt:formatDate value="${projectMaterial.startDate}" pattern="yyyy-MM-dd"/>"+"/"+"<fmt:formatDate value="${projectMaterial.endDate}" pattern="yyyy-MM-dd"/>"
- ,"projectType":"${projectMaterial.projectType}"
- ,"projectSite":"${projectMaterial.projectSite}"
- ,"projectPart":"${projectMaterial.projectPart}"
- /*,"canedit1":
- <c:choose>
- <c:when test="${fns:getUser().id == projectMaterial.createBy.id}">"1"</c:when>
- <c:otherwise>"0"</c:otherwise>
- </c:choose>*/
- }
- </c:forEach>
- </c:if>
- ]
- // ,even: true
- // ,height: 315
- });
- /*$("#delUser").bind("click",function () {
- //获得表格CheckBox已经选中的行的信息
- var checkList = layui.table.checkStatus('contentTable1').data;
- //定义数组存放批量删除的行的id
- var listId = [];
- //进行遍历所有选中行数据,拿出每一行的id存储到数组中
- $.each(checkList, function (i, data) {
- listId.push(data.id);
- });
- if (listId.length <= 0) {
- layer.msg("请选择需要删除的信息", {icon: 2})
- } else {
- $.ajax({
- type:"post",
- url:"${ctx}/project/projectMaterialsWarehouse/deleteAll?listId="+ listId,
- dataType:"json",
- success:function(data){
- if(data.success) {
- top.layer.msg(data.str, {icon: 1});
- window.location.reload();
- }else {
- top.layer.msg(data.str, {icon: 0});
- }
- }
- })
- return true;
- }
- });*/
- })
- resizeListTable();
- $("a").on("click",addLinkVisied);
- </script>
- <script>
- resizeListWindow2();
- $(window).resize(function(){
- resizeListWindow2();
- });
- </script>
- </body>
- </html>
|