From 6b1c7e3fa773aa75ea34b346d4104ba70064f52c Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期四, 31 八月 2023 14:35:53 +0800
Subject: [PATCH] 调整设备状态解析2
---
igds-web/src/main/resources/static/admin/inout/out-weight.js | 448 +++++++++++++++++++++++++++++++------------------------
1 files changed, 252 insertions(+), 196 deletions(-)
diff --git a/igds-web/src/main/resources/static/admin/inout/out-weight.js b/igds-web/src/main/resources/static/admin/inout/out-weight.js
index ec1c9be..5edb8da 100644
--- a/igds-web/src/main/resources/static/admin/inout/out-weight.js
+++ b/igds-web/src/main/resources/static/admin/inout/out-weight.js
@@ -34,7 +34,7 @@
shadeClose: true,
shade: 0.3,
closeBtn: 2,
- offset: ['50px','120px'],
+ offset: ['50px', '120px'],
area: ['1000px', '640px'],
content: '../../basic/inout/inout-progress?type=' + type + "&t=" + Math.random()
});
@@ -48,9 +48,8 @@
// 鐩戝惉閲嶉噺鍙樺寲
$(".weight").blur(function () {
- var name = this.name;
// deAutoByWeight(name);
- deAutoByOut(name);
+ deAutoByOut(this.name)
});
// 鍒濆鍖朩ebSocket
@@ -85,42 +84,42 @@
//鏆傛棤
}
-// 鏍规嵁褰撳墠鎿嶄綔鐨勬寜閽甀D鏇存柊鍏朵粬鎸夐挳鐘舵��
-function flushBtn(btnId) {
- if ("btn-weight" == btnId) {// 绉伴噸鍚庡彲浠ョ偣鍑诲畬鎴愮О閲�
- $("#btn-submit").removeClass("layui-btn-disabled");
- $("#btn-submit").attr("disabled", false);
- }
-
- if ("btn-submit" == btnId) {
- $("#btn-submit").addClass("layui-btn-disabled");
- $("#btn-submit").attr("disabled", true);
-
- if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {// 鍑哄簱锛屽鏋滄槸绌鸿溅绉伴噸锛屽畬鎴愭敹鐩存帴鍒锋柊椤甸潰
- resetForm();
- } else {
- // 瀹屾垚绉伴噸鍚庢帶鍒舵寜閽�
- $("#btn-weight").addClass("layui-btn-disabled");
- $("#btn-weight").attr("disabled", true);
-
- $("#btn-printBill").removeClass("layui-btn-disabled");
- $("#btn-printBill").attr("disabled", false);
- addDisabled();
- }
- }
- if ("btn-printBill" == btnId) {// 鎵撳嵃杩囩鍗曪紝璇存槑涓氬姟瀹屾垚
- $("#btn-weight").removeClass("layui-btn-disabled");
- $("#btn-weight").attr("disabled", false);
-
- $("#btn-submit").addClass("layui-btn-disabled");
- $("#btn-submit").attr("disabled", true);
-
- $("#btn-printBill").addClass("layui-btn-disabled");
- $("#btn-printBill").attr("disabled", true);
- delDisabled();
- resetForm();
- }
-}
+// // 鏍规嵁褰撳墠鎿嶄綔鐨勬寜閽甀D鏇存柊鍏朵粬鎸夐挳鐘舵��
+// function flushBtn(btnId) {
+// if ("btn-weight" == btnId) {// 绉伴噸鍚庡彲浠ョ偣鍑诲畬鎴愮О閲�
+// $("#btn-submit").removeClass("layui-btn-disabled");
+// $("#btn-submit").attr("disabled", false);
+// }
+//
+// if ("btn-submit" == btnId) {
+// $("#btn-submit").addClass("layui-btn-disabled");
+// $("#btn-submit").attr("disabled", true);
+//
+// if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {// 鍑哄簱锛屽鏋滄槸绌鸿溅绉伴噸锛屽畬鎴愭敹鐩存帴鍒锋柊椤甸潰
+// resetForm();
+// } else {
+// // 瀹屾垚绉伴噸鍚庢帶鍒舵寜閽�
+// $("#btn-weight").addClass("layui-btn-disabled");
+// $("#btn-weight").attr("disabled", true);
+//
+// $("#btn-printBill").removeClass("layui-btn-disabled");
+// $("#btn-printBill").attr("disabled", false);
+// addDisabled();
+// }
+// }
+// if ("btn-printBill" == btnId) {// 鎵撳嵃杩囩鍗曪紝璇存槑涓氬姟瀹屾垚
+// $("#btn-weight").removeClass("layui-btn-disabled");
+// $("#btn-weight").attr("disabled", false);
+//
+// $("#btn-submit").addClass("layui-btn-disabled");
+// $("#btn-submit").attr("disabled", true);
+//
+// $("#btn-printBill").addClass("layui-btn-disabled");
+// $("#btn-printBill").attr("disabled", true);
+// delDisabled();
+// resetForm();
+// }
+// }
//鎺у埗娴佺▼鐜妭鏄剧ず
function showProgress() {
@@ -195,17 +194,19 @@
form.render();
// 鐐瑰嚮绉伴噸鏃跺�欒嚜鍔ㄦ姄鎷嶆暟鎹�
- layer.msg("绯荤粺鑷姩鎶撴媿淇濈暀璁板綍鈥︹��");
+ // layer.msg("绯荤粺鑷姩鎶撴媿淇濈暀璁板綍鈥︹��");
snapData = {
companyId: companyId,
deptId: deptId,
progress: recordData.progress,
bizType: bizType,
plateNum: recordData.plateNum,
-
- id1: (null != snapDto1) ? snapDto1.id : null,
- id2: (null != snapDto2) ? snapDto2.id : null,
- id3: (null != snapDto3) ? snapDto3.id : null,
+ id1: snapDto1.id,
+ id2: snapDto2.id,
+ id3: snapDto3.id,
+ // id1: (null != snapDto1) ? snapDto1.id : null,
+ // id2: (null != snapDto2) ? snapDto2.id : null,
+ // id3: (null != snapDto3) ? snapDto3.id : null,
sort: $("#scaleName").val(),
weight: weightDto.weight
@@ -223,7 +224,8 @@
success: function (result) {
layer.close(index);
if (result.code != "0000") {
- layer.alert(result.msg);
+ alertError(result.msg);
+ // layer.alert(result.msg);
} else {
snapData = result.data;
}
@@ -240,14 +242,15 @@
}
// 鍒锋柊鐘舵��
- flushBtn("btn-weight");
+ // flushBtn("btn-weight");
}
+
//鏂扮殑璇诲崱鏂瑰紡
function flushICCard() {
- if(cardDto && cardDto.protocol != "TCP_DEFAULT"){
+ if (cardDto && cardDto.protocol != "TCP_DEFAULT") {
//鍗忚鑾峰彇
flushICCard2();
- }else {
+ } else {
//鏈湴璇诲彇
flushICCard1();
}
@@ -261,7 +264,7 @@
var index = layer.load();
$.ajax({
type: "POST",
- url: "../../inout/api/ic-card-num",
+ url: "../../inout/api/get-icCard",
dataType: "json",
contentType: "application/json;charset=UTF-8",
data: param,
@@ -276,7 +279,9 @@
offset: ['300px', '300px']
});
} else {
- $("#intelCard").val(result.data.icCardNo);
+ paramIntelCard = data;
+ $("#text-param").text("璇嗗埆鍗″彿锛�" + paramIntelCard);
+ flushData(paramIntelCard, null);
}
}
layer.close(index);
@@ -294,7 +299,7 @@
* 鏈湴璇诲彇鏅烘収鍗�
*/
function flushICCard1() {
- $("#intelCard").val(null);
+ $("#text-param").val(null);
$("#form-data")[0].reset();
form.render();
recordData = null;
@@ -313,8 +318,9 @@
if (data === "not found") {
layer.alert("璇烽噸鏂拌鍗★紒", {offset: ['300px', '300px']});
} else {
- $("#intelCard").val(data);
- flushData();
+ paramIntelCard = data;
+ $("#text-param").text("璇嗗埆鍗″彿锛�" + paramIntelCard);
+ flushData(paramIntelCard, null);
}
},
error: function () {
@@ -323,7 +329,7 @@
});
}
-// 浣跨敤鎻掍欢鑾峰彇鐪佷唤璇�
+// 浣跨敤鎻掍欢鑾峰彇韬唤璇佸彿
function flushIdCard() {
var index = layer.load();
$.ajax({
@@ -343,8 +349,10 @@
});
return;
}
- $("#userId").val(data.idNum);
- flushData();
+ // $("#userId").val(data.idNum);
+ $("#text-param").text("璇嗗埆韬唤璇侊細" + paramIdCard);
+
+ flushData(null, paramIdCard);
},
error: function () {
layer.alert("韬唤璇佽鍙栧け璐ワ紝璇锋墜鍔ㄥ綍鍏ワ紒", {
@@ -380,10 +388,11 @@
});
}
-// 鎵撳嵃杩囩鍗�
+
+// 鐐瑰嚮鎵撳嵃锛岀郴缁熷垽鏂槸鍚﹀凡缁忔墽琛屽畬鎴愶紝濡傛灉宸茬粡瀹屾垚锛岀洿鎺ユ墦鍗帮紝濡傛灉鏈畬鎴愬垯鍏堟墽琛屽畬鎴�
function printBill() {
if (!recordData) {
- layer.alert("娌℃湁鑾峰彇鍒颁笟鍔℃暟鎹紝涓嶆敮鎸佹墦鍗帮紒");
+ alertError("娌℃湁鑾峰彇鍒颁笟鍔℃暟鎹紝鎵撳嵃琚嫆缁濓紒");
return;
}
// 浠庡悗鍙拌幏鍙栨ā鐗堝苟鎵撳嵃
@@ -391,7 +400,27 @@
// 鍚堝苟鏇存柊鐣跺墠缂栬緫鏁版嵁
Object.assign(recordData, data);
- printBillStep2();
+ var index = layer.load();
+ $.ajax({
+ type: "POST",
+ url: "../../basic/inout/report/bill-weight",
+ dataType: "json",
+ contentType: "application/json;charset=UTF-8",
+ data: JSON.stringify(recordData),
+ success: function (result) {
+ layer.close(index);
+ if (result.code != "0000") {
+ alertError(result.msg);
+ } else {
+ layer.msg("寮�濮嬫覆鏌撴墦鍗板崟鈥︹��");
+ printWeight(result.data);
+ }
+ },
+ error: function () {
+ layer.close(index);
+ alertError("鑾峰彇鎵撳嵃妯$増澶辫触锛岃鑱旂郴绠$悊鍛樻煡鐪嬪師鍥�");
+ }
+ });
}
// 鐐瑰嚮鎵撳嵃锛屽厛鎵ц绯荤粺榛樿鎵ц瀹屾垚鍗″洖鏀�
@@ -399,7 +428,7 @@
var index = layer.load();
$.ajax({
type: "POST",
- url: "../../basic/inout-report/inout-bill-weight",
+ url: "../../basic/inout-report/bill-weight",
dataType: "json",
contentType: "application/json;charset=UTF-8",
data: JSON.stringify(recordData),
@@ -415,7 +444,7 @@
printWeight(result.data);
}
// 鍒锋柊鎸夐挳
- flushBtn("btn-printBill");
+ // flushBtn("btn-printBill");
}
layer.close(index);
},
@@ -440,26 +469,52 @@
$("#btn-weight").removeClass("layui-btn-disabled");
$("#btn-weight").attr("disabled", false);
- //绌鸿溅鍜屾弧杞﹁閲嶇疆
- updateEditAndProgress();
+ $("#text-param").val('');
- //鎵i噸淇℃伅妗嗘仮澶嶄负鍙紪杈�
- delDisabled();
+ // //绌鸿溅鍜屾弧杞﹁閲嶇疆
+ // updateEditAndProgress();
+ //
+ // //鎵i噸淇℃伅妗嗘仮澶嶄负鍙紪杈�
+ // delDisabled();
}
+//鏄剧ず璐ㄦ淇℃伅
+function showCheck() {
+ if (!recordData) {
+ alertError("娌℃湁涓氬姟鏁版嵁淇℃伅锛屾墽琛岃鎷掔粷");
+ return;
+ }
+
+ // 鑾峰彇鍖栭獙椤逛俊鎭�
+ // flushCheckItem();
+
+ layer.open({
+ type: 1,
+ title: "璐ㄦ璇︾粏",
+ offset: ['120px', '100px'],
+ area: ['1000px', '520px'],
+ shade: 0,
+ content: $('#checkDetail'),
+ btnAlign: 'c',
+ btn: ['鍙栨秷'],
+ yes: function () {
+ layer.closeAll();
+ },
+ closeBtn: 0
+ });
+}
function flushPage() {
layer.confirm('纭畾瑕佸埛鏂伴〉闈㈠悧锛�', {icon: 3, title: '鎻愮ず'}, function (index) {
resetForm();
- layer.msg("椤甸潰閲嶇疆瀹屾垚锛岃閲嶆柊鎿嶄綔鈥︹��");
layer.close(index);
});
}
-function flushData() {
+function flushData(intelCard, userIdCard) {
var index = layer.load();
- var userId2 = $("#userId").val();
- var intelCard = $("#intelCard").val();
+ var userId2 = userIdCard;
+ var intelCard = intelCard;
var plateNum = $("#plateNum").val();
var param = {
type: type,
@@ -477,7 +532,7 @@
data: JSON.stringify(param),
success: function (result) {
if (result.code != "0000") {
- notify(result.msg, result.data);
+ notifyProgress(result.msg, result.data);
} else {
recordData = result.data;
// 杩斿洖鐨勬暟鎹繘琛岃祴鍊�
@@ -490,7 +545,8 @@
},
error: function () {
layer.close(index);
- layer.alert("鏌ヨ澶辫触锛岃閲嶆柊灏濊瘯锛侊紒");
+ alertError("鏌ヨ澶辫触锛岃閲嶆柊灏濊瘯");
+ // layer.alert("鏌ヨ澶辫触锛岃閲嶆柊灏濊瘯锛侊紒");
}
});
}
@@ -542,37 +598,37 @@
}
// 褰撳墠瀹屾垚
-function submit(data) {
+function submit() {
if (null == recordData) {
- notify("娌℃湁鏁版嵁鍙互鎻愪氦", null);
+ notifyProgress("娌℃湁鏁版嵁鍙互鎻愪氦", null);
return;
}
var data = form.val("form-data");
// 鏍¢獙-鍑哄簱绌鸿溅
if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
if (data.emptyWeight <= 0.0) {
- notify("绌鸿溅绉伴噸淇℃伅蹇呭~锛侊紒", null);
+ notifyProgress("绌鸿溅绉伴噸淇℃伅蹇呭~锛侊紒", null);
return;
}
if (!data.depotId) {
- notify("瑁呭嵏浠撳簱蹇呴』濉啓锛侊紒", null);
+ notifyProgress("瑁呭嵏浠撳簱蹇呴』濉啓锛侊紒", null);
return;
}
if (!data.noticeId) {
- notify("閫氱煡鍗曞繀椤诲~鍐欙紒锛�", null);
+ notifyProgress("閫氱煡鍗曞繀椤诲~鍐欙紒锛�", null);
return;
}
} else {
if (data.fullWeight <= 0.0) {
- notify("婊¤溅绉伴噸淇℃伅蹇呭~锛侊紒", null);
+ notifyProgress("婊¤溅绉伴噸淇℃伅蹇呭~锛侊紒", null);
return;
}
if (!data.foodVariety) {
- notify("绮鍝佺蹇呭~锛侊紒", null);
+ notifyProgress("绮鍝佺蹇呭~锛侊紒", null);
return;
}
if (!data.settleWeight || data.settleWeight <= 0.0) {
- notify("缁撶畻閲嶉噺鍚堣锛岃鏍稿锛侊紒", null);
+ notifyProgress("缁撶畻閲嶉噺鍚堣锛岃鏍稿锛侊紒", null);
return;
}
}
@@ -589,141 +645,141 @@
fileName: snapData.fileName3
}];
recordData.files = files;
-
var index = layer.load();
$.ajax({
type: "POST",
- url: "../../basic/inout/inout-next-step",
+ url: "../../basic/inout/submit-weight",
dataType: "json",
contentType: "application/json;charset=UTF-8",
data: JSON.stringify(recordData),
success: function (result) {
if (result.code != "0000") {
- notify(result.msg, result.data);
+ notifyProgress(result.msg, result.data);
} else {
- notify("鏁版嵁鎻愪氦鎴愬姛", result.data);
+ notifyProgress("鏁版嵁鎻愪氦鎴愬姛", result.data);
// 鏇存柊鎸夐挳鏄剧ず
- flushBtn("btn-submit");
+ // flushBtn("btn-submit");
}
layer.close(index);
},
error: function () {
layer.close(index);
- notify("鎻愪氦澶辫触锛岃閲嶆柊灏濊瘯", null);
+ notifyProgress("鎻愪氦澶辫触锛岃閲嶆柊灏濊瘯", null);
}
});
//浠ヤ笅閫昏緫涓哄鍔犱竴涓闊抽�氱煡鐨勮皟鐢ㄦ柟娉曪紝涓嶈�冭檻杩斿洖缁撴灉
- var curWeight = recordData.fullWeight;
- if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
- curWeight = recordData.emptyWeight;
- }
- var param = {
- sort: $("#scaleName").val(),
- weight: curWeight,
- inoutProgress: recordData.progress,
- deptId: recordData.deptId,
- companyId: recordData.companyId,
- plateNum:recordData.plateNum
- };
- $.ajax({
- type: "POST",
- url: "../../inout/api/notice-weight-done",
- dataType: "json",
- contentType: "application/json;charset=UTF-8",
- data: JSON.stringify(param)
- });
+ // var curWeight = recordData.fullWeight;
+ // if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
+ // curWeight = recordData.emptyWeight;
+ // }
+ // var param = {
+ // sort: $("#scaleName").val(),
+ // weight: curWeight,
+ // inoutProgress: recordData.progress,
+ // deptId: recordData.deptId,
+ // companyId: recordData.companyId,
+ // plateNum:recordData.plateNum
+ // };
+ // $.ajax({
+ // type: "POST",
+ // url: "../../inout/api/notice-weight-done",
+ // dataType: "json",
+ // contentType: "application/json;charset=UTF-8",
+ // data: JSON.stringify(param)
+ // });
}
-
-// ---------------------------閫氱煡鍗�-寮�濮� -------------------//
-// 寮瑰嚭寰�鏉ュ崟浣嶄笅鎷夋
-function showNotice() {
- var index = layer.load();
- var param = {
- type: type
- };
- // 娓叉煋寰�鏉ュ崟浣嶅垪琛�
- table.render({
- elem: '#tableNotice',
- url: '../../basic/inout/list-notice鈥攐ut',
- page: false,
- // skin : "nob",
- // size : 'sm',
- even: true,
- method: 'POST',
- contentType: "application/json;charset=UTF-8",
- cols: [[{
- field: 'name',
- title: '閫氱煡鍗曞悕绉�',
- width: '15%'
- }, {
- field: 'customerName',
- title: '鏀惰揣鍗曚綅'
- }, {
- field: 'depotName',
- title: '浠撳簱鍚嶇О',
- width: '15%'
- }, {
- field: 'foodVarietyName',
- title: '绮鍝佺',
- width: '10%'
- }, {
- field: 'year',
- title: '骞翠唤',
- width: '8%'
- }, {
- field: 'contractName',
- title: '鎵�灞炲悎鍚�'
- }]],
- where: param,
- parseData: function (res) {
- if ("0000" == res.code) {
- return {
- "code": "0",
- "msg": res.msg,
- "data": res.data
- }
- } else {
- return {
- "code": "1",
- "msg": res.msg
- }
- }
- },
- done: function (res) {
- layer.close(index);
- }
- });
-
- //鍙屽嚮鏄剧ず閫変腑鏁版嵁
- table.on('rowDouble(tableNotice)', function (obj) {
- var data = obj.data;
- form.val("form-data", {
- customerId: data.customerId,
- customerName: data.customerName,
- noticeId: data.id,
- foodType: data.foodType,
- foodLevel: data.foodLevel
- });
- // 鍏抽棴
- layer.closeAll();
- });
-
- // 寮瑰嚭瀵硅瘽妗�
- layer.open({
- type: 1,
- offset: ['100px', '250px'],
- title: "鍑哄簱閫氱煡鍗�",
- area: ['900px', '600px'],
- shade: 0,
- content: $('#listNotice'),
- btn: 0,
- btn: ['鍙栨秷'],
- yes: function () {
- layer.closeAll();
- },
- closeBtn: 0
- });
-}
-// ---------------------------閫氱煡鍗� -缁撴潫 -------------------//
\ No newline at end of file
+//-----------------------杞Щ鑷硍eight.js涓�----------------------//
+// // ---------------------------閫氱煡鍗�-寮�濮� -------------------//
+// // 寮瑰嚭寰�鏉ュ崟浣嶄笅鎷夋
+// function showNotice() {
+// var index = layer.load();
+// var param = {
+// type: type
+// };
+// // 娓叉煋寰�鏉ュ崟浣嶅垪琛�
+// table.render({
+// elem: '#tableNotice',
+// url: '../../basic/inout/list-notice-out',
+// page: false,
+// // skin : "nob",
+// // size : 'sm',
+// even: true,
+// method: 'POST',
+// contentType: "application/json;charset=UTF-8",
+// cols: [[{
+// field: 'name',
+// title: '閫氱煡鍗曞悕绉�',
+// width: '15%'
+// }, {
+// field: 'customerName',
+// title: '鏀惰揣鍗曚綅'
+// }, {
+// field: 'depotName',
+// title: '浠撳簱鍚嶇О',
+// width: '15%'
+// }, {
+// field: 'foodVarietyName',
+// title: '绮鍝佺',
+// width: '10%'
+// }, {
+// field: 'year',
+// title: '骞翠唤',
+// width: '8%'
+// }, {
+// field: 'contractName',
+// title: '鎵�灞炲悎鍚�'
+// }]],
+// where: param,
+// parseData: function (res) {
+// if ("0000" == res.code) {
+// return {
+// "code": "0",
+// "msg": res.msg,
+// "data": res.data
+// }
+// } else {
+// return {
+// "code": "1",
+// "msg": res.msg
+// }
+// }
+// },
+// done: function (res) {
+// layer.close(index);
+// }
+// });
+//
+// //鍙屽嚮鏄剧ず閫変腑鏁版嵁
+// table.on('rowDouble(tableNotice)', function (obj) {
+// var data = obj.data;
+// form.val("form-data", {
+// customerId: data.customerId,
+// customerName: data.customerName,
+// noticeId: data.id,
+// foodType: data.foodType,
+// foodLevel: data.foodLevel
+// });
+// // 鍏抽棴
+// layer.closeAll();
+// });
+//
+// // 寮瑰嚭瀵硅瘽妗�
+// layer.open({
+// type: 1,
+// offset: ['100px', '250px'],
+// title: "鍑哄簱閫氱煡鍗�",
+// area: ['900px', '600px'],
+// shade: 0,
+// content: $('#listNotice'),
+// btn: 0,
+// btn: ['鍙栨秷'],
+// yes: function () {
+// layer.closeAll();
+// },
+// closeBtn: 0
+// });
+// }
+//
+// // ---------------------------閫氱煡鍗� -缁撴潫 -------------------//
\ No newline at end of file
--
Gitblit v1.9.3