YYC
2023-06-19 0b27b9263ce721844d124ec4541a83b0f6db6c13
igds-app/js/admin/warn-list.js
@@ -19,7 +19,8 @@
   "data": {
      "id": "",
      "status": "",
      "remark": ""
      "remark": "",
      "completeUser":""
   }
};
@@ -31,6 +32,7 @@
   data.tokenAuth = user.tokenAuth;
   dataPop.tokenAuth = user.tokenAuth;
   data.data.deptId = selectDeptId;
   dataPop.data.completeUser = user.cname
   url = user.url + "/api-phone/v35/gateway";
   dateTime = getDate(new Date())
@@ -57,7 +59,6 @@
      success: function(result) {
         if (result.code == "0000") {
            warnList = result.data;
            console.log(warnList)
            renderWarn();
         } else {
            renderWarn();
@@ -69,47 +70,7 @@
         mui.alert("系统繁忙,请重试!", "提示", ["确定"], function() {}, "div")
      }
   })
   warnList = [{
         "id": "88",
         "name": "拉目些调",
         "type": "nostrud",
         "eventType": "cillumreprehenderitest",
         "level": "1",
         "status": "40",
         "time": "2006-11-01 14:01:36",
         "info": "dolor",
         "depotId": "6",
         "depotName": "",
         "remark": "00000"
      },
      {
         "id": "56",
         "name": "法都象叫与局",
         "type": "cillumreprehenderitUt",
         "eventType": "in",
         "level": "2",
         "status": "20",
         "time": "1981-02-18 22:28:23",
         "info": "deserunt Excepteur aliqua veniam commodo",
         "depotId": "28",
         "depotName": "龙用改素",
         "remark": "1111"
      }, {
         "id": "72",
         "name": "华林九别",
         "type": "exdeseruntcillumeu",
         "eventType": "aliqua sint dolor aute",
         "level": "1",
         "status": "10",
         "time": "1978-07-23 12:17:27",
         "info": "deserunt nostrud id tempor",
         "depotId": "70",
         "depotName": "县志选只",
         "remark": ""
      }
   ]
   renderWarn();
}
@@ -176,8 +137,7 @@
   var html = '';
   if (warnList && warnList.length > 0) {
      $.each(warnList, function(index, item) {
         html += '<li><div class="con myfancy" onclick="openPop(\'' + item.id + '\',\'' + (item.remark ==
            null ? "" : item.remark) + '\',\'' + item.status + '\')">';
         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') {
@@ -194,11 +154,11 @@
         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 == '1') {
         if (item.level == '01') {
            html +=
               '<div class="box"><div class="group level-2"><div class="desc">高级</div><div class="ort">警告级别</div></div></div></div>';
         }
         if (item.level == '2') {
         if (item.level == '02') {
            html +=
               '<div class="box"><div class="group level-1"><div class="desc">中级</div><div class="ort">警告级别</div></div></div></div>';
         }
@@ -207,16 +167,27 @@
         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, remark, status) {
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') {
@@ -226,7 +197,20 @@
   $("#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") {
@@ -249,9 +233,11 @@
      success: function(result) {
         if (result.code == "0000") {
            mui.toast(result.msg);
            getWarnList();
            // console.log(JSON.stringify(result))
         } else {
            mui.toast(result.msg);
            getWarnList();
            // console.log(JSON.stringify(result))
         }
      },