| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Expires" content="0" />
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <link rel="shortcut icon" href="/img/logo.png" />
- <link rel="bookmark" href="/img/logo.png" />
- <link rel="stylesheet" href="/plugins/bootstrap-4.3.1/css/bootstrap.min.css">
- <link rel="stylesheet" href="/plugins/font-awesome-4.7.0/css/font-awesome.min.css">
- <link rel="stylesheet" href="/main/common/StyleSheet.css" />
- <script src="/Plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
- <script src="/Plugins/jquery.easing/jquery.easing.min.js"></script>
- <script src="/Plugins/virtualkeyboard/xvirtualkeyboard.js"></script>
- <title>东科软件</title>
- </head>
- <body class="bg-light">
- <!--导航菜单-->
- <script src="/main/common/navbar.js"></script>
- <div class="container pt-4">
- <!--登录窗体-->
- <form id="登录窗体" class="p-5 rounded shadow-sm bg-white position-absolute" style="width:350px;top:50%;margin-top:-800px;left:50%;margin-left:-175px;">
- <h5 class="text-center">用户登录</h5>
- <div class="form-row pt-3">
- <div class="form-group col-12">
- <label class="sr-only" for="登录类型">登录类型</label>
- <div class="input-group mb-2 ">
- <div class="input-group-prepend">
- <div class="input-group-text" style="width:40px;"><i class="fa fa-cog " aria-hidden="true"></i></div>
- </div>
- <select class="custom-select" id="登录类型">
- <option value="1">打卡并登录工位</option>
- <option value="0">仅打卡</option>
- </select>
- </div>
- </div>
- </div>
- <div class="form-row">
- <div class="form-group col-12">
- <label class="sr-only" for="账套">账套</label>
- <div class="input-group mb-2">
- <div class="input-group-prepend">
- <div class="input-group-text" style="width:40px;"><i class="fa fa-address-book-o" aria-hidden="true"></i></div>
- </div>
- <input value="dongke" type="text" class="form-control" id="账套" placeholder="请输入账套">
- </div>
- </div>
- </div>
- <div class="form-row">
- <div class="form-group col-12">
- <label class="sr-only" for="用户">用户</label>
- <div class="input-group mb-2">
- <div class="input-group-prepend">
- <div class="input-group-text" style="width:40px;"><i class="fa fa-user" aria-hidden="true"></i></div>
- </div>
- <input onkeyup="this.value=this.value.toUpperCase()" value="" type="text" class="form-control" id="用户" placeholder="请输入用户">
- </div>
- </div>
- </div>
- <div class="form-row">
- <div class="form-group col-12">
- <label class="sr-only" for="密码">密码</label>
- <div class="input-group mb-2">
- <div class="input-group-prepend">
- <div class="input-group-text" style="width:40px;"><i class="fa fa-key" aria-hidden="true"></i></div>
- </div>
- <input onkeydown="if (event.keyCode == 13) doLogin();" type="password" class="form-control" id="密码" placeholder="请输入密码">
- </div>
- </div>
- </div>
- <div class="form-row col-12 justify-content-center">
- <button onclick="loginButton_onClick()" type="button" class="btn btn-danger" style="width:100px;">登录</button>
- <button type="reset" class="btn btn-secondary" style="width:100px;">重置</button>
- </div>
- </form>
- <!--工位窗体-->
- <form id="工位窗体" class="p-5 rounded shadow-sm bg-white position-absolute" style="width:350px;top:50%;margin-top:-800px;left:50%;margin-left:-175px;">
- <h5 class="text-center">请您确认工位</h5>
- <div class="form-row pt-3">
- <div class="form-group col-12">
- <label class="sr-only" for="工位">工位</label>
- <div class="input-group mb-2 ">
- <div class="input-group-prepend">
- <div class="input-group-text" style="width:40px;"><i class="fa fa-share-alt" aria-hidden="true"></i></div>
- </div>
- <select class="custom-select" id="工位">
- </select>
- </div>
- </div>
- </div>
- <div class="form-row col-12 justify-content-center">
- <button onclick="workButton_onClick()" type="button" class="btn btn-danger" style="width:100px;">确定</button>
- <button type="reset" class="btn btn-secondary" style="width:100px;">重置</button>
- </div>
- </form>
- <!--打卡窗体-->
- <form id="打卡窗体" class="pt-5 pb-5 rounded shadow-sm bg-white position-absolute" style="width:600px;top:50%;margin-top:-800px;left:50%;margin-left:-300px;">
- <h5 class="text-center">请您确认当前工号员工</h5>
- <div class="form-row pt-3 pl-5">
- <div id="工号员工模板" style="display:none">
- <label class="checkbox-inline pt-2" style="width:250px;border-bottom:1px solid lightgray">
- <input type="checkbox" value="{STAFFID}"> {STAFFCODE} {STAFFNAME} {JOBSNAME}
- </label>
- </div>
- <!--<div id="工号员工模板" style="display:none">
- <label class="checkbox-inline" style="width:90px;">
- <input type="checkbox" value="{STAFFID}"> {STAFFNAME}
- </label>
- </div>-->
- <div id="工号员工" class="form-group" style="font-size:18px;">
- </div>
- </div>
- <div class="form-row col-12 justify-content-center">
- <button onclick="regButton_onClick()" type="button" class="btn btn-danger" style="width:100px;">确定</button>
- <button type="reset" class="btn btn-secondary" style="width:100px;">重置</button>
- </div>
- </form>
- </div>
- <!--版权信息-->
- <script src="/main/common/footer.js"></script>
- <script src="/Plugins/bootstrap-4.3.1/js/bootstrap.bundle.min.js"></script>
- <script src="/Plugins/sweetalert/sweetalert.min.js"></script>
- <script src="/Plugins/xrequest/xrequest.min.js"></script>
- <script src="/Plugins/md5/md5.js"></script>
- <script src="/main/common/xuwell.js"></script>
- <script>
- var workStation = [];
- $(function () {
- $('#登录窗体').animateShow();
- });
- function keyBoard() {
- //启用软键盘
- $('#账套').keyboard({ usePreview: false, autoAccept: true });
- $('#用户').keyboard({ usePreview: false, autoAccept: true });
- $('#密码').keyboard({ usePreview: false, autoAccept: true });
- swal({
- title: '用户登录',
- text: '软键盘已加载!',
- icon: 'success',
- button: '确定'
- });
- }
- //登录按钮
- function loginButton_onClick() {
- console.log('账套:' + $('#账套').val() + ' 用户名:' + $('#用户').val() + ' 密码:' + hex_md5($('#密码').val()).toUpperCase());
- doLogin();
- }
- //打卡按钮
- function regButton_onClick() {
- console.log('工号员工:' + $('#工号员工').getCheckBoxVal());
- $('#打卡窗体').animateHide();
- doRegSave();
- }
- //工位按钮
- function workButton_onClick() {
- //$("#工位").find("option:selected").text();
- console.log('工位:' + $('#工位').val());
- if ($('#工位').val() != '') {
- $('#工位窗体').animateHide();
- $('#打卡窗体').animateShow(doRegLoad());
- }
- else {
- swal({
- title: '工位选择',
- text: '请您选择工位!',
- icon: 'error',
- button: '确定'
- });
- }
- }
- //登录处理
- function doLogin() {
- swal({
- title: '用户登录',
- text: '正在登录,请稍候。。。',
- icon: 'info',
- button: false,
- closeOnClickOutside: false
- });
- var loginData = {
- 'accountCode': $('#账套').val(),
- 'userCode': $('#用户').val(),
- 'userPassword': hex_md5($('#密码').val()).toUpperCase()
- };
- $.get('api/LogIn_WCF.ashx', loginData, function (data) {
- swal.close();
- var json = JSON.parse(data);
- if (json['Status'] == '0') {
- //登录成功
- $('#登录窗体').animateHide();
- $('#工位窗体').animateShow(doWorkLoad());
- }
- else {
- swal({
- title: '登录失败!',
- text: json['Message'],
- icon: 'error',
- button: '确定'
- });
- }
- });
- }
- //打卡数据读取
- function doRegLoad() {
- $('#工号员工').loadHtml('api/GetWorkStationUser.ashx?UserCode=' + $('#用户').val() + '&WorkstationId=' + $('#工位').val() , '#工号员工模板', function (data) {
- console.log(data);
- $.get('api/GetClassesUser.ashx?UserCode=' + $('#用户').val(), function (data) {
- var json = JSON.parse(data);
- if (json['success'] == true) {
- if (json['rows'].length > 0) $('#工号员工').setCheckBoxVal(json['rows'][0]['STAFFID']);
- }
- else {
- //数据读取失败
- }
- });
- });
- }
- //打卡数据保存 登录类型 1:打卡并登录工位 0:只打卡不登录工位
- function doRegSave() {
- console.log($('#登录类型').val());
- //打卡操作
- $.get('api/GetWorkStationUserReg.ashx', {
- 'UserCode': $('#用户').val(),
- 'WorkstationId':$('#工位').val(),
- 'StaffId': $('#工号员工').getCheckBoxVal()
- }, function (data) {
- var json = JSON.parse(data);
- if (json['success'] == true) {
- //打卡成功
- swal({
- title: '用户登录',
- text: '工号 ' + $('#用户').val() + ' 打卡成功!',
- icon: 'success',
- button: '确定'
- }).then(function () {
- //按登录类型执行
- if ($('#登录类型').val() == "1") {
- //登录工位
- for (var i = 0; i < workStation.length; i++) {
- if (workStation[i]['ID'].toString() == $('#工位').val()) {
- window.location.href = workStation[i]['TYPEURL'];
- }
- }
- }
- else {
- //不登录工位
- $('#用户').val('');
- $('#密码').val('');
- $('#用户').focus();
- $('#登录窗体').animateShow();
- }
- });
- }
- else {
- //打卡失败
- swal({
- title: '用户登录',
- text: '工号 ' + $('#用户').val() + ' 打卡失败!',
- icon: 'success',
- button: '确定'
- });
- //跳回到登录窗体
- $('#用户').val('');
- $('#密码').val('');
- $('#用户').focus();
- $('#登录窗体').animateShow();
- }
- });
- }
- //工位数据加载
- function doWorkLoad() {
- $('#工位').loadSelect('api/GetWorkStation.ashx?UserCode=' + $('#用户').val(), function (data) {
- console.log(data);
- $('#工位').get(0).selectedIndex = 1;
- workStation = data["rows"];
- });
- }
- //工位数据保存
- function doWorkSave() {
- }
- //跳转到工位模块
- function doPage() {
-
- }
- </script>
- </body>
- </html>
|