From 97372541208141dd927ecb786168d5bc5b938cc2 Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期四, 04 十二月 2025 11:42:04 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 fzzy-igdss-web/src/main/resources/static/inout/check.js |  308 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 308 insertions(+), 0 deletions(-)

diff --git a/fzzy-igdss-web/src/main/resources/static/inout/check.js b/fzzy-igdss-web/src/main/resources/static/inout/check.js
new file mode 100644
index 0000000..bb78ad3
--- /dev/null
+++ b/fzzy-igdss-web/src/main/resources/static/inout/check.js
@@ -0,0 +1,308 @@
+//褰撳墠鑺傜偣 鍏ュ簱璐ㄦ
+var layer;
+var laydate;
+var form;
+var table;
+var page = 1;
+var limit = 10;
+var curCheckData = null;// 褰撳墠缂栬緫鏁版嵁
+var curCheckItems = null;// 褰撳墠鏁版嵁鐨勬鏌ラ」淇℃伅
+
+$(function () {
+    layui.use(['layer', 'laydate', 'form', 'table'], function () {
+        layer = layui.layer;
+        form = layui.form;
+        table = layui.table;
+        laydate = layui.laydate;
+
+        laydate.render({
+            elem: '#start',
+            theme: '#7b8e9f',
+            value: startTime
+        });
+
+        laydate.render({
+            elem: '#end',
+            theme: '#7b8e9f',
+            value: endTime
+        });
+
+        // 鐩戝惉琛屽伐鍏蜂簨浠�
+        table.on('tool(tableData)', function (obj) {
+            if (obj.event === 'edit') {
+                //灞曠ず鏁版嵁
+                showDetail(obj.data);
+            }
+        });
+
+        // 鍒濆鍖栬〃鍗曟暟鎹�
+        renderTable();
+    });
+
+    //鏄剧ず鍏ュ簱娴佺▼
+    showProgress();
+});
+
+/**
+ * 鎺у埗娴佺▼鐜妭鏄剧ず
+ */
+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");
+    }
+}
+
+// 鏌ヨ
+function flushData() {
+    var index = layer.load();
+    var param = form.val("form-param");
+
+    table.reload('tableData', {
+        url: "/basic/inout/page-inout-data",
+        where: param,
+    });
+
+    $("thead tr").css({
+        "border-bottom": "2px solid #53adce",
+        "background": "#eff4f6"
+    });
+    layer.close(index);
+}
+
+function showDetail(data) {
+    curCheckData = data;
+    // 璧嬪��
+    form.val("form-detail", data);
+    form.render();
+
+    layer.open({
+        type: 1,
+        title: "濉啓鍖栭獙淇℃伅",
+        area: ['1400px', '700px'],
+        shade: 0,
+        content: $('#checkDetail'),
+        btnAlign: 'c',
+        btn: ['淇濆瓨鎻愪氦', '鍏抽棴鍙栨秷'],
+        yes: function () {
+            // 鏇存柊鍒伴〉闈�
+            var data = form.val("form-detail");
+            // 鍚堝苟鏇存柊鐣跺墠缂栬緫鏁版嵁
+            Object.assign(curCheckData, data);
+            submit();
+        }, btn2: function () {
+            parent.layer.closeAll();
+        },
+        closeBtn: 0
+    });
+}
+
+//淇濆瓨鎻愪氦
+function submit() {
+
+    if (!curCheckData.perWet) {
+        layer.alert("璇峰~鍐欒川妫�姘村垎淇℃伅锛侊紒");
+        return;
+    }
+    if (!curCheckData.perImpurity) {
+        layer.alert("璇峰~鍐欒川妫�鏉傝川淇℃伅锛侊紒");
+        return;
+    }
+
+    var index = layer.load();
+    $.ajax({
+        type: "POST",
+        url: "/basic/inout/submit-check",
+        dataType: "json",
+        contentType: "application/json;charset=UTF-8",
+        async: false,
+        data: JSON.stringify(curCheckData),
+        success: function (result) {
+            if (result.code != "0000") {
+                layer.close(index);
+                notify(result.msg, result.data);
+            } else {
+                parent.layer.closeAll();
+                curCheckData = null;
+                notify("鏁版嵁鎻愪氦鎴愬姛", result.data);
+                flushData();
+            }
+        },
+        error: function () {
+            layer.close(index);
+            layer.alert("鎻愪氦澶辫触锛岃閲嶆柊灏濊瘯锛�");
+        }
+    });
+}
+
+/**
+ * 娓叉煋琛ㄥ崟鏁版嵁
+ */
+function renderTable() {
+    var param = form.val("form-param");
+    // 娓呯┖鏁版嵁
+    $("#tableData").empty();
+    table.render({
+        elem: '#tableData',
+        url: '/basic/inout/page-inout-data',
+        page: true,
+        limit: limit,
+        even: true,
+        method: 'POST',
+        contentType: "application/json;charset=UTF-8",
+        cols: [[{
+            type: 'numbers',
+            title: '搴忓彿'
+        },{
+            field: 'id',
+            title: '鍗曟嵁鍙�',
+            width: '10%',
+            style: 'color: #f67d06;font-weight: bold'
+        }, {
+            field: 'plateNum',
+            title: '杞︾墝鍙�',
+            width: '8%',
+            style: 'font-weight: bold'
+        }, {
+            field: 'type',
+            title: '绫诲瀷',
+            width: '6%',
+            templet: function (item) {
+                var result = item.type;
+                return result == "IN" ? "鍏ュ簱" : "鍑哄簱";
+            }
+        },{
+            field: 'customerName',
+            title: '寰�鏉ュ崟浣�'
+        }, {
+            field: 'depotId',
+            title: '瑁呭嵏浠撳簱',
+            width: '10%',
+            templet: function (item) {
+                var result = item.depotId;
+                $.each(listDepot, function (index, data) {
+                    if (item.depotId == data.id) {
+                        result = data.name;
+                        return true;
+                    }
+                });
+                return result == null ? "" : result;
+            }
+        }, {
+            field: 'foodVariety',
+            title: '绮鍝佺',
+            width: '10%',
+            templet: function (item) {
+                var result = item.foodVariety;
+                $.each(listFoodVariety, function (index, data) {
+                    if (item.foodVariety == data.code) {
+                        result = data.name;
+                        return true;
+                    }
+                });
+                return result == null ? "" : result;
+            }
+        }, {
+            field: 'perWet',
+            title: '姘村垎',
+            width: '8%'
+        }, {
+            field: 'perImpurity',
+            title: '鏉傝川',
+            width: '8%'
+        }, {
+            field: 'progress',
+            title: '娴佺▼杩涘害',
+            width: '10%',
+            style: 'font-weight: bold',
+            templet: function (item) {
+                return INOUT_PROGRESS_MSG(item.progress);
+            }
+        }, {
+            field: '',
+            title: '鎿嶄綔',
+            width: '9%',
+            toolbar: "#barControl"
+        }]],
+        where: param,
+        parseData: function (res) {
+            if ("0000" === res.code) {
+                return {
+                    "code": "0",
+                    "msg": res.msg,
+                    "count": res.data.total,
+                    "data": res.data.records
+                }
+            } else {
+                return {
+                    "code": "1",
+                    "msg": res.msg
+                }
+            }
+        }
+    });
+    $("thead tr").css({
+        "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']});
+    }
+}
+
+// ---------------------------绮浜у湴 -缁撴潫 -------------------//
\ No newline at end of file

--
Gitblit v1.9.3