Ver código fonte

Merge remote-tracking branch 'origin/master'

Enford 5 anos atrás
pai
commit
d4ce47d2b4

+ 5 - 0
src/main/java/com/jeeplus/modules/sg/picking/activiti/mapper/ShowListMapper.java

@@ -124,4 +124,9 @@ public interface ShowListMapper extends BaseMapper<ShowList> {
     String findAcqStatus(ShowList showList);
 
     List<ExportListing> exportListing(List<String> list);
+
+    /**
+     * 根据id从模块表中查询附件
+     */
+    List<PickIng> findMdImg(String id);
 }

+ 4 - 0
src/main/java/com/jeeplus/modules/sg/picking/activiti/mapper/xml/ShowListMapper.xml

@@ -305,4 +305,8 @@
 		</foreach>
 		order by material_code
 	</select>
+
+	<select id="findMdImg" resultType="com.jeeplus.modules.sg.picking.activiti.entity.PickIng">
+		select md_img as mdImg from md_module_block where id =  #{id};
+	</select>
 </mapper>

+ 9 - 0
src/main/java/com/jeeplus/modules/sg/picking/activiti/service/ShowListService.java

@@ -179,4 +179,13 @@ public class ShowListService extends CrudService<ShowListMapper, ShowList> {
 		return showListMapper.exportListing(list);
 	}
 
+
+
+	public Page<PickIng> findNewImgPage(Page<PickIng> page, PickIng pickIng) {
+		dataRuleFilter(pickIng);
+		pickIng.setPage(page);
+		page.setList(mapper.findMdImg(pickIng.getId()));
+		return page;
+	}
+
 }

+ 17 - 0
src/main/java/com/jeeplus/modules/sg/picking/activiti/web/PickIngController.java

@@ -34,6 +34,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
@@ -203,6 +204,22 @@ public class PickIngController extends BaseController {
     }
 
     /**
+     * 配网项目经理审核
+     */
+    @RequestMapping(value = "pickPic")
+    public String pickPic(PickIng pickIng, Model model) {
+        model.addAttribute("pickIng", pickIng);
+        return "modules/sg/picking/activiti/pickPic";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "pickPicData")
+    public Map<String, Object> pickPicData(PickIng pickIng, HttpServletRequest request, HttpServletResponse response, Model model) {
+        Page<PickIng> page = showListService.findNewImgPage(new Page<PickIng>(request, response), pickIng);
+        return getBootstrapData(page);
+    }
+
+    /**
      * 库存对比
      */
     @RequestMapping(value = "inventoryComparison")

+ 1 - 1
src/main/webapp/webpage/modules/sg/picking/activiti/pickIng.jsp

@@ -82,7 +82,7 @@
 											<input style="width:40px;" placeholder="0" type="number" min="0" name="need" id="${itemss.id}"/><span>&nbsp;${itemss.mdUnit}</span>
 <%--											<span><img onclick="jp.showPic('${itemss.mdImg}')" src="${itemss.mdImg}" height="50px"></span>--%>
 											<c:if test="${not empty itemss.mdImg}">
-												<a id="imgButton" class="btn btn-success btn-xs waves-effect m-r-5" href="javascript:jp.showPic('${itemss.mdImg}')">显示图片</a>
+												<a id="imgButton" class="btn btn-success btn-xs waves-effect m-r-5" href="javascript:jp.openViewDialog('查看附件','${ctx}/picking/activiti/pickPic?id=${itemss.id}', '800px', '500px')">显示附件</a>
 											</c:if>
 										</div>
 								</td>

+ 199 - 0
src/main/webapp/webpage/modules/sg/picking/activiti/pickPic.js

