From 2df906a447195f9786dd468512ea895d6cc18532 Mon Sep 17 00:00:00 2001 From: YYC <1833023622@qq.com> Date: 星期四, 15 五月 2025 14:53:54 +0800 Subject: [PATCH] APP3.5开发 --- igds-app/js/admin/warn-list.js | 164 +++++++++++++++++++++++++++++++++--------------------- 1 files changed, 99 insertions(+), 65 deletions(-) diff --git a/igds-app/js/admin/warn-list.js b/igds-app/js/admin/warn-list.js index 525270c..ec009c8 100644 --- a/igds-app/js/admin/warn-list.js +++ b/igds-app/js/admin/warn-list.js @@ -1,11 +1,10 @@ var url = null; var dateTime; -var warnData = null; +var warnList = null; var data = { "interfaceId": "5801", "tokenAuth": "", - "sign": "10003", - "outId": "10003", + "outId": "58011", "reqDateTime": new Date(), "data": { "deptId": "", @@ -15,13 +14,13 @@ var dataPop = { "interfaceId": "5802", "tokenAuth": "", - "sign": "10003", - "outId": "10003", + "outId": "58021", "reqDateTime": new Date(), "data": { - "id":"", + "id": "", "status": "", - "remark": "" + "remark": "", + "completeUser":"" } }; @@ -33,10 +32,11 @@ data.tokenAuth = user.tokenAuth; dataPop.tokenAuth = user.tokenAuth; data.data.deptId = selectDeptId; - url = user.url + "/api-phone/v35/gateway"; + dataPop.data.completeUser = user.cname + url = user.url + "/api/phone/v35/gateway"; dateTime = getDate(new Date()) - $('#date').val(dateTime) + document.getElementById("date").value = dateTime //鑾峰彇璀﹀憡璁板綍 getWarnList(); @@ -58,8 +58,7 @@ data: JSON.stringify(data), success: function(result) { if (result.code == "0000") { - warnData = result.data; - console.log(warnData) + warnList = result.data; renderWarn(); } else { renderWarn(); @@ -71,7 +70,9 @@ mui.alert("绯荤粺绻佸繖,璇烽噸璇曪紒", "鎻愮ず", ["纭畾"], function() {}, "div") } }) + } + //榛樿鑾峰彇褰撳ぉ鏃ユ湡(yyyy-MM-dd) function getDate() { @@ -105,13 +106,11 @@ //鍔犲噺澶╂暟 function addAndReduceMonth(tag) { - var date = new Date(dateTime); - date = date.setDate(date.getDate() + tag); date = new Date(date); dateTime = getDate(date); - $('#date').val(dateTime) + document.getElementById("date").value = dateTime //鑾峰彇璀﹀憡璁板綍 getWarnList(); } @@ -121,72 +120,103 @@ type: "date", //璁剧疆鏃ュ巻鍒濆瑙嗗浘妯″紡 // beginDate: new Date(2015, 04, 25), //璁剧疆寮�濮嬫棩鏈� // endDate: new Date(2016, 04, 25), //璁剧疆缁撴潫鏃ユ湡 + value: dateTime }) + var time = dateTime dtpicker.show(function(e) { + dateTime = e.value; document.getElementById("date").value = e.value + if(time != dateTime){ + getWarnList(); + } }) } - - - //娓叉煋椤甸潰 function renderWarn() { var html = ''; - if (warnData) { - var warnList = warnData.data; - if (warnList && warnList.length > 0) { - $.each(warnList, function(index, item) { - html += '<li><div class="con myfancy" onclick="openPop('+item.id+')">'; - if (item.status == '10') { - html += '<span class="type">鏈鐞�</span>'; - } - if (item.status == '20') { - html += '<span class="type k">澶勭悊寤惰繜</span>'; - } - if (item.status == '30') { - html += '<span class="type k">宸插鐞�</span>'; - } - if (item.status == '40') { - html += '<span class="type k">蹇界暐</span>'; - } - html += '<div class="tit">璀﹀憡鍚嶇О: <span>' + item.name + '</span></div>'; - html += '<div class="txt">'; - html += '<div class="box"><div class="group c"><div class="desc">' + item.type + - '</div><div class="ort">璀﹀憡绫诲瀷</div></div></div>'; - html += '<div class="box"><div class="group c1"><div class="desc">' + item.depotName + - '</div><div class="ort">浠撳簱鍚嶇О</div></div></div>'; - if (item.level == '1') { - html += - '<div class="box"><div class="group level-2"><div class="desc">楂樼骇</div><div class="ort">璀﹀憡绾у埆</div></div></div></div>'; - } - if (item.level == '2') { - html += - '<div class="box"><div class="group level-1"><div class="desc">涓骇</div><div class="ort">璀﹀憡绾у埆</div></div></div></div>'; - } + if (warnList && warnList.length > 0) { + $.each(warnList, function(index, item) { + html += '<li><div class="con myfancy" id="'+item.id+'" remark="'+(item.remark == null ? "" : item.remark) +'" status="'+item.status+'" >'; + if (item.status == '10') { + html += '<span class="type">鏈鐞�</span>'; + }else if (item.status == '20') { + html += '<span class="type k">澶勭悊寤惰繜</span>'; + }else if (item.status == '30') { + html += '<span class="type k">宸插鐞�</span>'; + }else if (item.status == '40') { + html += '<span class="type k">蹇界暐</span>'; + } + html += '<div class="tit">璀﹀憡鍚嶇О: <span>' + item.name + '</span></div>'; + html += '<div class="txt">'; + html += '<div class="box"><div class="group c"><div class="desc">' + item.type + + '</div><div class="ort">璀﹀憡绫诲瀷</div></div></div>'; + html += '<div class="box"><div class="group c1"><div class="desc">' + (item.depotName == null || + item.depotName == "" ? "--" : item.depotName) + + '</div><div class="ort">浠撳簱鍚嶇О</div></div></div>'; + if (item.level == '01') { + html += + '<div class="box"><div class="group level-2"><div class="desc">涓�绾ч璀�</div><div class="ort">璀﹀憡绾у埆</div></div></div></div>'; + }else if (item.level == '02') { + html += + '<div class="box"><div class="group level-1"><div class="desc">浜岀骇棰勮</div><div class="ort">璀﹀憡绾у埆</div></div></div></div>'; + }else if(item.level == '03'){ + html += + '<div class="box"><div class="group level-1"><div class="desc">涓夌骇棰勮</div><div class="ort">璀﹀憡绾у埆</div></div></div></div>'; + }else { + html += + '<div class="box"><div class="group level-1"><div class="desc">--</div><div class="ort">璀﹀憡绾у埆</div></div></div></div>'; + } - html += '<div class="tit coation">璀﹀憡鍐呭: <span>' + item.info + '</span></div>'; - html += '<div class="time">' + item.time + '</div></div></li>'; - }) - } else { - html += - '<li><div class="con myfancy" style="text-align: center;font-size: 20px;color:#dd524d">鏆傛棤璀﹀憡淇℃伅</div></li>'; - } + html += '<div class="tit coation">璀﹀憡鍐呭: <span>' + (item.info == null || + item.info == "" ? "......" : item.info)+ '</span></div>'; + html += '<div class="time">' + item.time + '</div></div></li>'; + }) } else { - html += - '<li><div class="con myfancy" style="text-align: center;font-size: 20px;color:#dd524d">鏆傛棤璀﹀憡淇℃伅</div></li>'; + html += '<li><div class="con myfancy" id="0" remark="鏆傛棤璀﹀憡淇℃伅" status="30">'; + html += '<span class="type k">宸插鐞�</span>'; + html += '<div class="tit">璀﹀憡鍚嶇О: <span>鏆傛棤璀﹀憡淇℃伅</span></div>'; + html += '<div class="txt">'; + html += '<div class="box"><div class="group c"><div class="desc">--</div><div class="ort">璀﹀憡绫诲瀷</div></div></div>'; + html += '<div class="box"><div class="group c1"><div class="desc">--</div><div class="ort">浠撳簱鍚嶇О</div></div></div>'; + html += '<div class="box"><div class="group level-1"><div class="desc">鏃�</div><div class="ort">璀﹀憡绾у埆</div></div></div></div>'; + html += '<div class="tit coation">璀﹀憡鍐呭: <span>鏃犺鍛婂唴瀹�</span></div>'; + html += '<div class="time">'+dateTime+'</div></div></li>'; + // html += + // '<li><div class="con myfancy" style="text-align: center;font-size: 20px;color:#dd524d">鏆傛棤璀﹀憡淇℃伅</div></li>'; } $("#recordList").html(html); - } - //鎵撳紑寮圭獥 -function openPop(warnId) { +mui(".mui-scroll-wrapper").on("tap", ".m-caution-mana ul li .myfancy", function() { + var warnId = this.getAttribute("id"); + var status = this.getAttribute("status"); + var remark = this.getAttribute("remark"); dataPop.data.id = warnId; + var html = '' + if (status == '10') { + html += '<div type="button" class="mui-btn cancel" onclick="handleWarn(\'' + 1 + '\')">蹇界暐</div>' + html += '<div type="button" class="mui-btn confirm" onclick="handleWarn(\'' + 2 + '\')">澶勭悊</div>' + } + $("#handleWarn").html(html); + document.getElementById("textareaPop").value = remark; $('#m-pop').css('display', 'flex'); -} +}) + +// //鎵撳紑寮圭獥 +// function openPop(warnId, remark, status) { +// dataPop.data.id = warnId; +// var html = '' +// if (status == '10') { +// html += '<div type="button" class="mui-btn cancel" onclick="handleWarn(\'' + 1 + '\')">蹇界暐</div>' +// html += '<div type="button" class="mui-btn confirm" onclick="handleWarn(\'' + 2 + '\')">澶勭悊</div>' +// } +// $("#handleWarn").html(html); +// document.getElementById("textareaPop").value = remark; +// $('#m-pop').css('display', 'flex'); +// } //璀﹀憡澶勭悊 function handleWarn(tag) { if (tag == "1") { @@ -197,7 +227,8 @@ dataPop.data.status = '30' // mui.toast("璀﹀憡澶勭悊"); } - dataPop.data.remark = mui("#textareaPop")[0].value; + dataPop.data.remark = document.getElementById("textareaPop").value; + console.log(JSON.stringify(dataPop.data),"warn-list") //璇锋眰 mui.ajax(url, { type: "POST", @@ -207,10 +238,13 @@ data: JSON.stringify(dataPop), success: function(result) { if (result.code == "0000") { - console.log(JSON.stringify(result)) + mui.toast(result.msg); + getWarnList(); + // console.log(JSON.stringify(result)) } else { mui.toast(result.msg); - console.log(JSON.stringify(result)) + getWarnList(); + // console.log(JSON.stringify(result)) } }, error: function() { @@ -231,7 +265,7 @@ //婊戝姩 mui('.mui-scroll-wrapper').scroll({ - indicators: false, //鏄惁鏄剧ず婊氬姩鏉� + indicators: true, //鏄惁鏄剧ず婊氬姩鏉� deceleration: 0.0006, //闃诲凹绯绘暟,绯绘暟瓒婂皬婊戝姩瓒婄伒鏁� bounce: false, //鏄惁鍚敤鍥炲脊 deceleration: 0.0005 //flick 鍑忛�熺郴鏁帮紝绯绘暟瓒婂ぇ锛屾粴鍔ㄩ�熷害瓒婃參锛屾粴鍔ㄨ窛绂昏秺灏忥紝榛樿鍊�0.0006 -- Gitblit v1.9.3