YYC
2023-06-13 c7ba1ce89a2a552eee9b5edadc9a302d8aafb05b
igds-app/js/admin/inout-out-handle-list.js
@@ -29,13 +29,15 @@
   var selectDeptId = JSON.parse(localStorage.getItem('selectDeptId'));
   url = user.url + "/api-phone/v35/gateway";
   data.tokenAuth = user.tokenAuth;
   data1.tokenAuth = user.tokenAuth;
   data.data.deptId = selectDeptId;
   getOutHandleList();
   getInHandleList();
}
//查询出库记录
function getOutHandleList() {
function getInHandleList() {
   outHandleData = null;
   //查询的车牌号
   data.data.plateNum = mui("#plateNum")[0].value;
   //请求
   mui.ajax(url, {
@@ -47,12 +49,12 @@
      success: function(result) {
         if (result.code == "0000") {
            outHandleData = result.data;
            console.log("if",JSON.stringify(result))
            console.log("if", JSON.stringify(result))
            renderData();
         } else {
            renderData();
            mui.toast(result.msg);
            console.log("else",JSON.stringify(result))
            console.log("else", JSON.stringify(result))
         }
      },
      error: function() {
@@ -114,35 +116,29 @@
//渲染页面
function renderData() {
   var html = '';
   if (outHandleData) {
      if (outHandleData && outHandleData.length > 0) {
         $.each(outHandleData, function(index, item) {
            html += '<li><div class="con"><div class="top">';
            html += '<div class="info">车牌号: <b>' + (item.plateNum == null ? "" : item.plateNum) + '</b></div>';
            html += '<a href="" id = "' + item.id + '" plateNum = "' + item.plateNum + '" depotName = "' +
               item.depotName + '" storeKeeperName = "' + (item.storeKeeperName == "" || item
                  .storeKeeperName == "" ? '--' : item.storeKeeperName) +
               '" class="link">值仓<span class="mui-icon mui-icon-arrowright"></span></a>';
            html += '</div><div class="box">';
            html += '<div class="item"><div class="conbox" style="background-image: url(images/icons/g-i19.png);">';
            html += '<div class="h3">' + (item.depotName == null ? "" : item.depotName) + '</div>';
            html += '<div class="bot">目标仓库</div></div></div>';
            html += '<div class="item"><div class="conbox" style="background-image: url(images/icons/g-i20.png);">';
            html += '<div class="h3">' + (item.foodVarietyName == null ? "" : item.foodVarietyName) + '</div>';
            html += '<div class="bot">粮食品种</div></div></div>';
            html += '<div class="item"><div class="conbox" style="background-image: url(images/icons/g-i21.png);">';
            html += '<div class="h3">' + (item.foodLevelName == null ? "" : item.foodLevelName) + '</div>';
            html += '<div class="bot">粮食等级</div></div></div>';
            html += '</div></div></li>';
         })
      } else {
         html +=
            '<li><div class="con"><div style="text-align: center;font-size: 20px;color:#dd524d;padding-top: 16px;">暂无入库待值仓信息</div></div></li>';
      }
   if (outHandleData && outHandleData.length > 0) {
      $.each(outHandleData, function(index, item) {
         html += '<li><div class="con"><div class="top">';
         html += '<div class="info">车牌号: <b>' + (item.plateNum == null ? "" : item.plateNum) + '</b></div>';
         html += '<a href="" id = "' + item.id + '" plateNum = "' + item.plateNum + '" depotName = "' + item.depotName + '" storeKeeperName = "' +
         (item.storeKeeperName == "" || item.storeKeeperName == "" ? '--' : item.storeKeeperName) + '" class="link">值仓<span class="mui-icon mui-icon-arrowright"></span></a>';
         html += '</div><div class="box">';
         html += '<div class="item"><div class="conbox" style="background-image: url(images/icons/g-i19.png);">';
         html += '<div class="h3">' + (item.depotName == null ? "" : item.depotName) + '</div>';
         html += '<div class="bot">目标仓库</div></div></div>';
         html += '<div class="item"><div class="conbox" style="background-image: url(images/icons/g-i20.png);">';
         html += '<div class="h3">' + (item.foodVarietyName == null ? "" : item.foodVarietyName) + '</div>';
         html += '<div class="bot">粮食品种</div></div></div>';
         html += '<div class="item"><div class="conbox" style="background-image: url(images/icons/g-i21.png);">';
         html += '<div class="h3">' + (item.foodLevelName == null ? "" : item.foodLevelName) + '</div>';
         html += '<div class="bot">粮食等级</div></div></div>';
         html += '</div></div></li>';
      })
   } else {
      html +=
         '<li><div class="con"><div style="text-align: center;font-size: 20px;color:#dd524d;padding-top: 16px;">暂无入库待值仓信息</div></div></li>';
   }
   $("#handleList").html(html);
}
@@ -152,20 +148,19 @@
   var depotName = this.getAttribute("depotName")
   var plateNum = this.getAttribute("plateNum")
   var storeKeeperName = this.getAttribute("storeKeeperName")
   var picker = new mui.PopPicker();
   picker.setData([{
      value: "photo",
      text: "现场值仓"
   }, {
      value: "snap",
      text: "远程值仓"
   }])
   picker.pickers[0].setSelectedValue('photo');
   picker.show(function(SelectedItem) {
      console.log(JSON.stringify(SelectedItem));
      if(SelectedItem.value == 'photo'){
      if (SelectedItem.value == 'photo') {
         mui.openWindow({
            url: "inout-out-handle.html",
            id: "inout-out-handle",
@@ -178,7 +173,7 @@
               }
            }
         })
      }else{
      } else {
         mui.openWindow({
            url: "inout-out-handle.html",
            id: "inout-out-handle",
@@ -193,49 +188,6 @@
         })
      }
   })
   // var btnArray = [{
   //    title:"现场值仓"
   // },{
   //    title:"远程值仓"
   // }];
   // plus.nativeUI.actionSheet({
   //    title:"请选择",
   //    cancel:"取消",
   //    buttons:btnArray
   // },function(e) {
   //    var index = e.index;
   //    switch (index) {
   //       case 1:
   //          mui.openWindow({
   //             url: "inout-out-handle.html",
   //             id: "inout-out-handle",
   //             extras: {
   //                data: {
   //                   serialNumber: id,
   //                   plateNum: plateNum,
   //                   depotName: depotName,
   //                   storeKeeperName: storeKeeperName
   //                }
   //             }
   //          })
   //          break;
   //       case 2:
   //          mui.openWindow({
   //             url: "inout-out-handle.html",
   //             id: "inout-out-handle",
   //             extras: {
   //                data: {
   //                   serialNumber: id,
   //                   plateNum: plateNum,
   //                   depotName: depotName,
   //                   storeKeeperName: storeKeeperName
   //                }
   //             }
   //          })
   //          break;
   //    }
   // });
});
/*---------------NFC读卡功能-------------------*/
@@ -350,7 +302,7 @@
         waiting.close();
         //读取id成功,赋值并发送请求查询
         data.data.intelCard = id;
         data1.data.intelCard = id;
         getInoutDetail();
      }
   } else {