From 2c99685a60ecc2da91364642b45a636d1af13b1f Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期五, 07 八月 2020 16:53:31 +0800
Subject: [PATCH] #
---
src/main/webapp/views/console.html | 203 +++++++++++++++++++++++++++++++++-----------------
1 files changed, 132 insertions(+), 71 deletions(-)
diff --git a/src/main/webapp/views/console.html b/src/main/webapp/views/console.html
index 56663d2..7a7e438 100644
--- a/src/main/webapp/views/console.html
+++ b/src/main/webapp/views/console.html
@@ -203,7 +203,7 @@
<!-- 鍫嗗灈鏈� -->
<div class="crn">
<hr class="pathway">
- <div id="crn1" class="machine"></div>
+ <div id="crn-2" class="machine"></div>
</div>
<!-- 璐ф灦 -->
<div class="stock-group">
@@ -342,7 +342,7 @@
<!-- 鍫嗗灈鏈� -->
<div class="crn">
<hr class="pathway">
- <div id="crn2" class="machine"></div>
+ <div id="crn-1" class="machine"></div>
</div>
<!-- 璐ф灦 -->
<div class="stock-group">
@@ -424,7 +424,7 @@
<span>璁惧鍙�</span>
</div>
<div class="form-item-input">
- <input type="text" name="devpNo" value="12" disabled="disabled" style="width: 4rem">
+ <input type="text" name="devpNo" value="" disabled="disabled" style="width: 4rem">
</div>
</div>
<div class="form-item" style="width: 25%">
@@ -432,7 +432,7 @@
<span>宸ヤ綔鍙�</span>
</div>
<div class="form-item-input">
- <input type="text" name="workNo" value="9998" disabled="disabled" style="width: 4rem">
+ <input type="text" name="workNo" value="" disabled="disabled" style="width: 4rem">
</div>
</div>
<div class="form-item" style="width: 45%">
@@ -440,7 +440,7 @@
<span>宸ヤ綔鐘舵��</span>
</div>
<div class="form-item-input">
- <input type="text" name="workStatus" value="2.璁惧涓婄Щ鍔�" disabled="disabled" style="width: 10rem">
+ <input type="text" name="workStatus" value="" disabled="disabled" style="width: 10rem">
</div>
</div>
@@ -450,7 +450,7 @@
<span>鑷姩</span>
</div>
<div class="form-item-input">
- <input type="checkbox" name="auto" disabled="disabled" style="width: 1rem" checked>
+ <input type="checkbox" name="autoing" disabled="disabled" style="width: 1rem">
</div>
</div>
<div class="form-item" style="width: 20%">
@@ -458,7 +458,7 @@
<span>鏈夌墿</span>
</div>
<div class="form-item-input">
- <input type="checkbox" name="loading" disabled="disabled" style="width: 1rem" checked>
+ <input type="checkbox" name="loading" disabled="disabled" style="width: 1rem">
</div>
</div>
<div class="form-item" style="width: 20%">
@@ -466,7 +466,7 @@
<span>鑳藉叆</span>
</div>
<div class="form-item-input">
- <input type="checkbox" name="canining" disabled="disabled" style="width: 1rem" checked>
+ <input type="checkbox" name="canining" disabled="disabled" style="width: 1rem">
</div>
</div>
<div class="form-item" style="width: 20%">
@@ -474,7 +474,7 @@
<span>鑳藉嚭</span>
</div>
<div class="form-item-input">
- <input type="checkbox" name="canouting" disabled="disabled" style="width: 1rem" checked>
+ <input type="checkbox" name="canouting" disabled="disabled" style="width: 1rem">
</div>
</div>
@@ -484,7 +484,7 @@
<span>鍑哄叆绫诲瀷</span>
</div>
<div class="form-item-input">
- <input type="text" name="ioType" value="1.鍏ュ簱" disabled="disabled" style="width: 8rem">
+ <input type="text" name="ioType" value="" disabled="disabled" style="width: 8rem">
</div>
</div>
<div class="form-item" style="width: 25%">
@@ -492,7 +492,7 @@
<span>婧愮珯</span>
</div>
<div class="form-item-input">
- <input type="text" name="sourceStaNo" value="2303" disabled="disabled" style="width: 4rem">
+ <input type="text" name="sourceStaNo" value="" disabled="disabled" style="width: 4rem">
</div>
</div>
<div class="form-item" style="width: 25%">
@@ -500,7 +500,7 @@
<span>鐩爣绔�</span>
</div>
<div class="form-item-input">
- <input type="text" name="staNo" value="2410" disabled="disabled" style="width: 4rem">
+ <input type="text" name="staNo" value="" disabled="disabled" style="width: 4rem">
</div>
</div>
@@ -518,7 +518,7 @@
<span>鐩爣搴撲綅</span>
</div>
<div class="form-item-input">
- <input type="text" name="stock" value="" style="width: 8rem">
+ <input type="text" name="stock" value="" disabled="disabled" style="width: 8rem">
</div>
</div>
</form>
@@ -533,7 +533,7 @@
<span>鍫嗗灈鏈哄彿</span>
</div>
<div class="form-item-input">
- <input type="text" name="crnNo" value="12" disabled="disabled" style="width: 3rem">
+ <input type="text" name="crnNo" value="" disabled="disabled" style="width: 3rem">
</div>
</div>
<div class="form-item" style="width: 25%">
@@ -541,7 +541,7 @@
<span>宸ヤ綔鍙�</span>
</div>
<div class="form-item-input">
- <input type="text" name="workNo" value="9998" disabled="disabled" style="width: 5rem">
+ <input type="text" name="workNo" value="" disabled="disabled" style="width: 5rem">
</div>
</div>
<div class="form-item" style="width: 23%">
@@ -549,7 +549,7 @@
<span>婧愮珯</span>
</div>
<div class="form-item-input">
- <input type="text" name="sourceStaNo" value="2303" disabled="disabled" style="width: 4rem">
+ <input type="text" name="sourceStaNo" value="" disabled="disabled" style="width: 4rem">
</div>
</div>
<div class="form-item" style="width: 25%">
@@ -557,7 +557,7 @@
<span>鐩爣绔�</span>
</div>
<div class="form-item-input">
- <input type="text" name="staNo" value="2410" disabled="disabled" style="width: 4rem">
+ <input type="text" name="staNo" value="" disabled="disabled" style="width: 4rem">
</div>
</div>
@@ -567,7 +567,7 @@
<span>宸ヤ綔鐘舵��</span>
</div>
<div class="form-item-input">
- <input type="text" name="workStatus" value="2.璁惧涓婄Щ鍔�" disabled="disabled" style="width: 10rem">
+ <input type="text" name="workStatus" value="" disabled="disabled" style="width: 10rem">
</div>
</div>
<div class="form-item" style="width: 45%">
@@ -575,7 +575,7 @@
<span>鍑哄叆绫诲瀷</span>
</div>
<div class="form-item-input">
- <input type="text" name="ioType" value="1.鍏ュ簱" disabled="disabled" style="width: 10rem">
+ <input type="text" name="ioType" value="" disabled="disabled" style="width: 10rem">
</div>
</div>
@@ -619,15 +619,18 @@
</body>
<script>
- var systemRunning = true;
var crn1Position = 0;
var crn2Position = 0;
// 鍒濆鍖�
getSitesInfo();
getCrnInfo();
+ getSystemRunningStatus();
+ getBarcodeInfo();
// 瀹炴椂璁块棶
setInterval(function () {
getCrnInfo();
+ getSystemRunningStatus();
+ getBarcodeInfo()
}, 500);
setInterval(function () {
getSitesInfo();
@@ -635,49 +638,77 @@
// 绯荤粺杩愯寮�鍏�
function systemSwitch() {
- if (systemRunning){
+ if (parent.systemRunning){
layer.prompt({title: '璇疯緭鍏ュ彛浠わ紝骞跺仠姝� WCS 绯荤粺', formType: 1, shadeClose: true}, function(pass, idx){
layer.close(idx);
- if ("123"!==pass){
- alert("鍙d护閿欒");
- return;
- }
- var index = null;
- index = layer.load(1, {
- shade: [0.1,'#fff']
- });
- setTimeout(function () {
- if (systemRunning){
- $('#system-icon').attr("class", "system-icon-close");
- $('#system-run-desc').html("绯荤粺宸插仠姝�!");
- systemRunning = false;
- } else {
+ doSwitch(0, pass); // 鍋滄wcs绯荤粺
+ });
+ } else {
+ doSwitch(1); // 鍚姩wcs绯荤粺
+ }
+ }
+
+ // 璇锋眰鏈嶅姟鍣ㄦ帶鍒秝cs绯荤粺杩愯鐘舵��
+ function doSwitch(operatorType, password) {
+ // 鍔犺浇tips
+ var index = layer.load(1, {
+ shade: [0.1,'#fff']
+ });
+ $.ajax({
+ url: baseUrl+ "/console/system/switch",
+ headers: {'token': localStorage.getItem('token')},
+ // async: false,
+ data: {
+ operatorType: operatorType,
+ password: password
+ },
+ method: 'POST',
+ success: function (res) {
+ layer.close(index);
+ if (res.code === 200){
+ if (res.data.status) {
$('#system-icon').attr("class", "system-icon-open");
$('#system-run-desc').html("绯荤粺杩愯涓�...");
- systemRunning = true;
+ parent.systemRunning = true;
+ } else {
+ $('#system-icon').attr("class", "system-icon-close");
+ $('#system-run-desc').html("绯荤粺宸插仠姝�!");
+ parent.systemRunning = false;
}
- layer.close(index);
- }, 2000);
- });
-
- } else {
- var index = null;
- index = layer.load(1, {
- shade: [0.1,'#fff']
- });
- setTimeout(function () {
- if (systemRunning){
- $('#system-icon').attr("class", "system-icon-close");
- $('#system-run-desc').html("绯荤粺宸插仠姝�!");
- systemRunning = false;
- } else {
- $('#system-icon').attr("class", "system-icon-open");
- $('#system-run-desc').html("绯荤粺杩愯涓�...");
- systemRunning = true;
+ } else if (res.code === 403){
+ window.location.href = baseUrl+"/login";
+ } else {
+ alert(res.msg);
}
- layer.close(index);
- }, 2000);
- }
+ }
+ });
+
+ }
+
+ // 鑾峰彇wcs绯荤粺杩愯鐘舵��
+ function getSystemRunningStatus() {
+ $.ajax({
+ url: baseUrl+ "/console/system/running/status",
+ headers: {'token': localStorage.getItem('token')},
+ method: 'POST',
+ success: function (res) {
+ if (res.code === 200){
+ if (res.data.status) {
+ $('#system-icon').attr("class", "system-icon-open");
+ $('#system-run-desc').html("绯荤粺杩愯涓�...");
+ parent.systemRunning = true;
+ } else {
+ $('#system-icon').attr("class", "system-icon-close");
+ $('#system-run-desc').html("绯荤粺宸插仠姝�!");
+ parent.systemRunning = false;
+ }
+ } else if (res.code === 403){
+ window.location.href = baseUrl+"/login";
+ } else {
+ alert(res.msg);
+ }
+ }
+ });
}
// 杈撻�佽澶囧疄鏃舵暟鎹幏鍙�
@@ -693,7 +724,7 @@
$("#site-"+sites[i].siteId).attr("class", "site " + sites[i].siteStatus);
}
} else if (res.code === 403){
- top.location.href = baseUrl+"/login";
+ window.location.href = baseUrl+"/login";
} else {
alert(res.msg);
}
@@ -714,7 +745,7 @@
crnAnimate(crns[i].crnId, crns[i].offset);
}
} else if (res.code === 403){
- top.location.href = baseUrl+"/login";
+ window.location.href = baseUrl+"/login";
} else {
alert(res.msg);
}
@@ -730,9 +761,12 @@
method: 'POST',
success: function (res) {
if (res.code === 200){
-
+ var barcodes = res.data;
+ for (var i = 0; i < barcodes.length; i++){
+ $("#code-decoder-data-"+barcodes[i].barcodeId).html(barcodes[i].codeValue);
+ }
} else if (res.code === 403){
- top.location.href = baseUrl+"/login";
+ window.location.href = baseUrl+"/login";
} else {
alert(res.msg);
}
@@ -744,11 +778,11 @@
function crnAnimate(id, leftVal) {
switch (id) {
case 1:
- $("#crn1").animate({left: leftVal+'px'}, 1000);
+ $("#crn-1").animate({left: leftVal+'px'}, 1000);
crn1Position = leftVal;
break;
case 2:
- $("#crn2").animate({left: leftVal+'px'}, 1000);
+ $("#crn-2").animate({left: leftVal+'px'}, 1000);
crn2Position = leftVal;
break;
default:
@@ -760,8 +794,12 @@
// 杈撻�佽澶囩偣鍑讳簨浠�
$('.site').on('click', function () {
+ var id = this.id.split("-")[1];
+ if (id === undefined) {
+ return;
+ }
layer.open({
- title: "1204绔欑偣淇℃伅",
+ title: id + " 绔欑偣淇℃伅璇︽儏",
closeBtn: 0,
skin: 'layui-layer-lan',
offset: '180px',
@@ -770,17 +808,29 @@
content: $('#siteWindow'),
area: ['35rem', '18rem'],
btn: ['纭畾', '鍏抽棴'],
- yes: function(index, layero){
- layer.close(index);
- alert(1);
+ success: function(layero, index){
+ http.post(baseUrl+"/console/site/detail", {siteId: id}, function (res) {
+ for (var val in res.data) {
+ var find = $("#siteWindow").find(":input[name='" + val + "']");
+ if (find[0].type==='text') {
+ find.val(res.data[val]);
+ } else if (find[0].type === 'checkbox') {
+ find.attr("checked", res.data[val] === 'Y');
+ }
+ }
+ })
+ },
+ end: function () {
+ $(':input', $("#siteWindow")).val('').removeAttr('checked').removeAttr('selected');
}
});
});
// 鍫嗗灈鏈虹偣鍑讳簨浠�
$('.machine').on('click', function () {
+ var id = this.id.split("-")[1];
layer.open({
- title: "1鍙峰爢鍨涙満",
+ title: id+"鍙峰爢鍨涙満",
skin: 'layui-layer-lan',
closeBtn: 0,
type: 1,
@@ -789,9 +839,20 @@
content: $("#crnWindow"),
area: ['40rem', '20rem'],
btn: ['纭畾', '鍏抽棴'],
- yes: function(index, layero){
- layer.close(index);
- alert(1);
+ success: function(layero, index){
+ http.post(baseUrl+"/console/crn/detail", {crnNo: id}, function (res) {
+ for (var val in res.data) {
+ var find = $("#crnWindow").find(":input[name='" + val + "']");
+ if (find[0].type==='text') {
+ find.val(res.data[val]);
+ } else if (find[0].type === 'checkbox') {
+ find.attr("checked", res.data[val] === 'Y');
+ }
+ }
+ })
+ },
+ end: function () {
+ $(':input', $("#crnWindow")).val('').removeAttr('checked').removeAttr('selected');
}
});
});
--
Gitblit v1.9.1