From 723f54708d7c2b71f916e40952ebc818629e66ab Mon Sep 17 00:00:00 2001
From: YYC <1833023622@qq.com>
Date: 星期四, 19 十月 2023 19:50:34 +0800
Subject: [PATCH] 船运问题修改2
---
igds-web/src/main/resources/static/admin/inout/in-weight.js | 655 ++++++++++++++++++++++++-----------------------------------
1 files changed, 269 insertions(+), 386 deletions(-)
diff --git a/igds-web/src/main/resources/static/admin/inout/in-weight.js b/igds-web/src/main/resources/static/admin/inout/in-weight.js
index e1ced5b..93b01f3 100644
--- a/igds-web/src/main/resources/static/admin/inout/in-weight.js
+++ b/igds-web/src/main/resources/static/admin/inout/in-weight.js
@@ -5,6 +5,10 @@
var recordData = null;// 涓氬姟鏁版嵁淇℃伅
var snapData;//绯荤粺鎶撴媿瀵硅薄淇℃伅
var timerWeight;
+var paramIntelCard;//璁惧璇嗗埆缁撴灉
+var paramIdCard;//璁惧璇嗗埆缁撴灉
+var curCheckItems = null;// 褰撳墠鏁版嵁鐨勬鏌ラ」淇℃伅
+var step = 1;
$(function () {
layui.use(['layer', 'laydate', 'form', 'table', 'util'], function () {
@@ -34,7 +38,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,8 +52,7 @@
// 鐩戝惉閲嶉噺鍙樺寲
$(".weight").blur(function () {
- var name = this.name;
- deAutoByIn(name);
+ deAutoByIn(this.name);
});
// 鍒濆鍖朩ebSocket
@@ -77,7 +80,6 @@
updateWeight();
});
});
-
};
// socket淇℃伅杩斿洖铏曠悊
@@ -85,134 +87,39 @@
//鏆傛棤
}
-// 鏍规嵁褰撳墠鎿嶄綔鐨勬寜閽甀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_FULL == 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() {
- if (!inoutProgress) {
- return;
- }
- if (inoutProgress.indexOf("REGISTER") == -1) {
- $("#progress-register").css("display", "none");
- }
- if (inoutProgress.indexOf("CHECK") == -1) {
- $("#progress-check").css("display", "none");
- }
- if (inoutProgress.indexOf("WEIGHT_FULL") == -1) {
- $("#progress-fullWeight").css("display", "none");
- }
- if (inoutProgress.indexOf("HANDLE") == -1) {
- $("#progress-hand").css("display", "none");
- }
- if (inoutProgress.indexOf("WEIGHT_EMPTY") == -1) {
- $("#progress-emptyWeight").css("display", "none");
- }
- if (inoutProgress.indexOf("CARD_BACK") == -1) {
- $("#progress-cardBack").css("display", "none");
- }
-}
-
-
-//鏇存敼鎵i噸淇℃伅妗嗕笉鍙紪杈�
-function addDisabled() {
- //鏉傝川
- $("#impurity").attr("disabled", true);
- $("#deImpurity").attr("disabled", true);
- //姘村垎
- $("#wet").attr("disabled", true);
- $("#deWet").attr("disabled", true);
- //鍊间粨
- $("#deHandle").attr("disabled", true);
- //鍏朵粬
- $("#deOther").attr("disabled", true);
-}
-
-//鎭㈠鎵i噸淇℃伅妗嗙紪杈戠姸鎬�
-function delDisabled() {
- //鏉傝川
- $("#impurity").attr("disabled", false);
- $("#deImpurity").attr("disabled", false);
- //姘村垎
- $("#wet").attr("disabled", false);
- $("#deWet").attr("disabled", false);
- //鍊间粨
- $("#deHandle").attr("disabled", false);
- //鍏朵粬
- $("#deOther").attr("disabled", false);
-}
-
-// 鐐瑰嚮绉伴噸
+//鐐瑰嚮绉伴噸
function weight() {
// 娌℃湁涓氬姟鏁版嵁涓嶅彲鎵ц
if (!recordData) {
- layer.alert("娌℃湁鏌ヨ鍒颁笟鍔℃暟鎹紝鎵ц琚嫆缁濓紒锛�");
+ alertError("娌℃湁鏌ヨ鍒颁笟鍔℃暟鎹紝鎵ц琚嫆缁濓紒");
return;
}
-
// 濡傛灉鏄┖杞︾О閲�
if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
form.val("form-data", {
emptyWeight: weightDto.weight
});
+ form.render();
}
-
// 濡傛灉鏄弧杞︾О閲�
if (InoutProgress.WEIGHT_FULL == recordData.progress) {
form.val("form-data", {
fullWeight: weightDto.weight
});
+ form.render();
}
- form.render();
- // 鐐瑰嚮绉伴噸鏃跺�欒嚜鍔ㄦ姄鎷嶆暟鎹�--澧炲姞閫氱煡淇℃伅
- layer.msg("绯荤粺鑷姩鎶撴媿淇濈暀璁板綍鈥︹��");
+ // 鐐瑰嚮绉伴噸鑷姩璋冪敤鎶撴媿
snapData = {
companyId: companyId,
deptId: deptId,
progress: recordData.progress,
bizType: bizType,
+ bizId: recordData.id,
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,
sort: $("#scaleName").val(),
weight: weightDto.weight
};
@@ -229,32 +136,28 @@
success: function (result) {
layer.close(index);
if (result.code != "0000") {
- layer.alert(result.msg);
+ alertError(result.msg);
} else {
snapData = result.data;
}
},
error: function () {
layer.close(index);
- layer.msg("鍚庡彴璋冪敤鎴浘澶辫触锛岃閲嶆柊灏濊瘯锛侊紒");
+ alertError("鍚庡彴璋冪敤鎴浘澶辫触锛岃閲嶆柊灏濊瘯");
}
});
-
- //鍏ュ簱绗簩娆$О閲嶆椂璋冪敤璁$畻鏂规硶
+ //濡傛灉鏄浜屾绉伴噸锛岄粯璁ゆ墽琛岃嚜鍔ㄨ绠�
if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
deAutoByIn("emptyWeight");
}
- flushBtn("btn-weight");
}
-//鏂扮殑璇诲崱鏂瑰紡
+//璇绘櫤鎱у崱
function flushICCard() {
- if(cardDto && cardDto.protocol != "TCP_DEFAULT"){
- //鍗忚鑾峰彇
- flushICCard2();
- }else {
- //鏈湴璇诲彇
+ if (!cardDto.protocol) {
flushICCard1();
+ } else {
+ flushICCard2();
}
}
@@ -262,35 +165,27 @@
* 鍗忚璇诲彇鏅烘収鍗�
*/
function flushICCard2() {
- var param = JSON.stringify(cardDto);
var index = layer.load();
+ var param = JSON.stringify(cardDto);
$.ajax({
type: "POST",
- url: "../../inout/api/ic-card-num",
+ url: "../../inout/api/get-icCard",
dataType: "json",
contentType: "application/json;charset=UTF-8",
data: param,
success: function (result) {
- if (result.code != "0000") {
- layer.alert(result.msg, {
- offset: ['300px', '300px']
- });
- } else {
- if (result.data.errorMsg) {
- layer.alert(result.data.errorMsg, {
- offset: ['300px', '300px']
- });
- } else {
- $("#intelCard").val(result.data.icCardNo);
- }
- }
layer.close(index);
+ if (result.code != "0000") {
+ alertError(result.msg);
+ } else {
+ paramIntelCard = data;
+ $("#text-param").text("璇嗗埆鍗″彿锛�" + paramIntelCard);
+ flushData(paramIntelCard, null);
+ }
},
error: function () {
layer.close(index);
- layer.alert("IC鍗¤鍙栧け璐ワ紒", {
- offset: ['300px', '300px']
- });
+ alertError("IC鍗¤鍙栧け璐�");
}
});
}
@@ -299,7 +194,8 @@
* 鏈湴璇诲彇鏅烘収鍗�
*/
function flushICCard1() {
- $("#intelCard").val(null);
+ var index = layer.load();
+ $("#text-param").val(null);
$("#form-data")[0].reset();
form.render();
recordData = null;
@@ -312,23 +208,24 @@
jsonp: "callback",
jsonpCallback: "jsonpCallback",
success: function (json) {
- //console.log(json);
var data = json.no;
- //console.log(data);
+ layer.close(index);
if (data === "not found") {
- layer.alert("璇烽噸鏂拌鍗★紒", {offset: ['300px', '300px']});
+ alertError("璇烽噸鏂拌鍗★紒");
} else {
- $("#intelCard").val(data);
- flushData();
+ paramIntelCard = data;
+ $("#text-param").text("璇嗗埆鍗″彿锛�" + paramIntelCard);
+ flushData(paramIntelCard, null);
}
},
error: function () {
- layer.alert("IC鍗¤鍙栧嚭閿欙紒", {offset: ['300px', '300px']});
+ layer.close(index);
+ alertError("IC鍗¤鍙栧嚭閿欙紒");
}
});
}
-// 浣跨敤鎻掍欢鑾峰彇鐪佷唤璇�
+// 浣跨敤鎻掍欢鑾峰彇韬唤璇�
function flushIdCard() {
var index = layer.load();
$.ajax({
@@ -343,21 +240,22 @@
layer.close(index);
var data = json.content;
if (data === "not found") {
- layer.alert("娌℃湁璇诲彇鍒拌韩浠借瘉淇℃伅锛岃鎵嬪姩褰曞叆锛�", {
- offset: ['300px', '300px']
- });
+ alertError("娌℃湁璇诲彇鍒拌韩浠借瘉淇℃伅锛�");
return;
}
- $("#userId").val(data.idNum);
- flushData();
+ paramIdCard = data;
+ $("#text-param").text("璇嗗埆韬唤璇侊細" + paramIdCard);
+ flushData(null, paramIdCard);
},
error: function () {
- layer.alert("韬唤璇佽鍙栧け璐ワ紝璇锋墜鍔ㄥ綍鍏ワ紒", {
- offset: ['300px', '300px']
- });
+ alertError("娌℃湁璇诲彇鍒拌韩浠借瘉淇℃伅锛�");
layer.close(index);
}
});
+}
+
+function flushByHand() {
+ flushData(null, null);
}
function flushWeight() {
@@ -389,7 +287,7 @@
// 鐐瑰嚮鎵撳嵃锛岀郴缁熷垽鏂槸鍚﹀凡缁忔墽琛屽畬鎴愶紝濡傛灉宸茬粡瀹屾垚锛岀洿鎺ユ墦鍗帮紝濡傛灉鏈畬鎴愬垯鍏堟墽琛屽畬鎴�
function printBill() {
if (!recordData) {
- layer.alert("娌℃湁鑾峰彇鍒颁笟鍔℃暟鎹紝涓嶆敮鎸佹墦鍗帮紒");
+ alertError("娌℃湁鑾峰彇鍒颁笟鍔℃暟鎹紝鎵撳嵃琚嫆缁濓紒");
return;
}
// 浠庡悗鍙拌幏鍙栨ā鐗堝苟鎵撳嵃
@@ -397,37 +295,25 @@
// 鍚堝苟鏇存柊鐣跺墠缂栬緫鏁版嵁
Object.assign(recordData, data);
- printBillStep2();
-}
-
-// 鐐瑰嚮鎵撳嵃锛屽厛鎵ц绯荤粺榛樿鎵ц瀹屾垚鍗″洖鏀�
-function printBillStep2() {
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),
success: function (result) {
layer.close(index);
if (result.code != "0000") {
- layer.msg(result.msg);
+ alertError(result.msg);
} else {
layer.msg("寮�濮嬫覆鏌撴墦鍗板崟鈥︹��");
- if (companyId && companyId == "5016") {
- print5016Weight(result.data);
- console.log("5016");
- } else {
- printWeight(result.data);
- }
- // 鍒锋柊鎸夐挳
- flushBtn("btn-printBill");
+ printWeight(result.data);
}
},
error: function () {
layer.close(index);
- layer.msg("鑾峰彇鎵撳嵃妯$増澶辫触锛岃鑱旂郴绠$悊鍛樻煡鐪嬪師鍥狅紒锛�");
+ alertError("鑾峰彇鎵撳嵃妯$増澶辫触锛岃鑱旂郴绠$悊鍛樻煡鐪嬪師鍥�");
}
});
}
@@ -438,43 +324,32 @@
form.render();
recordData = null;
weightDto.weight = 0.0;
-
$("#weightValue").text("0.0");
$("#img_scale_statule").attr("src", "../../static/images/icon-red.png");
- //绉伴噸鍙互澶嶇敤
- $("#btn-weight").removeClass("layui-btn-disabled");
- $("#btn-weight").attr("disabled", false);
-
- //绌鸿溅鍜屾弧杞﹁閲嶇疆
- updateEditAndProgress();
-
- //鎵i噸淇℃伅妗嗘仮澶嶄负鍙紪杈�
- delDisabled();
+ $("#text-param").val(null);
}
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 userIdCard = userIdCard;
+ var intelCard = intelCard;
var plateNum = $("#plateNum").val();
var param = {
type: type,
progress: progress,
intelCard: intelCard,
- userId: userId2,
+ userId: userIdCard,
plateNum: plateNum
};
-
$.ajax({
type: "POST",
url: "../../basic/inout/inout-query",
@@ -482,106 +357,105 @@
contentType: "application/json;charset=UTF-8",
data: JSON.stringify(param),
success: function (result) {
+ layer.close(index);
if (result.code != "0000") {
- notify(result.msg, result.data);
+ notifyProgress(result.msg, result.data);
} else {
recordData = result.data;
// 杩斿洖鐨勬暟鎹繘琛岃祴鍊�
form.val("form-data", recordData);
form.render();
+
updateEditAndProgress();
}
- layer.close(index);
},
error: function () {
layer.close(index);
- layer.alert("鏌ヨ澶辫触锛岃閲嶆柊灏濊瘯锛侊紒");
+ alertError("鏌ヨ澶辫触锛岃閲嶆柊灏濊瘯");
}
});
}
+
/**
- * 璺熸柊娴佺▼璇存槑鎻愬績淇℃伅
+ * 鏍规嵁涓氬姟鏁版嵁鏇存柊椤甸潰涓殑鐘舵��
*/
function updateEditAndProgress() {
- if (recordData) {
- if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
- $("#emptyWeight").removeClass("rkbk-search-input");
- $("#emptyWeight").attr("disabled", false);
+ if (!recordData) return true;
+ var curProgress = recordData.progress;
- $("#progress-hand").addClass("active");
- $("#progress-emptyWeight").addClass("active");
+ //绌鸿溅绉伴噸
+ if (InoutProgress.WEIGHT_EMPTY == curProgress) {
+ $("#progress-hand").addClass("active");
+ $("#progress-emptyWeight").addClass("active");
- $("#fullWeight").addClass("rkbk-search-input");
- $("#fullWeight").attr("disabled", true);
- }
- if (InoutProgress.WEIGHT_FULL == recordData.progress) {
- $("#fullWeight").removeClass("rkbk-search-input");
- $("#fullWeight").attr("disabled", false);
+ $("#depotIdLabel").removeClass("color-red");
+ }
- $("#progress-hand").removeClass("active");
- $("#progress-emptyWeight").removeClass("active");
-
- $("#emptyWeight").addClass("rkbk-search-input");
- $("#emptyWeight").attr("disabled", true);
- }
- } else {
- $("#fullWeight").addClass("rkbk-search-input");
- $("#fullWeight").attr("disabled", true);
-
- $("#emptyWeight").addClass("rkbk-search-input");
- $("#emptyWeight").attr("disabled", true);
-
+ //婊¤溅绉伴噸
+ if (InoutProgress.WEIGHT_FULL == curProgress) {
$("#progress-hand").removeClass("active");
$("#progress-emptyWeight").removeClass("active");
- }
- //鏍规嵁閰嶇疆淇℃伅璁剧疆鍦扮鏄惁鍙紪杈�
- if (weightEditTag && weightEditTag == 'N') {
- $("#fullWeight").addClass("rkbk-search-input");
- $("#fullWeight").attr("disabled", true);
- $("#emptyWeight").addClass("rkbk-search-input");
- $("#emptyWeight").attr("disabled", true);
+ //瑁呭嵏浠撳簱蹇呭~
+ $("#depotIdLabel").addClass("color-red");
+ }
+
+ //璁剧疆鍙紪杈�
+ if (weightEditTag == 'Y') {
+ $("#fullWeight").removeClass("rkbk-search-input");
+ $("#fullWeight").attr("disabled", false);
+
+ $("#emptyWeight").removeClass("rkbk-search-input");
+ $("#emptyWeight").attr("disabled", false);
}
}
// 褰撳墠瀹屾垚
function submit() {
- if (null == recordData) {
- notify("娌℃湁鏁版嵁鍙互鎻愪氦", null);
+ if (!recordData) {
+ alertError("娌℃湁涓氬姟鏁版嵁淇℃伅锛屾墽琛岃鎷掔粷");
return;
}
var data = form.val("form-data");
if (!data.depotId) {
- notify("瑁呭嵏浠撳簱蹇呴』濉啓", null);
+ alertError("鎻愮ず锛氳鍗镐粨搴撳繀濉�");
return;
}
+ if (!data.customerName) {
+ alertError("鎻愮ず锛氬鎴峰悕绉板繀濉�");
+ return;
+ }
+
// 鏍¢獙-鍏ュ簱婊¤溅绉伴噸
if (InoutProgress.WEIGHT_FULL == recordData.progress) {
if (data.fullWeight <= 0.0) {
- notify("婊¤溅绉伴噸淇℃伅蹇呭~锛侊紒", null);
- return;
- }
- if (!data.customerName) {
- notify("瀹㈡埛鍚嶇О蹇呭~锛侊紒", null);
- return;
- }
- } else {
- if (data.emptyWeight <= 0.0) {
- notify("绌鸿溅绉伴噸淇℃伅蹇呭~锛侊紒", null);
- return;
- }
- if (!data.foodVariety) {
- notify("绮鍝佺蹇呭~锛侊紒", null);
- return;
- }
- if (!data.settleWeight || data.settleWeight <= 0.0) {
- notify("缁撶畻閲嶉噺鍚堣锛岃鏍稿锛侊紒", null);
+ alertError("鎻愮ず锛氭弧杞︾О閲嶄俊鎭繀濉�");
return;
}
}
- // 鍚堝苟鏇存柊鐣跺墠缂栬緫鏁版嵁
+ if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {
+ if (data.emptyWeight <= 0.0) {
+ alertError("鎻愮ず锛氱┖杞︾О閲嶄俊鎭繀濉�");
+ return;
+ }
+ if (!data.foodVariety) {
+ alertError("鎻愮ず锛氱伯椋熷搧绉嶅繀濉�");
+ return;
+ }
+
+ if (!data.settleWeight || data.settleWeight <= 0.0) {
+ alertError("缁撶畻閲嶉噺涓嶅悎瑙勶紝璇锋牳瀵�");
+ return;
+ }
+ if (!data.recordWeight || data.recordWeight <= 0.0) {
+ alertError("鍏ュ簱閲嶉噺涓嶅悎瑙勶紝璇锋牳瀵�");
+ return;
+ }
+ }
+
+ //鍚堝苟鏁版嵁
Object.assign(recordData, data);
// 鑾峰彇鐓х墖
@@ -597,129 +471,43 @@
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);
+ alertError(result.msg);
} else {
notify("鏁版嵁鎻愪氦鎴愬姛", result.data);
- // 鏇存柊鎸夐挳鏄剧ず
- flushBtn("btn-submit");
}
layer.close(index);
},
error: function () {
layer.close(index);
- notify("鎻愪氦澶辫触锛岃閲嶆柊灏濊瘯", null);
+ alertError("鎻愪氦澶辫触锛岃閲嶆柊灏濊瘯");
}
- });
-
- //浠ヤ笅閫昏緫涓哄鍔犱竴涓闊抽�氱煡鐨勮皟鐢ㄦ柟娉曪紝涓嶈�冭檻杩斿洖缁撴灉--鍚庡彴璋冪敤
- 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 showCheck() {
+ if (!recordData) {
+ alertError("娌℃湁涓氬姟鏁版嵁淇℃伅锛屾墽琛岃鎷掔粷");
+ return;
+ }
-// ---------------------------閫氱煡鍗�-寮�濮� -------------------//
-// 寮瑰嚭寰�鏉ュ崟浣嶄笅鎷夋
-function showNotice() {
- var index = layer.load();
- var param = {
- type: type
- };
- // 娓叉煋寰�鏉ュ崟浣嶅垪琛�
- table.render({
- elem: '#tableNotice',
- url: '../../basic/inout/list-notice鈥攊n',
- 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: 'foodVarietyName',
- title: '绮鍝佺',
- width: '10%'
- }, {
- field: 'year',
- title: '骞翠唤',
- width: '8%'
- }, {
- field: 'unitName',
- title: '鏀惰揣鍗曚綅'
- }, {
- 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);
- }
- });
+ // 鑾峰彇鍖栭獙椤逛俊鎭�
+ flushCheckItem();
- //鍙屽嚮鏄剧ず閫変腑鏁版嵁
- table.on('rowDouble(tableNotice)', function (obj) {
- var data = obj.data;
- form.val("form-data", {
- customerId: data.customerId,
- customerName: data.customerName,
- noticeId: data.id
- });
- // 鍏抽棴
- layer.closeAll();
- });
-
- // 寮瑰嚭瀵硅瘽妗�
layer.open({
type: 1,
- offset: ['100px', '250px'],
- title: "鍏ュ簱閫氱煡鍗�",
- area: ['900px', '600px'],
+ title: "璐ㄦ璇︾粏",
+ offset: ['120px', '100px'],
+ area: ['1000px', '520px'],
shade: 0,
- content: $('#listNotice'),
- btn: 0,
+ content: $('#checkDetail'),
+ btnAlign: 'c',
btn: ['鍙栨秷'],
yes: function () {
layer.closeAll();
@@ -728,50 +516,145 @@
});
}
-// ---------------------------閫氱煡鍗� -缁撴潫 -------------------//
-//-------------------------閬撻椄鎿嶄綔--------------------------//
+/**
+ * 鍒锋柊鍖栭獙缁撴灉椤�
+ */
+function flushCheckItem() {
-function gateCtrl() {
- layer.open({
- type: 1,
- title: '璁惧鎿嶄綔-' + domSelectDevice.attr("name"),
- area: ['450px', '210px'],
- shade: 0,
- content: $('#control-gate'),
- btn: 0,
- closeBtn: 2
+ curCheckItems = null;
+ $.ajax({
+ type: "POST",
+ url: "../../basic/inout/get-check-item",
+ dataType: "json",
+ contentType: "application/json;charset=UTF-8",
+ data: JSON.stringify(recordData),
+ success: function (result) {
+ if (result.code != "0000") {
+ layer.msg(result.msg);
+ } else {
+ curCheckItems = result.data;
+
+ // 椤甸潰娓叉煋妫�娴嬮」
+ renderTableCheckItem();
+ }
+ },
+ error: function () {
+ layer.msg("鍚庡彴寮傚父锛岃閲嶈瘯鎴栬�呰仈绯荤鐞嗗憳锛侊紒");
+ }
});
}
-function controlGate(targetStatus){
- if(gateDto){
- var data = {"companyId":companyId
- ,"deptId":deptId
- ,"bizType":type
- ,"confId":gateDto.id
- ,"targetStatus":targetStatus
- ,"sort":gateDto.sort
- };
- $.ajax({
- type: "POST",
- url: "../../basic/inout/gate-ctrl",
- dataType: "json",
- contentType: "application/json;charset=UTF-8",
- data: JSON.stringify(data),
- success: function (result) {
- if (result.code != "0000") {
- layer.msg("鎿嶄綔澶辫触锛�"+result.msg);
- } else {
- layer.msg("鎿嶄綔鎴愬姛");
- }
- },
- error: function () {
- layer.alert("鎿嶄綔澶辫触锛岃閲嶆柊灏濊瘯锛侊紒");
- }
- });
- }else{
- layer.msg("娌℃湁鑾峰彇鍒拌澶囷紒");
+/**
+ * 寮瑰嚭鎻愰啋妗�
+ * @param msg 鎻愰啋淇℃伅
+ * @param data 鏁版嵁淇℃伅锛屽彲鑳戒负绌�
+ */
+function notify(msg, data) {
+ if (data) {
+ //璧嬪��
+ $("#resultMsg").text(msg);
+ $("#resultUserName").text(data.userName);
+ $("#resultPlateNum").text(data.plateNum);
+ if ("IN" == data.type) {
+ $("#resultType").text("鍏ュ簱-" + INOUT_PROGRESS_MSG(data.progress));
+ } else {
+ $("#resultType").text("鍑哄簱-" + INOUT_PROGRESS_MSG(data.progress));
}
+ $("#resultIntelCard").text(data.intelCard);
+
+ layer.open({
+ type: 1,
+ offset: ['150px', '200px'],
+ area: '450px;',
+ shade: 0.8,
+ id: 'dialog_notify_info',
+ btn: ['纭畾'],
+ content: $('#dialog-from-notify'),
+ yes: function (index) {
+ layer.closeAll();
+ }
+ });
+ } else {
+ layer.alert(msg, {offset: ['300px', '300px']});
+ }
}
-//-------------------------閬撻椄鎿嶄綔--------------------------//
\ No newline at end of file
+/**
+ * 娓叉煋琛ㄦ牸
+ */
+function renderTableCheckItem() {
+ // 娓呯┖鏁版嵁
+ $("#tableCheckItem").empty();
+ table.render({
+ elem: '#tableCheckItem',
+ data: curCheckItems,
+ page: false,
+ even: true,
+ cols: [[{
+ field: 'standardName',
+ title: '妫�楠岄」鐩�',
+ align: 'center',
+ width: '13%'
+ }, {
+ field: 'value',
+ title: '妫�楠屽��',
+ align: 'center',
+ width: '9%'
+ }, {
+ field: 'operaSymbolValue',
+ title: '鏍囧噯鍊�',
+ align: 'center',
+ width: '10%'
+ }, {
+ field: 'unit',
+ title: '鍗曚綅',
+ align: 'center',
+ width: '10%'
+ }, {
+ field: 'deNum',
+ title: '鎵i噸',
+ align: 'center',
+ width: '9%'
+ }, {
+ field: 'addNum',
+ title: '澧為噸',
+ align: 'center',
+ width: '9%'
+ }, {
+ field: 'dePrice',
+ title: '鎵d环',
+ align: 'center',
+ width: '9%'
+ }, {
+ field: 'addPrice',
+ title: '澧炰环',
+ align: 'center',
+ width: '9%'
+ }, {
+ field: 'result',
+ title: '妫�楠岀粨鏋�',
+ align: 'center',
+ width: '10%',
+ templet: function (item) {
+ if (item.result == null) {
+ return "";
+ }
+ if (item.result == '0') {
+ return "涓嶅悎鏍�";
+ }
+ if (item.result == '1') {
+ return "鍚堟牸";
+ }
+ }
+ }, {
+ field: 'remarks',
+ title: '澶囨敞璇存槑',
+ align: 'center'
+ }]]
+ });
+
+ $("thead tr").css({
+ "border-bottom": "2px solid #53adce",
+ "background": "#eff4f6"
+ });
+}
\ No newline at end of file
--
Gitblit v1.9.3