From 249b4676607baa4e064832ceaaff4bab488a84cd Mon Sep 17 00:00:00 2001
From: CZT <czt18638530771@163.com>
Date: 星期二, 27 六月 2023 19:30:22 +0800
Subject: [PATCH] 提交惠州惠新配置信息
---
igds-web/src/main/resources/static/admin/inout/in-check.js | 253 ++++++++++++++++++++++++++++----------------------
1 files changed, 142 insertions(+), 111 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 0a780a4..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
@@ -1,5 +1,6 @@
//褰撳墠鑺傜偣 鍏ュ簱璐ㄦ
var layer;
+var laydate;
var form;
var table;
var page = 1;
@@ -12,7 +13,7 @@
layer = layui.layer;
form = layui.form;
table = layui.table;
- var laydate = layui.laydate;
+ laydate = layui.laydate;
laydate.render({
elem: '#start',
@@ -27,9 +28,10 @@
});
laydate.render({
- elem: '#foodYear',
+ elem: '#checkTime',
theme: '#7b8e9f',
- type: 'year',
+ format: 'yyyy-MM-dd HH:mm:ss',
+ type: 'datetime'
});
// 鍒濆鍖栬〃鍗曟暟鎹�
@@ -45,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);
});
//鐩戝惉鍖栭獙缁撴灉鍗曞~鍐欐暟鎹�,骞剁粰鍑烘彁绀虹粨鏋�
@@ -108,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";
}
}
}
@@ -144,7 +151,7 @@
form.render('select');
}
-//鏍规嵁閫夋嫨浠撳簱鏄剧ず绮鍝佺
+//鏍规嵁鍝佺鑾峰彇鍖栭獙椤�
function updateFoodVariety(foodVariety) {
if (null == foodVariety || "" == foodVariety) return;
form.val("form-detail", {
@@ -153,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("鍚庡彴寮傚父锛岃閲嶈瘯鎴栬�呰仈绯荤鐞嗗憳锛侊紒");
+ }
+ });
}
// 鏌ヨ
@@ -295,14 +330,12 @@
function showDetail(obj) {
curCheckData = obj.data;
- // console.log(curCheckData);
- curCheckData.foodYear = dateFtt("yyyy", new Date());
- curCheckData.checkUser = checkUser;
- if (curCheckData.checkStatus == "NONE") {
- //闅愯棌杞︾墝閮ㄥ垎淇℃伅
- curCheckData.plateNum = replaceStr(curCheckData.plateNum);
+ curSampleData = obj.data;
+ if(!curCheckData.checkTime){
+ curCheckData.checkTime = dateFtt("yyyy-MM-dd hh:mm:ss", new Date());
}
+ curCheckData.checkUser = checkUser;
// 璧嬪��
form.val("form-detail", curCheckData);
@@ -311,7 +344,7 @@
layer.open({
type: 1,
title: "鍖栭獙鍗曟槑缁�",
- area: ['1400px', '650px'],
+ area: ['1400px', '700px'],
shade: 0,
content: $('#checkDetail'),
btnAlign: 'c',
@@ -331,9 +364,9 @@
});
// 鑾峰彇鍖栭獙椤逛俊鎭�
- flushCheckItem(null);
-};
-
+ flushCheckItem(curCheckData.foodVariety);
+ getPriceByFoodLevel(curCheckData.foodLevel);
+}
/**
* 鍒锋柊鍖栭獙缁撴灉椤�
@@ -341,6 +374,7 @@
function flushCheckItem(foodVariety) {
curCheckItems = null;
$("#check-result-tip").text("妫�楠岀粨鏋滐細#");
+ $("#price-result-tip2").text("绮瀹氫环锛�#鍏�/鍏枻");
curCheckData.foodVariety = foodVariety;
var index = layer.load();
@@ -379,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("璐ㄦ缁撴灉锛�#");
}
-};
+}
/**
* 娓叉煋琛ㄦ牸
@@ -411,28 +445,68 @@
even: true,
cols: [[{
field: 'standardName',
- title: '鍖栭獙椤圭洰',
+ title: '妫�楠岄」鐩�',
align: 'center',
- width: '20%'
+ width: '10%'
}, {
field: 'value',
- title: '鍖栭獙缁撴灉',
+ title: '妫�楠屽��',
align: 'center',
- width: '20%',
+ width: '10%',
edit: 'text'
+ }, {
+ field: 'operaSymbolValue',
+ title: '鏍囧噯鍊�',
+ align: 'center',
+ width: '10%'
}, {
field: 'unit',
title: '鍗曚綅',
align: 'center',
width: '10%'
}, {
- field: 'standardValue',
- title: '鍖栭獙鏍囧噯',
+ field: 'deNum',
+ title: '鎵i噸',
align: 'center',
- width: '15%'
+ width: '10%',
+ edit: 'text'
+ }, {
+ field: 'addNum',
+ title: '澧為噸',
+ align: 'center',
+ width: '10%',
+ edit: 'text'
+ }, {
+ field: 'dePrice',
+ title: '鎵d环',
+ align: 'center',
+ width: '10%',
+ edit: 'text'
+ }, {
+ field: 'addPrice',
+ title: '澧炰环',
+ align: 'center',
+ width: '10%',
+ edit: 'text'
+ }, {
+ 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: '璇� 鏄�',
+ title: '澶囨敞璇存槑',
align: 'center',
edit: 'text'
}]]
@@ -451,16 +525,8 @@
layer.alert("璇风‘璁ゅ寲楠岀粨鏋滐紒锛�");
return;
}
- if (!curCheckData.depotId) {
- layer.alert("璇烽�夋嫨瑁呭嵏浠撳簱锛侊紒");
- return;
- }
if (!curCheckData.foodVariety) {
layer.alert("璇风‘璁ょ伯椋熷搧绉嶏紒锛�");
- return;
- }
- if (!curCheckData.foodYear) {
- layer.alert("璇风‘璁ょ伯椋熷勾浠斤紒锛�");
return;
}
if (!curCheckData.foodLevel) {
@@ -471,13 +537,12 @@
layer.alert("璇风‘璁ょ伯椋熷畾浠凤紝濡備笉鑰冭檻瀹氫环锛岃濉啓0.0");
return;
}
-
curCheckData.checkItems = curCheckItems;
var index = layer.load();
$.ajax({
type: "POST",
- url: "../../basic/inout/update-check",
+ url: "../../basic/inout/submit-check",
dataType: "json",
contentType: "application/json;charset=UTF-8",
data: JSON.stringify(curCheckData),
@@ -516,37 +581,43 @@
contentType: "application/json;charset=UTF-8",
cols: [[{
field: 'checkId',
- title: '妫�楠屽崟鍙�',
- width: '13%',
+ title: '璐ㄦ鍗曞彿',
+ width: '10%',
style: 'color: #f67d06;font-weight: bold'
}, {
- field: 'plateNum',
- title: '杞﹁埞鍙�',
- width: '11%',
- style: 'font-weight: bold',
+ field: 'registerTime',
+ title: '鐧昏鏃堕棿',
+ width: '15%',
+ style: 'font-weight: bold'
+ }, {
+ field: 'sampleStatus',
+ title: '鏄惁鎵︽牱',
+ width: '10%',
templet: function (item) {
- if (item.checkStatus != "NONE") {
- return item.plateNum;
- } else {
- var result = replaceStr(item.plateNum);
- return result == null ? "" : result;
+ if (item.sampleStatus == null) {
+ return "鏈墻鏍�";
+ }
+ if (item.sampleStatus == 'NONE') {
+ return "鏈墻鏍�";
+ }
+ if (item.sampleStatus == 'SAMPLE') {
+ return "宸叉墻鏍�";
}
}
}, {
- field: 'customerName',
- title: '寰�鏉ュ崟浣�',
- templet: function (item) {
- if (item.checkStatus != "NONE") {
- return item.customerName;
- } else {
- var result = replaceStr(item.customerName);
- return result == null ? "" : result;
- }
- }
+ field: 'sampleUser',
+ title: '鎵︽牱浜�',
+ width: '10%',
+ style: 'font-weight: bold'
+ }, {
+ field: 'sampleTime',
+ title: '鎵︽牱鏃堕棿',
+ width: '15%',
+ style: 'font-weight: bold'
}, {
field: 'foodVariety',
title: '绮鍝佺',
- width: '10%',
+ width: '11%',
templet: function (item) {
var result = item.foodVariety;
$.each(listFoodVariety, function (index, data) {
@@ -560,7 +631,7 @@
}, {
field: 'depotId',
title: '瑁呭嵏浠撳簱',
- width: '10%',
+ width: '11%',
templet: function (item) {
var result = item.depotId;
$.each(listDepot, function (index, data) {
@@ -574,7 +645,6 @@
}, {
field: 'checkStatus',
title: '妫�楠岀粨鏋�',
- width: '10%',
style: 'font-weight: bold',
templet: function (item) {
if (item.checkStatus == 'NONE') {
@@ -589,13 +659,9 @@
return item.checkStatus == null ? "" : item.checkStatus;
}
}, {
- field: 'registerTime',
- title: '鐧昏鏃堕棿',
- width: '14%'
- }, {
field: '',
title: '鎿嶄綔',
- width: '9%',
+ width: '8%',
toolbar: "#barControl"
}]],
where: param,
@@ -619,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