Browse Source

Changed on Login Stuff and visibility control.

jason.lu 6 years ago
parent
commit
795ec5673d
2 changed files with 39 additions and 0 deletions
  1. 3 0
      denglu.html
  2. 36 0
      js/entrance.js

+ 3 - 0
denglu.html

@@ -94,11 +94,14 @@
             <div style="color: #ffffff"><img src="images/logo.jpg" style="width: 10%"> &nbsp;&nbsp;&nbsp;&nbsp;深圳市度彼电子有限公司
             </div>
             <font color="#ffffff"><span id="nowDateTimeSpan"></span></font>
+            <div onclick="logout()" class="btn btn-warning"> 注销账户 </div>
         </div>
     </nav>
     <div class="container-fluid" style="margin-top: 10em">
         <div class="alert alert-warning" id="mpAlert" style="display:none">
         </div>
+        <div class="alert alert-info" id="mpRemain" style="display:none">
+        </div>
         <div class="card">
             <h5 class="card-header">
                 生产线 :

+ 36 - 0
js/entrance.js

@@ -136,3 +136,39 @@ function startToSchedule(obj) {
     }
 }
 
+function checkIfExists(){
+    get_data("/fcWorkSchedule/remaining",on_receive_exist);
+}
+
+function getRemainHTML(obj) {
+    return `<a href='lazhang.html?scheduleId=${obj.scheduleId}&flowId=${obj.flowId}'> 正在进行的班次: ${obj.flowName} ${obj.fcDay} </a> `
+}
+
+function send_remain(a, b) {
+    $("#mpRemain").html(a);
+    $("#mpRemain").show();
+    return;
+}
+
+function on_receive_exist(objs, sta){
+    let obj = first_parse(this, objs);
+    console.log(obj);
+    if(obj != null && obj != undefined && obj.list != null && obj.list != undefined && obj.list.length > 0){
+        let i = 0;
+        let wholehtml = "";
+        for(i=0;i<obj.list.length;i++){
+            wholehtml += getRemainHTML(obj.list[i]);
+        }
+        wholehtml += "任一产线必须结束以前的班次才能开始新的班次!";
+        send_remain(wholehtml);
+    }else{
+        send_alert("查询失败");
+    }
+}
+
+function logout(){
+    setCookieWithTimeout("doibyUser","",-10);
+    console.log(getCookie("doibyUser"));
+    location.href="sign-in1.html";
+}
+