From 1a47d9eef4cfe9385ce66b791de84db54a5ba87c Mon Sep 17 00:00:00 2001
From: jiazx0107@163.com <jiazx0107@163.com>
Date: 星期日, 25 六月 2023 20:30:36 +0800
Subject: [PATCH] 出入库流程优化-入库详单优化
---
igds-web/src/main/resources/static/admin/inout/in-check.js | 125 +++++++++++++++++++++--------------------
1 files changed, 65 insertions(+), 60 deletions(-)
diff --git a/igds-web/src/main/resources/static/admin/inout/in-check.js b/igds-web/src/main/resources/static/admin/inout/in-check.js
index f8a46e1..249ebe0 100644
--- a/igds-web/src/main/resources/static/admin/inout/in-check.js
+++ b/igds-web/src/main/resources/static/admin/inout/in-check.js
@@ -47,9 +47,14 @@
}
});
- //鐩戝惉绮鍝佺
+ //鐩戝惉绮鍝佺锛岃幏鍙栧寲楠岄」
layui.form.on('select(select_foodVariety)', function (data) {
updateFoodVariety(data.value);
+ });
+
+ //鐩戝惉绮绛夌骇锛岃幏鍙栫伯椋熷畾浠�
+ layui.form.on('select(select_foodLevel)', function (data) {
+ getPriceByFoodLevel(data.value);
});
//鐩戝惉鍖栭獙缁撴灉鍗曞~鍐欐暟鎹�,骞剁粰鍑烘彁绀虹粨鏋�
@@ -110,23 +115,23 @@
if (symbol && limit) {
if (">=" == symbol) {
if (newValue < limit) {
- data.remarks = "涓嶅悎鏍�";
+ data.result = "0";
} else {
- data.remarks = "鍚堟牸";
+ data.result = "1";
}
}
if ("<=" == symbol) {
if (newValue > limit) {
- data.remarks = "涓嶅悎鏍�";
+ data.result = "0";
} else {
- data.remarks = "鍚堟牸";
+ data.result = "1";
}
}
if ("==" == symbol) {
if (newValue != limit) {
- data.remarks = "涓嶅悎鏍�";
+ data.result = "0";
} else {
- data.remarks = "鍚堟牸";
+ data.result = "1";
}
}
}
@@ -146,7 +151,7 @@
form.render('select');
}
-//鏍规嵁閫夋嫨浠撳簱鏄剧ず绮鍝佺
+//鏍规嵁鍝佺鑾峰彇鍖栭獙椤�
function updateFoodVariety(foodVariety) {
if (null == foodVariety || "" == foodVariety) return;
form.val("form-detail", {
@@ -155,6 +160,34 @@
form.render();
flushCheckItem(foodVariety);
+}
+
+//鏍规嵁閫夋嫨浠撳簱鏄剧ず绮鍝佺
+function getPriceByFoodLevel(foodLevel) {
+ if (null == foodLevel || "" == foodLevel) return;
+ form.val("form-detail", {
+ foodLevel: foodLevel
+ });
+ form.render();
+ var data = form.val("form-detail");
+
+ $.ajax({
+ type: "POST",
+ url: "../../basic/inout/get-price",
+ dataType: "json",
+ contentType: "application/json;charset=UTF-8",
+ data: JSON.stringify(data),
+ success: function (result) {
+ if (result.code != "0000") {
+ layer.msg(result.msg);
+ } else {
+ $("#check-result-tip2").text("绮瀹氫环锛�" + result.data.price + "鍏�/鍏枻");
+ }
+ },
+ error: function () {
+ layer.msg("鍚庡彴寮傚父锛岃閲嶈瘯鎴栬�呰仈绯荤鐞嗗憳锛侊紒");
+ }
+ });
}
// 鏌ヨ
@@ -303,10 +336,6 @@
curCheckData.checkTime = dateFtt("yyyy-MM-dd hh:mm:ss", new Date());
}
curCheckData.checkUser = checkUser;
- if (curCheckData.checkStatus == "NONE") {
- //闅愯棌杞︾墝閮ㄥ垎淇℃伅
- curCheckData.plateNum = replaceStr(curCheckData.plateNum);
- }
// 璧嬪��
form.val("form-detail", curCheckData);
@@ -335,7 +364,8 @@
});
// 鑾峰彇鍖栭獙椤逛俊鎭�
- flushCheckItem(null);
+ flushCheckItem(curCheckData.foodVariety);
+ getPriceByFoodLevel(curCheckData.foodLevel);
}
/**
@@ -344,7 +374,7 @@
function flushCheckItem(foodVariety) {
curCheckItems = null;
$("#check-result-tip").text("妫�楠岀粨鏋滐細#");
- $("#price-result-tip").text("绮鍗曚环锛�#鍏�/鍏枻");
+ $("#price-result-tip2").text("绮瀹氫环锛�#鍏�/鍏枻");
curCheckData.foodVariety = foodVariety;
var index = layer.load();
@@ -383,23 +413,23 @@
}
var msg;
$.each(curCheckItems, function (index, data) {
- if (!data.remarks) {
+ if (!data.result) {
return true;
}
- if (data.remarks == "涓嶅悎鏍�") {
+ if (data.result == "0") {
msg = "涓嶅悎鏍�";
return false;
}
- if (data.remarks == "鍚堟牸") {
+ if (data.result == "1") {
msg = "鍚堟牸";
}
});
if (msg) {
- $("#check-result-tip").text("妫�楠岀粨鏋滐細" + msg + "锛涚伯椋熷崟浠凤細#鍏�/鍏枻");
+ $("#check-result-tip").text("璐ㄦ缁撴灉锛�" + msg);
} else {
- $("#check-result-tip").text("妫�楠岀粨鏋滐細鍚堟牸" + "锛涚伯椋熷崟浠凤細#鍏�/鍏枻");
+ $("#check-result-tip").text("璐ㄦ缁撴灉锛�#");
}
-};
+}
/**
* 娓叉煋琛ㄦ牸
@@ -425,7 +455,7 @@
width: '10%',
edit: 'text'
}, {
- field: 'operaSymbol',
+ field: 'operaSymbolValue',
title: '鏍囧噯鍊�',
align: 'center',
width: '10%'
@@ -463,7 +493,17 @@
title: '妫�楠岀粨鏋�',
align: 'center',
width: '10%',
- edit: 'text'
+ templet: function (item) {
+ if (item.result == null) {
+ return "";
+ }
+ if (item.result == '0') {
+ return "涓嶅悎鏍�";
+ }
+ if (item.result == '1') {
+ return "鍚堟牸";
+ }
+ }
}, {
field: 'remarks',
title: '澶囨敞璇存槑',
@@ -502,7 +542,7 @@
var index = layer.load();
$.ajax({
type: "POST",
- url: "../../basic/inout/update-check1",
+ url: "../../basic/inout/submit-check",
dataType: "json",
contentType: "application/json;charset=UTF-8",
data: JSON.stringify(curCheckData),
@@ -645,48 +685,13 @@
"border-bottom": "2px solid #53adce",
"background": "#eff4f6"
});
-};
+}
// 琛ㄥ崟娓呯┖
function resetForm() {
$("#form-param")[0].reset();
form.render();
-};
-
-/**
- * 寮瑰嚭鎻愰啋妗�
- * @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']});
- }
-};
+}
// ---------------------------绮浜у湴 -寮�濮� -------------------//
// 寮瑰嚭绮浜у湴涓嬫媺妗�
--
Gitblit v1.9.3