YYC
2023-06-15 1bd6821c8ccc6861c74505bab0e8c52fe38f69f7
igds-app/js/admin/inout-in-record.js
@@ -20,7 +20,7 @@
   url = user.url + "/api-phone/v35/gateway";
   data.tokenAuth = user.tokenAuth;
   data.data.deptId = selectDeptId;
   //获取当前天时间
   dateTime = getDate(new Date());
   $("#dateTime").val(dateTime);
@@ -32,10 +32,10 @@
//查询入库记录
function getInRecordList() {
   inRecordData = null;
   //赋值参数的日期
   data.data.dateTime = dateTime;
   console.log(JSON.stringify(data), "inout-in-record")
   //请求
   mui.ajax(url, {
      type: "POST",
@@ -49,13 +49,39 @@
            renderData();
         } else {
            renderData();
            mui.toast(result.mag);
            mui.toast(result.msg);
         }
      },
      error: function() {
         mui.alert("系统繁忙,请重试!", "提示", ["确定"], function() {}, "div")
      }
   })
   // inRecordData = {
   //    "sum": "55",
   //    "listInout": [{
   //          "id": "98",
   //          "plateNum": "39",
   //          "depotId": "83",
   //          "depotName": "能始际法高等",
   //          "foodVariety": "quis Ut",
   //          "foodVarietyName": "被龙济来",
   //          "recordWeight": "25",
   //          "completeTime": "1971-10-20 14:45:38"
   //       },
   //       {
   //          "id": "37",
   //          "plateNum": "50",
   //          "depotId": "16",
   //          "depotName": "准民青共工",
   //          "foodVariety": "aliquip eiusmod laborum nulla",
   //          "foodVarietyName": "号走根形",
   //          "recordWeight": "30",
   //          "completeTime": "1971-04-09 06:42:06"
   //       }
   //    ],
   // }
}
//渲染页面
@@ -63,10 +89,10 @@
   var html = '';
   var sumHtml = '0';
   if(inRecordData){
   if (inRecordData) {
      sumHtml = inRecordData.sum;
      var inRecordList = inRecordData.listInout;
      // console.log(JSON.stringify(inRecordList))
      if (inRecordList && inRecordList.length > 0) {
         $.each(inRecordList, function(index, item) {
            html += '<div class="item">';
@@ -77,15 +103,17 @@
            html += '<li><div class="con" style="background-image: url(images/icons/g-i25.png);">';
            html += '仓库名称:<b>' + (item.depotName == null ? "" : item.depotName) + '</b></div></li>';
            html += '<li><div class="con" style="background-image: url(images/icons/g-i32.png);">';
            html += '粮食品种:<b>' + (item.foodVarietyName == null ? "" : item.foodVarietyName) + '</b></div></li>';
            html += '粮食品种:<b>' + (item.foodVarietyName == null ? "" : item.foodVarietyName) +
               '</b></div></li>';
            html += '<li><div class="con" style="background-image: url(images/icons/g-i24.png);">';
            html += '结算重量:<span><em>' + (item.recordWeight == null ? "0" : item.recordWeight) + '</em>KG</span></div></li>';
            html += '结算重量:<span><em>' + (item.recordWeight == null ? "0" : item.recordWeight) +
               '</em>KG</span></div></li>';
            html += '</ul><div class="time">完成时间:' + getStrDate(item.completeTime) + '</div></div>';
         })
      } else {
         html += '<div class="id" style="text-align: center;font-size: 20px;color:#dd524d">所选日期暂无入库记录信息</div>';
      }
   }else{
   } else {
      html += '<div class="id" style="text-align: center;font-size: 20px;color:#dd524d">所选日期暂无入库记录信息</div>';
   }
   $("#sum").html(sumHtml);
@@ -100,21 +128,24 @@
   date = new Date(date);
   dateTime = getDate(date);
   $("#dateTime").val(dateTime);
   getInRecordList();
}
//选择日期
function chooseDate() {
   var dtpicker = new mui.DtPicker({
      type: "date" //设置日历初始视图模式
      type: "date" ,//设置日历初始视图模式
      value: dateTime
   })
   var time = dateTime
   dtpicker.show(function(e) {
      dateTime = e.value;
      $("#dateTime").val(dateTime);
      if(time != dateTime){
         getInRecordList();
      }
   })
   getInRecordList();
}
//默认获取当前日期(yyyy-MM-dd)
@@ -162,5 +193,4 @@
   deceleration: 0.0006, //阻尼系数,系数越小滑动越灵敏
   bounce: false, //是否启用回弹
   deceleration: 0.0005 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006
});
});