From cc9d69e980b73aae333ab72d370aff82594afbf4 Mon Sep 17 00:00:00 2001
From: czt <czt18638530771@163.com>
Date: 星期五, 23 五月 2025 11:03:28 +0800
Subject: [PATCH] 调整细节

---
 igds-dzhwk-web/src/main/resources/static/dzhwk/pest/pest-check.js |  737 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 737 insertions(+), 0 deletions(-)

diff --git a/igds-dzhwk-web/src/main/resources/static/dzhwk/pest/pest-check.js b/igds-dzhwk-web/src/main/resources/static/dzhwk/pest/pest-check.js
new file mode 100644
index 0000000..4f1b7d9
--- /dev/null
+++ b/igds-dzhwk-web/src/main/resources/static/dzhwk/pest/pest-check.js
@@ -0,0 +1,737 @@
+var layer;
+var depotId;// 褰撳墠浠撳簱id
+var curData;// 褰撳墠浠撶伯鎯呮暟鎹�
+var mapData;// 鏍规嵁鏃ユ湡鏌ヨ鐨勬瘡涓粨搴撲竴鏉℃暟鎹�
+var form;
+var table;
+var listData;// 榛樿椤甸潰涓殑绮儏鍒楄〃
+var gasConf;// 姘斾綋閲囬泦閰嶇疆淇℃伅锛屽寘鎷紑濮嬮噰闆嗙偣鍜屾埅鑷抽噰闆嗙偣銆�
+
+$(function () {
+    layui.use(['layer', 'laydate', 'form', 'table'], function () {
+        form = layui.form;
+        layer = layui.layer;
+        var laydate = layui.laydate;
+        table = layui.table;
+
+        // 鏃ユ湡
+        laydate.render({
+            elem: '#checkDateMore',
+            theme: '#7b8e9f'
+        });
+
+        laydate.render({
+            elem: '#printCheckDate',
+            theme: '#7b8e9f'
+        });
+
+        // 鐩戝惉浠撳簱閫夋嫨
+        form.on('select(select_depotId)', function (obj) {
+            flushData(null);
+
+            //鑾峰彇褰撳墠浠撳簱鏁堟灉鍥�
+            // cutImg(obj.value);
+            //鏍规嵁浠撳簱缂栫爜鍒囨崲閲囬泦鐐逛綅缃�
+            // cutPoint(obj.value);
+        });
+
+        // 鐩戝惉閫夋嫨鎵规
+        form.on('select(select_batchId)', function (obj) {
+            var value = obj.value;
+            if (value == "0") {// 琛ㄧず寮瑰嚭鏇村鎵规
+                showMore();
+            } else {
+                flushByBatchId(value);
+            }
+        });
+        flushData(null);
+    });
+});
+
+/**
+ * 鍒囨崲閲囬泦鐐�
+ * @param depotId
+ */
+function cutPoint(depotId) {
+	//棣栧厛闄ゅ幓宸叉湁鏁堟灉
+    $(".qt-pic-icon-active").removeClass("qt-pic-icon-active");
+
+    $("#list-point-right").css("display","none");
+    $("#list-point-left").css("display","block");
+}
+
+
+//鏍规嵁閲囬泦杩涘害淇℃伅娓叉煋閲囬泦鐐规晥鏋�
+function renderCheckPoint(checkProgress) {
+	if (depotId != checkProgress.depotId) {
+		$("#progress-info").text("");
+		return;
+	}
+    $("#progress-info").text(checkProgress.msg);
+    
+    //棣栧厛闄ゅ幓宸叉湁鏁堟灉
+    $(".qt-pic-icon-active").removeClass("qt-pic-icon-active");
+
+	var id = "#point" + checkProgress.checkPoint+"-left";
+	$(id).addClass("qt-pic-icon-active");
+	id = "#point" + checkProgress.checkPoint+"-right";
+	$(id).addClass("qt-pic-icon-active");
+};
+
+// 鍗曚粨鎵撳嵃
+function printSingle() {
+    layer.msg("鏆傛湭瀵规帴锛�");
+    return;
+    layer.msg("寮�濮嬬敓鎴愭墦鍗版ā鐗堚�︹��");
+    var html = builderModel(curData,dept);
+    layer.msg("寮�濮嬭皟鐢ㄦ墦鍗版満绋嬪簭棰勮鈥︹��");
+    previewA4(html);
+};
+
+// 鎵归噺鎵撳嵃
+function printBatch() {
+    layer.msg("鏆傛湭瀵规帴锛�");
+    return;
+    // 棣栧厛鍘婚櫎涔嬪墠鐨勯�夋嫨
+    var name;
+    $('#batchPrintSelect input').each(function () {
+        name = $(this).prop("name");
+        if (name == "printCheckDate") {// 璺宠繃
+            return true;
+        }
+        $(this).prop("disabled", false);
+        $(this).prop("checked", false);
+    });
+    form.render();
+
+    // 寮瑰嚭閫夋嫨妗�
+    layer.open({
+        type: 1,
+        title: '鎵归噺鎵撳嵃锛堢孩鑹茶〃绀烘病鏈夋娴嬭褰曪紝榛樿涓哄綋澶╋級',
+        area: ['690px', '450px'],
+        shade: 0,
+        content: $('#batchPrintSelect'),
+        btn: ['鍏ㄩ��', '鍙嶉��', '閲嶉��', '鎵撳嵃棰勮', '鍙栨秷鎵撳嵃'],
+        yes: function () {
+            var disabled, name;
+            $('#batchPrintSelect input').each(function () {
+                disabled = $(this).prop("disabled");
+                name = $(this).prop("name");
+                if (name == "printCheckDate" || disabled) {
+                } else {
+                    $(this).prop("checked", true);
+                }
+            });
+            form.render();
+        },
+        btn2: function () {
+            var disabled, name;
+            $('#batchPrintSelect input').each(function () {
+                disabled = $(this).prop("disabled");
+                name = $(this).prop("name");
+                if (name == "printCheckDate" || disabled) {
+                    // 涓嶅仛澶勭悊
+                } else {
+                    if ($(this).prop("checked")) {
+                        $(this).prop("checked", false);
+                    } else {
+                        $(this).prop("checked", true);
+                    }
+                }
+            });
+            form.render();
+            return false;
+        },
+        btn3: function () {
+            var disabled, name;
+            $('#batchPrintSelect input').each(function () {
+                disabled = $(this).prop("disabled");
+                name = $(this).prop("name");
+                if (name == "printCheckDate" || disabled) {
+                    // 涓嶅仛澶勭悊
+                } else {
+                    $(this).prop("checked", false);
+                }
+            });
+            form.render();
+            return false;
+        },
+        btn4: function () {
+            printBatchTodo();
+        },
+        btn5: function () {
+            layer.close(0);
+        },
+        closeBtn: 0
+    });
+
+    // 榛樿璋冪敤鑾峰彇鏁版嵁鏇存柊
+    $("#printCheckDate").prop("value", dateFtt("yyyy-MM-dd", new Date()));
+    getPrintBatchDepot();
+};
+
+// 鑾峰彇鎵归噺鎵撳嵃鐨勪俊鎭�
+function getPrintBatchDepot() {
+    layer.msg("楠岃瘉绮儏妫�娴嬭褰曗�︹��");
+    var checkDate = $("#printCheckDate").val();
+    $.ajax({
+        type: "POST",
+        url: "../../basic/pest/query-checkDate-map",
+        dataType: "json",
+        contentType: "application/json;charset=UTF-8",
+        data: JSON.stringify({
+            checkDate: checkDate
+        }),
+        success: function (result) {
+            if (result.code != "0000") {
+                layer.msg(result.msg);
+                // 璁剧疆鎵�鏈変粨搴撲笉鍙��
+                var name;
+                $('#batchPrintSelect input').each(function () {
+                    name = $(this).prop("name");
+                    if (name != "printCheckDate") {// 璺宠繃
+                        $(this).prop("disabled", true);
+                    }
+                });
+                form.render();
+
+            } else {
+                mapData = result.data;
+
+                // 鍔ㄦ�佽皟鏁翠粨搴撴槸鍚﹀彲浠ラ�夋嫨
+                var name, value;
+                $('#batchPrintSelect input').each(function () {
+                    name = $(this).prop("name");
+                    value = $(this).val();
+                    if (name != "printCheckDate") {// 璺宠繃
+                        if (mapData[value]) {
+                            $(this).prop("disabled", false);
+                        } else {
+                            $(this).prop("disabled", true);
+                        }
+                    }
+                });
+                form.render();
+            }
+        },
+        error: function () {
+            layer.msg("鎵归噺鎵撳嵃鑾峰彇绮儏淇℃伅澶辫触锛�");
+        }
+    });
+};
+
+// 鏍规嵁鏌ヨ鐨勬暟鎹壒閲忔墦鍗伴瑙�
+function printBatchTodo() {
+    layer.msg("寮�濮嬫壒閲忕敓鎴愭墦鍗版ā鐗堚�︹��");
+    var strHtml;
+    var value;
+    var checked;
+    var printData;
+    // 灏嗕粨搴撴暟鎹垪琛ㄨ浆鎹负MAP
+    var mapDepot = {};
+    $.each(listDepot, function (index, data) {
+        mapDepot[data.id] = data;
+    });
+    var LODOP = getLodop();
+    LODOP.PRINT_INIT("姘斾綋妫�娴嬫姤琛�");// 鍒濆鍖栧湪寰幆澶�
+    LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "A4");
+    $('#batchPrintSelect input').each(function () {
+        if ($(this).prop("name") == "printCheckDate") {// 璺宠繃
+            return true;
+        }
+        checked = $(this).prop("checked");
+        if (checked) {
+            value = $(this).val();
+            LODOP.NewPage();
+            printData = mapData[value];
+            if (!printData) {// 濡傛灉娌℃湁绮儏鏁版嵁璺宠繃鎵ц涓嬩竴涓�
+                return true;
+            }
+            printData.depotData = mapDepot[value];
+            strHtml = builderModel(printData,dept);
+            LODOP.ADD_PRINT_HTM(30, 40, "180mm", "100%", strHtml);
+        }
+    });
+    layer.msg("寮�濮嬭皟鐢ㄦ墦鍗扮▼搴忛瑙堚�︹��");
+    LODOP.PREVIEW();
+};
+
+// 鐐瑰嚮鍒锋柊鎿嶄綔
+function flushData(checkDate) {
+    depotId = $("#depotId").val();
+    if (!depotId) {
+        layer.msg("璇峰厛閫夋嫨浠撳簱锛�");
+        return;
+    }
+    cleanData();
+    listData = [{"batchId":"202410230838","checkNum":5,"checkUser":"绠$悊鍛�","companyId":"1000","depotData":{"bulkWeight":600,"companyId":"1000","depotStatus":"3","depotStatusName":"灏佷粨","depotType":"01","depotTypeName":"骞虫埧浠�","deptId":"1000001001","foodLevel":"03","foodLevelName":"涓夌瓑","foodLocation":"姹熻タ鐪�","foodType":"123","foodTypeName":"鍘跨骇鍦版柟鍌ㄥ绮�","foodVariety":"1131","foodYear":"2024","id":"LB03","name":"L1-1C浠�","orderNum":3,"storageMax":5000000,"storageReal":1825000,"storeDate":1724342400000,"storeKeeperLevel":"楂樼骇淇濈鍛�","storeKeeperPhone":"####","storeType":"1"},"depotId":"LB03","listPoint":[{"passCode":1,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 08:38"},{"passCode":2,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 08:38"},{"passCode":3,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 08:38"},{"passCode":4,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 08:38"},{"passCode":5,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 08:38"}],"pestEnd":5,"pestMax":2,"pestStart":1,"points":"1,0;2,0;3,0;4,0;5,2;","receiveDate":"2024-10-23 08:38","remark":"鍩烘湰鏃犺櫕绮�","sysDate":1747965415141},{"batchId":"202410100836","checkNum":5,"checkUser":"鍦扮瀹�","companyId":"1000","depotData":{"$ref":"$[0][0].depotData"},"depotId":"LB03","listPoint":[{"passCode":1,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 09:38"},{"passCode":2,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 09:38"},{"passCode":3,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 09:38"},{"passCode":4,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 09:38"},{"passCode":5,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 09:38"}],"pestEnd":5,"pestMax":0,"pestStart":1,"points":"1,0;2,0;3,0;4,0;5,0;","receiveDate":"2024-10-23 09:38","remark":"鍩烘湰鏃犺櫕绮�","sysDate":1747965415141},{"batchId":"202410081616","checkNum":5,"checkUser":"鍦扮瀹�","companyId":"1000","depotData":{"$ref":"$[0][0].depotData"},"depotId":"LB03","listPoint":[{"passCode":1,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 11:38"},{"passCode":2,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 11:38"},{"passCode":3,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 11:38"},{"passCode":4,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 11:38"},{"passCode":5,"pestNum":0,"pestType":"","receiveDate":"2024-10-23 11:38"}],"pestEnd":5,"pestMax":5,"pestStart":1,"points":"1,4;2,2;3,1;4,2;5,5;","receiveDate":"2024-10-23 11:38","remark":"涓�鑸櫕绮�","sysDate":1747965415141}];
+
+    if(!listData){
+        return;
+    }
+    curData = listData[0];
+
+    // 娓叉煋鏁版嵁
+    renderDataInfo();
+
+    // 鍦ㄦ壒娆¢�夋嫨涓坊鍔犱笅鎷夋暟鎹�
+    resetSelectBatchId();
+
+    // 璋冪敤鍏ㄩ儴鍏抽棴
+    layer.closeAll();
+    layer.msg("鏇存柊鎴愬姛鈥︹��");
+
+
+    // var data = {
+    //     depotId: depotId,
+    //     checkDate: checkDate
+    // };
+    // $.ajax({
+    //     type: "POST",
+    //     url: "../../basic/pest/list-data",
+    //     dataType: "json",
+    //     contentType: "application/json;charset=UTF-8",
+    //     data: JSON.stringify(data),
+    //     success: function (result) {
+    //         if (result.code != "0000") {
+    //             layer.msg(result.msg);
+    //         }
+    //         listData = result.data;
+    //         if(!listData){
+    //             return;
+    //         }
+    //         curData = listData[0];
+    //
+    //         // 娓叉煋鏁版嵁
+    //         renderDataInfo();
+    //
+    //         // 鍦ㄦ壒娆¢�夋嫨涓坊鍔犱笅鎷夋暟鎹�
+    //         resetSelectBatchId();
+    //
+    //         // 璋冪敤鍏ㄩ儴鍏抽棴
+    //         layer.closeAll();
+    //         layer.msg("鏇存柊鎴愬姛鈥︹��");
+    //     },
+    //     error: function () {
+    //         layer.msg("鏍规嵁褰撳墠鏉′欢鑾峰彇绮儏鏁版嵁娓叉煋鍥炬爣澶辫触锛侊紒");
+    //     }
+    // });
+};
+
+//娓呯┖鏁版嵁
+function cleanData() {
+    //娓呯┖妫�娴嬫椂闂存壒娆″��
+    $("#batchId").empty();
+    form.render();
+
+    $("#checkNum").text("0");
+    $("#remark").text("鏃犺櫕");
+
+    $("#tableInfo").html("");
+}
+
+//鍒囨崲浠撳簱鍥剧墖
+function cutImg(depotId) {
+    //榛樿鍥剧墖
+    var gasImg = gasImgMap[depotId];
+    var imgPath = "../../basic/file/getImg?filePath=" + gasImg.fileImg;
+
+    $("#depot_img").attr("src", imgPath);
+}
+
+//娓叉煋琛ㄦ牸锛屽悓鏃舵覆鏌撴帓琛�
+function renderTableInfo() {
+    var listPoint = curData.listPoint;
+    var v1 = curData.pestMax, v2 = 0.0, v3 = 0.0, v4 = 0.0;
+    var tableHtml = "<table class=\"layui-table\" lay-even lay-skin=\"nob\" >";
+    tableHtml += "<thead><tr><th>妫�娴嬩綅</th><th lay-data=\"{sort:true}\">铏澶存暟</th><th>铏绫诲瀷</th></tr></thead>";
+    tableHtml += "<tbody>";
+    // 鍔ㄦ�佸垱寤鸿〃鏍�
+    $.each(listPoint, function (index, item) {
+        tableHtml += "<tr><td>" + item.passCode + "</td>";
+        tableHtml += "<td>" + item.pestNum + "</td>";
+        tableHtml += "<td>" + item.pestType + "</td></tr>";
+
+        //娓叉煋鎺掕
+        if (index == 0) {
+            $("#orderValue1").text(item.pestNum);
+            $("#orderName1").text("閲囬泦浣�" + item.passCode);
+        }
+        if (index == 1) {
+            $("#orderValue2").text(item.pestNum);
+            $("#orderName2").text("閲囬泦浣�" + item.passCode);
+        }
+        if (index == 2) {
+            $("#orderValue3").text(item.pestNum);
+            $("#orderName3").text("閲囬泦浣�" + item.passCode);
+        }
+        if (index == 3) {
+            $("#orderValue4").text(item.pestNum);
+            $("#orderName4").text("閲囬泦浣�" + item.passCode);
+        }
+    });
+    tableHtml += "</tbody></table>";
+    $("#tableInfo").html(tableHtml);
+};
+
+// 鍥炲~妫�娴嬩俊鎭�
+function renderDataInfo() {
+    $("#checkNum").text(curData.checkNum);
+    $("#remark").text(curData.remark);
+
+    //娓叉煋琛ㄦ牸鍜屾帓琛�
+    renderTableInfo();
+};
+
+// 鏍规嵁鎵规鏇存柊鐨勫�艰皟鏁�
+function flushByBatchId(batchId) {
+    var temp;
+    $.each(listData, function (index, item) {
+        if (item.batchId == batchId) {
+            temp = item;
+            return false;
+        }
+    });
+    if (temp) {
+        curData = temp;
+        renderDataInfo();
+        layer.msg("鏇存柊鎴愬姛鈥︹��");
+    }
+};
+
+// 閲嶇疆鎵规涓嬫媺妗�
+function resetSelectBatchId() {
+    // 棣栧厛娓呯┖鍘熸潵鐨勫��
+    $("#batchId").empty();
+    // 鏈笅鎷夋璧嬪��
+    $.each(listData, function (index, item) {
+        $('#batchId').append(new Option(item.receiveDate, item.batchId));// 涓嬫媺鑿滃崟閲屾坊鍔犲厓绱�
+    });
+    $('#batchId').append(new Option("閫夋嫨鏃堕棿鈥︹��", "0"));
+    form.render();
+};
+
+// 鏇村鎵规閫夋嫨
+function showMore() {
+    layer.open({
+        type: 1,
+        title: '璇烽�夋嫨鏃堕棿',
+        area: ['380px', '250px'],
+        shade: 0,
+        content: $('#dialogMoreSelect'),
+        btn: ['纭閫夋嫨', '鍙栨秷'],
+        yes: function () {
+            var checkDateMore = $("#checkDateMore").val();
+            if (checkDateMore) {
+                flushData(checkDateMore);
+            } else {
+                layer.msg("璇峰厛纭鏃堕棿锛�");
+            }
+        },
+        btn2: function () {
+            layer.close(0);
+        },
+        closeBtn: 0
+    });
+};
+
+// 姘斾綋閲囬泦鐨勫叆鍙f柟娉曪紝type=1,琛ㄧず鏁翠粨閲囬泦锛泃ype=2,琛ㄧず閫夋嫨閲囬泦锛宼ype=3琛ㄧず澶氫粨閲囬泦
+function checkStart(type) {
+    layer.msg("鏆傛湭瀵规帴锛�");
+    return;
+    if (3 == type) {
+        checkBatch();
+        return;
+    }
+
+    // 鏁翠粨閲囬泦鍜岄�夋嫨閲囬泦闇�瑕佽幏鍙栧埌姘斾綋鐨勯厤缃俊鎭悗杩涜鎿嶄綔
+    depotId = $("#depotId").val();
+    if (!depotId) {
+        layer.msg("璇峰厛閫夋嫨浠撳簱锛�");
+        return;
+    }
+
+    if (gasConf && gasConf.depotId == depotId) {
+        if (1 == type) {
+            check();
+        }
+        if (2 == type) {
+            checkSelect();
+        }
+        return;
+    }
+
+    layer.msg("鑾峰彇褰撳墠浠撳簱鐨勯厤缃俊鎭�︹��");
+    var data = {
+        depotId: depotId
+    };
+    $.ajax({
+        type: "POST",
+        url: "../../basic/pest/gas-conf",
+        dataType: "json",
+        contentType: "application/json;charset=UTF-8",
+        data: JSON.stringify(data),
+        success: function (result) {
+            if (result.code != "0000") {
+                layer.msg(result.msg);
+                return;
+            }
+            gasConf = result.data;
+            if (1 == type) {
+                check();
+                return;
+            }
+            if (2 == type) {
+                checkSelect();
+                return;
+            }
+        },
+        error: function () {
+            layer.msg("鑾峰彇褰撳墠浠撳簱閰嶇疆淇℃伅澶辫触锛�");
+        }
+    });
+
+};
+
+// 鍗曚釜绮儏妫�娴�
+function check() {
+    layer.msg("寮�濮嬫皵浣撴娴嬧�︹��");
+    var data = {
+        depotId: depotId
+    };
+    $.ajax({
+        type: "POST",
+        url: "../../basic/pest/check-single",
+        dataType: "json",
+        contentType: "application/json;charset=UTF-8",
+        data: JSON.stringify(data),
+        success: function (result) {
+            if (result.code != "ORDER_SUCCESS") {
+                if (result.msg) {
+                    layer.msg(result.msg);
+                } else {
+                    layer.msg("鎵ц鍑虹幇寮傚父锛岃閲嶈瘯鎴栬仈绯荤鐞嗗憳");
+                }
+            } else {
+                layer.msg("鍛戒护宸茬粡鎴愬姛鍙戦�侊紝寰呯粓绔搷搴斺�︹��");
+            }
+        },
+        error: function () {
+            layer.msg("姘斾綋妫�娴嬪嚭鐜板紓甯革紝鎵ц澶辫触锛�");
+        }
+    });
+};
+
+// 閫夋嫨閲囬泦鐐归噰闆�
+function checkSelect() {
+    // 寮瑰嚭閫夋嫨妗嗭紝閫夋嫨淇℃伅
+    var gasStart = gasConf.gasStart, gasEnd = gasConf.gasEnd;
+    var strHtml = "";
+    for (var i = gasStart; i <= gasEnd; i++) {
+        if (i < 10) {
+            strHtml += "<input title='浣嶇疆0" + i + "' type='checkbox' value='"
+                + i + "'>";
+            strHtml += "<div class='layui-unselect layui-form-checkbox'><span>浣嶇疆0"
+                + i
+                + "</span><i class='layui-icon layui-icon-ok'></i></div>";
+        } else {
+            strHtml += "<input title='浣嶇疆" + i + "' type='checkbox' value='" + i
+                + "'>";
+            strHtml += "<div class='layui-unselect layui-form-checkbox'><span>浣嶇疆"
+                + i
+                + "</span><i class='layui-icon layui-icon-ok'></i></div>";
+        }
+    }
+    $("#div_point_select").html(strHtml);
+    form.render();
+
+    // 寮�濮嬮�夋嫨
+    layer.open({
+        type: 1,
+        title: '閫夋嫨閲囬泦鐐癸紙鍏ㄩ�夎浣跨敤鏁翠粨閲囬泦锛�',
+        area: ['690px', '450px'],
+        shade: 0,
+        content: $('#pointSelect'),
+        btn: ['鍏ㄩ��', '鍙嶉��', '閲嶉��', '纭畾妫�娴�', '鍙栨秷妫�娴�'],
+        yes: function () {
+            $('#pointSelect input').each(function () {
+                $(this).prop("checked", true);
+            });
+            form.render();
+        },
+        btn2: function () {
+            $('#pointSelect input').each(function () {
+                if ($(this).prop("checked")) {
+                    $(this).prop("checked", false);
+                } else {
+                    $(this).prop("checked", true);
+                }
+            });
+            form.render();
+            return false;
+        },
+        btn3: function () {
+            $('#pointSelect input').each(function () {
+                $(this).prop("checked", false);
+            });
+            form.render();
+            return false;
+        },
+        btn4: function () {
+            return checkSelectStep2();
+        },
+        btn5: function () {
+            layer.close(0);
+        },
+        closeBtn: 1
+    });
+};
+
+// 鎵ц閲囬泦鐐规娴�
+function checkSelectStep2() {
+    // 鑾峰彇閫夋嫨鐨勯噰闆嗙偣
+    var checkPoints = "";
+    $('#pointSelect input').each(function () {
+        if ($(this).prop("checked")) {
+            checkPoints += $(this).val() + ",";
+        }
+    });
+
+    if (checkPoints == "") {
+        layer.msg("璇烽�夋嫨闇�瑕佹娴嬬殑閲囬泦鐐�");
+        return false;
+    }
+    layer.msg("寮�濮嬫皵浣撴娴嬧�︹��");
+    var data = {
+        depotId: depotId,
+        checkPoints: checkPoints
+    };
+    $.ajax({
+        type: "POST",
+        url: "../../basic/pest/check-select",
+        dataType: "json",
+        contentType: "application/json;charset=UTF-8",
+        data: JSON.stringify(data),
+        success: function (result) {
+            if (result.code != "ORDER_SUCCESS") {
+                if (result.msg) {
+                    layer.msg(result.msg);
+                } else {
+                    layer.msg("鎵ц鍑虹幇寮傚父锛岃閲嶈瘯鎴栬仈绯荤鐞嗗憳");
+                }
+                return false;
+            } else {
+                layer.msg("鍛戒护宸茬粡鎴愬姛鍙戦�侊紝寰呯粓绔搷搴斺�︹��");
+                return true;
+            }
+        },
+        error: function () {
+            layer.msg("姘斾綋妫�娴嬪嚭鐜板紓甯革紝鎵ц澶辫触锛�");
+            return false;
+        }
+    });
+    return true;
+};
+
+// 鎵归噺绮儏閲囬泦
+function checkBatch() {
+    // 棣栧厛鍘婚櫎涔嬪墠鐨勯�夋嫨
+    $('#batchCheckSelect input').each(function () {
+        $(this).prop("checked", false);
+    });
+    form.render();
+
+    // 寮瑰嚭閫夋嫨妗�
+    layer.open({
+        type: 1,
+        title: '鎵归噺閲囬泦閫夋嫨',
+        area: ['690px', '450px'],
+        shade: 0,
+        content: $('#batchCheckSelect'),
+        btn: ['鍏ㄩ��', '鍙嶉��', '閲嶉��', '鎵ц閲囬泦', '鍙栨秷閲囬泦'],
+        yes: function () {
+            $('#batchCheckSelect input').each(function () {
+                $(this).prop("checked", true);
+            });
+            form.render();
+        },
+        btn2: function () {
+            $('#batchCheckSelect input').each(function () {
+                if ($(this).prop("checked")) {
+                    $(this).prop("checked", false);
+                } else {
+                    $(this).prop("checked", true);
+                }
+            });
+            form.render();
+            return false;
+        },
+        btn3: function () {
+            $('#batchCheckSelect input').each(function () {
+                $(this).prop("checked", false);
+            });
+            form.render();
+            return false;
+        },
+        btn4: function () {
+            return checkBatchStep2();
+        },
+        btn5: function () {
+            layer.close(0);
+        },
+        closeBtn: 0
+    });
+};
+
+/**
+ * 寮�濮嬫墽琛屾壒閲忔娴�
+ */
+function checkBatchStep2() {
+    var depotIds = "";
+    $('#batchCheckSelect input').each(function () {
+        if ($(this).prop("checked")) {
+            depotIds += $(this).val() + ",";
+        }
+    });
+
+    if (depotIds == "") {
+        layer.msg("璇峰厛閫夋嫨闇�瑕佹娴嬬殑浠撳簱鈥︹��");
+        return false;
+    }
+    layer.msg("寮�濮嬫墽琛屾壒閲忔娴嬧�︹��");
+    // 璋冪敤鍚庡彴鎵归噺妫�娴�
+    var data = {
+        depotIds: depotIds
+    };
+    $.ajax({
+        type: "POST",
+        url: "../../basic/pest/check-batch",
+        dataType: "json",
+        contentType: "application/json;charset=UTF-8",
+        data: JSON.stringify(data),
+        success: function (result) {
+            if (result.code != "ORDER_SUCCESS") {
+                if (result.msg) {
+                    layer.msg(result.msg);
+                } else {
+                    layer.msg("鎵ц鍑虹幇寮傚父锛岃閲嶈瘯鎴栬仈绯荤鐞嗗憳");
+                }
+                return false;
+            } else {
+                layer.msg("鍛戒护宸茬粡鎴愬姛鍙戦�侊紝寰呯粓绔搷搴斺�︹��");
+                return true;
+            }
+        },
+        error: function () {
+            layer.msg("妫�娴嬪嚭鐜板紓甯革紝鎵ц澶辫触锛�");
+            return false;
+        }
+    });
+    return true;
+};
+
+function gasChart() {
+    layer.msg("鏆傛湭瀵规帴锛�");
+    return;
+    layer.msg("鍔熻兘鏆傛湭寮�鏀锯�︹��");
+};
\ No newline at end of file

--
Gitblit v1.9.3