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/gas/gas-check.js | 758 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 758 insertions(+), 0 deletions(-) diff --git a/igds-dzhwk-web/src/main/resources/static/dzhwk/gas/gas-check.js b/igds-dzhwk-web/src/main/resources/static/dzhwk/gas/gas-check.js new file mode 100644 index 0000000..51ee4f6 --- /dev/null +++ b/igds-dzhwk-web/src/main/resources/static/dzhwk/gas/gas-check.js @@ -0,0 +1,758 @@ +var layer; +var depotId;// 褰撳墠浠撳簱id +var curData;// 褰撳墠浠撶伯鎯呮暟鎹� +var mapData;// 鏍规嵁鏃ユ湡鏌ヨ鐨勬瘡涓粨搴撲竴鏉℃暟鎹� +var form; +var table; +var checkType; +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); + }); +}); + +//鏍规嵁閲囬泦杩涘害淇℃伅娓叉煋閲囬泦鐐规晥鏋� +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"); +} + +/** + * 鍒囨崲閲囬泦鐐� + * @param depotId + */ +function cutPoint(depotId) { + //棣栧厛闄ゅ幓宸叉湁鏁堟灉 + $(".qt-pic-icon-active").removeClass("qt-pic-icon-active"); + //鏍规嵁涔変箤杩欒竟鐩存帴鍒ゆ柇 + if("0135,0137,0139,0141,0143,0145,0147,0149,0151,0153".indexOf(depotId) >=0 ){ + $("#list-point-right").css("display","block"); + $("#list-point-left").css("display","none"); + }else{ + $("#list-point-right").css("display","none"); + $("#list-point-left").css("display","block"); + } +} + +// 鍗曚粨鎵撳嵃 +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/gas/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":"202407151349","checkNum":5,"checkUser":"绠$悊鍛�","companyId":"1000","depotData":{"bulkWeight":600,"companyId":"1000","depotStatus":"1","depotStatusName":"绌轰粨","depotType":"01","depotTypeName":"骞虫埧浠�","deptId":"P0101","foodLevel":"02","foodLevelName":"浜岀瓑","foodType":"122","foodTypeName":"甯傜骇鍦版柟鍌ㄥ绮�","foodVariety":"1131","id":"LA02","name":"P01-01","orderNum":5,"storageMax":5000000,"storageReal":0,"storeKeeperLevel":"楂樼骇淇濈鍛�","storeKeeperPhone":"####","storeType":"1"},"depotId":"LA02","listPoint":[{"passCode":1,"perCo2":497,"perN2":74.9,"perO2":25,"perPh3":0,"receiveDate":"2024-07-15 13:50"},{"passCode":2,"perCo2":497,"perN2":74.9,"perO2":25,"perPh3":0,"receiveDate":"2024-07-15 13:50"},{"passCode":3,"perCo2":496,"perN2":74.9,"perO2":25,"perPh3":0,"receiveDate":"2024-07-15 13:50"},{"passCode":4,"perCo2":496,"perN2":74.9,"perO2":25,"perPh3":0,"receiveDate":"2024-07-15 13:50"},{"passCode":5,"perCo2":482,"perN2":74.9,"perO2":25,"perPh3":0,"receiveDate":"2024-07-15 13:50"}],"perCo2":493.6,"perCo2Max":497,"perCo2Min":482,"perN2":74.9,"perN2Max":74.9,"perN2Min":74.9,"perO2":25,"perO2Max":25,"perO2Min":25,"perPh3":0,"perPh3Max":0,"perPh3Min":0,"points":"1,497.0,25.0,0.0,74.9;2,497.0,25.0,0.0,74.9;3,496.0,25.0,0.0,74.9;4,496.0,25.0,0.0,74.9;5,482.0,25.0,0.0,74.9;","receiveDate":"2024-07-15 13:50","strReceiveDate":"2024-07-15 13:50","sysDate":1747964186612,"type":"0"},{"batchId":"202407141532","checkNum":5,"checkUser":"绠$悊鍛�","companyId":"1000","depotData":{"$ref":"$[0][0].depotData"},"depotId":"LA02","listPoint":[{"passCode":1,"perCo2":416,"perN2":74.9,"perO2":25,"perPh3":0,"receiveDate":"2024-07-15 14:50"},{"passCode":2,"perCo2":408,"perN2":74.9,"perO2":25,"perPh3":0,"receiveDate":"2024-07-15 14:50"},{"passCode":3,"perCo2":412,"perN2":74.9,"perO2":25,"perPh3":0,"receiveDate":"2024-07-15 14:50"},{"passCode":4,"perCo2":433,"perN2":74.9,"perO2":25,"perPh3":0,"receiveDate":"2024-07-15 14:50"},{"passCode":5,"perCo2":484,"perN2":74.9,"perO2":25,"perPh3":0,"receiveDate":"2024-07-15 14:50"}],"perCo2":430.6,"perCo2Max":484,"perCo2Min":408,"perN2":74.9,"perN2Max":74.9,"perN2Min":74.9,"perO2":25,"perO2Max":25,"perO2Min":25,"perPh3":0,"perPh3Max":0,"perPh3Min":0,"points":"1,416.0,25.0,0.0,74.9;2,408.0,25.0,0.0,74.9;3,412.0,25.0,0.0,74.9;4,433.0,25.0,0.0,74.9;5,484.0,25.0,0.0,74.9;","receiveDate":"2024-07-15 14:50","strReceiveDate":"2024-07-14 15:32","sysDate":1747964186613,"type":"0"}]; + if(!listData) return; + curData = listData[0]; + + // 娓叉煋鏁版嵁 + renderDataInfo(); + + // 鍦ㄦ壒娆¢�夋嫨涓坊鍔犱笅鎷夋暟鎹� + resetSelectBatchId(); + + // 璋冪敤鍏ㄩ儴鍏抽棴 + layer.closeAll(); + layer.msg("鏇存柊鎴愬姛鈥︹��"); + + // var data = { + // depotId : depotId, + // checkDate : checkDate + // }; + // $.ajax({ + // type : "POST", + // url : "../../basic/gas/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(); + + $("#perO2").text("#"); + $("#perO2Max").text("#"); + $("#perO2Min").text("#"); + + $("#perCo2").text("#"); + $("#perCo2Max").text("#"); + $("#perCo2Min").text("#"); + + $("#perPh3").text("#"); + $("#perPh3Max").text("#"); + $("#perPh3Min").text("#"); + + $("#perN2").text("#"); + $("#perN2Max").text("#"); + $("#perN2Min").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 tableHtml = "<table class=\"layui-table\" lay-even lay-skin=\"nob\">"; + tableHtml += "<colgroup><col width=\"20%\"><col width=\"20%\"><col width=\"20%\"><col width=\"20%\"><col></colgroup>"; + if(curData.type && curData.type == "1"){ + tableHtml += "<thead><tr><th style='background: #c2c2c2;' colspan='5'>妫�娴嬬被鍨嬶細鐔忚捀妫�娴�</th></tr></thead>"; + }else { + tableHtml += "<thead><tr><th style='background: #c2c2c2;' colspan='5'>妫�娴嬬被鍨嬶細甯歌妫�娴�</th></tr></thead>"; + } + tableHtml += "<thead><tr><th>閫氶亾</th><th>CO2</th><th>O2</th><th>PH3</th><th>N2</th></tr></thead>"; + tableHtml += "<tbody>"; + // 鍔ㄦ�佸垱寤鸿〃鏍� + $.each(listPoint, function(index, item) { + tableHtml += "<tr><td>" + item.passCode + "</td>"; + tableHtml += "<td>" + (item.perCo2== -100 ? "#" : item.perCo2) + "</td>"; + tableHtml += "<td>" + (item.perO2== -100 ? "#" : item.perO2) + "</td>"; + tableHtml += "<td>" + (item.perPh3== -100 ? "#" : item.perPh3) + "</td>"; + tableHtml += "<td>" + (item.perN2== -100 ? "#" : item.perN2) + "</td></tr>"; + }); + tableHtml += "</tbody></table>"; + $("#tableInfo").html(tableHtml); +}; + +// 鍥炲~妫�娴嬩俊鎭� +function renderDataInfo() { + $("#perCo2").text(curData.perCo2 == -100 ? "#" : curData.perCo2); + $("#perO2").text(curData.perO2 == -100 ? "#" : curData.perO2); + $("#perPh3").text(curData.perPh3 == -100 ? "#" : curData.perPh3); + $("#perN2").text(curData.perN2 == -100 ? "#" : curData.perN2); + + $("#perO2Max").text(curData.perO2Max == -100 ? "#" : curData.perO2Max); + $("#perO2Min").text(curData.perO2Min == -100 ? "#" : curData.perO2Min); + + $("#perCo2Max").text(curData.perCo2Max == -100 ? "#" : curData.perCo2Max); + $("#perCo2Min").text(curData.perCo2Min == -100 ? "#" : curData.perCo2Min); + + $("#perPh3Max").text(curData.perPh3Max == -100 ? "#" : curData.perPh3Max); + $("#perPh3Min").text(curData.perPh3Min == -100 ? "#" : curData.perPh3Min); + + $("#perN2Max").text(curData.perN2Max == -100 ? "#" : curData.perN2Max); + $("#perN2Min").text(curData.perN2Min == -100 ? "#" : curData.perN2Min); + + 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; + checkType = $("input[name='type']:checked").val(); + if(!checkType){ + 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/gas/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, + type : checkType + }; + $.ajax({ + type : "POST", + url : "../../basic/gas/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, + type : checkType, + checkPoints : checkPoints + }; + $.ajax({ + type : "POST", + url : "../../basic/gas/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, + type : checkType + }; + $.ajax({ + type : "POST", + url : "../../basic/gas/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("鍔熻兘鏆傛湭寮�鏀锯�︹��"); +}; \ No newline at end of file -- Gitblit v1.9.3