166 lines
7.0 KiB
Plaintext
166 lines
7.0 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||
|
|
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||
|
|
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||
|
|
<%String contextPath = request.getContextPath();%>
|
||
|
|
<!DOCTYPE html>
|
||
|
|
<!-- <html lang="zh-CN"> -->
|
||
|
|
<!-- BEGIN HEAD -->
|
||
|
|
<head>
|
||
|
|
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||
|
|
<!-- 引用页头及CSS页-->
|
||
|
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||
|
|
<!-- 引入comm.js-->
|
||
|
|
<script type="text/javascript" src="<%= request.getContextPath()%>/plugins/qrcode/qrcode.js" charset="utf-8"></script>
|
||
|
|
<script type="text/javascript" src="<%= request.getContextPath()%>/plugins/qrcode/jquery.qrcode.min.js" charset="utf-8"></script>
|
||
|
|
<script type="text/javascript">
|
||
|
|
//二维码转格式
|
||
|
|
function utf16to8(str) {
|
||
|
|
var out, i, len, c;
|
||
|
|
out = "";
|
||
|
|
len = str.length;
|
||
|
|
for (i = 0; i < len; i++) {
|
||
|
|
c = str.charCodeAt(i);
|
||
|
|
if ((c >= 0x0001) && (c <= 0x007F)) {
|
||
|
|
out += str.charAt(i);
|
||
|
|
} else if (c > 0x07FF) {
|
||
|
|
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
|
||
|
|
out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
|
||
|
|
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||
|
|
} else {
|
||
|
|
out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
|
||
|
|
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return out;
|
||
|
|
}
|
||
|
|
|
||
|
|
$(function() {
|
||
|
|
var select =$("#search_code").select2({
|
||
|
|
ajax: {
|
||
|
|
type:'POST',
|
||
|
|
url: ext.contextPath +"/user/getUnitsByUserId4Select.do",
|
||
|
|
dataType: 'json',
|
||
|
|
delay: 250,
|
||
|
|
processResults: function (data) {
|
||
|
|
return {
|
||
|
|
results: data
|
||
|
|
}
|
||
|
|
},
|
||
|
|
cache: true
|
||
|
|
},
|
||
|
|
placeholder:'请选择',//默认文字提示
|
||
|
|
allowClear: true,//允许清空
|
||
|
|
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||
|
|
language: "zh-CN",
|
||
|
|
minimumInputLength: 0,
|
||
|
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
|
|
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||
|
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||
|
|
});
|
||
|
|
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||
|
|
select.on("change",function(e){
|
||
|
|
var companyid=$(this).val();
|
||
|
|
var url=ext.basePath+"/Login/register.do?unitId="+companyid;
|
||
|
|
var cidd2 = utf16to8(url);
|
||
|
|
$('#qrcodeTable2').empty();
|
||
|
|
$('#qrcodeTable2').qrcode({
|
||
|
|
render : "canvas",
|
||
|
|
width : 150, //设置宽度
|
||
|
|
height : 150, //设置高度
|
||
|
|
typeNumber : -1, //计算模式
|
||
|
|
correctLevel : QRErrorCorrectLevel.H,//纠错等级
|
||
|
|
background : "#ffffff",//背景颜色
|
||
|
|
foreground : "#000000", //前景颜色
|
||
|
|
text : cidd2
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
});
|
||
|
|
$(function() {
|
||
|
|
$.post(ext.contextPath + "/user/getUnitsByUserId4Select.do", {}, function(data) {
|
||
|
|
|
||
|
|
/* var selelct =$("#search_code").select2({
|
||
|
|
data: data,
|
||
|
|
placeholder:'请选择',//默认文字提示
|
||
|
|
allowClear: false,//允许清空
|
||
|
|
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
||
|
|
language: "zh-CN",
|
||
|
|
minimumInputLength: 0,
|
||
|
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
|
|
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||
|
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||
|
|
}); */
|
||
|
|
|
||
|
|
if(data.length==1){
|
||
|
|
//选择厂区为一个厂时隐藏选择框
|
||
|
|
//selelct.val(data[0].id).trigger("change");
|
||
|
|
//selelct.attr("disabled","disabled");
|
||
|
|
$("#search_code").next().css("display", "none");
|
||
|
|
$("#company").text(data[0].text);
|
||
|
|
$("#companylabel").html("公司:");
|
||
|
|
// $("#companyname").val(data[0].id);
|
||
|
|
var companyid=data[0].id;
|
||
|
|
var url=ext.basePath+"/Login/register.do?unitId="+companyid;
|
||
|
|
var cidd2 = utf16to8(url);
|
||
|
|
$('#qrcodeTable2').empty();
|
||
|
|
$('#qrcodeTable2').qrcode({
|
||
|
|
render : "canvas",
|
||
|
|
width : 150, //设置宽度
|
||
|
|
height : 150, //设置高度
|
||
|
|
typeNumber : -1, //计算模式
|
||
|
|
correctLevel : QRErrorCorrectLevel.H,//纠错等级
|
||
|
|
background : "#ffffff",//背景颜色
|
||
|
|
foreground : "#000000", //前景颜色
|
||
|
|
text : cidd2
|
||
|
|
});
|
||
|
|
}else{
|
||
|
|
//selelct.val("").trigger("change");
|
||
|
|
// $("#companyname").attr("disabled","disabled");
|
||
|
|
$("#company").css("display", "none");
|
||
|
|
}
|
||
|
|
},'json');
|
||
|
|
})
|
||
|
|
</script>
|
||
|
|
|
||
|
|
</head>
|
||
|
|
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||
|
|
<div class="wrapper">
|
||
|
|
<!-- 引用top -->
|
||
|
|
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||
|
|
<!-- 菜单栏 -->
|
||
|
|
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||
|
|
<div class="content-wrapper">
|
||
|
|
<!-- Content Header (Page header) -->
|
||
|
|
<section class="content-header">
|
||
|
|
<h1 id ="head_title"></h1>
|
||
|
|
<ol class="breadcrumb">
|
||
|
|
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||
|
|
<!-- <li class="active">Here</li> -->
|
||
|
|
</ol>
|
||
|
|
</section>
|
||
|
|
<!-- Main content -->
|
||
|
|
<section class="content container-fluid">
|
||
|
|
<div id="mainAlertdiv"></div>
|
||
|
|
<div id="subDiv" style="width: 220px;height:10px;"></div>
|
||
|
|
<div id="menu4SelectDiv"></div>
|
||
|
|
<div >
|
||
|
|
<div class="form-group " style="padding:0;">
|
||
|
|
<label class="form-label" id="companylabel">公司</label>
|
||
|
|
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
||
|
|
<span class="select2-selection select2-selection--single" id="company" style="width:220px;border: none;background: transparent;" ></span>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<br>
|
||
|
|
<div id="qrcodeTable2" style="display:block;margin: 0 auto;text-align:center; width:150px"></div>
|
||
|
|
</div>
|
||
|
|
</section>
|
||
|
|
<!-- /.content -->
|
||
|
|
</div>
|
||
|
|
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||
|
|
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
</html>
|