@@ -0,0 +1,199 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<script>
+$(document).ready(function() {
+	$('#testPicTable').bootstrapTable({
+
+		  //请求方法
+               method: 'post',
+               //类型json
+               dataType: "json",
+               contentType: "application/x-www-form-urlencoded",
+               //显示检索按钮
+	           showSearch: true,
+               //显示刷新按钮
+               showRefresh: true,
+               //显示切换手机试图按钮
+               showToggle: true,
+               //显示 内容列下拉框
+    	       showColumns: true,
+    	       //显示到处按钮
+    	       showExport: true,
+    	       //显示切换分页按钮
+    	       showPaginationSwitch: true,
+    	       //最低显示2行
+    	       minimumCountColumns: 2,
+               //是否显示行间隔色
+               striped: true,
+               //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)     
+               cache: false,    
+               //是否显示分页(*)  
+               pagination: true,   
+                //排序方式 
+               sortOrder: "asc",  
+               //初始化加载第一页,默认第一页
+               pageNumber:1,   
+               //每页的记录行数(*)   
+               pageSize: 10,  
+               //可供选择的每页的行数(*)    
+               pageList: [10, 25, 50, 100],
+               //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
+               url: "${ctx}/picking/activiti/pickPicData",
+               //默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
+               //queryParamsType:'',   
+               ////查询参数,每次调用是会带上这个参数,可自定义                         
+               queryParams : function(params) {
+               	var searchParam = $("#searchForm").serializeJSON();
+               	searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1;
+               	searchParam.pageSize = params.limit === undefined? -1 : params.limit;
+               	searchParam.orderBy = params.sort === undefined? "" : params.sort+ " "+  params.order;
+                   return searchParam;
+               },
+               //分页方式:client客户端分页,server服务端分页(*)
+               sidePagination: "server",
+               contextMenuTrigger:"right",//pc端 按右键弹出菜单
+               contextMenuTriggerMobile:"press",//手机端 弹出菜单,click:单击, press:长按。
+               contextMenu: '#context-menu',
+               onClickRow: function(row, $el){
+               },
+               	onShowSearch: function () {
+			$("#search-collapse").slideToggle();
+		},
+               columns: [
+				   {
+					checkbox: true
+					},
+				 {
+		        field: 'mdImg',
+		        title: '图片路径',
+		        sortable: true,
+		        sortName: 'mdImg',
+		        formatter:function(value, row , index){
+		        	var valueArray = value.split("|");
+		        	var labelArray = [];
+		        	for(var i =0 ; i<valueArray.length; i++){
+		        		if(!/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(valueArray[i]))
+		        		{
+		        			labelArray[i] = "<a href=\""+valueArray[i]+"\" url=\""+valueArray[i]+"\" target=\"_blank\">"+decodeURIComponent(valueArray[i].substring(valueArray[i].lastIndexOf("/")+1))+"</a>"
+		        		}else{
+		        			labelArray[i] = '<img   onclick="jp.showPic(\''+valueArray[i]+'\')"'+' height="50px" src="'+valueArray[i]+'">';
+		        		}
+		        	}
+		        	return labelArray.join(" ");
+		        }
+		       
+		    }]
+		});
+		
+		  
+	  if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端
+
+		 
+		  $('#testPicTable').bootstrapTable("toggleView");
+		}
+	  
+	  $('#testPicTable').on('check.bs.table uncheck.bs.table load-success.bs.table ' +
+                'check-all.bs.table uncheck-all.bs.table', function () {
+            $('#remove').prop('disabled', ! $('#testPicTable').bootstrapTable('getSelections').length);
+            $('#view,#edit').prop('disabled', $('#testPicTable').bootstrapTable('getSelections').length!=1);
+        });
+		  
+		$("#btnImport").click(function(){
+			jp.open({
+			    type: 2,
+                area: [500, 200],
+                auto: true,
+			    title:"导入数据",
+			    content: "${ctx}/tag/importExcel" ,
+			    btn: ['下载模板','确定', '关闭'],
+				    btn1: function(index, layero){
+					  jp.downloadFile('${ctx}/test/pic/testPic/import/template');
+				  },
+			    btn2: function(index, layero){
+				        var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+						iframeWin.contentWindow.importExcel('${ctx}/test/pic/testPic/import', function (data) {
+							if(data.success){
+								jp.success(data.msg);
+								refresh();
+							}else{
+								jp.error(data.msg);
+							}
+                            jp.close(index);
+                        });//调用保存事件
+                    return false;
+				  },
+				 
+				  btn3: function(index){ 
+					  jp.close(index);
+	    	       }
+			}); 
+		});
+		
+		
+	 $("#export").click(function(){//导出Excel文件
+			jp.downloadFile('${ctx}/test/pic/testPic/export');
+	  });
+
+		    
+	  $("#search").click("click", function() {// 绑定查询按扭
+		  $('#testPicTable').bootstrapTable('refresh');
+		});
+	 
+	 $("#reset").click("click", function() {// 绑定查询按扭
+		  $("#searchForm  input").val("");
+		  $("#searchForm  select").val("");
+		  $("#searchForm  .select-item").html("");
+		  $('#testPicTable').bootstrapTable('refresh');
+		});
+		
+		
+	});
+		
+  function getIdSelections() {
+        return $.map($("#testPicTable").bootstrapTable('getSelections'), function (row) {
+            return row.id
+        });
+    }
+  
+  function deleteAll(){
+		jp.confirm('确认要删除该图片管理记录吗?', function(){
+			jp.loading();  	
+			jp.get("${ctx}/managementcenter/upload/delete?ids=" + getIdSelections(), function(data){
+         	  		if(data.success){
+         	  			$('#testPicTable').bootstrapTable('refresh');
+         	  			jp.success(data.msg);
+         	  		}else{
+         	  			jp.error(data.msg);
+         	  		}
+         	  	})
+          	   
+		})
+  }
+
+    //刷新列表
+  function refresh(){
+  	$('#testPicTable').bootstrapTable('refresh');
+  }
+  
+   function add(){
+	  jp.openSaveDialog('新增图片管理', "${ctx}/managementcenter/upload/list",'800px', '500px');
+  }
+
+
+  
+   function edit(id){//没有权限时,不显示确定按钮
+       if(id == undefined){
+	      id = getIdSelections();
+	}
+	jp.openSaveDialog('编辑图片管理', "${ctx}/managementcenter/upload/imagesForm?id=" + id, '800px', '500px');
+  }
+  
+ function view(id){//没有权限时,不显示确定按钮
+      if(id == undefined){
+             id = getIdSelections();
+      }
+        jp.openViewDialog('查看图片管理', "${ctx}/managementcenter/upload/imagesForm?id=" + id, '800px', '500px');
+ }
+
+
+
+</script>

+ 32 - 0
src/main/webapp/webpage/modules/sg/picking/activiti/pickPic.jsp

@@ -0,0 +1,32 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/webpage/include/taglib.jsp"%>
+<html>
+<head>
+	<title>附件查看</title>
+	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
+	<meta name="decorator" content="ani"/>
+	<%@ include file="/webpage/include/bootstraptable.jsp"%>
+	<%@include file="/webpage/include/treeview.jsp" %>
+	<%@include file="pickPic.js" %>
+</head>
+<body>
+	<div class="wrapper wrapper-content">
+	<div class="panel panel-primary">
+	<div class="panel-heading">
+		<h3 class="panel-title">附件查看</h3>
+	</div>
+	<div class="panel-body">
+
+	<form:form id="searchForm" modelAttribute="pickIng" class="form form-horizontal well clearfix">
+		<form:hidden path="id"/>
+	</form:form>
+
+	<!-- 表格 -->
+	<table id="testPicTable"   data-toolbar="#toolbar"></table>
+
+    <!-- context menu -->
+	</div>
+	</div>
+	</div>
+</body>
+</html>